Changes in freeDiameter/fD.h [20:277ec00d793e:29:5ba91682f0bc] in freeDiameter
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
freeDiameter/fD.h
r20 r29 152 152 enum { 153 153 /* Dump all info about this peer in the debug log */ 154 FDEVP_DUMP_ALL = 2000154 FDEVP_DUMP_ALL = 1500 155 155 156 156 /* request to terminate this peer : disconnect, requeue all messages */ 157 157 ,FDEVP_TERMINATE 158 158 159 /* A message was received in the peer */ 160 ,FDEVP_MSG_INCOMING 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 161 170 162 171 /* The PSM state is expired */ 163 172 ,FDEVP_PSM_TIMEOUT 173 164 174 }; 165 175 const char * fd_pev_str(int event); 166 176 #define CHECK_EVENT( _e ) \ 167 177 (((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 }; 168 185 169 186 /* Structure to store a sent request */ … … 173 190 }; 174 191 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 };208 192 209 193 /* Functions */ 210 int fd_peer_fini();194 int fd_peer_fini(); 211 195 void fd_peer_dump_list(int details); 212 196 void fd_peer_dump(struct fd_peer * peer, int details); 213 int fd_peer_alloc(struct fd_peer ** ptr); 214 int fd_peer_free(struct fd_peer ** ptr); 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 ); 215 200 /* fd_peer_add declared in freeDiameter.h */ 201 int fd_peer_validate( struct fd_peer * peer ); 216 202 217 203 /* Peer expiry */ … … 221 207 222 208 /* Peer state machine */ 223 int fd_psm_start();224 int fd_psm_begin(struct fd_peer * peer );225 int fd_psm_terminate(struct fd_peer * peer );209 int fd_psm_start(); 210 int fd_psm_begin(struct fd_peer * peer ); 211 int fd_psm_terminate(struct fd_peer * peer ); 226 212 void fd_psm_abord(struct fd_peer * peer ); 227 213 228 214 /* Server sockets */ 229 215 void fd_servers_dump(); 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 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); 244 238 245 239
Note: See TracChangeset
for help on using the changeset viewer.