X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=lib%2Ffrrlua.h;h=bf6eb5fd913bb926f1334a90bc272d459d4be9c9;hb=aa2602bf60426086b003471ab8c52d5c340d797f;hp=c4de82740c3c709bc321ef37c64c76e618cd4149;hpb=af17728126b76468d70228dbaea9575bd1764a1e;p=mirror_frr.git diff --git a/lib/frrlua.h b/lib/frrlua.h index c4de82740..bf6eb5fd9 100644 --- a/lib/frrlua.h +++ b/lib/frrlua.h @@ -1,20 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (C) 2016-2019 Cumulus Networks, Inc. * Donald Sharp, Quentin Young - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; see the file COPYING; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __FRRLUA_H__ #define __FRRLUA_H__ @@ -34,6 +21,8 @@ extern "C" { #endif +DECLARE_MTYPE(SCRIPT_RES); + /* * gcc-10 is complaining about the wrapper function * not being compatible with lua_pushstring returning @@ -98,6 +87,10 @@ void lua_pushin6addr(lua_State *L, const struct in6_addr *addr); void lua_decode_in6addr(lua_State *L, int idx, struct in6_addr *addr); +void lua_pushipaddr(lua_State *L, const struct ipaddr *addr); + +void lua_pushethaddr(lua_State *L, const struct ethaddr *addr); + /* * Converts the Lua value at idx to an in6_addr. * @@ -136,6 +129,10 @@ void lua_decode_sockunion(lua_State *L, int idx, union sockunion *su); */ void *lua_tosockunion(lua_State *L, int idx); +void lua_pushnexthop_group(lua_State *L, const struct nexthop_group *ng); + +void lua_pushnexthop(lua_State *L, const struct nexthop *nexthop); + /* * Converts an int to a Lua value and pushes it on the stack. */ @@ -162,10 +159,12 @@ void lua_decode_stringp(lua_State *L, int idx, char *str); void *lua_tostringp(lua_State *L, int idx); /* - * No-op decocder + * No-op decoders */ void lua_decode_noop(lua_State *L, int idx, const void *ptr); +void lua_decode_integer_noop(lua_State *L, int idx, int i); + /* * Retrieve an integer from table on the top of the stack. *