Navigation


Changeset 903:4382d7420e65 in freeDiameter for include


Ignore:
Timestamp:
Dec 15, 2012, 5:24:34 AM (11 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • include/freeDiameter/libfdproto.h

    r899 r903  
    13311331        AVP_BY_CODE = 50,       /* "what" points to an avp_code_t, vendor is always 0 */
    13321332        AVP_BY_NAME,            /* "what" points to a char *, vendor is always 0 */
     1333        AVP_BY_NAME_ALL_VENDORS,/* "what" points to a string. Might be quite slow... */
     1334        AVP_BY_STRUCT,          /* "what" points to a struct dict_avp_request_ex (see bellow) */
     1335                       
     1336        /* kept for backward compatibility, better use AVP_BY_STRUCT above instead */
    13331337        AVP_BY_CODE_AND_VENDOR, /* "what" points to a struct dict_avp_request (see bellow), where avp_vendor and avp_code are set */
    1334         AVP_BY_NAME_AND_VENDOR, /* "what" points to a struct dict_avp_request (see bellow), where avp_vendor and avp_name are set */
    1335         AVP_BY_NAME_ALL_VENDORS /* "what" points to a string. Might be quite slow... */
     1338        AVP_BY_NAME_AND_VENDOR  /* "what" points to a struct dict_avp_request (see bellow), where avp_vendor and avp_name are set */
    13361339};
    13371340
    13381341/* Struct used for some researchs */
     1342struct dict_avp_request_ex {
     1343        struct {
     1344                /* Only one of the following fields must be set. */
     1345                struct dict_object *    vendor;         /* most efficient if already known, set to NULL to ignore */
     1346                vendor_id_t             vendor_id;      /* set to 0 to ignore -- prefer AVP_BY_CODE or AVP_BY_NAME for vendor 0 */
     1347                char *                  vendor_name;    /* set to NULL to ignore */
     1348        } avp_vendor;
     1349       
     1350        struct {
     1351                /* Only one of the following fields must be set */
     1352                avp_code_t       avp_code; /* set to 0 to ignore */
     1353                char *           avp_name; /* set to NULL to ignore */
     1354        } avp_data;
     1355};
     1356
    13391357struct dict_avp_request {
    13401358        vendor_id_t      avp_vendor;
     
    13421360        char *           avp_name;
    13431361};
     1362
    13441363
    13451364
Note: See TracChangeset for help on using the changeset viewer.