]> git.ipfire.org Git - people/ms/libloc.git/commitdiff
lua: Export network flags
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 22 Feb 2024 16:20:38 +0000 (16:20 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 22 Feb 2024 16:25:11 +0000 (16:25 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/lua/location.c

index 727482f2096abdfd443887ed92b074e9314f26f3..6f2157cfc0bd9ef32f8d8fc89ad528501775ef8e 100644 (file)
@@ -22,6 +22,7 @@
 #include <lualib.h>
 
 #include <libloc/libloc.h>
+#include <libloc/network.h>
 
 #include "location.h"
 #include "as.h"
@@ -77,5 +78,18 @@ int luaopen_location(lua_State* L) {
        lua_pushstring(L, LIBLOC_DEFAULT_DATABASE_PATH);
        lua_setfield(L, -2, "DATABASE_PATH");
 
+       // Add flags
+       lua_pushnumber(L, LOC_NETWORK_FLAG_ANONYMOUS_PROXY);
+       lua_setfield(L, -2, "NETWORK_FLAG_ANONYMOUS_PROXY");
+
+       lua_pushnumber(L, LOC_NETWORK_FLAG_SATELLITE_PROVIDER);
+       lua_setfield(L, -2, "NETWORK_FLAG_SATELLITE_PROVIDER");
+
+       lua_pushnumber(L, LOC_NETWORK_FLAG_ANYCAST);
+       lua_setfield(L, -2, "NETWORK_FLAG_ANYCAST");
+
+       lua_pushnumber(L, LOC_NETWORK_FLAG_DROP);
+       lua_setfield(L, -2, "NETWORK_FLAG_DROP");
+
        return 1;
 }