Changeset 1424:c8057892e56b in freeDiameter for contrib
- Timestamp:
- Feb 19, 2020, 8:24:13 AM (4 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
contrib/test_Gx/main_gx.c
r1271 r1424 701 701 702 702 } 703 /* Search a given AVP model in an AVP (extracted from libfreediameter/message.c ) */704 int fd_avp_search_avp ( struct avp * groupedavp, struct dict_object * what, struct avp ** avp )705 {706 struct avp * nextavp;707 struct avp_hdr * nextavphdr;708 struct dict_avp_data dictdata;709 710 711 TRACE_ENTRY("%p %p %p", groupedavp, what, avp);712 713 CHECK_FCT( fd_dict_getval(what, &dictdata) );714 715 // Loop only in the group AVP716 CHECK_FCT( fd_msg_browse(groupedavp, MSG_BRW_FIRST_CHILD, (void *)&nextavp, NULL) );717 CHECK_FCT( fd_msg_avp_hdr( nextavp, &nextavphdr ) );718 719 while (nextavphdr) {720 721 if ( (nextavphdr->avp_code == dictdata.avp_code) && (nextavphdr->avp_vendor == dictdata.avp_vendor) ) // always 0 if no Vendor flag722 {723 break;724 }725 726 // Otherwise move to next AVP in the grouped AVP727 CHECK_FCT( fd_msg_browse(nextavp, MSG_BRW_NEXT, (void *)&nextavp, NULL) );728 729 if(nextavp!=NULL)730 {731 CHECK_FCT( fd_msg_avp_hdr( nextavp, &nextavphdr ) );732 }733 else734 nextavphdr=NULL;735 }736 if (avp)737 *avp = nextavp;738 739 if (avp && nextavp) {740 struct dictionary * dict;741 CHECK_FCT( fd_dict_getdict( what, &dict) );742 CHECK_FCT_DO( fd_msg_parse_dict( nextavp, dict, NULL ), );743 }744 745 if (avp || nextavp)746 return 0;747 else748 return ENOENT;749 }750 703 751 704 static int cca_cb( struct msg ** msg, … … 785 738 786 739 CHECK_FCT(fd_msg_search_avp ( *msg, chrg_rule_grp, &g_avp )); 787 CHECK_FCT(fd_ avp_search_avp(g_avp, chrg_rule_name, &avp));740 CHECK_FCT(fd_msg_search_avp(g_avp, chrg_rule_name, &avp)); 788 741 789 742 if(avp) {
Note: See TracChangeset
for help on using the changeset viewer.