diff options
| author | Donald Lee <dlqs@gmx.com> | 2021-06-22 05:03:07 +0800 |
|---|---|---|
| committer | Donald Lee <dlqs@gmx.com> | 2021-06-22 05:03:07 +0800 |
| commit | b7da61c1d1b2824b139bfce73b1d6849d4b75b6a (patch) | |
| tree | f2462d0d2710228d1b74795a976f74798031e63e /lib/frrscript.h | |
| parent | bdc1085d7b84514f978e2752352c6ddd34bb88e0 (diff) | |
bgpd: Update bgp_script encoders and decoders
This is an example of creating encoders and decoders for user defined
structs and registering them in the ENCODE_ARGS DECODE_ARGS macro
in frrscript.
Signed-off-by: Donald Lee <dlqs@gmx.com>
Diffstat (limited to 'lib/frrscript.h')
| -rw-r--r-- | lib/frrscript.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/frrscript.h b/lib/frrscript.h index 14e1834a11..5942c3dce8 100644 --- a/lib/frrscript.h +++ b/lib/frrscript.h @@ -25,6 +25,7 @@ #include <lua.h> #include "frrlua.h" +#include "../bgpd/bgp_script.h" #ifdef __cplusplus extern "C" { @@ -117,7 +118,9 @@ struct in_addr * : lua_pushinaddr, \ struct in6_addr * : lua_pushin6addr, \ union sockunion * : lua_pushsockunion, \ time_t * : lua_pushtimet, \ -char * : lua_pushstring_wrapper \ +char * : lua_pushstring_wrapper, \ +struct attr * : lua_pushattr, \ +struct peer * : lua_pushpeer \ )(L, value) #define DECODE_ARGS_WITH_STATE(L, value) \ @@ -129,7 +132,8 @@ 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 \ +char * : lua_decode_stringp, \ +struct attr * : lua_decode_attr \ )(L, -1, value) /* |
