diff options
Diffstat (limited to 'src/options.h')
-rw-r--r-- | src/options.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/options.h b/src/options.h new file mode 100644 index 0000000..ec75fc0 --- /dev/null +++ b/src/options.h | |||
@@ -0,0 +1,30 @@ | |||
1 | #ifndef OPTIONS_H | ||
2 | #define OPTIONS_H | ||
3 | |||
4 | #include <lua.h> | ||
5 | #include "socket.h" | ||
6 | |||
7 | /* option registry */ | ||
8 | typedef struct t_opt { | ||
9 | const char *name; | ||
10 | int (*func)(lua_State *L, p_sock ps); | ||
11 | } t_opt; | ||
12 | typedef t_opt *p_opt; | ||
13 | |||
14 | /* supported options */ | ||
15 | int opt_dontroute(lua_State *L, p_sock ps); | ||
16 | int opt_broadcast(lua_State *L, p_sock ps); | ||
17 | int opt_reuseaddr(lua_State *L, p_sock ps); | ||
18 | int opt_tcp_nodelay(lua_State *L, p_sock ps); | ||
19 | int opt_keepalive(lua_State *L, p_sock ps); | ||
20 | int opt_linger(lua_State *L, p_sock ps); | ||
21 | int opt_reuseaddr(lua_State *L, p_sock ps); | ||
22 | int opt_ip_multicast_ttl(lua_State *L, p_sock ps); | ||
23 | int opt_ip_multicast_loop(lua_State *L, p_sock ps); | ||
24 | int opt_ip_add_membership(lua_State *L, p_sock ps); | ||
25 | int opt_ip_drop_membersip(lua_State *L, p_sock ps); | ||
26 | |||
27 | /* invokes the appropriate option handler */ | ||
28 | int opt_meth_setoption(lua_State *L, p_opt opt, p_sock ps); | ||
29 | |||
30 | #endif | ||