|
#define | COERCE(_vb, _box, _type, _enumv) |
|
#define | COERCE_A(_type, _enumv) COERCE(a, one, _type, _enumv) |
|
#define | COERCE_B(_type, _enumv) COERCE(b, two, _type, _enumv) |
|
#define | COMP(_type, _field) case FR_TYPE_ ## _type: dst->vb_ ##_field = (_field ## _t) ~src->vb_ ##_field; break |
|
#define | ERR_INVALID (-2) |
|
#define | ERR_OVERFLOW (-3) |
|
#define | ERR_UNDERFLOW (-4) |
|
#define | ERR_ZERO (-5) |
|
#define | is_ipv6(_x) (((_x)->type == FR_TYPE_IPV6_ADDR) || ((_x)->type == FR_TYPE_IPV6_PREFIX) || ((((_x)->type == FR_TYPE_COMBO_IP_ADDR) || ((_x)->type == FR_TYPE_COMBO_IP_PREFIX)) && ((_x)->vb_ip.af == AF_INET6))) |
|
#define | swap(_a, _b) do { __typeof__ (_a) _tmp = _a; _a = _b; _b = _tmp; } while (0) |
|
#define | T(_x) [T_OP_ ## _x ## _EQ] = T_ ## _x |
|
|
static int | calc_bool (UNUSED TALLOC_CTX *ctx, fr_value_box_t *dst, fr_value_box_t const *a, fr_token_t op, fr_value_box_t const *b) |
|
static int | calc_combo_ip_addr (TALLOC_CTX *ctx, fr_value_box_t *dst, fr_value_box_t const *in1, fr_token_t op, fr_value_box_t const *in2) |
|
static int | calc_combo_ip_prefix (TALLOC_CTX *ctx, fr_value_box_t *dst, fr_value_box_t const *in1, fr_token_t op, fr_value_box_t const *in2) |
|
static int | calc_date (UNUSED TALLOC_CTX *ctx, fr_value_box_t *dst, fr_value_box_t const *a, fr_token_t op, fr_value_box_t const *b) |
|
static int | calc_float32 (UNUSED TALLOC_CTX *ctx, fr_value_box_t *dst, fr_value_box_t const *in1, fr_token_t op, fr_value_box_t const *in2) |
|
static int | calc_float64 (UNUSED TALLOC_CTX *ctx, fr_value_box_t *dst, fr_value_box_t const *in1, fr_token_t op, fr_value_box_t const *in2) |
|
static int | calc_int64 (TALLOC_CTX *ctx, fr_value_box_t *dst, fr_value_box_t const *in1, fr_token_t op, fr_value_box_t const *in2) |
|
static int | calc_ipv4_addr (UNUSED TALLOC_CTX *ctx, fr_value_box_t *dst, fr_value_box_t const *in1, fr_token_t op, fr_value_box_t const *in2) |
|
static int | calc_ipv4_prefix (UNUSED TALLOC_CTX *ctx, fr_value_box_t *dst, fr_value_box_t const *a, fr_token_t op, fr_value_box_t const *b) |
|
static int | calc_ipv6_addr (UNUSED TALLOC_CTX *ctx, fr_value_box_t *dst, fr_value_box_t const *in1, fr_token_t op, fr_value_box_t const *in2) |
|
static int | calc_ipv6_prefix (UNUSED TALLOC_CTX *ctx, fr_value_box_t *dst, fr_value_box_t const *a, fr_token_t op, fr_value_box_t const *b) |
|
static int | calc_octets (TALLOC_CTX *ctx, fr_value_box_t *dst, fr_value_box_t const *a, fr_token_t op, fr_value_box_t const *b) |
|
static int | calc_string (TALLOC_CTX *ctx, fr_value_box_t *dst, fr_value_box_t const *a, fr_token_t op, fr_value_box_t const *b) |
|
static int | calc_time_delta (UNUSED TALLOC_CTX *ctx, fr_value_box_t *dst, fr_value_box_t const *a, fr_token_t op, fr_value_box_t const *b) |
|
static int | calc_uint64 (TALLOC_CTX *ctx, fr_value_box_t *dst, fr_value_box_t const *in1, fr_token_t op, fr_value_box_t const *in2) |
|
static int | cast_ipv4_addr (fr_value_box_t *out, fr_value_box_t const *in) |
|
static int | cast_ipv6_addr (fr_value_box_t *out, fr_value_box_t const *in) |
|
int | fr_value_calc_assignment_op (TALLOC_CTX *ctx, fr_value_box_t *dst, fr_token_t op, fr_value_box_t const *src) |
| Calculate DST OP SRC. More...
|
|
int | fr_value_calc_binary_op (TALLOC_CTX *ctx, fr_value_box_t *dst, fr_type_t hint, fr_value_box_t const *a, fr_token_t op, fr_value_box_t const *b) |
| Calculate DST = A OP B. More...
|
|
int | fr_value_calc_list_cmp (TALLOC_CTX *ctx, fr_value_box_t *dst, fr_value_box_list_t const *list1, fr_token_t op, fr_value_box_list_t const *list2) |
|
static bool | fr_value_calc_list_empty (fr_value_box_list_t const *list) |
|
int | fr_value_calc_list_op (TALLOC_CTX *ctx, fr_value_box_t *box, fr_token_t op, fr_value_box_list_t const *list) |
| Apply a set of operations in order to create an output box. More...
|
|
int | fr_value_calc_nary_op (TALLOC_CTX *ctx, fr_value_box_t *dst, fr_type_t type, fr_token_t op, fr_value_box_t const *group) |
| Calculate DST = OP { A, B, C, ... More...
|
|
int | fr_value_calc_unary_op (TALLOC_CTX *ctx, fr_value_box_t *dst, fr_token_t op, fr_value_box_t const *src) |
| Calculate unary operations. More...
|
|
static int | get_ipv6_prefix (uint8_t const *in) |
|
static int | handle_result (fr_type_t type, fr_token_t op, int rcode) |
|
static int | invalid_type (fr_type_t type) |
|
Functions to perform calculations on leaf values.
- Id
- efa54e8a18513b795641ff2f17231e946e3fce24
- Copyright
- 2021 Network RADIUS SAS (legal.nosp@m.@net.nosp@m.workr.nosp@m.adiu.nosp@m.s.com)
Definition in file calc.c.
Updates type (a,b) -> c.
Note that we MUST have a less than b here. Otherwise there will be two entries for the same upcast, and the entries may get out of sync.
These upcasts are for comparisons. In some cases, we can promote one data type to another, and then compare them. However, this is not always possible.
If one side is a string and the other isn't, then we try to parse the string as the type of the other side.
If one side is an octets type and the other isn't, then we try to parse the octets as the type of the other side.
- Todo:
-
Definition at line 426 of file calc.c.
Updates type (a,b) -> c.
Note that we MUST have a less than b here. Otherwise there will be two entries for the same upcast, and the entries may get out of sync.
These upcasts are for operations.
If one side is a string and the other isn't, then we try to parse the string as the type of the other side.
If one side is an octets type and the other isn't, then we try to parse the octets as the type of the other side.
Definition at line 65 of file calc.c.