Changeset 20:277ec00d793e in freeDiameter for include/freeDiameter/freeDiameter.h
- Timestamp:
- Oct 7, 2009, 7:31:39 PM (15 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
include/freeDiameter/freeDiameter.h
r18 r20 118 118 struct fd_endpoint { 119 119 struct fd_list chain; /* link in cnf_endpoints list */ 120 sSS ss; /* the socket information. */120 sSS ss; /* the socket information. List is always ordered by ss value (memcmp) */ 121 121 struct { 122 122 unsigned conf : 1; /* This endpoint is statically configured in a configuration file */ … … 175 175 ,FDEV_DUMP_DICT /* Dump the content of the dictionary */ 176 176 ,FDEV_DUMP_EXT /* Dump state of extensions */ 177 ,FDEV_DUMP_SERV /* Dump the server socket status */ 177 178 ,FDEV_DUMP_QUEUES /* Dump the message queues */ 178 179 ,FDEV_DUMP_CONFIG /* Dump the configuration */ 179 180 ,FDEV_DUMP_PEERS /* Dump the list of peers */ 180 181 }; 181 const char * fd_ev_str(int event); 182 const char * fd_ev_str(int event); /* defined in freeDiameter/main.c */ 182 183 183 184 … … 202 203 If we win the election, we must disconnect the initiated connection and send a CEA on the other => we go to OPEN state. 203 204 If we lose, we disconnect the other connection (receiver) and fallback to WAITCEA state. */ 205 STATE_OPEN_HANDSHAKE, /* TLS Handshake and validation are in progress in open state */ 204 206 205 207 /* Failover state machine */ … … 211 213 #define STATE_MAX STATE_ZOMBIE 212 214 }; 213 extern const char *peer_state_str[]; 215 extern const char *peer_state_str[]; /* defined in freeDiameter/p_psm.c */ 214 216 #define STATE_STR(state) \ 215 217 (((unsigned)(state)) <= STATE_MAX ? peer_state_str[((unsigned)(state)) ] : "<Invalid>") … … 245 247 unsigned exp :1; 246 248 247 /* Following flags are read-only and received from remote peer */ 248 #define PI_INB_NONE 1 /* Remote peer advertised inband-sec-id 0 (None) */ 249 #define PI_INB_TLS 2 /* Remote peer advertised inband-sec-id 1 (TLS) */ 250 unsigned inband :2; /* This is only meaningful with pi_flags.sec == 3 */ 249 unsigned inband_none :1; /* This is only meaningful with pi_flags.sec == 3 */ 250 unsigned inband_tls :1; /* This is only meaningful with pi_flags.sec == 3 */ 251 251 252 252 unsigned relay :1; /* The remote peer advertized the relay application */ … … 338 338 * !0 : An error occurred. 339 339 */ 340 int fd_peer_validate_register ( int (*peer_validate)(struct peer_info * /* info */, int * /* auth */ ) );340 int fd_peer_validate_register ( int (*peer_validate)(struct peer_info * /* info */, int * /* auth */, int (**cb2)(struct peer_info *)) ); 341 341 /* 342 342 * CALLBACK: peer_validate … … 345 345 * info : Structure containing information about the peer attempting the connection. 346 346 * auth : Store there the result if the peer is accepted (1), rejected (-1), or unknown (0). 347 * cb2 : If != NULL and in case of PI_SEC_TLS_OLD, another callback to call after handshake (if auth = 1). 347 348 * 348 349 * DESCRIPTION: 349 350 * This callback is called when a new connection is being established from an unknown peer, 350 * after the CER is received. An extension must register such callback with peer_validate_register. 351 * after the CER is received. An extension must register such callback with peer_validate_register. 352 * 353 * If (info->pi_flags.sec == PI_SEC_TLS_OLD) the extension may instruct the daemon explicitely 354 * to not use TLS by clearing info->pi_flags.inband_tls -- only if inband_none is set. 355 * 356 * If (info->pi_flags.sec == PI_SEC_TLS_OLD) and info->pi_flags.inband_tls is set, 357 * the extension may also need to check the credentials provided during the TLS 358 * exchange (remote certificate). For this purpose, it may set the address of a new callback 359 * to be called once the handshake is completed. This new callback receives the information 360 * structure as parameter (with pi_sec_data set) and returns 0 if the credentials are correct, 361 * or an error code otherwise. If the error code is received, the connection is closed and the 362 * peer is destroyed. 351 363 * 352 364 * RETURN VALUE:
Note: See TracChangeset
for help on using the changeset viewer.