Changeset 13:ef9ef3bf4752 in freeDiameter for include
- Timestamp:
- Sep 30, 2009, 6:25:46 PM (15 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- include/freeDiameter
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
include/freeDiameter/CMakeLists.txt
r8 r13 11 11 # Disable SCTP support completly ? 12 12 OPTION(DISABLE_SCTP "Disable SCTP support?") 13 14 # Disable SCTP support completly ? 15 OPTION(ERRORS_ON_TODO "(development) Generate compilation errors on TODO items ?" OFF) 13 16 14 17 -
include/freeDiameter/freeDiameter-host.h.in
r9 r13 45 45 46 46 #cmakedefine DISABLE_SCTP 47 47 #cmakedefine ERRORS_ON_TODO 48 48 #cmakedefine DEBUG 49 49 -
include/freeDiameter/freeDiameter.h
r12 r13 81 81 struct fd_list chain; /* link in cnf_endpoints list */ 82 82 sSS ss; /* the socket information. */ 83 struct { 84 unsigned conf : 1; /* This endpoint is statically configured in a configuration file */ 85 unsigned disc : 1; /* This endpoint was resolved from the Diameter Identity or other DNS query */ 86 unsigned adv : 1; /* This endpoint was advertized in Diameter CER/CEA exchange */ 87 unsigned ll : 1; /* Lower layer mechanism provided this endpoint */ 88 89 /* To add: a validity timestamp for DNS records ? How do we retrieve this lifetime from DNS ? */ 90 91 } meta; /* Additional information about the endpoint */ 83 92 }; 84 93 … … 164 173 peer_state_str[ ((unsigned)(state)) <= STATE_REOPEN ? ((unsigned)(state)) : 0 ] 165 174 166 /* Information about a remote peer , used both for query and for creating a new entry*/175 /* Information about a remote peer. Same structure is used for creating a new entry, but not all fields are meaningful in that case */ 167 176 struct peer_info { 168 177 169 char * pi_diamid; /* UTF-8, \0 terminated. The Diameter Identity of the remote peer */170 char * pi_realm; /* idem, its realm. */178 char * pi_diamid; /* UTF-8, \0 terminated. The Diameter Identity of the remote peer */ 179 char * pi_realm; /* Its realm, as received in CER/CEA exchange. */ 171 180 172 181 struct { … … 191 200 192 201 #define PI_EXP_NONE 0 /* the peer entry does not expire */ 193 #define PI_EXP_INACTIVE 1 /* the peer entry expires after pi_lft seconds without activity */202 #define PI_EXP_INACTIVE 1 /* the peer entry expires (i.e. is deleted) after pi_lft seconds without activity */ 194 203 unsigned exp :1; 195 204 … … 199 208 unsigned inband :2; /* This is only meaningful with pi_flags.sec == 3 */ 200 209 201 unsigned relay :1; /* The remote peer advertized the relay application */ 202 } pi_flags; 210 unsigned relay :1; /* The remote peer advertized the relay application */ 211 212 } pi_flags; /* Some flags */ 203 213 204 214 /* Additional parameters */ 205 uint32_t pi_lft; /* lifetime of entry without activity (except watchdogs)(see pi_flags.exp definition) */215 uint32_t pi_lft; /* lifetime of this peer when inactive (see pi_flags.exp definition) */ 206 216 uint16_t pi_streams; /* number of streams for SCTP. 0 = default */ 207 217 uint16_t pi_port; /* port to connect to. 0: default. */ … … 209 219 int pi_twtimer; /* use this value for TwTimer instead of global, if != 0 */ 210 220 211 struct fd_list pi_endpoints; /* Endpoint(s) of the remote peer (discovered or advertized). list of struct fd_endpoint. DNS resolved if empty. */ 221 struct fd_list pi_endpoints; /* Endpoint(s) of the remote peer (configured, discovered, or advertized). list of struct fd_endpoint. DNS resolved if empty. */ 222 223 /* TLS specific data -- the exact data pointed here depends on the security module in use (ex: gnutls, ...) */ 224 enum { 225 PI_SEC_GNUTLS = 0, /* The security module is GNUTLS, this is the default */ 226 PI_SEC_OTHER /* Another security module (TBD) */ 227 } pi_sec_module; 228 union { 229 /* Security data when pi_sec_module == PI_SEC_GNUTLS */ 230 struct { 231 void * CA; /* Authority to use to validate this peer credentials (a CA or root certificate) -- use default if NULL */ 232 void * cred; /* The (valid) credentials that the peer has presented */ 233 } gnutls; 234 /* Security data when pi_sec_module == PI_SEC_OTHER */ 235 struct { 236 void * dummy; /* Something meaningful for the other security module */ 237 } other; 238 } pi_sec_data; 212 239 213 240 /* The remaining information is read-only, not used for peer creation */ … … 244 271 * DESCRIPTION: 245 272 * Add a peer to the list of peers to which the daemon must maintain a connexion. 246 * If cb is not null, the callback is called when the connection is in OPEN state or 273 * 274 * The content of info parameter is copied, except for the list of endpoints if 275 * not empty, which is simply moved into the created object. It means that the list 276 * items must have been malloc'd, so that they can be freed. 277 * 278 * If cb is not null, the callback is called when the connection is in OPEN state or 247 279 * when an error has occurred. The callback should use the pi_state information to 248 * determine which one it is. 280 * determine which one it is. If the first parameter of the called callback is NULL, it 281 * means that the peer is being destroyed before attempt success / failure. 282 * cb is called to allow freeing cb_data in * this case. 283 * 284 * The orig_dbg string is only useful for easing debug, and can be left to NULL. 249 285 * 250 286 * RETURN VALUE: -
include/freeDiameter/libfreeDiameter.h
r10 r13 189 189 #define TRACE_DEBUG_ALL( str ) \ 190 190 TRACE_DEBUG(CALL, str ); 191 192 /* For development only, to keep track of TODO locations in the code */ 193 #ifndef ERRORS_ON_TODO 194 #define TODO( _msg, _args... ) \ 195 TRACE_DEBUG(NONE, _msg , ##_args); 196 #else /* ERRORS_ON_TODO */ 197 #define TODO( _msg, _args... ) \ 198 "TODO" = _msg ## _args; /* just a stupid compilation error to spot the todo */ 199 #endif /* ERRORS_ON_TODO */ 191 200 192 201
Note: See TracChangeset
for help on using the changeset viewer.