aboutsummaryrefslogtreecommitdiff
path: root/src/options.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/options.h')
-rw-r--r--src/options.h30
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 */
8typedef struct t_opt {
9 const char *name;
10 int (*func)(lua_State *L, p_sock ps);
11} t_opt;
12typedef t_opt *p_opt;
13
14/* supported options */
15int opt_dontroute(lua_State *L, p_sock ps);
16int opt_broadcast(lua_State *L, p_sock ps);
17int opt_reuseaddr(lua_State *L, p_sock ps);
18int opt_tcp_nodelay(lua_State *L, p_sock ps);
19int opt_keepalive(lua_State *L, p_sock ps);
20int opt_linger(lua_State *L, p_sock ps);
21int opt_reuseaddr(lua_State *L, p_sock ps);
22int opt_ip_multicast_ttl(lua_State *L, p_sock ps);
23int opt_ip_multicast_loop(lua_State *L, p_sock ps);
24int opt_ip_add_membership(lua_State *L, p_sock ps);
25int opt_ip_drop_membersip(lua_State *L, p_sock ps);
26
27/* invokes the appropriate option handler */
28int opt_meth_setoption(lua_State *L, p_opt opt, p_sock ps);
29
30#endif