diff options
author | cjtallman <cjtallman@gmail.com> | 2015-06-11 09:02:20 -0700 |
---|---|---|
committer | cjtallman <cjtallman@gmail.com> | 2015-06-11 09:02:20 -0700 |
commit | 67abaf89eb9f3de8d7e00f310c502fc7534af2b7 (patch) | |
tree | 4c9604ee0ae522abb3714ed6b3770271a575b1a0 /src/options.c | |
parent | 321c0c9b1f7b6b83cd83b58e7e259f53eca69373 (diff) | |
download | luasocket-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.c | 10 |
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 | ||
108 | int opt_get_dontroute(lua_State *L, p_socket ps) | ||
109 | { | ||
110 | return opt_getboolean(L, ps, SOL_SOCKET, SO_DONTROUTE); | ||
111 | } | ||
112 | |||
108 | int opt_set_broadcast(lua_State *L, p_socket ps) | 113 | int 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 | ||
118 | int opt_get_broadcast(lua_State *L, p_socket ps) | ||
119 | { | ||
120 | return opt_getboolean(L, ps, SOL_SOCKET, SO_BROADCAST); | ||
121 | } | ||
122 | |||
113 | int opt_set_ip6_unicast_hops(lua_State *L, p_socket ps) | 123 | int 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); |