]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Use of 'op' instead of 'operator', and declare it as an FR_TOKEN.
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 20 Jan 2013 13:09:57 +0000 (13:09 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 20 Jan 2013 13:15:29 +0000 (13:15 +0000)
Operator conflicts with a C++ keyword.

21 files changed:
src/include/libradius.h
src/include/radiusd.h
src/lib/print.c
src/lib/valuepair.c
src/main/conffile.c
src/main/evaluate.c
src/main/modcall.c
src/main/radsniff.c
src/main/valuepair.c
src/modules/rlm_attr_filter/rlm_attr_filter.c
src/modules/rlm_cache/rlm_cache.c
src/modules/rlm_checkval/rlm_checkval.c
src/modules/rlm_detail/rlm_detail.c
src/modules/rlm_eap/types/rlm_eap_ikev2/ike_conf.c
src/modules/rlm_expr/paircmp.c
src/modules/rlm_fastusers/rlm_fastusers.c
src/modules/rlm_files/rlm_files.c
src/modules/rlm_jradius/rlm_jradius.c
src/modules/rlm_perl/rlm_perl.c
src/modules/rlm_policy/evaluate.c
src/modules/rlm_rest/rest.c

index ee5567f69d1b48a30b21b3d36f08d1ce4c4f8233..63627c4bc94c2a3ad6ac9d62d7a63987ab7b37ca 100644 (file)
@@ -108,22 +108,23 @@ extern "C" {
 #endif
 
 typedef struct attr_flags {
-       unsigned int            has_tag : 1;  /* tagged attribute */
-       unsigned int            do_xlat : 1;  /* strvalue is dynamic */
-       unsigned int            unknown_attr : 1; /* not in dictionary */
-       unsigned int            array : 1; /* pack multiples into 1 attr */
-       unsigned int            has_value : 1; /* has a value */
-       unsigned int            has_value_alias : 1; /* has a value alias */
-       unsigned int            has_tlv : 1; /* has sub attributes */
-       unsigned int            is_tlv : 1; /* is a sub attribute */
-       unsigned int            extended : 1; /* extended attribute */
-       unsigned int            long_extended : 1; /* long format */
-       unsigned int            evs : 1;            /* extended VSA */
-       unsigned int            wimax: 1;           /* WiMAX format=1,1,c */
-
-       int8_t                  tag;          /* tag for tunneled attributes */
-       uint8_t                 encrypt;      /* encryption method */
-       uint8_t                 length;
+       unsigned int    has_tag : 1;            //!< Tagged attribute.
+       unsigned int    do_xlat : 1;            //!< Strvalue is dynamic.
+       unsigned int    unknown_attr : 1;       //!< Not in dictionary.
+       unsigned int    array : 1;              //!< Pack multiples into 1 attr.
+       unsigned int    has_value : 1;          //!< Has a value.
+       unsigned int    has_value_alias : 1;    //!< Has a value alias.
+       unsigned int    has_tlv : 1;            //!< Has sub attributes.
+       unsigned int    is_tlv : 1;             //!< Is a sub attribute.
+       unsigned int    extended : 1;           //!< Extended attribute.
+       unsigned int    long_extended : 1;      //!< Long format.
+       unsigned int    evs : 1;                //!< Extended VSA.
+       unsigned int    wimax: 1;               //!< WiMAX format=1,1,c.
+
+       int8_t          tag;                    //!< Tag for tunneled.
+                                               //!< Attributes.
+       uint8_t         encrypt;                //!< Ecryption method.
+       uint8_t         length;
 } ATTR_FLAGS;
 
 /*
@@ -187,17 +188,11 @@ typedef struct value_pair {
        unsigned int            attribute;
        unsigned int            vendor;
        int                     type;
-#ifdef __cplusplus
-       /*
-        *      C++ hackery.  The server and modules are all C, so
-        *      the defs here don't affect them.  But any C++ code
-        *      gets excited over "operator", so we change the name.
-        */
-       FR_TOKEN                op_token;
-#else
-       FR_TOKEN                operator;
-#endif
 
+       FR_TOKEN                op;             //!< Operator to use when 
+                                               //!< moving or inserting 
+                                               //!< valuepair into a list.
+                                               
         ATTR_FLAGS              flags;
 
        size_t                  length; /* of data field */
@@ -426,8 +421,8 @@ VALUE_PAIR  *paircopy2(VALUE_PAIR *vp, unsigned int attr, unsigned int vendor, in
 void           pairmove(VALUE_PAIR **to, VALUE_PAIR **from);
 void           pairmove2(VALUE_PAIR **to, VALUE_PAIR **from, unsigned int attr, unsigned int vendor, int8_t tag);
 VALUE_PAIR     *pairparsevalue(VALUE_PAIR *vp, const char *value);
-VALUE_PAIR     *pairmake(const char *attribute, const char *value, int operator);
-VALUE_PAIR     *pairmake_xlat(const char *attribute, const char *value, int operator);
+VALUE_PAIR     *pairmake(const char *attribute, const char *value, FR_TOKEN op);
+VALUE_PAIR     *pairmake_xlat(const char *attribute, const char *value, FR_TOKEN op);
 VALUE_PAIR     *pairread(const char **ptr, FR_TOKEN *eol);
 FR_TOKEN       userparse(const char *buffer, VALUE_PAIR **first_pair);
 VALUE_PAIR     *readvp2(FILE *fp, int *pfiledone, const char *errprefix);
@@ -491,12 +486,12 @@ void              print_abinary(const VALUE_PAIR *vp, char *buffer, size_t len, int delimits
 /* random numbers in isaac.c */
 /* context of random number generator */
 typedef struct fr_randctx {
-  uint32_t randcnt;
-  uint32_t randrsl[256];
-  uint32_t randmem[256];
-  uint32_t randa;
-  uint32_t randb;
-  uint32_t randc;
+       uint32_t randcnt;
+       uint32_t randrsl[256];
+       uint32_t randmem[256];
+       uint32_t randa;
+       uint32_t randb;
+       uint32_t randc;
 } fr_randctx;
 
 void fr_isaac(fr_randctx *ctx);
index 7e0081459e66255efb07275b519b9838383dbf97..481116ca7c7ae9b02b3f141e7cdfe336e5c10a5e 100644 (file)
@@ -647,7 +647,7 @@ VALUE_PAIR  *radius_paircreate(REQUEST *request, VALUE_PAIR **vps,
                                   unsigned int attribute, unsigned int vendor, int type);
 VALUE_PAIR *radius_pairmake(REQUEST *request, VALUE_PAIR **vps,
                            const char *attribute, const char *value,
-                           int operator);
+                           FR_TOKEN op);
 
 /* xlat.c */
 typedef size_t (*RADIUS_ESCAPE_STRING)(REQUEST *, char *out, size_t outlen, const char *in, void *arg);
index 3f9772463cbfd4cd767fd297f8c58c86820236be..d3a16f2e950656eb678b605ecab2e3e178dbe2d6 100644 (file)
@@ -599,9 +599,9 @@ int vp_prints(char *out, size_t outlen, const VALUE_PAIR *vp)
        out[0] = 0;
        if (!vp) return 0;
 
-       if ((vp->operator > T_OP_INVALID) &&
-           (vp->operator < T_TOKEN_LAST)) {
-               token = vp_tokens[vp->operator];
+       if ((vp->op > T_OP_INVALID) &&
+           (vp->op < T_TOKEN_LAST)) {
+               token = vp_tokens[vp->op];
        } else {
                token = "<INVALID-TOKEN>";
        }
index 448df28a5d0ae39a76e89ab25942910ef98d3005..1563d36d583677e4b7b500be3dd2c88b6650796f 100644 (file)
@@ -96,7 +96,7 @@ VALUE_PAIR *pairalloc(const DICT_ATTR *da)
                memset(&vp->flags, 0, sizeof(vp->flags));
                vp->flags.unknown_attr = 1;
        }
-       vp->operator = T_OP_EQ;
+       vp->op = T_OP_EQ;
 
        switch (vp->type) {
                case PW_TYPE_BYTE:
@@ -166,7 +166,7 @@ VALUE_PAIR *paircreate_raw(int attr, int vendor, int type, VALUE_PAIR *vp)
 
        vp->vendor = vendor;
        vp->attribute = attr;
-       vp->operator = T_OP_EQ;
+       vp->op = T_OP_EQ;
        vp->name = p;
        vp->type = type;
        vp->length = 0;
@@ -552,7 +552,7 @@ void pairmove(VALUE_PAIR **to, VALUE_PAIR **from)
                        continue;
                }
 
-               switch (i->operator) {
+               switch (i->op) {
                        /*
                         *      These are COMPARISON attributes
                         *      from a check list, and are not
@@ -586,7 +586,7 @@ void pairmove(VALUE_PAIR **to, VALUE_PAIR **from)
 
 
                        found = pairfind(*to, i->attribute, i->vendor, TAG_ANY);
-                       switch (i->operator) {
+                       switch (i->op) {
 
                        /*
                         *      If matching attributes are found,
@@ -1060,8 +1060,8 @@ VALUE_PAIR *pairparsevalue(VALUE_PAIR *vp, const char *value)
                        /*
                         *      It's a comparison, not a real IP.
                         */
-                       if ((vp->operator == T_OP_REG_EQ) ||
-                           (vp->operator == T_OP_REG_NE)) {
+                       if ((vp->op == T_OP_REG_EQ) ||
+                           (vp->op == T_OP_REG_NE)) {
                                break;
                        }
 
@@ -1444,7 +1444,7 @@ VALUE_PAIR *pairparsevalue(VALUE_PAIR *vp, const char *value)
  *
  */
 static VALUE_PAIR *pairmake_any(const char *attribute, const char *value,
-                               int operator)
+                               FR_TOKEN op)
 {
        unsigned int    attr, vendor;
        unsigned int    dv_type = 1;
@@ -1656,7 +1656,7 @@ static VALUE_PAIR *pairmake_any(const char *attribute, const char *value,
                return NULL;
        }
 
-       vp->operator = (operator == 0) ? T_OP_EQ : operator;
+       vp->op = (op == 0) ? T_OP_EQ : op;
        if (!value) return vp;
 
        size = strlen(value + 2);
@@ -1687,7 +1687,7 @@ static VALUE_PAIR *pairmake_any(const char *attribute, const char *value,
 /*
  *     Create a VALUE_PAIR from an ASCII attribute and value.
  */
-VALUE_PAIR *pairmake(const char *attribute, const char *value, int operator)
+VALUE_PAIR *pairmake(const char *attribute, const char *value, FR_TOKEN op)
 {
        DICT_ATTR       *da;
        VALUE_PAIR      *vp;
@@ -1737,14 +1737,14 @@ VALUE_PAIR *pairmake(const char *attribute, const char *value, int operator)
         *      another method to create the attribute.
         */
        if ((da = dict_attrbyname(attrname)) == NULL) {
-               return pairmake_any(attrname, value, operator);
+               return pairmake_any(attrname, value, op);
        }
 
        if ((vp = pairalloc(da)) == NULL) {
                return NULL;
        }
 
-       vp->operator = (operator == 0) ? T_OP_EQ : operator;
+       vp->op = (op == 0) ? T_OP_EQ : op;
 
        /*      Check for a tag in the 'Merit' format of:
         *      :Tag:Value.  Print an error if we already found
@@ -1780,7 +1780,7 @@ VALUE_PAIR *pairmake(const char *attribute, const char *value, int operator)
          vp->flags.tag = tag;
        }
 
-       switch (vp->operator) {
+       switch (vp->op) {
        default:
                break;
 
@@ -1829,7 +1829,7 @@ VALUE_PAIR *pairmake(const char *attribute, const char *value, int operator)
                        }
                }
 
-               return pairmake_xlat(attribute, value, operator);
+               return pairmake_xlat(attribute, value, op);
 #endif
        }
 
@@ -1849,7 +1849,8 @@ VALUE_PAIR *pairmake(const char *attribute, const char *value, int operator)
        return vp;
 }
 
-VALUE_PAIR *pairmake_xlat(const char *attribute, const char *value, int operator)
+VALUE_PAIR *pairmake_xlat(const char *attribute, const char *value,
+                         FR_TOKEN op)
 {
        VALUE_PAIR *vp;
 
@@ -1858,7 +1859,7 @@ VALUE_PAIR *pairmake_xlat(const char *attribute, const char *value, int operator
                return NULL;
        }
 
-       vp = pairmake(attribute, NULL, operator);
+       vp = pairmake(attribute, NULL, op);
        if (!vp) return vp;
 
        strlcpy(vp->vp_strvalue, value, sizeof(vp->vp_strvalue));
@@ -2180,7 +2181,7 @@ int paircmp(VALUE_PAIR *one, VALUE_PAIR *two)
 {
        int compare;
 
-       switch (one->operator) {
+       switch (one->op) {
        case T_OP_CMP_TRUE:
                return (two != NULL);
 
@@ -2218,7 +2219,7 @@ int paircmp(VALUE_PAIR *one, VALUE_PAIR *two)
                        compare = regexec(&reg, buffer, 0, NULL, 0);
 
                        regfree(&reg);
-                       if (one->operator == T_OP_REG_EQ) return (compare == 0);
+                       if (one->op == T_OP_REG_EQ) return (compare == 0);
                        return (compare != 0);
                }
 #endif
@@ -2321,7 +2322,7 @@ int paircmp(VALUE_PAIR *one, VALUE_PAIR *two)
        /*
         *      Now do the operator comparison.
         */
-       switch (one->operator) {
+       switch (one->op) {
        case T_OP_CMP_EQ:
                return (compare == 0);
 
index c82c2f6c26b2aeb59dc434e671c850116e739894..e8e5eb2c1b3fdd3e33bfaf3a07ea7d9c2d76c3e3 100644 (file)
@@ -60,7 +60,7 @@ struct conf_pair {
        CONF_ITEM item;
        const char *attr;
        const char *value;
-       FR_TOKEN operator;
+       FR_TOKEN op;
        FR_TOKEN value_type;
 };
 struct conf_part {
@@ -155,7 +155,7 @@ static CONF_ITEM *cf_datatoitem(CONF_DATA *cd)
  *     Create a new CONF_PAIR
  */
 static CONF_PAIR *cf_pair_alloc(const char *attr, const char *value,
-                               FR_TOKEN operator, FR_TOKEN value_type,
+                               FR_TOKEN op, FR_TOKEN value_type,
                                CONF_SECTION *parent)
 {
        char *p;
@@ -183,7 +183,7 @@ static CONF_PAIR *cf_pair_alloc(const char *attr, const char *value,
                cp->value = p;
        }
        cp->value_type = value_type;
-       cp->operator = operator;
+       cp->op = op;
 
        return cp;
 }
@@ -486,7 +486,7 @@ int cf_pair_replace(CONF_SECTION *cs, CONF_PAIR *cp, const char *value)
        CONF_PAIR *newp;
        CONF_ITEM *ci, *cn, **last;
 
-       newp = cf_pair_alloc(cp->attr, value, cp->operator, cp->value_type,
+       newp = cf_pair_alloc(cp->attr, value, cp->op, cp->value_type,
                             cs);
        if (!newp) return -1;
 
@@ -2046,7 +2046,7 @@ const char *cf_pair_value(const CONF_PAIR *pair)
 
 FR_TOKEN cf_pair_operator(const CONF_PAIR *pair)
 {
-       return (pair ? pair->operator : T_OP_INVALID);
+       return (pair ? pair->op : T_OP_INVALID);
 }
 
 /*
@@ -2084,13 +2084,13 @@ VALUE_PAIR *cf_pairtovp(CONF_PAIR *pair)
         *      FALSE comparisons never match.  BUT if it's a "string"
         *      or `string`, then remember to expand it later.
         */
-       if ((pair->operator != T_OP_CMP_FALSE) &&
+       if ((pair->op != T_OP_CMP_FALSE) &&
            ((pair->value_type == T_DOUBLE_QUOTED_STRING) ||
             (pair->value_type == T_BACK_QUOTED_STRING))) {
-               return pairmake_xlat(pair->attr, pair->value, pair->operator);
+               return pairmake_xlat(pair->attr, pair->value, pair->op);
        }
 
-       return pairmake(pair->attr, pair->value, pair->operator);
+       return pairmake(pair->attr, pair->value, pair->op);
 }
 
 /*
index 7c3b3ec21400753f6caddd6506434f7993cee066..ccae4dec96749f968640856f544ee7b4287d8151 100644 (file)
@@ -299,7 +299,7 @@ static int radius_do_cmp(REQUEST *request, int *presult,
                                return FALSE;
                        }
 
-                       myvp.operator = token;
+                       myvp.op = token;
                        *presult = paircmp(&myvp, vp);
                        RDEBUG3("  paircmp -> %d", *presult);
                        return TRUE;
@@ -866,7 +866,7 @@ void radius_pairmove(REQUEST *request, VALUE_PAIR **to, VALUE_PAIR *from)
                 *      is empty, and we're supposed to replace or
                 *      "add if not existing".
                 */
-               if (from_list[i]->operator == T_OP_ADD) goto append;
+               if (from_list[i]->op == T_OP_ADD) goto append;
 
                found = FALSE;
                for (j = 0; j < to_count; j++) {
@@ -892,7 +892,7 @@ void radius_pairmove(REQUEST *request, VALUE_PAIR **to, VALUE_PAIR *from)
                         *      one in the "to" list, and move over
                         *      the one in the "from" list.
                         */
-                       if (from_list[i]->operator == T_OP_SET) {
+                       if (from_list[i]->op == T_OP_SET) {
                                RDEBUG4("::: OVERWRITING %s FROM %d TO %d",
                                       to_list[j]->name, i, j);
                                pairfree(&to_list[j]);
@@ -907,7 +907,7 @@ void radius_pairmove(REQUEST *request, VALUE_PAIR **to, VALUE_PAIR *from)
                         *      exist... but it exists, so we stop
                         *      looking.
                         */
-                       if (from_list[i]->operator == T_OP_EQ) {
+                       if (from_list[i]->op == T_OP_EQ) {
                                found = TRUE;
                                break;
                        }
@@ -916,7 +916,7 @@ void radius_pairmove(REQUEST *request, VALUE_PAIR **to, VALUE_PAIR *from)
                         *      Delete every attribute, independent
                         *      of its value.
                         */
-                       if (from_list[i]->operator == T_OP_CMP_FALSE) {
+                       if (from_list[i]->op == T_OP_CMP_FALSE) {
                                goto delete;
                        }
 
@@ -924,17 +924,17 @@ void radius_pairmove(REQUEST *request, VALUE_PAIR **to, VALUE_PAIR *from)
                         *      Delete all matching attributes from
                         *      "to"
                         */
-                       if ((from_list[i]->operator == T_OP_SUB) ||
-                           (from_list[i]->operator == T_OP_CMP_EQ) ||
-                           (from_list[i]->operator == T_OP_LE) ||
-                           (from_list[i]->operator == T_OP_GE)) {
+                       if ((from_list[i]->op == T_OP_SUB) ||
+                           (from_list[i]->op == T_OP_CMP_EQ) ||
+                           (from_list[i]->op == T_OP_LE) ||
+                           (from_list[i]->op == T_OP_GE)) {
                                int rcode;
-                               int old_op = from_list[i]->operator;
+                               int old_op = from_list[i]->op;
 
                                /*
                                 *      Check for equality.
                                 */
-                               from_list[i]->operator = T_OP_CMP_EQ;
+                               from_list[i]->op = T_OP_CMP_EQ;
 
                                /*
                                 *      If equal, delete the one in
@@ -948,7 +948,7 @@ void radius_pairmove(REQUEST *request, VALUE_PAIR **to, VALUE_PAIR *from)
                                 *      operator back to it's original
                                 *      value.
                                 */
-                               from_list[i]->operator = old_op;
+                               from_list[i]->op = old_op;
 
                                switch (old_op) {
                                case T_OP_CMP_EQ:
@@ -1005,10 +1005,10 @@ void radius_pairmove(REQUEST *request, VALUE_PAIR **to, VALUE_PAIR *from)
                 *      moved by another operator.
                 */
                if (!found && from_list[i]) {
-                       if ((from_list[i]->operator == T_OP_EQ) ||
-                           (from_list[i]->operator == T_OP_LE) ||
-                           (from_list[i]->operator == T_OP_GE) ||
-                           (from_list[i]->operator == T_OP_SET)) {
+                       if ((from_list[i]->op == T_OP_EQ) ||
+                           (from_list[i]->op == T_OP_LE) ||
+                           (from_list[i]->op == T_OP_GE) ||
+                           (from_list[i]->op == T_OP_SET)) {
                        append:
                                RDEBUG4("::: APPENDING %s FROM %d TO %d",
                                       from_list[i]->name, i, tailto);
@@ -1059,7 +1059,7 @@ void radius_pairmove(REQUEST *request, VALUE_PAIR **to, VALUE_PAIR *from)
                 *      file and debug output, where we don't want to
                 *      see the operators.
                 */
-               vp->operator = T_OP_EQ;
+               vp->op = T_OP_EQ;
 
                /*
                 *      Fix dumb cache issues
@@ -1112,7 +1112,7 @@ struct conf_pair {
        CONF_ITEM item;
        char *attr;
        char *value;
-       FR_TOKEN operator;
+       FR_TOKEN op;
        FR_TOKEN value_type;
 };
 
index 36a512e0b85bd50a71809c0a3f4a953fd302d6c0..7fd4087bd677692d28fd8404de76420b812e853f 100644 (file)
@@ -1494,14 +1494,14 @@ static modcallable *do_compile_modupdate(modcallable *parent,
                        return NULL;
                }
 
-               if ((vp->operator != T_OP_EQ) &&
-                   (vp->operator != T_OP_CMP_EQ) &&
-                   (vp->operator != T_OP_ADD) &&
-                   (vp->operator != T_OP_SUB) &&
-                   (vp->operator != T_OP_LE) &&
-                   (vp->operator != T_OP_GE) &&
-                   (vp->operator != T_OP_CMP_FALSE) &&
-                   (vp->operator != T_OP_SET)) {
+               if ((vp->op != T_OP_EQ) &&
+                   (vp->op != T_OP_CMP_EQ) &&
+                   (vp->op != T_OP_ADD) &&
+                   (vp->op != T_OP_SUB) &&
+                   (vp->op != T_OP_LE) &&
+                   (vp->op != T_OP_GE) &&
+                   (vp->op != T_OP_CMP_FALSE) &&
+                   (vp->op != T_OP_SET)) {
                        pairfree(&head);
                        pairfree(&vp);
                        cf_log_err(ci, "Invalid operator for attribute");
@@ -1513,8 +1513,8 @@ static modcallable *do_compile_modupdate(modcallable *parent,
                 *      <= or >= can only happen for integer
                 *      attributes.
                 */
-               if ((vp->operator == T_OP_LE) ||
-                   (vp->operator == T_OP_GE)) {
+               if ((vp->op == T_OP_LE) ||
+                   (vp->op == T_OP_GE)) {
                        if ((vp->type != PW_TYPE_BYTE) &&
                            (vp->type != PW_TYPE_SHORT) &&
                            (vp->type != PW_TYPE_INTEGER) &&
index 74d982f269e74697404a739dd8e2e9e2bed1b3aa..6047a2daf02ca6c6bc737b633d43fe93d5d67915 100644 (file)
@@ -78,7 +78,7 @@ static int filter_packet(RADIUS_PACKET *packet)
                     check_item != NULL;
                     check_item = check_item->next)
                        if ((check_item->attribute == vp->attribute)
-                        && (check_item->operator != T_OP_SET)) {
+                        && (check_item->op != T_OP_SET)) {
                                compare = paircmp(check_item, vp);
                                if (compare == 1)
                                        pass++;
index 98c4da60afe8fdef22fe6192f2bd52d773e4acfb..e83773d07120268b198d8b07c80c0a5ef0a98c66 100644 (file)
@@ -115,11 +115,11 @@ int radius_compare_vps(REQUEST *request, VALUE_PAIR *check, VALUE_PAIR *vp)
        /*
         *      Check for =* and !* and return appropriately
         */
-       if (check->operator == T_OP_CMP_TRUE)  return 0;
-       if (check->operator == T_OP_CMP_FALSE) return 1;
+       if (check->op == T_OP_CMP_TRUE)  return 0;
+       if (check->op == T_OP_CMP_FALSE) return 1;
 
 #ifdef HAVE_REGEX_H
-       if (check->operator == T_OP_REG_EQ) {
+       if (check->op == T_OP_REG_EQ) {
                int i, compare;
                regex_t reg;
                char value[1024];
@@ -194,7 +194,7 @@ int radius_compare_vps(REQUEST *request, VALUE_PAIR *check, VALUE_PAIR *vp)
                return -1;
        }
 
-       if (check->operator == T_OP_REG_NE) {
+       if (check->op == T_OP_REG_NE) {
                int compare;
                regex_t reg;
                char value[1024];
@@ -340,8 +340,8 @@ int radius_callback_compare(REQUEST *req, VALUE_PAIR *request,
        /*
         *      Check for =* and !* and return appropriately
         */
-       if (check->operator == T_OP_CMP_TRUE)  return 0;
-       if (check->operator == T_OP_CMP_FALSE) return 1;
+       if (check->op == T_OP_CMP_TRUE)  return 0;
+       if (check->op == T_OP_CMP_FALSE) return 1;
 
        /*
         *      See if there is a special compare function.
@@ -489,8 +489,8 @@ int paircompare(REQUEST *req, VALUE_PAIR *request, VALUE_PAIR *check,
                 *      then don't bother comparing it to any attributes
                 *      sent to us by the user.  It ALWAYS matches.
                 */
-               if ((check_item->operator == T_OP_SET) ||
-                   (check_item->operator == T_OP_ADD)) {
+               if ((check_item->op == T_OP_SET) ||
+                   (check_item->op == T_OP_ADD)) {
                        continue;
                }
 
@@ -518,7 +518,7 @@ int paircompare(REQUEST *req, VALUE_PAIR *request, VALUE_PAIR *check,
                         *      This hack makes CHAP-Password work..
                         */
                        case PW_USER_PASSWORD:
-                               if (check_item->operator == T_OP_CMP_EQ) {
+                               if (check_item->op == T_OP_CMP_EQ) {
                                        DEBUG("WARNING: Found User-Password == \"...\".");
                                        DEBUG("WARNING: Are you sure you don't mean Cleartext-Password?");
                                        DEBUG("WARNING: See \"man rlm_pap\" for more information.");
@@ -555,7 +555,7 @@ int paircompare(REQUEST *req, VALUE_PAIR *request, VALUE_PAIR *check,
                         *      Didn't find it.  If we were *trying*
                         *      to not find it, then we succeeded.
                         */
-                       if (check_item->operator == T_OP_CMP_FALSE) {
+                       if (check_item->op == T_OP_CMP_FALSE) {
                                continue;
                        } else {
                                return -1;
@@ -566,7 +566,7 @@ int paircompare(REQUEST *req, VALUE_PAIR *request, VALUE_PAIR *check,
                 *      Else we found it, but we were trying to not
                 *      find it, so we failed.
                 */
-               if (check_item->operator == T_OP_CMP_FALSE) {
+               if (check_item->op == T_OP_CMP_FALSE) {
                        return -1;
                }
 
@@ -596,7 +596,7 @@ int paircompare(REQUEST *req, VALUE_PAIR *request, VALUE_PAIR *check,
                compare = radius_callback_compare(req, auth_item, check_item,
                                                  check, reply);
 
-               switch (check_item->operator) {
+               switch (check_item->op) {
                        case T_OP_EQ:
                        default:
                                radlog(L_INFO,  "Invalid operator for item %s: "
@@ -703,7 +703,7 @@ void pairxlatmove(REQUEST *req, VALUE_PAIR **to, VALUE_PAIR **from)
                }
 
                found = pairfind(*to, i->attribute, i->vendor, TAG_ANY);
-               switch (i->operator) {
+               switch (i->op) {
 
                        /*
                         *      If a similar attribute is found,
@@ -828,16 +828,16 @@ VALUE_PAIR *radius_paircreate(UNUSED REQUEST *request, VALUE_PAIR **vps,
  * @param[in] vps to modify.
  * @param[in] attribute name.
  * @param[in] value attribute value.
- * @param[in] operator fr_tokens value.
+ * @param[in] op fr_tokens value.
  * @return a new VALUE_PAIR.
  */
 VALUE_PAIR *radius_pairmake(UNUSED REQUEST *request, VALUE_PAIR **vps,
                            const char *attribute, const char *value,
-                           int operator)
+                           FR_TOKEN op)
 {
        VALUE_PAIR *vp;
 
-       vp = pairmake(attribute, value, operator);
+       vp = pairmake(attribute, value, op);
        if (!vp) return NULL;
 
        if (vps) pairadd(vps, vp);
@@ -1519,13 +1519,13 @@ int radius_map2request(REQUEST *request, const value_pair_map_t *map,
        }
        
        for (vp = head; vp != NULL; vp = vp->next) {
-               vp->operator = map->op;
+               vp->op = map->op;
                
                if (debug_flag) {
                        vp_prints_value(buffer, sizeof(buffer), vp, 1);
                        
                        RDEBUG("\t%s %s %s (%s)", map->dst->name,
-                              fr_int2str(fr_tokens, vp->operator, "¿unknown?"), 
+                              fr_int2str(fr_tokens, vp->op, "¿unknown?"), 
                               buffer, src ? src : map->src->name);
                }
        }
index 628ce7cc35b889a7e7afbbd3797a71036c798499..62b3bedc405839d9a0e9c963326a9951ae3b5229 100644 (file)
@@ -62,7 +62,7 @@ static void check_pair(VALUE_PAIR *check_item, VALUE_PAIR *reply_item,
 {
        int compare;
 
-       if (check_item->operator == T_OP_SET) return;
+       if (check_item->op == T_OP_SET) return;
 
        compare = paircmp(check_item, reply_item);
        if (compare == 1) {
@@ -247,7 +247,7 @@ static rlm_rcode_t attr_filter_common(void *instance, REQUEST *request,
                         *    If it is a SET operator, add the attribute to
                         *    the output list without checking it.
                         */
-                       if (check_item->operator == T_OP_SET ) {
+                       if (check_item->op == T_OP_SET ) {
                                vp = paircopyvp(check_item);
                                if (!vp) {
                                        pairfree(&output);
@@ -284,7 +284,7 @@ static rlm_rcode_t attr_filter_common(void *instance, REQUEST *request,
                                 */
                                if ((check_item->attribute == PW_VENDOR_SPECIFIC) &&
                                        (vp->vendor != 0) &&
-                                       (check_item->operator == T_OP_CMP_TRUE)) {
+                                       (check_item->op == T_OP_CMP_TRUE)) {
                                        pass++;
                                        continue;
                                }
index 364b50ca6e7375530e1447c42a43d26ca8de10e5..2c9fb5643fe9fb024c465f92f2ba49ea44379da3 100644 (file)
@@ -421,7 +421,7 @@ static rlm_cache_entry_t *cache_add(rlm_cache_t *inst, REQUEST *request,
                                                               found);
                                        if (!vp) continue;
                                        
-                                       vp->operator = map->op;
+                                       vp->op = map->op;
                                        pairadd(to_cache, vp);
                                        
                                        if (to_req) {
@@ -463,7 +463,7 @@ static rlm_cache_entry_t *cache_add(rlm_cache_t *inst, REQUEST *request,
                                                  "¿unknown?"),
                                       map->src->name,
                                       vp->name);
-                               vp->operator = map->op;
+                               vp->op = map->op;
                        }
                        
                        pairadd(to_cache, found);
@@ -491,7 +491,7 @@ static rlm_cache_entry_t *cache_add(rlm_cache_t *inst, REQUEST *request,
                        vp = pairalloc(map->dst->da);
                        if (!vp) continue;
                        
-                       vp->operator = map->op;
+                       vp->op = map->op;
                        vp = pairparsevalue(vp, buffer);
                        if (!vp) continue;
                        
@@ -514,7 +514,7 @@ static rlm_cache_entry_t *cache_add(rlm_cache_t *inst, REQUEST *request,
                        vp = pairalloc(map->dst->da);
                        if (!vp) continue;
                        
-                       vp->operator = map->op;
+                       vp->op = map->op;
                        vp = pairparsevalue(vp, map->src->name);
                        if (!vp) continue;
                        
index 116194e06e0a6cff0441c4752cd38959bc228c4e..01d77617c628fd63e09e15bed183d79ab650c6fa 100644 (file)
@@ -259,7 +259,7 @@ static rlm_rcode_t do_checkval(void *instance, REQUEST *request)
                }
 #ifdef HAVE_REGEX_H
                if (rcode == RLM_MODULE_REJECT &&
-                   chk_vp->operator == T_OP_REG_EQ) {
+                   chk_vp->op == T_OP_REG_EQ) {
                        regex_t reg;
                        int err;
                        char err_msg[MAX_STRING_LEN];
index 2416ec25698d8e493e34b12ebe6b244e1b607b12..8bf6a1259bb4ff80726b0d8aef54c2a7584f69f4 100644 (file)
@@ -409,7 +409,7 @@ static rlm_rcode_t do_detail(void *instance, REQUEST *request, RADIUS_PACKET *pa
 
                memset(&src_vp, 0, sizeof(src_vp));
                memset(&dst_vp, 0, sizeof(dst_vp));
-               src_vp.operator = dst_vp.operator = T_OP_EQ;
+               src_vp.op = dst_vp.op = T_OP_EQ;
 
                switch (packet->src_ipaddr.af) {
                case AF_INET:
index c072f13d32cf27b48346cc4d8629e4d2b85e7146..6f9bc530b851f663e69bf198bf881be5f3aae9e8 100644 (file)
@@ -115,7 +115,7 @@ int getusersfile(const char *filename, PAIR_LIST **pair_list, const char *compat
                                 *      Ignore attributes which are set
                                 *      properly.
                                 */
-                               if (vp->operator != T_OP_EQ) {
+                               if (vp->op != T_OP_EQ) {
                                        continue;
                                }
 
@@ -135,7 +135,7 @@ int getusersfile(const char *filename, PAIR_LIST **pair_list, const char *compat
                                                DEBUG("\tChanging '%s =' to '%s =='",
                                                                vp->name, vp->name);
                                        }
-                                       vp->operator = T_OP_CMP_EQ;
+                                       vp->op = T_OP_CMP_EQ;
                                        continue;
                                }
 
@@ -160,11 +160,11 @@ int getusersfile(const char *filename, PAIR_LIST **pair_list, const char *compat
                                                        (vp->attribute != PW_HUNTGROUP_NAME)) {
                                                DEBUG("\tChanging '%s =' to '%s +='",
                                                                vp->name, vp->name);
-                                               vp->operator = T_OP_ADD;
+                                               vp->op = T_OP_ADD;
                                        } else {
                                                DEBUG("\tChanging '%s =' to '%s =='",
                                                                vp->name, vp->name);
-                                               vp->operator = T_OP_CMP_EQ;
+                                               vp->op = T_OP_CMP_EQ;
                                        }
                                }
 
index 25b9e2b216225d777f8681c1dc3a15a60fdb19fd..36f1b84af4c376841fb5a5752f501b3bd0de1929 100644 (file)
@@ -219,8 +219,8 @@ static int genericcmp(void *instance UNUSED,
                      VALUE_PAIR *check_pairs UNUSED,
                      VALUE_PAIR **reply_pairs UNUSED)
 {
-       if ((check->operator != T_OP_REG_EQ) &&
-           (check->operator != T_OP_REG_EQ)) {
+       if ((check->op != T_OP_REG_EQ) &&
+           (check->op != T_OP_REG_EQ)) {
                int rcode;
                char name[1024];
                char value[1024];
@@ -229,7 +229,7 @@ static int genericcmp(void *instance UNUSED,
                snprintf(name, sizeof(name), "%%{%s}", check->name);
 
                radius_xlat(value, sizeof(value), name, req, NULL, NULL);
-               vp = pairmake(check->name, value, check->operator);
+               vp = pairmake(check->name, value, check->op);
 
                /*
                 *      Paircmp returns 0 for failed comparison,
index f2cda30419df8fefba003c759b418e712f7959e4..bff0adc3d6361bbbb0e28aa24c4d889622a78443 100644 (file)
@@ -253,7 +253,7 @@ static int fastuser_getfile(struct fastuser_instance *inst, const char *filename
                         *      Ignore attributes which are set
                         *      properly.
                         */
-                       if (vp->operator != T_OP_EQ)
+                       if (vp->op != T_OP_EQ)
                                continue;
 
 
@@ -271,7 +271,7 @@ static int fastuser_getfile(struct fastuser_instance *inst, const char *filename
                                        DEBUG("\tChanging '%s =' to '%s =='",
                                                vp->name, vp->name);
                                }
-                               vp->operator = T_OP_CMP_EQ;
+                               vp->op = T_OP_CMP_EQ;
                                continue;
                        }
 
@@ -296,11 +296,11 @@ static int fastuser_getfile(struct fastuser_instance *inst, const char *filename
                                        (vp->attribute != PW_HUNTGROUP_NAME)) {
                                        DEBUG("\tChanging '%s =' to '%s +='",
                                                vp->name, vp->name);
-                                               vp->operator = T_OP_ADD;
+                                               vp->op = T_OP_ADD;
                                } else {
                                        DEBUG("\tChanging '%s =' to '%s =='",
                                                vp->name, vp->name);
-                                       vp->operator = T_OP_CMP_EQ;
+                                       vp->op = T_OP_CMP_EQ;
                                }
                        }
 
index fa00e6cd993b7073673d3c7ca9905c2ace328940..2aff3e0d6b5a0f22e358401e6dead30999b8ab73 100644 (file)
@@ -170,7 +170,7 @@ static int getusersfile(const char *filename, fr_hash_table_t **pht,
                                 *      Ignore attributes which are set
                                 *      properly.
                                 */
-                               if (vp->operator != T_OP_EQ) {
+                               if (vp->op != T_OP_EQ) {
                                        continue;
                                }
 
@@ -190,7 +190,7 @@ static int getusersfile(const char *filename, fr_hash_table_t **pht,
                                                DEBUG("\tChanging '%s =' to '%s =='",
                                                                vp->name, vp->name);
                                        }
-                                       vp->operator = T_OP_CMP_EQ;
+                                       vp->op = T_OP_CMP_EQ;
                                        continue;
                                }
 
@@ -215,11 +215,11 @@ static int getusersfile(const char *filename, fr_hash_table_t **pht,
                                                        (vp->attribute != PW_HUNTGROUP_NAME)) {
                                                DEBUG("\tChanging '%s =' to '%s +='",
                                                                vp->name, vp->name);
-                                               vp->operator = T_OP_ADD;
+                                               vp->op = T_OP_ADD;
                                        } else {
                                                DEBUG("\tChanging '%s =' to '%s =='",
                                                                vp->name, vp->name);
-                                               vp->operator = T_OP_CMP_EQ;
+                                               vp->op = T_OP_CMP_EQ;
                                        }
                                }
 
index 61117eb5b974430a6576bda6842decad7857a027..f8ac47fc82049c38a2b18ec5dea7b750d37ca3e6 100644 (file)
@@ -641,7 +641,7 @@ static int pack_vps(byte_array * ba, VALUE_PAIR * vps)
     if (pack_uint32(ba, i) == -1) return -1;
     i = vp->length;
     if (pack_uint32(ba, i) == -1) return -1;
-    i = vp->operator;
+    i = vp->op;
     if (pack_uint32(ba, i) == -1) return -1;
 
     switch (vp->type) {
@@ -786,7 +786,7 @@ static int read_vps(JRADIUS *inst, JRSOCK *jrsock, VALUE_PAIR **pl, int plen)
      *     Create new attribute
      */
     vp = paircreate(atype, 0, -1);
-    vp->operator = aop;
+    vp->op = aop;
 
     if (vp->type == -1) {
       /*
index 3bb8461d7c04e674a0ea5b54b0d9797b320f7cc7..056b068130950b1ba4b187213ae7beb9c65c8c14 100644 (file)
@@ -633,13 +633,13 @@ static void perl_store_vps(VALUE_PAIR *vp, HV *rad_hv)
  *     Value Pair Format
  *
  */
-static int pairadd_sv(VALUE_PAIR **vp, char *key, SV *sv, int operator) {
+static int pairadd_sv(VALUE_PAIR **vp, char *key, SV *sv, FR_TOKEN op) {
        char            *val;
        VALUE_PAIR      *vpp;
 
        if (SvOK(sv)) {
                val = SvPV_nolen(sv);
-               vpp = pairmake(key, val, operator);
+               vpp = pairmake(key, val, op);
                if (vpp != NULL) {
                        pairadd(vp, vpp);
                        radlog(L_DBG,
index 2e0720ef8be02a1b4e63b3db1cc502932b41c300..1af085c2072a27775dbb449091807f7b6a149110 100644 (file)
@@ -817,7 +817,7 @@ static VALUE_PAIR *assign2vp(REQUEST *request,
                             const policy_assignment_t *assign)
 {
        VALUE_PAIR *vp;
-       FR_TOKEN operator = T_OP_EQ;
+       FR_TOKEN op = T_OP_EQ;
        const char *value = assign->rhs;
        char buffer[2048];
 
@@ -833,15 +833,15 @@ static VALUE_PAIR *assign2vp(REQUEST *request,
         */
        switch (assign->assign) {
        case POLICY_LEX_ASSIGN:
-               operator = T_OP_EQ;
+               op = T_OP_EQ;
                break;
 
        case POLICY_LEX_SET_EQUALS:
-               operator = T_OP_SET;
+               op = T_OP_SET;
                break;
 
        case POLICY_LEX_PLUS_EQUALS:
-               operator = T_OP_ADD;
+               op = T_OP_ADD;
                break;
 
        default:
@@ -852,7 +852,7 @@ static VALUE_PAIR *assign2vp(REQUEST *request,
                return NULL;
        }
 
-       vp = pairmake(assign->lhs, value, operator);
+       vp = pairmake(assign->lhs, value, op);
        if (!vp) {
                fprintf(stderr, "Failed creating pair: %s %s\n", value, fr_strerror());
        }
index 1641f13a93106b2593c09e14b5267f2951f8510a..e93a905203b7084b9e60d434f301f32f8b45f0b1 100644 (file)
@@ -199,7 +199,7 @@ typedef struct json_flags {
        boolean do_xlat;        //!< If TRUE value will be expanded with xlat.
        boolean is_json;        //!< If TRUE value will be inserted as raw JSON
                                // (multiple values not supported).
-       FR_TOKEN operator;      //!< The operator that determines how the new VP
+       FR_TOKEN op;            //!< The operator that determines how the new VP
                                // is processed. @see fr_tokens
 } json_flags_t;
 #endif
@@ -1087,7 +1087,7 @@ static int rest_decode_post(rlm_rest_t *instance,
                        goto error;
                }
 
-               vp->operator = T_OP_SET;
+               vp->op = T_OP_SET;
  
                /*
                 *      Check to see if we've already processed an
@@ -1098,12 +1098,12 @@ static int rest_decode_post(rlm_rest_t *instance,
                while (*current++) {
                        if ((current[0]->attr == da->attr) &&
                            (current[0]->vendor == da->vendor)) {
-                               vp->operator = T_OP_ADD;
+                               vp->op = T_OP_ADD;
                                break;
                        }
                }
                
-               if (vp->operator != T_OP_ADD) {
+               if (vp->op != T_OP_ADD) {
                        current[0] = da;
                        current[1] = NULL;
                }
@@ -1195,7 +1195,7 @@ static VALUE_PAIR *json_pairmake_leaf(rlm_rest_t *instance,
                return NULL;
        }
 
-       vp->operator = flags->operator;
+       vp->op = flags->op;
 
        tmp = pairparsevalue(vp, value);
        if (tmp == NULL) {
@@ -1298,7 +1298,7 @@ static VALUE_PAIR *json_pairmake(rlm_rest_t *instance,
         */
        entry = json_object_get_object(object)->head;
        while (entry) {
-               flags.operator = T_OP_SET;
+               flags.op = T_OP_SET;
                flags.do_xlat  = 1;
                flags.is_json  = 0;
 
@@ -1382,10 +1382,10 @@ static VALUE_PAIR *json_pairmake(rlm_rest_t *instance,
                         */
                        tmp = json_object_object_get(value, "op");
                        if (tmp) {
-                               flags.operator = fr_str2int(fr_tokens,
-                                                           json_object_get_string(tmp), 0);
+                               flags.op = fr_str2int(fr_tokens,
+                                                     json_object_get_string(tmp), 0);
 
-                               if (!flags.operator) {
+                               if (!flags.op) {
                                        RDEBUG("Invalid operator value \"%s\","
                                               " skipping", tmp);
                                        continue;
@@ -1447,9 +1447,9 @@ static VALUE_PAIR *json_pairmake(rlm_rest_t *instance,
                 *      Automagically switch the op for multivalued
                 *      attributes.
                 */
-               if (((flags.operator == T_OP_SET) ||
-                    (flags.operator == T_OP_EQ)) && (len > 1)) {
-                       flags.operator = T_OP_ADD;
+               if (((flags.op == T_OP_SET) ||
+                    (flags.op == T_OP_EQ)) && (len > 1)) {
+                       flags.op = T_OP_ADD;
                }
 
                if (!flags.is_json &&