40static void debug(
const char*
fmt, ...);
56 debug(
"can't type expression");
129 struct comments comments;
133 arg =
mapGet(expr,
"equal");
153 equal = eval_equal_expression(
left,
right);
183 arg =
mapGet(expr,
"not-equal");
203 equal = eval_equal_expression(
left,
right);
255 arg =
mapGet(expr,
"and");
263 debug(
"can't get and right branch");
384 arg =
mapGet(expr,
"not");
405 arg =
mapGet(arg,
"equal");
417 arg =
mapGet(arg,
"not-equal");
513 arg =
mapGet(expr,
"substring");
516 string =
mapGet(arg,
"expression");
519 offset =
mapGet(arg,
"offset");
528 mapSet(arg,
string,
"expression");
533 mapSet(arg, offset,
"offset");
546 if ((
off < 0) || (len < 0))
591 (
off == 0) && (len == 1)) {
618 if (
s->length <=
off)
653 arg =
mapGet(expr,
"suffix");
656 string =
mapGet(arg,
"expression");
665 mapSet(arg,
string,
"expression");
704 arg =
mapGet(expr,
"lowercase");
710 mapSet(expr, arg,
"lowercase");
718 for (
i = 0;
i <
r->length;
i++)
739 arg =
mapGet(expr,
"uppercase");
745 mapSet(expr, arg,
"lowercase");
753 for (
i = 0;
i <
r->length;
i++)
851 arg =
mapGet(expr,
"concat");
919 arg =
mapGet(expr,
"encode-int8");
925 mapSet(expr, arg,
"encode-int8");
952 arg =
mapGet(expr,
"encode-int16");
958 mapSet(expr, arg,
"encode-int16");
986 arg =
mapGet(expr,
"encode-int32");
992 mapSet(expr, arg,
"encode-int32");
1023 arg =
mapGet(expr,
"gethostbyname");
1032 debug(
"gethostbyname: %s: host unknown",
1036 debug(
"gethostbyname: %s: temporary name "
1037 "server failure", hostname);
1040 debug(
"gethostbyname: %s: name server failed",
1044 debug(
"gethostbyname: %s: no A record "
1045 "associated with address", hostname);
1049 for (
i = 0; h->h_addr_list[
i] !=
NULL;
i++) {
1090 arg =
mapGet(expr,
"binary-to-ascii");
1093 base =
mapGet(arg,
"base");
1096 width =
mapGet(arg,
"width");
1099 separator =
mapGet(arg,
"separator");
1100 if (separator ==
NULL)
1108 mapSet(arg, base,
"base");
1113 mapSet(arg, width,
"width");
1118 mapSet(arg, separator,
"separator");
1132 if ((
b < 2) || (
b > 16))
1134 if ((
b != 8) && (
b != 10) && (
b != 16))
1137 if ((
w != 8) && (
w != 16) && (
w != 32))
1169 }
else if (
w == 16) {
1173 if ((buf->
length % 2) != 0)
1200 }
else if (
w == 32) {
1204 if ((buf->
length % 4) != 0)
1280 arg =
mapGet(expr,
"reverse");
1283 width =
mapGet(arg,
"width");
1292 mapSet(arg, width,
"width");
1340 arg =
mapGet(expr,
"pick-first-value");
1457 arg =
mapGet(expr,
"v6relay");
1460 relay =
mapGet(arg,
"relay");
1466 mapSet(arg, relay,
"relay");
1506 arg =
mapGet(expr,
"extract-int8");
1512 mapSet(expr, arg,
"extract-int8");
1538 arg =
mapGet(expr,
"extract-int16");
1544 mapSet(expr, arg,
"extract-int16");
1572 arg =
mapGet(expr,
"extract-int32");
1578 mapSet(expr, arg,
"extract-int32");
1603 arg =
mapGet(expr,
"const-int");
1639 arg =
mapGet(expr,
"add");
1688 arg =
mapGet(expr,
"subtract");
1737 arg =
mapGet(expr,
"multiply");
1786 arg =
mapGet(expr,
"divide");
1837 arg =
mapGet(expr,
"remainder");
1888 arg =
mapGet(expr,
"binary-and");
1937 arg =
mapGet(expr,
"binary-or");
1986 arg =
mapGet(expr,
"binary-xor");
2066 debug(
"bad const-int");
2082 debug(
"bad const-int");
2095 debug(
"bad const-int");
2128 debug(
"bad const-data");
2144 debug(
"bad const-data");
2157 debug(
"bad const-data");
2182 debug(
"equal between unexpected %s and %s",
2216 if (
sleft->length == 0) {
2217 debug(
"empty const-data");
2244debug(
const char*
fmt, ...)
void concatString(struct string *s, const struct string *a)
isc_boolean_t eqString(const struct string *s, const struct string *o)
struct string * makeString(int l, const char *s)
isc_boolean_t boolValue(const struct element *e)
struct element * copy(struct element *e)
void listRemove(struct element *l, int i)
struct element * createBool(isc_boolean_t b)
struct string * allocString(void)
void appendString(struct string *s, const char *a)
struct element * listGet(struct element *l, int i)
struct string * stringValue(struct element *e)
struct element * createNull(void)
void concat(struct element *l, struct element *o)
isc_boolean_t mapContains(const struct element *m, const char *k)
struct string * hexaValue(struct element *s)
struct element * createInt(int64_t i)
void mapSet(struct element *m, struct element *e, const char *k)
void listSet(struct element *l, struct element *e, int i)
size_t listSize(const struct element *l)
struct element * createMap(void)
struct element * createString(const struct string *s)
void mapRemove(struct element *m, const char *k)
struct element * mapGet(struct element *m, const char *k)
int64_t intValue(const struct element *e)
const char * type2name(int t)
struct string * makeStringExt(int l, const char *s, char fmt)
#define TAILQ_CONCAT(head1, head2)
struct element * eval_boolean_expression(struct element *expr, isc_boolean_t *modifiedp)
struct element * eval_expression(struct element *expr, isc_boolean_t *modifiedp)
struct element * eval_data_expression(struct element *expr, isc_boolean_t *modifiedp)
struct element * eval_numeric_expression(struct element *expr, isc_boolean_t *modifiedp)
int is_boolean_expression(struct expression *expr)
int is_numeric_expression(struct expression *expr)
int is_data_expression(struct expression *expr)