Operator conflicts with a C++ keyword.
#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;
/*
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 */
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);
/* 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);
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);
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>";
}
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:
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;
continue;
}
- switch (i->operator) {
+ switch (i->op) {
/*
* These are COMPARISON attributes
* from a check list, and are not
found = pairfind(*to, i->attribute, i->vendor, TAG_ANY);
- switch (i->operator) {
+ switch (i->op) {
/*
* If matching attributes are found,
/*
* 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;
}
*
*/
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;
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);
/*
* 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;
* 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
vp->flags.tag = tag;
}
- switch (vp->operator) {
+ switch (vp->op) {
default:
break;
}
}
- return pairmake_xlat(attribute, value, operator);
+ return pairmake_xlat(attribute, value, op);
#endif
}
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;
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));
{
int compare;
- switch (one->operator) {
+ switch (one->op) {
case T_OP_CMP_TRUE:
return (two != NULL);
compare = regexec(®, buffer, 0, NULL, 0);
regfree(®);
- if (one->operator == T_OP_REG_EQ) return (compare == 0);
+ if (one->op == T_OP_REG_EQ) return (compare == 0);
return (compare != 0);
}
#endif
/*
* Now do the operator comparison.
*/
- switch (one->operator) {
+ switch (one->op) {
case T_OP_CMP_EQ:
return (compare == 0);
CONF_ITEM item;
const char *attr;
const char *value;
- FR_TOKEN operator;
+ FR_TOKEN op;
FR_TOKEN value_type;
};
struct conf_part {
* 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;
cp->value = p;
}
cp->value_type = value_type;
- cp->operator = operator;
+ cp->op = op;
return cp;
}
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;
FR_TOKEN cf_pair_operator(const CONF_PAIR *pair)
{
- return (pair ? pair->operator : T_OP_INVALID);
+ return (pair ? pair->op : T_OP_INVALID);
}
/*
* 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);
}
/*
return FALSE;
}
- myvp.operator = token;
+ myvp.op = token;
*presult = paircmp(&myvp, vp);
RDEBUG3(" paircmp -> %d", *presult);
return TRUE;
* 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++) {
* 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]);
* 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;
}
* 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;
}
* 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
* 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:
* 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);
* 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
CONF_ITEM item;
char *attr;
char *value;
- FR_TOKEN operator;
+ FR_TOKEN op;
FR_TOKEN value_type;
};
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");
* <= 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) &&
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++;
/*
* 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];
return -1;
}
- if (check->operator == T_OP_REG_NE) {
+ if (check->op == T_OP_REG_NE) {
int compare;
regex_t reg;
char value[1024];
/*
* 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.
* 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;
}
* 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.");
* 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;
* 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;
}
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: "
}
found = pairfind(*to, i->attribute, i->vendor, TAG_ANY);
- switch (i->operator) {
+ switch (i->op) {
/*
* If a similar attribute is found,
* @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);
}
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);
}
}
{
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) {
* 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);
*/
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;
}
found);
if (!vp) continue;
- vp->operator = map->op;
+ vp->op = map->op;
pairadd(to_cache, vp);
if (to_req) {
"¿unknown?"),
map->src->name,
vp->name);
- vp->operator = map->op;
+ vp->op = map->op;
}
pairadd(to_cache, found);
vp = pairalloc(map->dst->da);
if (!vp) continue;
- vp->operator = map->op;
+ vp->op = map->op;
vp = pairparsevalue(vp, buffer);
if (!vp) continue;
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;
}
#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];
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:
* Ignore attributes which are set
* properly.
*/
- if (vp->operator != T_OP_EQ) {
+ if (vp->op != T_OP_EQ) {
continue;
}
DEBUG("\tChanging '%s =' to '%s =='",
vp->name, vp->name);
}
- vp->operator = T_OP_CMP_EQ;
+ vp->op = T_OP_CMP_EQ;
continue;
}
(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;
}
}
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];
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,
* Ignore attributes which are set
* properly.
*/
- if (vp->operator != T_OP_EQ)
+ if (vp->op != T_OP_EQ)
continue;
DEBUG("\tChanging '%s =' to '%s =='",
vp->name, vp->name);
}
- vp->operator = T_OP_CMP_EQ;
+ vp->op = T_OP_CMP_EQ;
continue;
}
(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;
}
}
* Ignore attributes which are set
* properly.
*/
- if (vp->operator != T_OP_EQ) {
+ if (vp->op != T_OP_EQ) {
continue;
}
DEBUG("\tChanging '%s =' to '%s =='",
vp->name, vp->name);
}
- vp->operator = T_OP_CMP_EQ;
+ vp->op = T_OP_CMP_EQ;
continue;
}
(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;
}
}
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) {
* Create new attribute
*/
vp = paircreate(atype, 0, -1);
- vp->operator = aop;
+ vp->op = aop;
if (vp->type == -1) {
/*
* 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,
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];
*/
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:
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());
}
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
goto error;
}
- vp->operator = T_OP_SET;
+ vp->op = T_OP_SET;
/*
* Check to see if we've already processed an
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;
}
return NULL;
}
- vp->operator = flags->operator;
+ vp->op = flags->op;
tmp = pairparsevalue(vp, value);
if (tmp == NULL) {
*/
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;
*/
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;
* 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 &&