comparison 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
comparison
equal deleted inserted replaced
902:42d0a08cffa8 903:4382d7420e65
1788 } 1788 }
1789 } 1789 }
1790 1790
1791 /* Now try and resolve the model from the avp code and vendor */ 1791 /* Now try and resolve the model from the avp code and vendor */
1792 if (avp->avp_public.avp_flags & AVP_FLAG_VENDOR) { 1792 if (avp->avp_public.avp_flags & AVP_FLAG_VENDOR) {
1793 struct dict_avp_request avpreq; 1793 struct dict_avp_request_ex avpreq;
1794 avpreq.avp_vendor = avp->avp_public.avp_vendor; 1794 memset(&avpreq, 0, sizeof(avpreq));
1795 avpreq.avp_code = avp->avp_public.avp_code; 1795 avpreq.avp_vendor.vendor_id = avp->avp_public.avp_vendor;
1796 CHECK_FCT( fd_dict_search ( dict, DICT_AVP, AVP_BY_CODE_AND_VENDOR, &avpreq, &avp->avp_model, 0)); 1796 avpreq.avp_data.avp_code = avp->avp_public.avp_code;
1797 CHECK_FCT( fd_dict_search ( dict, DICT_AVP, AVP_BY_STRUCT, &avpreq, &avp->avp_model, 0));
1797 } else { 1798 } else {
1798 /* no vendor */ 1799 /* no vendor */
1799 CHECK_FCT( fd_dict_search ( dict, DICT_AVP, AVP_BY_CODE, &avp->avp_public.avp_code, &avp->avp_model, 0)); 1800 CHECK_FCT( fd_dict_search ( dict, DICT_AVP, AVP_BY_CODE, &avp->avp_public.avp_code, &avp->avp_model, 0));
1800 } 1801 }
1801 1802
"Welcome to our mercurial repository"