diff options
| author | Quentin Young <qlyoung@users.noreply.github.com> | 2021-07-05 04:13:20 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-05 04:13:20 +0000 |
| commit | 71bae95e4aa78a5f269d7d26171911169e0810b1 (patch) | |
| tree | 36a3633d7eddd2d549366a5f8883d7868bacea8a /lib/frrlua.h | |
| parent | b09ca18c3f453356d7bd381701341f67000845b0 (diff) | |
| parent | cd3c3a98e279326a0fc69a0f0d7620abdf8b404f (diff) | |
Merge pull request #8888 from dlqs/lua-call
Diffstat (limited to 'lib/frrlua.h')
| -rw-r--r-- | lib/frrlua.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/frrlua.h b/lib/frrlua.h index 6fb30938b0..c4de82740c 100644 --- a/lib/frrlua.h +++ b/lib/frrlua.h @@ -50,6 +50,8 @@ static inline void lua_pushstring_wrapper(lua_State *L, const char *str) */ void lua_pushprefix(lua_State *L, const struct prefix *prefix); +void lua_decode_prefix(lua_State *L, int idx, struct prefix *prefix); + /* * Converts the Lua value at idx to a prefix. * @@ -63,6 +65,8 @@ void *lua_toprefix(lua_State *L, int idx); */ void lua_pushinterface(lua_State *L, const struct interface *ifp); +void lua_decode_interface(lua_State *L, int idx, struct interface *ifp); + /* * Converts the Lua value at idx to an interface. * @@ -77,6 +81,8 @@ void *lua_tointerface(lua_State *L, int idx); */ void lua_pushinaddr(lua_State *L, const struct in_addr *addr); +void lua_decode_inaddr(lua_State *L, int idx, struct in_addr *addr); + /* * Converts the Lua value at idx to an in_addr. * @@ -90,6 +96,8 @@ void *lua_toinaddr(lua_State *L, int idx); */ void lua_pushin6addr(lua_State *L, const struct in6_addr *addr); +void lua_decode_in6addr(lua_State *L, int idx, struct in6_addr *addr); + /* * Converts the Lua value at idx to an in6_addr. * @@ -103,6 +111,8 @@ void *lua_toin6addr(lua_State *L, int idx); */ void lua_pushtimet(lua_State *L, const time_t *time); +void lua_decode_timet(lua_State *L, int idx, time_t *time); + /* * Converts the Lua value at idx to a time_t. * @@ -116,6 +126,8 @@ void *lua_totimet(lua_State *L, int idx); */ void lua_pushsockunion(lua_State *L, const union sockunion *su); +void lua_decode_sockunion(lua_State *L, int idx, union sockunion *su); + /* * Converts the Lua value at idx to a sockunion. * @@ -129,6 +141,8 @@ void *lua_tosockunion(lua_State *L, int idx); */ void lua_pushintegerp(lua_State *L, const long long *num); +void lua_decode_integerp(lua_State *L, int idx, long long *num); + /* * Converts the Lua value at idx to an int. * @@ -137,6 +151,8 @@ void lua_pushintegerp(lua_State *L, const long long *num); */ void *lua_tointegerp(lua_State *L, int idx); +void lua_decode_stringp(lua_State *L, int idx, char *str); + /* * Pop string. * @@ -146,6 +162,11 @@ void *lua_tointegerp(lua_State *L, int idx); void *lua_tostringp(lua_State *L, int idx); /* + * No-op decocder + */ +void lua_decode_noop(lua_State *L, int idx, const void *ptr); + +/* * Retrieve an integer from table on the top of the stack. * * key |
