mirror of
https://github.com/lunarmodules/luasocket.git
synced 2024-11-08 14:28:21 +01:00
Added missing options for UDP getoption.
Documentation says "dontroute", "broadcast", "reuseaddr", and "reuseport" are supported as arguments to getoption, however their implementations were missing.
This commit is contained in:
parent
321c0c9b1f
commit
67abaf89eb
@ -105,11 +105,21 @@ int opt_set_dontroute(lua_State *L, p_socket ps)
|
||||
return opt_setboolean(L, ps, SOL_SOCKET, SO_DONTROUTE);
|
||||
}
|
||||
|
||||
int opt_get_dontroute(lua_State *L, p_socket ps)
|
||||
{
|
||||
return opt_getboolean(L, ps, SOL_SOCKET, SO_DONTROUTE);
|
||||
}
|
||||
|
||||
int opt_set_broadcast(lua_State *L, p_socket ps)
|
||||
{
|
||||
return opt_setboolean(L, ps, SOL_SOCKET, SO_BROADCAST);
|
||||
}
|
||||
|
||||
int opt_get_broadcast(lua_State *L, p_socket ps)
|
||||
{
|
||||
return opt_getboolean(L, ps, SOL_SOCKET, SO_BROADCAST);
|
||||
}
|
||||
|
||||
int opt_set_ip6_unicast_hops(lua_State *L, p_socket ps)
|
||||
{
|
||||
return opt_setint(L, ps, IPPROTO_IPV6, IPV6_UNICAST_HOPS);
|
||||
|
@ -40,11 +40,12 @@ int opt_set_ip6_drop_membersip(lua_State *L, p_socket ps);
|
||||
int opt_set_ip6_v6only(lua_State *L, p_socket ps);
|
||||
|
||||
/* supported options for getoption */
|
||||
int opt_get_dontroute(lua_State *L, p_socket ps);
|
||||
int opt_get_broadcast(lua_State *L, p_socket ps);
|
||||
int opt_get_reuseaddr(lua_State *L, p_socket ps);
|
||||
int opt_get_tcp_nodelay(lua_State *L, p_socket ps);
|
||||
int opt_get_keepalive(lua_State *L, p_socket ps);
|
||||
int opt_get_linger(lua_State *L, p_socket ps);
|
||||
int opt_get_reuseaddr(lua_State *L, p_socket ps);
|
||||
int opt_get_ip_multicast_loop(lua_State *L, p_socket ps);
|
||||
int opt_get_ip_multicast_if(lua_State *L, p_socket ps);
|
||||
int opt_get_error(lua_State *L, p_socket ps);
|
||||
|
@ -89,6 +89,10 @@ static t_opt optset[] = {
|
||||
|
||||
/* socket options for getoption */
|
||||
static t_opt optget[] = {
|
||||
{"dontroute", opt_get_dontroute},
|
||||
{"broadcast", opt_get_broadcast},
|
||||
{"reuseaddr", opt_get_reuseaddr},
|
||||
{"reuseport", opt_get_reuseport},
|
||||
{"ip-multicast-if", opt_get_ip_multicast_if},
|
||||
{"ip-multicast-loop", opt_get_ip_multicast_loop},
|
||||
{"error", opt_get_error},
|
||||
|
Loading…
Reference in New Issue
Block a user