Navigation


Changeset 602:0b5d21c87855 in freeDiameter


Ignore:
Timestamp:
Nov 25, 2010, 4:27:54 PM (13 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Added new AVP search criteria in the dictionary: AVP_BY_NAME_ALL_VENDORS

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • include/freeDiameter/libfreeDiameter.h

    r594 r602  
    12101210        AVP_BY_NAME,            /* "what" points to a string, vendor is always 0 */
    12111211        AVP_BY_CODE_AND_VENDOR, /* "what" points to a struct dict_avp_request (see bellow), where avp_vendor and avp_code are set */
    1212         AVP_BY_NAME_AND_VENDOR  /* "what" points to a struct dict_avp_request (see bellow), where avp_vendor and avp_name are set */
     1212        AVP_BY_NAME_AND_VENDOR, /* "what" points to a struct dict_avp_request (see bellow), where avp_vendor and avp_name are set */
     1213        AVP_BY_NAME_ALL_VENDORS /* "what" points to a string. Might be quite slow... */
    12131214};
    12141215
  • libfreeDiameter/dictionary.c

    r446 r602  
    592592        struct fd_list * __li;                                                  \
    593593        ret = 0;                                                                \
    594         for  (__li = (sentinel); __li->next != (sentinel); __li = __li->next) { \
    595                 __cmp = strcmp(__str, _O(__li->next->o)->data. datafield );     \
     594        for  (__li = (sentinel)->next; __li != (sentinel); __li = __li->next) { \
     595                __cmp = strcmp(__str, _O(__li->o)->data. datafield );           \
    596596                if (__cmp == 0) {                                               \
    597597                        if (result)                                             \
    598                                 *result = _O(__li->next->o);                    \
     598                                *result = _O(__li->o);                          \
    599599                        goto end;                                               \
    600600                }                                                               \
     
    974974                        break;
    975975               
     976                case AVP_BY_NAME_ALL_VENDORS:
     977                        {
     978                                struct fd_list * li;
     979                               
     980                                /* First, search for vendor 0 */
     981                                SEARCH_string( what, &dict->dict_vendors.list[2], avp.avp_name, 1);
     982                               
     983                                /* If not found, loop for all vendors, until found */
     984                                for (li = dict->dict_vendors.list[0].next; li != &dict->dict_vendors.list[0]; li = li->next) {
     985                                        SEARCH_string( what, &_O(li->o)->list[2], avp.avp_name, 1);
     986                                }
     987                        }
     988                        break;
     989               
    976990                default:
    977991                        /* Invalid criteria */
Note: See TracChangeset for help on using the changeset viewer.