Mercurial > hg > freeDiameter
diff libfdproto/messages.c @ 903:4382d7420e65
Add new AVP_BY_STRUCT method for searching vendor-specific AVPs. This allows more flexibility and superseeds AVP_BY_NAME_AND_VENDOR and AVP_BY_CODE_AND_VENDOR.
author | Sebastien Decugis <sdecugis@freediameter.net> |
---|---|
date | Fri, 14 Dec 2012 21:24:34 +0100 |
parents | fbf77629cb7b |
children | 9bd18fa4e601 |
line wrap: on
line diff
--- a/libfdproto/messages.c Fri Dec 14 20:42:28 2012 +0100 +++ b/libfdproto/messages.c Fri Dec 14 21:24:34 2012 +0100 @@ -1790,10 +1790,11 @@ /* Now try and resolve the model from the avp code and vendor */ if (avp->avp_public.avp_flags & AVP_FLAG_VENDOR) { - struct dict_avp_request avpreq; - avpreq.avp_vendor = avp->avp_public.avp_vendor; - avpreq.avp_code = avp->avp_public.avp_code; - CHECK_FCT( fd_dict_search ( dict, DICT_AVP, AVP_BY_CODE_AND_VENDOR, &avpreq, &avp->avp_model, 0)); + struct dict_avp_request_ex avpreq; + memset(&avpreq, 0, sizeof(avpreq)); + avpreq.avp_vendor.vendor_id = avp->avp_public.avp_vendor; + avpreq.avp_data.avp_code = avp->avp_public.avp_code; + CHECK_FCT( fd_dict_search ( dict, DICT_AVP, AVP_BY_STRUCT, &avpreq, &avp->avp_model, 0)); } else { /* no vendor */ CHECK_FCT( fd_dict_search ( dict, DICT_AVP, AVP_BY_CODE, &avp->avp_public.avp_code, &avp->avp_model, 0));