Changes in freeDiameter/fD.h [29:5ba91682f0bc:20:277ec00d793e] in freeDiameter
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
freeDiameter/fD.h
r29 r20 152 152 enum { 153 153 /* Dump all info about this peer in the debug log */ 154 FDEVP_DUMP_ALL = 1500154 FDEVP_DUMP_ALL = 2000 155 155 156 156 /* request to terminate this peer : disconnect, requeue all messages */ 157 157 ,FDEVP_TERMINATE 158 158 159 /* A connection object has received a message. (data contains the buffer) */ 160 ,FDEVP_CNX_MSG_RECV 161 162 /* A connection object has encountered an error (disconnected). */ 163 ,FDEVP_CNX_ERROR 164 165 /* Endpoints of a connection have been changed (multihomed SCTP). */ 166 ,FDEVP_CNX_EP_CHANGE 167 168 /* A new connection has been established (data contains the appropriate info) */ 169 ,FDEVP_CNX_INCOMING 159 /* A message was received in the peer */ 160 ,FDEVP_MSG_INCOMING 170 161 171 162 /* The PSM state is expired */ 172 163 ,FDEVP_PSM_TIMEOUT 173 174 164 }; 175 165 const char * fd_pev_str(int event); 176 166 #define CHECK_EVENT( _e ) \ 177 167 (((int)(_e) >= FDEVP_DUMP_ALL) && ((int)(_e) <= FDEVP_PSM_TIMEOUT)) 178 179 /* The data structure for FDEVP_CNX_INCOMING events */180 struct cnx_incoming {181 struct msg * cer; /* the CER message received on this connection */182 struct cnxctx * cnx; /* The connection context */183 int validate; /* The peer is new, it must be validated (by an extension) or error CEA to be sent */184 };185 168 186 169 /* Structure to store a sent request */ … … 190 173 }; 191 174 175 /* The connection context structure */ 176 struct cnxctx { 177 int cc_socket; /* The socket object of the connection -- <=0 if no socket is created */ 178 179 struct fifo **cc_events; /* Location of the events list to send connection events */ 180 181 int cc_proto; /* IPPROTO_TCP or IPPROTO_SCTP */ 182 int cc_tls; /* Is TLS already started ? */ 183 184 uint16_t cc_port; /* Remote port of the connection, when we are client */ 185 struct fd_list cc_ep_remote; /* The remote address(es) of the connection */ 186 struct fd_list cc_ep_local; /* The local address(es) of the connection */ 187 188 /* If cc_proto == SCTP */ 189 struct { 190 int str_out;/* Out streams */ 191 int str_in; /* In streams */ 192 int pairs; /* max number of pairs ( = min(in, out)) */ 193 int next; /* # of stream the next message will be sent to */ 194 } cc_sctp_para; 195 196 /* If cc_tls == true */ 197 struct { 198 int mode; /* GNUTLS_CLIENT / GNUTLS_SERVER */ 199 gnutls_session_t session; /* Session object (stream #0 in case of SCTP) */ 200 } cc_tls_para; 201 202 /* If both conditions */ 203 struct { 204 gnutls_session_t *res_sessions; /* Sessions of other pairs of streams, resumed from the first */ 205 /* Buffers, threads, ... */ 206 } cc_sctp_tls_para; 207 }; 192 208 193 209 /* Functions */ 194 int 210 int fd_peer_fini(); 195 211 void fd_peer_dump_list(int details); 196 212 void fd_peer_dump(struct fd_peer * peer, int details); 197 int fd_peer_alloc(struct fd_peer ** ptr); 198 int fd_peer_free(struct fd_peer ** ptr); 199 int fd_peer_handle_newCER( struct msg ** cer, struct cnxctx ** cnx ); 213 int fd_peer_alloc(struct fd_peer ** ptr); 214 int fd_peer_free(struct fd_peer ** ptr); 200 215 /* fd_peer_add declared in freeDiameter.h */ 201 int fd_peer_validate( struct fd_peer * peer );202 216 203 217 /* Peer expiry */ … … 207 221 208 222 /* Peer state machine */ 209 int 210 int 211 int 223 int fd_psm_start(); 224 int fd_psm_begin(struct fd_peer * peer ); 225 int fd_psm_terminate(struct fd_peer * peer ); 212 226 void fd_psm_abord(struct fd_peer * peer ); 213 227 214 228 /* Server sockets */ 215 229 void fd_servers_dump(); 216 int fd_servers_start(); 217 int fd_servers_stop(); 218 219 /* Connection contexts -- there are also definitions in cnxctx.h for the relevant files */ 220 struct cnxctx * fd_cnx_serv_tcp(uint16_t port, int family, struct fd_endpoint * ep); 221 struct cnxctx * fd_cnx_serv_sctp(uint16_t port, struct fd_list * ep_list); 222 int fd_cnx_serv_listen(struct cnxctx * conn); 223 struct cnxctx * fd_cnx_serv_accept(struct cnxctx * serv); 224 struct cnxctx * fd_cnx_cli_connect_tcp(sSA * sa, socklen_t addrlen); 225 struct cnxctx * fd_cnx_cli_connect_sctp(int no_ip6, uint16_t port, struct fd_list * list); 226 int fd_cnx_start_clear(struct cnxctx * conn, int loop); 227 int fd_cnx_handshake(struct cnxctx * conn, int mode, char * priority, void * alt_creds); 228 char * fd_cnx_getid(struct cnxctx * conn); 229 int fd_cnx_getproto(struct cnxctx * conn); 230 int fd_cnx_getTLS(struct cnxctx * conn); 231 int fd_cnx_getcred(struct cnxctx * conn, const gnutls_datum_t **cert_list, unsigned int *cert_list_size); 232 int fd_cnx_getendpoints(struct cnxctx * conn, struct fd_list * local, struct fd_list * remote); 233 char * fd_cnx_getremoteid(struct cnxctx * conn); 234 int fd_cnx_receive(struct cnxctx * conn, struct timespec * timeout, unsigned char **buf, size_t * len); 235 int fd_cnx_recv_setaltfifo(struct cnxctx * conn, struct fifo * alt_fifo); /* send FDEVP_CNX_MSG_RECV event to the fifo list */ 236 int fd_cnx_send(struct cnxctx * conn, unsigned char * buf, size_t len); 237 void fd_cnx_destroy(struct cnxctx * conn); 230 int fd_servers_start(); 231 void fd_servers_stop(); 232 233 /* Connection contexts */ 234 struct cnxctx * fd_cnx_init(int sock, int proto); 235 int fd_cnx_handshake(struct cnxctx * conn, int mode); 236 237 /* SCTP */ 238 #ifndef DISABLE_SCTP 239 int fd_sctp_create_bind_server( int * socket, uint16_t port ); 240 int fd_sctp_get_str_info( int socket, int *in, int *out ); 241 242 #endif /* DISABLE_SCTP */ 243 238 244 239 245
Note: See TracChangeset
for help on using the changeset viewer.