aboutsummaryrefslogtreecommitdiff
path: root/src/options.c
diff options
context:
space:
mode:
authorcjtallman <cjtallman@gmail.com>2015-06-11 09:02:20 -0700
committercjtallman <cjtallman@gmail.com>2015-06-11 09:02:20 -0700
commit67abaf89eb9f3de8d7e00f310c502fc7534af2b7 (patch)
tree4c9604ee0ae522abb3714ed6b3770271a575b1a0 /src/options.c
parent321c0c9b1f7b6b83cd83b58e7e259f53eca69373 (diff)
downloadluasocket-67abaf89eb9f3de8d7e00f310c502fc7534af2b7.tar.gz
luasocket-67abaf89eb9f3de8d7e00f310c502fc7534af2b7.tar.bz2
luasocket-67abaf89eb9f3de8d7e00f310c502fc7534af2b7.zip
Added missing options for UDP getoption.
Documentation says "dontroute", "broadcast", "reuseaddr", and "reuseport" are supported as arguments to getoption, however their implementations were missing.
Diffstat (limited to 'src/options.c')
-rw-r--r--src/options.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/options.c b/src/options.c
index 8ac2a14..0c96721 100644
--- a/src/options.c
+++ b/src/options.c
@@ -105,11 +105,21 @@ int opt_set_dontroute(lua_State *L, p_socket ps)
105 return opt_setboolean(L, ps, SOL_SOCKET, SO_DONTROUTE); 105 return opt_setboolean(L, ps, SOL_SOCKET, SO_DONTROUTE);
106} 106}
107 107
108int opt_get_dontroute(lua_State *L, p_socket ps)
109{
110 return opt_getboolean(L, ps, SOL_SOCKET, SO_DONTROUTE);
111}
112
108int opt_set_broadcast(lua_State *L, p_socket ps) 113int opt_set_broadcast(lua_State *L, p_socket ps)
109{ 114{
110 return opt_setboolean(L, ps, SOL_SOCKET, SO_BROADCAST); 115 return opt_setboolean(L, ps, SOL_SOCKET, SO_BROADCAST);
111} 116}
112 117
118int opt_get_broadcast(lua_State *L, p_socket ps)
119{
120 return opt_getboolean(L, ps, SOL_SOCKET, SO_BROADCAST);
121}
122
113int opt_set_ip6_unicast_hops(lua_State *L, p_socket ps) 123int opt_set_ip6_unicast_hops(lua_State *L, p_socket ps)
114{ 124{
115 return opt_setint(L, ps, IPPROTO_IPV6, IPV6_UNICAST_HOPS); 125 return opt_setint(L, ps, IPPROTO_IPV6, IPV6_UNICAST_HOPS);