Changeset 1103:d8591b1c56cd in freeDiameter for include
- Timestamp:
- May 10, 2013, 7:48:57 PM (11 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- include/freeDiameter
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
include/freeDiameter/libfdcore.h
r1102 r1103 553 553 554 554 555 /* 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) */ 556 int fd_msg_parse_or_error( struct msg ** msg ); 555 /* Parse a message against our dictionary, 556 return 0 in case of success. 557 log parsing error & return error code in case of failure in parsing. 558 In addition, if the error code is EBADMSG (the message does not follow our dictionary) 559 if *msg was a request, *msg is NULL and *error contains the error message ready to send back on return 560 if *msg was an answer, *msg is untouched and *error==*msg if *msg was an error message, *error is null otherwise */ 561 int fd_msg_parse_or_error( struct msg ** msg, struct msg **error ); 557 562 558 563 … … 926 931 - {peer} is set if the message is received from a peer's connection, and NULL if the message is from a new client 927 932 connected and not yet identified 928 - {other} is NULL .933 - {other} is NULL, or a char * identifying the connection when {peer} is null. 929 934 - {permsgdata} points to either a new empty structure allocated for this message or the one passed to HOOK_DATA_RECEIVED if used. 930 935 */ … … 959 964 */ 960 965 966 HOOK_MESSAGE_PARSING_ERROR, 967 /* Hook called when a message being processed cannot be parsed successfully. 968 - {msg} points to the message if buffer was parsed successfully, or NULL otherwise. You should not call fd_msg_parse_dict on this in any case. 969 - {peer} is NULL or the peer that received the message. If NULL and the message is not NULL, you can still retrieve the source from the message itself. 970 - {other} is a char * pointer to the error message (human-readable) if {msg} is not NULL, a pointer to struct fd_cnx_rcvdata containing the received buffer otherwise. 971 - {permsgdata} points to existing structure associated with this message (or new structure if no previous hook was registered). 972 */ 973 961 974 HOOK_MESSAGE_ROUTING_ERROR, 962 /* Hook called when a message being processed by the routing thread meets an error such as: 963 -- parsing error 964 -- no remaining available peer for sending, based on routing callbacks decisions (maybe after retries). 975 /* Hook called when a message being processed by the routing thread meets an error such as no remaining available peer for sending, based on routing callbacks decisions (maybe after retries). 965 976 - {msg} points to the message. Again, the objects may not have been dictionary resolved. If you 966 977 try to call fd_msg_parse_dict, it might slow down the operation of a relay agent, although this hook is not on the normal execution path. … … 994 1005 It is probably a good idea to log this for analysis / backup. 995 1006 - {msg} points to the message, which will be freed as soon as the hook returns. 996 - {peer} is NULL.1007 - {peer} may be NULL or a peer related to the event. 997 1008 - {other} is a char * pointer to the error message (human-readable). 998 1009 - {permsgdata} points to existing structure associated with this message (or new structure if no previous hook was registered). … … 1000 1011 1001 1012 HOOK_PEER_CONNECT_FAILED, 1002 /* Hook called when a connection attempt to a remote peer has failed.1003 - {msg} may be NULL (lower layer error, e.g. connection timeout) or points to the CEA message sent or received (with an error code).1013 /* Hook called when a connection attempt to/from a remote peer has failed. This hook is also called when the peer was in OPEN state and the connection is broken. 1014 - {msg} may be NULL (lower layer error, e.g. connection timeout) or points to a message showing the error (either invalid incoming message, or the CEA message sent or received with an error code). 1004 1015 - {peer} may be NULL for incoming requests from unknown peers being rejected, otherwise it points to the peer structure associated with the attempt. 1005 1016 - {other} is a char * pointer to the error message (human-readable). … … 1008 1019 1009 1020 HOOK_PEER_CONNECT_SUCCESS, 1010 /* Hook called when a connection attempt to a remote peer has succeeded (the peer moves to OPEN state). 1011 - {msg} points to the CEA message sent or received (with an success code) -- in case it is sent, you can always get access to the matching CER. 1021 /* Hook called when a connection attempt to/from a remote peer has succeeded (the peer moves to OPEN_HANDSHAKE or OPEN state). 1022 In case of deprecated TLS handshake after the CER/CEA exchange, this hook can still be followed by HOOK_PEER_CONNECT_FAILED if TLS handshake fails. 1023 - {msg} points to the CEA message sent or received (with a success code) -- in case it is sent, you can always get access to the matching CER. 1012 1024 - {peer} points to the peer structure. 1013 1025 - {other} is NULL. … … 1069 1081 * 1070 1082 * PARAMETERS: 1071 * type_mask : A bitmask of fd_hook_type bits for which this cb is registered, e.g. ((1 << HOOK_MESSAGE_RECEIVED) | |(1 << HOOK_MESSAGE_SENT))1083 * type_mask : A bitmask of fd_hook_type bits for which this cb is registered, e.g. ((1 << HOOK_MESSAGE_RECEIVED) | (1 << HOOK_MESSAGE_SENT)) 1072 1084 * fd_hook_cb : The callback function to register (see prototype above). 1073 1085 * regdata : Pointer to pass to the callback when it is called. The data is opaque to the daemon. … … 1093 1105 /* Remove a hook registration */ 1094 1106 int fd_hook_unregister( struct fd_hook_hdl * handler ); 1107 1108 1109 /* Use the following function to retrieve any pmd structure associated with a request matching the current answer. Returns NULL in case of error / no such structure */ 1110 struct fd_hook_permsgdata * fd_hook_get_request_pmd(struct fd_hook_data_hdl *data_hdl, struct msg * answer); 1095 1111 1096 1112 -
include/freeDiameter/libfdproto.h
r1102 r1103 146 146 */ 147 147 void fd_log ( int, const char *, ... ) _ATTRIBUTE_PRINTFLIKE_(2,3); 148 #ifndef SWIG 148 149 void fd_log_va( int, const char *, va_list args ); 150 #endif /* SWIG */ 149 151 150 152 /* these are internal objects of the debug facility, … … 609 611 DECLARE_FD_DUMP_PROTOTYPE(fd_sa_dump_node, sSA * sa, int flags); 610 612 DECLARE_FD_DUMP_PROTOTYPE(fd_sa_dump_node_serv, sSA * sa, int flags); 613 #define sSA_DUMP_STRLEN (INET6_ADDRSTRLEN + 1 + 32 + 2) 614 void fd_sa_sdump_numeric(char * buf /* must be at least sSA_DUMP_STRLEN */, sSA * sa); 611 615 612 616
Note: See TracChangeset
for help on using the changeset viewer.