summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2023-11-25 22:00:35 +0100
committerMikael Magnusson <mikma@users.sourceforge.net>2023-11-25 22:00:35 +0100
commitd38fe44d1f974a2e1ef6b25f7a26e650bf8bc8d4 (patch)
treeb24aff7b147ada05b3a2cbf1c2761d6438da482d
parentf8a1bf8df680010e74ec5c590a403784d9ca4f65 (diff)
parent4cdd6f2ea0af64843082c05147c307eb62165352 (diff)
Merge commit '4cdd6f2e' into wireguard-next-tmp7-1
-rw-r--r--filter/decl.m42
-rw-r--r--filter/f-inst.c36
2 files changed, 19 insertions, 19 deletions
diff --git a/filter/decl.m4 b/filter/decl.m4
index 7078aa51..8c02a1f9 100644
--- a/filter/decl.m4
+++ b/filter/decl.m4
@@ -305,7 +305,7 @@ INST([[FI_METHOD__]]$1[[__]]$2, m4_eval($3 + 1), 1) {
METHOD_CONSTRUCTOR("$2");
}')
-m4_define(METHOD_R, `METHOD($1, $2, $3, [[ RESULT($4, $5, $6) ]])')
+m4_define(METHOD_R, `METHOD($1, $2, 0, [[ RESULT($3, $4, $5) ]])')
# 2) Code wrapping
# The code produced in 1xx temporary diversions is a raw code without
diff --git a/filter/f-inst.c b/filter/f-inst.c
index 7fc9672a..61627b4e 100644
--- a/filter/f-inst.c
+++ b/filter/f-inst.c
@@ -496,8 +496,8 @@
RESULT(T_BOOL, i, (v1.type != T_VOID) && !undef_value(v1));
}
- METHOD_R(T_NET, type, 0, T_ENUM_NETTYPE, i, v1.val.net->type);
- METHOD_R(T_IP, is_v4, 0, T_BOOL, i, ipa_is_ip4(v1.val.ip));
+ METHOD_R(T_NET, type, T_ENUM_NETTYPE, i, v1.val.net->type);
+ METHOD_R(T_IP, is_v4, T_BOOL, i, ipa_is_ip4(v1.val.ip));
/* Add initialized variable */
INST(FI_VAR_INIT, 1, 0) {
@@ -553,10 +553,10 @@
RESULT_VAL(val);
}
- METHOD_R(T_PATH, empty, 0, T_PATH, ad, &null_adata);
- METHOD_R(T_CLIST, empty, 0, T_CLIST, ad, &null_adata);
- METHOD_R(T_ECLIST, empty, 0, T_ECLIST, ad, &null_adata);
- METHOD_R(T_LCLIST, empty, 0, T_LCLIST, ad, &null_adata);
+ METHOD_R(T_PATH, empty, T_PATH, ad, &null_adata);
+ METHOD_R(T_CLIST, empty, T_CLIST, ad, &null_adata);
+ METHOD_R(T_ECLIST, empty, T_ECLIST, ad, &null_adata);
+ METHOD_R(T_LCLIST, empty, T_LCLIST, ad, &null_adata);
/* Common loop begin instruction, always created by f_for_cycle() */
INST(FI_FOR_LOOP_START, 0, 3) {
@@ -971,11 +971,11 @@
}
/* Get length of */
- METHOD_R(T_NET, len, 0, T_INT, i, net_pxlen(v1.val.net));
- METHOD_R(T_PATH, len, 0, T_INT, i, as_path_getlen(v1.val.ad));
- METHOD_R(T_CLIST, len, 0, T_INT, i, int_set_get_size(v1.val.ad));
- METHOD_R(T_ECLIST, len, 0, T_INT, i, ec_set_get_size(v1.val.ad));
- METHOD_R(T_LCLIST, len, 0, T_INT, i, lc_set_get_size(v1.val.ad));
+ METHOD_R(T_NET, len, T_INT, i, net_pxlen(v1.val.net));
+ METHOD_R(T_PATH, len, T_INT, i, as_path_getlen(v1.val.ad));
+ METHOD_R(T_CLIST, len, T_INT, i, int_set_get_size(v1.val.ad));
+ METHOD_R(T_ECLIST, len, T_INT, i, ec_set_get_size(v1.val.ad));
+ METHOD_R(T_LCLIST, len, T_INT, i, lc_set_get_size(v1.val.ad));
INST(FI_NET_SRC, 1, 1) { /* Get src prefix */
ARG(1, T_NET);
@@ -1060,8 +1060,8 @@
]]);
/* Get ROA ASN or community ASN part */
- METHOD_R(T_PAIR, asn, 0, T_INT, i, v1.val.i >> 16);
- METHOD_R(T_LC, asn, 0, T_INT, i, v1.val.lc.asn);
+ METHOD_R(T_PAIR, asn, T_INT, i, v1.val.i >> 16);
+ METHOD_R(T_LC, asn, T_INT, i, v1.val.lc.asn);
METHOD(T_NET, asn, 0, [[
if (!net_is_roa(v1.val.net))
@@ -1074,7 +1074,7 @@
/* Convert prefix to IP */
- METHOD_R(T_NET, ip, 0, T_IP, ip, net_prefix(v1.val.net));
+ METHOD_R(T_NET, ip, T_IP, ip, net_prefix(v1.val.net));
INST(FI_ROUTE_DISTINGUISHER, 1, 1) {
ARG(1, T_NET);
@@ -1101,16 +1101,16 @@
}
/* Get last ASN from non-aggregated part of AS PATH */
- METHOD_R(T_PATH, last_nonaggregated, 0, T_INT, i, as_path_get_last_nonaggregated(v1.val.ad));
+ METHOD_R(T_PATH, last_nonaggregated, T_INT, i, as_path_get_last_nonaggregated(v1.val.ad));
/* Get data part from the standard community */
- METHOD_R(T_PAIR, data, 0, T_INT, i, v1.val.i & 0xFFFF);
+ METHOD_R(T_PAIR, data, T_INT, i, v1.val.i & 0xFFFF);
/* Get data1 part from the large community */
- METHOD_R(T_LC, data1, 0, T_INT, i, v1.val.lc.ldp1);
+ METHOD_R(T_LC, data1, T_INT, i, v1.val.lc.ldp1);
/* Get data2 part from the large community */
- METHOD_R(T_LC, data2, 0, T_INT, i, v1.val.lc.ldp2);
+ METHOD_R(T_LC, data2, T_INT, i, v1.val.lc.ldp2);
INST(FI_CLIST_MIN, 1, 1) { /* Get minimum element from list */
ARG(1, T_CLIST);