Navigation


Changeset 1424:c8057892e56b in freeDiameter for extensions/app_sip/libapp_sip.c


Ignore:
Timestamp:
Feb 19, 2020, 8:24:13 AM (4 years ago)
Author:
Luke Mewburn <luke@mewburn.net>
Branch:
default
Phase:
public
Message:

adapt extensions to fd_msg_search_avp(struct avp)

Remove now-unnecessary fd_avp_search_avp() implementations
now that fd_msg_search_avp() can be used.

TODO: rt_rewrite.fdx still uses own version because that does
extra validation and logging (that may or may not be necessary).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/app_sip/libapp_sip.c

    r433 r1424  
    6767}
    6868
    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 AVP
    83         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 flag
    89                 {
    90                         break;
    91                 }
    92                
    93                 // Otherwise move to next AVP in the grouped AVP
    94                 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                 else
    101                         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         else
    115                 return ENOENT;
    116 }
    11769struct avp_hdr *walk_digest(struct avp *avp, int avp_code)
    11870{
Note: See TracChangeset for help on using the changeset viewer.