Changeset 706:4ffbc9f1e922 in freeDiameter for include/freeDiameter/libfdcore.h
- Timestamp:
- Feb 9, 2011, 3:26:58 PM (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
include/freeDiameter/libfdcore.h
r658 r706 108 108 char *cnf_file; /* Configuration file to parse, default is DEFAULT_CONF_FILE */ 109 109 110 char *cnf_diamid; /* Diameter Identity of the local peer (FQDN -- UTF-8) */111 size_t cnf_diamid_len; /*length of the previous string */112 char *cnf_diamrlm; /* Diameter realm of the local peer, default to realm part of diam_id */110 DiamId_t cnf_diamid; /* Diameter Identity of the local peer (FQDN -- ASCII) */ 111 size_t cnf_diamid_len;/* cached length of the previous string */ 112 DiamId_t cnf_diamrlm; /* Diameter realm of the local peer, default to realm part of cnf_diamid */ 113 113 size_t cnf_diamrlm_len;/* length of the previous string */ 114 114 … … 187 187 STATE_SUSPECT, /* A DWR was sent and not answered within TwTime. Failover in progress. */ 188 188 STATE_REOPEN, /* Connection has been re-established, waiting for 3 DWR/DWA exchanges before putting back to service */ 189 190 /* Ordering issues with multistream & state machine. -- see top of p_psm.c for explanation */ 191 STATE_OPEN_NEW, /* after CEA is sent, until a new message is received. Force ordering in this state */ 192 STATE_CLOSING_GRACE, /* after DPA is sent or received, give a short delay for messages in the pipe to be received. */ 189 193 190 194 /* Error state */ … … 205 209 , "STATE_SUSPECT" \ 206 210 , "STATE_REOPEN" \ 211 , "STATE_OPEN_NEW" \ 212 , "STATE_CLOSING_GRACE" \ 207 213 , "STATE_ZOMBIE" \ 208 214 }; … … 237 243 struct peer_info { 238 244 239 char * pi_diamid; /* UTF-8, \0 terminated. The Diameter Identity of the remote peer. */ 245 DiamId_t pi_diamid; /* (supposedly) UTF-8, \0 terminated. The Diameter Identity of the remote peer. */ 246 size_t pi_diamidlen; /* cached length of pi_diamid */ 240 247 241 248 struct { … … 250 257 } pic_flags; /* Flags influencing the connection to the remote peer */ 251 258 252 char * pic_realm; /* If configured, the daemon will matchthe received realm in CER/CEA matches this. */259 DiamId_t pic_realm; /* If configured, the daemon will check the received realm in CER/CEA matches this. */ 253 260 uint16_t pic_port; /* port to connect to. 0: default. */ 254 261 … … 263 270 struct { 264 271 265 enum peer_state pir_state; /* Current state of the peer in the state machine. fd_cpu_flush_cache() might be useful before reading. */ 266 267 char * pir_realm; /* The received realm in CER/CEA. */ 272 /* enum peer_state pir_state; */ 273 /* Since 1.1.0, read the state with fd_peer_getstate(peer). */ 274 275 DiamId_t pir_realm; /* The received realm in CER/CEA. */ 276 size_t pir_realmlen; /* length of the realm */ 268 277 269 278 uint32_t pir_vendorid; /* Content of the Vendor-Id AVP, or 0 by default */ 270 279 uint32_t pir_orstate; /* Origin-State-Id value */ 271 char * pir_prodname; /* copy of UTF-8Product-Name AVP (\0 terminated) */280 os0_t pir_prodname; /* copy of Product-Name AVP (\0 terminated) */ 272 281 uint32_t pir_firmrev; /* Content of the Firmware-Revision AVP */ 273 282 int pir_relay; /* The remote peer advertized the relay application */ … … 290 299 291 300 struct peer_hdr { 292 struct fd_list chain; /* Li st of all the peers, ordered by their Diameter Id*/301 struct fd_list chain; /* Link into the list of all the peers, ordered by their Diameter Id (fd_os_cmp) */ 293 302 struct peer_info info; /* The public data */ 294 303 … … 339 348 * 340 349 * PARAMETERS: 341 * diamid : A \0 terminated string. 350 * diamid : an UTF8 string describing the diameter Id of the peer to seek 351 * diamidlen : length of the diamid 352 * igncase : perform an almost-case-insensitive search? (slower) 342 353 * peer : The peer is stored here if it exists. 343 354 * … … 349 360 * !0 : An error occurred. 350 361 */ 351 int fd_peer_getbyid( char * diamid, struct peer_hdr ** peer ); 362 int fd_peer_getbyid( DiamId_t diamid, size_t diamidlen, int igncase, struct peer_hdr ** peer ); 363 364 /* 365 * FUNCTION: fd_peer_get_state 366 * 367 * PARAMETERS: 368 * peer : The peer which state to read 369 * 370 * DESCRIPTION: 371 * Returns the current state of the peer. 372 * 373 * RETURN VALUE: 374 * -1 : peer is invalid 375 * >=0 : the state of the peer at the time of reading. 376 */ 377 int fd_peer_get_state(struct peer_hdr *peer); 352 378 353 379 /* … … 474 500 /* Add Origin-Host, Origin-Realm, (if osi) Origin-State-Id AVPS at the end of the message */ 475 501 int fd_msg_add_origin ( struct msg * msg, int osi ); 502 503 /* Generate a new Session-Id and add it at the beginning of the message (opt is added at the end of the sid if provided) */ 504 int fd_msg_new_session( struct msg * msg, os0_t opt, size_t optlen ); 505 476 506 477 507 /* Parse a message against our dictionary, and in case of error log and eventually build the error reply (on return and EBADMSG, *msg == NULL or *msg is the error message ready to send) */
Note: See TracChangeset
for help on using the changeset viewer.