Mercurial > hg > freeDiameter
comparison include/freeDiameter/libfdcore.h @ 1301:50fb308e84f7
Added a new hook to allow extensions act on the error messages being returned in case of parsing error (e.g. if some mandatory AVP are expected in error messages)
author | Sebastien Decugis <sdecugis@freediameter.net> |
---|---|
date | Sun, 30 Aug 2015 01:58:21 +0800 |
parents | 035f489b845b |
children | 5a505af0bba0 |
comparison
equal
deleted
inserted
replaced
1300:3f1e79e1273e | 1301:50fb308e84f7 |
---|---|
1000 - {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. | 1000 - {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. |
1001 - {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. | 1001 - {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. |
1002 - {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. | 1002 - {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. |
1003 - {permsgdata} points to existing structure associated with this message (or new structure if no previous hook was registered). | 1003 - {permsgdata} points to existing structure associated with this message (or new structure if no previous hook was registered). |
1004 */ | 1004 */ |
1005 | 1005 |
1006 HOOK_MESSAGE_ROUTING_ERROR, | 1006 HOOK_MESSAGE_ROUTING_ERROR, |
1007 /* 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). | 1007 /* 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). |
1008 - {msg} points to the message. Again, the objects may not have been dictionary resolved. If you | 1008 - {msg} points to the message. Again, the objects may not have been dictionary resolved. If you |
1009 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. | 1009 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. |
1010 - {peer} is NULL. | 1010 - {peer} is NULL. |
1056 - {peer} points to the peer structure. | 1056 - {peer} points to the peer structure. |
1057 - {other} is NULL. | 1057 - {other} is NULL. |
1058 - {permsgdata} is always NULL for this hook. | 1058 - {permsgdata} is always NULL for this hook. |
1059 */ | 1059 */ |
1060 | 1060 |
1061 #define HOOK_LAST HOOK_PEER_CONNECT_SUCCESS | 1061 HOOK_MESSAGE_PARSING_ERROR2, |
1062 /* Hook called after an error message has been generated due to a dictionary parsing error. | |
1063 - {msg} points to the error message that has been generated. | |
1064 - {peer} is NULL. You can still retrieve the source from the message itself. | |
1065 - {other} is NULL | |
1066 - {permsgdata} points to existing structure associated with this message (or new structure if no previous hook was registered). | |
1067 Use this hook if you need to populate more data in the error being returned, from the error message. | |
1068 (e.g. some AVP need to be added to replies even if error case. | |
1069 */ | |
1070 #define HOOK_LAST HOOK_MESSAGE_PARSING_ERROR2 | |
1062 }; | 1071 }; |
1063 | 1072 |
1064 | 1073 |
1065 /* Type of the {permsgdata} pointer. It is up to each extension to define its own structure. This is opaque for the framework. */ | 1074 /* Type of the {permsgdata} pointer. It is up to each extension to define its own structure. This is opaque for the framework. */ |
1066 struct fd_hook_permsgdata; | 1075 struct fd_hook_permsgdata; |