summaryrefslogtreecommitdiffstats
path: root/lib/frrscript.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/frrscript.h')
-rw-r--r--lib/frrscript.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/frrscript.h b/lib/frrscript.h
index df49b57..ce313a1 100644
--- a/lib/frrscript.h
+++ b/lib/frrscript.h
@@ -181,6 +181,11 @@ void frrscript_fini(void);
} while (0)
/*
+ * Noop function. Used below where we need a noop decoder for any type.
+ */
+void _lua_decode_noop(lua_State *, ...);
+
+/*
* Maps the type of value to its encoder/decoder.
* Add new mappings here.
*
@@ -192,7 +197,9 @@ void frrscript_fini(void);
#define ENCODE_ARGS_WITH_STATE(L, value) \
_Generic((value), \
int : lua_pushinteger, \
-long long * : lua_pushintegerp, \
+int * : lua_pushintegerp, \
+long long : lua_pushinteger, \
+long long * : lua_pushlonglongp, \
struct prefix * : lua_pushprefix, \
struct interface * : lua_pushinterface, \
struct in_addr * : lua_pushinaddr, \
@@ -211,8 +218,8 @@ struct zebra_dplane_ctx * : lua_pushzebra_dplane_ctx \
#define DECODE_ARGS_WITH_STATE(L, value) \
_Generic((value), \
-int : lua_decode_integer_noop, \
-long long * : lua_decode_integerp, \
+int * : lua_decode_integerp, \
+long long * : lua_decode_longlongp, \
struct prefix * : lua_decode_prefix, \
struct interface * : lua_decode_interface, \
struct in_addr * : lua_decode_inaddr, \
@@ -220,13 +227,7 @@ struct in6_addr * : lua_decode_in6addr, \
union sockunion * : lua_decode_sockunion, \
char * : lua_decode_stringp, \
struct attr * : lua_decode_attr, \
-struct peer * : lua_decode_noop, \
-const struct prefix * : lua_decode_noop, \
-const struct ipaddr * : lua_decode_noop, \
-const struct ethaddr * : lua_decode_noop, \
-const struct nexthop_group * : lua_decode_noop, \
-const struct nexthop * : lua_decode_noop, \
-struct zebra_dplane_ctx * : lua_decode_noop \
+default : _lua_decode_noop \
)((L), -1, (value))
/*