mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-03 08:35:05 +00:00
lib: Add polymorphic noop macro
Co-authored-by: Quentin Young <qlyoung@qlyoung.net> Signed-off-by: Quentin Young <qlyoung@qlyoung.net> Signed-off-by: Donald Lee <dlqs@gmx.com>
This commit is contained in:
parent
83cbdcc267
commit
2faab06ed3
@ -25,6 +25,8 @@ DEFINE_MTYPE_STATIC(LIB, SCRIPT, "Scripting");
|
||||
|
||||
struct frrscript_names_head frrscript_names_hash;
|
||||
|
||||
void _lua_decode_noop(lua_State *L, ...) {}
|
||||
|
||||
/*
|
||||
* Wrapper for frrscript_names_add
|
||||
* Use this to register hook calls when a daemon starts up
|
||||
|
@ -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.
|
||||
@ -220,13 +225,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))
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user