From acb594b1d825c6e12369cebb941968ec08c840ce Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 06:24:31 +0200 Subject: Adding upstream version 10.0. Signed-off-by: Daniel Baumann --- lib/frrscript.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'lib/frrscript.h') diff --git a/lib/frrscript.h b/lib/frrscript.h index df49b57..ce313a1 100644 --- a/lib/frrscript.h +++ b/lib/frrscript.h @@ -180,6 +180,11 @@ void frrscript_fini(void); assert(lua_gettop(lfs->L) == 1); \ } 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)) /* -- cgit v1.2.3