Changeset 16:013ce9851131 in freeDiameter for include/freeDiameter/freeDiameter.h
- Timestamp:
- Oct 2, 2009, 6:57:06 PM (15 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
include/freeDiameter/freeDiameter.h
r14 r16 39 39 40 40 #include <freeDiameter/libfreeDiameter.h> 41 #include <gnutls/gnutls.h> 42 #include <gnutls/x509.h> 43 44 /* GNUTLS version */ 45 #ifndef GNUTLS_VERSION 46 #define GNUTLS_VERSION LIBGNUTLS_VERSION 47 #endif /* GNUTLS_VERSION */ 48 49 /* Check the return value of a GNUTLS function, log and propagate */ 50 #define CHECK_GNUTLS_DO( __call__, __fallback__ ) { \ 51 int __ret__; \ 52 TRACE_DEBUG_ALL( "Check FCT: " #__call__ ); \ 53 __ret__ = (__call__); \ 54 if (__ret__ < 0) { \ 55 TRACE_DEBUG(INFO, "Error in '" #__call__ "':\t%s", gnutls_strerror(__ret__)); \ 56 __fallback__; \ 57 } \ 58 } 41 59 42 60 … … 70 88 unsigned tls_alg: 1; /* TLS algorithm for initiated cnx. 0: separate port. 1: inband-security (old) */ 71 89 } cnf_flags; 90 91 struct { 92 /* GNUTLS global state */ 93 /* Server credential(s) */ 94 } cnf_sec_data; 72 95 73 96 uint32_t cnf_orstateid; /* The value to use in Origin-State-Id, default to random value */ … … 151 174 enum peer_state { 152 175 /* Stable states */ 153 STATE_ ZOMBIE = 0, /* The threads handling the peer are not running for some reason*/176 STATE_NEW = 0, /* The peer has been just been created, PSM thread not started yet */ 154 177 STATE_OPEN, /* Connexion established */ 155 178 … … 168 191 STATE_SUSPECT, /* A DWR was sent and not answered within TwTime. Failover in progress. */ 169 192 STATE_REOPEN, /* Connection has been re-established, waiting for 3 DWR/DWA exchanges before putting back to service */ 193 194 /* Error state */ 195 STATE_ZOMBIE /* The PSM thread is not running anymore; it must be re-started or peer should be deleted. */ 196 #define STATE_MAX STATE_ZOMBIE 170 197 }; 171 198 extern const char *peer_state_str[]; 172 199 #define STATE_STR(state) \ 173 (((unsigned)(state)) <= STATE_ REOPEN? peer_state_str[((unsigned)(state)) ] : "<Invalid>")200 (((unsigned)(state)) <= STATE_MAX ? peer_state_str[((unsigned)(state)) ] : "<Invalid>") 174 201 175 202 /* Information about a remote peer. Same structure is used for creating a new entry, but not all fields are meaningful in that case */ … … 220 247 221 248 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;239 249 240 250 /* The remaining information must not be modified, and is not used for peer creation */ … … 245 255 uint32_t pi_firmrev; /* Content of the Firmware-Revision AVP */ 246 256 struct fd_list pi_apps; /* applications advertised by the remote peer, except relay (pi_flags.relay) */ 257 struct { 258 /* This is inspired from http://www.gnu.org/software/gnutls/manual/gnutls.html#ex_003ax509_002dinfo */ 259 const gnutls_datum_t *cert_list; /* The (valid) credentials that the peer has presented */ 260 unsigned int cert_list_size;/* Number of certificates in the list */ 261 } pi_sec_data; 247 262 }; 248 263
Note: See TracChangeset
for help on using the changeset viewer.