* datatypes.
*/
-void frrlua_newtable_prefix(lua_State *L, const struct prefix *prefix)
+int frrlua_newtable_prefix(lua_State *L, const struct prefix *prefix)
{
char buffer[100];
lua_setfield(L, -2, "route");
lua_pushinteger(L, prefix->family);
lua_setfield(L, -2, "family");
- lua_setglobal(L, "prefix");
+
+ return 0;
}
-void frrlua_newtable_interface(lua_State *L, const struct interface *ifp)
+int frrlua_newtable_interface(lua_State *L, const struct interface *ifp)
{
zlog_debug("frrlua: pushing interface table");
lua_setfield(L, -2, "link_ifindex");
lua_pushinteger(L, ifp->ll_type);
lua_setfield(L, -2, "linklayer_type");
+
+ return 0;
}
/*
{
lua_newtable(L);
luaL_setfuncs(L, log_funcs, 0);
- lua_setfield(L, -2, "log");
+ lua_setglobal(L, "log");
}
/*
*
* Additionally sets the global variable "prefix" to point at this table.
*/
-void frrlua_newtable_prefix(lua_State *L, const struct prefix *prefix);
+int frrlua_newtable_prefix(lua_State *L, const struct prefix *prefix);
/*
* Pushes a new table containing relevant fields from an interface structure.
*/
-void frrlua_newtable_interface(lua_State *L, const struct interface *ifp);
+int frrlua_newtable_interface(lua_State *L, const struct interface *ifp);
/*
* Retrieve a string from table on the top of the stack.