summaryrefslogtreecommitdiff
path: root/lib/frrscript.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/frrscript.h')
-rw-r--r--lib/frrscript.h23
1 files changed, 11 insertions, 12 deletions
diff --git a/lib/frrscript.h b/lib/frrscript.h
index 7ba4f0cbdb..ce313a1b63 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,13 +197,14 @@ 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, \
struct in6_addr * : lua_pushin6addr, \
union sockunion * : lua_pushsockunion, \
-time_t * : lua_pushtimet, \
char * : lua_pushstring_wrapper, \
struct attr * : lua_pushattr, \
struct peer * : lua_pushpeer, \
@@ -212,23 +218,16 @@ 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, \
struct in6_addr * : lua_decode_in6addr, \
union sockunion * : lua_decode_sockunion, \
-time_t * : lua_decode_timet, \
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))
/*