Skip to content

Commit e7cc807

Browse files
committed
Add lunatik_getenv function
1 parent 6e41e9d commit e7cc807

File tree

5 files changed

+12
-2
lines changed

5 files changed

+12
-2
lines changed

lunatik.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "lua/lua.h"
2424
#include "lunatik_conf.h"
2525
#include "netlink.h"
26+
#include "luautil.h"
2627

2728
struct lunatik_instance {
2829
struct hlist_head states_table[LUNATIK_HASH_BUCKETS];
@@ -59,4 +60,6 @@ lunatik_State *lunatik_netnewstate(const char *name, size_t maxalloc, struct net
5960
int lunatik_netclosestate(const char *name, struct net *net);
6061
lunatik_State *lunatik_netstatelookup(const char *name, struct net *net);
6162

63+
lunatik_State *lunatik_getenv(lua_State *L);
64+
6265
#endif /* LUNATIK_STATES_H */

lunatik_core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ EXPORT_SYMBOL(lunatik_netnewstate);
182182
EXPORT_SYMBOL(lunatik_netclosestate);
183183
EXPORT_SYMBOL(lunatik_netstatelookup);
184184

185+
EXPORT_SYMBOL(lunatik_getenv);
186+
185187
extern struct genl_family lunatik_family;
186188
extern void lunatik_statesinit(void);
187189
extern void lunatik_closeall_from_default_ns(void);

netlink.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ struct lunatik_data {
4141
size_t size;
4242
};
4343

44-
#endif
44+
#endif /* NETLINK_H */

netlink_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#ifdef _KERNEL
55
extern struct genl_family lunatik_family;
66
#include <net/genetlink.h>
7-
#endif
7+
#endif /* _KERNEL */
88

99
#define LUNATIK_FRAGMENT_SIZE (3000) // TODO Find, a size more precise
1010
#define DELIMITER 3 //How many delimiters will be necessary in each part of the message

states.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,3 +265,8 @@ int lunatik_netclosestate(const char *name, struct net *net)
265265

266266
return 0;
267267
}
268+
269+
lunatik_State *lunatik_getenv(lua_State *L)
270+
{
271+
return luaU_getenv(L, lunatik_State);
272+
}

0 commit comments

Comments
 (0)