Changeset 1424:c8057892e56b in freeDiameter for extensions/app_sip/libapp_sip.c
- Timestamp:
- Feb 19, 2020, 8:24:13 AM (4 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/app_sip/libapp_sip.c
r433 r1424 67 67 } 68 68 69 70 /* Search a given AVP model in an AVP (extracted from libfreediameter/message.c ) */71 int fd_avp_search_avp ( struct avp * groupedavp, struct dict_object * what, struct avp ** avp )72 {73 struct avp * nextavp;74 struct avp_hdr * nextavphdr;75 struct dict_avp_data dictdata;76 77 78 TRACE_ENTRY("%p %p %p", groupedavp, what, avp);79 80 CHECK_FCT( fd_dict_getval(what, &dictdata) );81 82 // Loop only in the group AVP83 CHECK_FCT( fd_msg_browse(groupedavp, MSG_BRW_FIRST_CHILD, (void *)&nextavp, NULL) );84 CHECK_FCT( fd_msg_avp_hdr( nextavp, &nextavphdr ) );85 86 while (nextavphdr) {87 88 if ( (nextavphdr->avp_code == dictdata.avp_code) && (nextavphdr->avp_vendor == dictdata.avp_vendor) ) // always 0 if no Vendor flag89 {90 break;91 }92 93 // Otherwise move to next AVP in the grouped AVP94 CHECK_FCT( fd_msg_browse(nextavp, MSG_BRW_NEXT, (void *)&nextavp, NULL) );95 96 if(nextavp!=NULL)97 {98 CHECK_FCT( fd_msg_avp_hdr( nextavp, &nextavphdr ) );99 }100 else101 nextavphdr=NULL;102 }103 if (avp)104 *avp = nextavp;105 106 if (avp && nextavp) {107 struct dictionary * dict;108 CHECK_FCT( fd_dict_getdict( what, &dict) );109 CHECK_FCT_DO( fd_msg_parse_dict( nextavp, dict, NULL ), );110 }111 112 if (avp || nextavp)113 return 0;114 else115 return ENOENT;116 }117 69 struct avp_hdr *walk_digest(struct avp *avp, int avp_code) 118 70 {
Note: See TracChangeset
for help on using the changeset viewer.