Mercurial > hg > freeDiameter
diff include/freeDiameter/libfreeDiameter.h @ 114:5b3868944e2b
Reporting errors in parse_dict function
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Tue, 08 Dec 2009 16:55:18 +0900 |
parents | 6a294d977878 |
children | cc42d8607114 |
line wrap: on
line diff
--- a/include/freeDiameter/libfreeDiameter.h Tue Dec 08 15:38:09 2009 +0900 +++ b/include/freeDiameter/libfreeDiameter.h Tue Dec 08 16:55:18 2009 +0900 @@ -2179,12 +2179,21 @@ */ int fd_msg_parse_buffer ( unsigned char ** buffer, size_t buflen, struct msg ** msg ); +/* Parsing Error Information structure */ +struct fd_pei { + char * pei_errcode; /* name of the error code to use */ + struct avp * pei_avp; /* pointer to invalid or missing AVP (to be freed) */ + char * pei_message; /* Overwrite default message if needed */ + int pei_protoerr; /* do we set the 'E' bit in the error message ? */ +}; + /* * FUNCTION: fd_msg_parse_dict * * PARAMETERS: * object : A msg or AVP object as returned by fd_msg_parse_buffer. * dict : the dictionary containing the objects definitions to use for resolving all AVPs. + * error_info : If not NULL, will contain the detail about error upon return. May be used to generate an error reply. * * DESCRIPTION: * This function looks up for the command and each children AVP definitions in the dictionary. @@ -2202,15 +2211,7 @@ * ENOMEM : Unable to allocate enough memory to complete the operation. * ENOTSUP : No dictionary definition for the command or one of the mandatory AVP was found. */ -int fd_msg_parse_dict ( msg_or_avp * object, struct dictionary * dict ); - -/* Parsing Error Information structure */ -struct fd_pei { - char * pei_errcode; /* name of the error code to use */ - struct avp * pei_avp; /* pointer to invalid or missing AVP (to be freed) */ - char * pei_message; /* Overwrite default message if needed */ - int pei_protoerr; /* do we set the 'E' bit in the error message ? */ -}; +int fd_msg_parse_dict ( msg_or_avp * object, struct dictionary * dict, struct fd_pei *error_info ); /* * FUNCTION: fd_msg_parse_rules