network stack: getsockopt/setsockopt are no longer optional for protocols, as suggested by Axel.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21085 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -129,6 +129,24 @@ icmp_control(net_protocol *protocol, int level, int option, void *value,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
icmp_getsockopt(net_protocol *protocol, int level, int option,
|
||||||
|
void *value, int *length)
|
||||||
|
{
|
||||||
|
return protocol->next->module->getsockopt(protocol->next, level, option,
|
||||||
|
value, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
icmp_setsockopt(net_protocol *protocol, int level, int option,
|
||||||
|
const void *value, int length)
|
||||||
|
{
|
||||||
|
return protocol->next->module->setsockopt(protocol->next, level, option,
|
||||||
|
value, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
icmp_bind(net_protocol *protocol, const struct sockaddr *address)
|
icmp_bind(net_protocol *protocol, const struct sockaddr *address)
|
||||||
{
|
{
|
||||||
@@ -330,8 +348,8 @@ net_protocol_module_info sICMPModule = {
|
|||||||
icmp_connect,
|
icmp_connect,
|
||||||
icmp_accept,
|
icmp_accept,
|
||||||
icmp_control,
|
icmp_control,
|
||||||
NULL, // getsockopt
|
icmp_getsockopt,
|
||||||
NULL, // setsockopt
|
icmp_setsockopt,
|
||||||
icmp_bind,
|
icmp_bind,
|
||||||
icmp_unbind,
|
icmp_unbind,
|
||||||
icmp_listen,
|
icmp_listen,
|
||||||
|
|||||||
@@ -1021,6 +1021,24 @@ udp_control(net_protocol *protocol, int level, int option, void *value,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
udp_getsockopt(net_protocol *protocol, int level, int option, void *value,
|
||||||
|
int *length)
|
||||||
|
{
|
||||||
|
return protocol->next->module->getsockopt(protocol->next, level, option,
|
||||||
|
value, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
udp_setsockopt(net_protocol *protocol, int level, int option,
|
||||||
|
const void *value, int length)
|
||||||
|
{
|
||||||
|
return protocol->next->module->setsockopt(protocol->next, level, option,
|
||||||
|
value, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
udp_bind(net_protocol *protocol, const struct sockaddr *address)
|
udp_bind(net_protocol *protocol, const struct sockaddr *address)
|
||||||
{
|
{
|
||||||
@@ -1218,8 +1236,8 @@ net_protocol_module_info sUDPModule = {
|
|||||||
udp_connect,
|
udp_connect,
|
||||||
udp_accept,
|
udp_accept,
|
||||||
udp_control,
|
udp_control,
|
||||||
NULL, // getsockopt
|
udp_getsockopt,
|
||||||
NULL, // setsockopt
|
udp_setsockopt,
|
||||||
udp_bind,
|
udp_bind,
|
||||||
udp_unbind,
|
udp_unbind,
|
||||||
udp_listen,
|
udp_listen,
|
||||||
|
|||||||
@@ -319,6 +319,24 @@ link_control(net_protocol *_protocol, int level, int option, void *value,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
link_getsockopt(net_protocol *protocol, int level, int option, void *value,
|
||||||
|
int *length)
|
||||||
|
{
|
||||||
|
return protocol->next->module->getsockopt(protocol, level, option,
|
||||||
|
value, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
link_setsockopt(net_protocol *protocol, int level, int option,
|
||||||
|
const void *value, int length)
|
||||||
|
{
|
||||||
|
return protocol->next->module->setsockopt(protocol, level, option,
|
||||||
|
value, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
link_bind(net_protocol *protocol, const struct sockaddr *address)
|
link_bind(net_protocol *protocol, const struct sockaddr *address)
|
||||||
{
|
{
|
||||||
@@ -467,8 +485,8 @@ net_protocol_module_info gLinkModule = {
|
|||||||
link_connect,
|
link_connect,
|
||||||
link_accept,
|
link_accept,
|
||||||
link_control,
|
link_control,
|
||||||
NULL, // getsockopt
|
link_getsockopt,
|
||||||
NULL, // setsockopt
|
link_setsockopt,
|
||||||
link_bind,
|
link_bind,
|
||||||
link_unbind,
|
link_unbind,
|
||||||
link_listen,
|
link_listen,
|
||||||
|
|||||||
@@ -751,14 +751,8 @@ int
|
|||||||
socket_getsockopt(net_socket *socket, int level, int option, void *value,
|
socket_getsockopt(net_socket *socket, int level, int option, void *value,
|
||||||
int *_length)
|
int *_length)
|
||||||
{
|
{
|
||||||
for (net_protocol *protocol = socket->first_protocol;
|
return socket->first_protocol->module->getsockopt(socket->first_protocol,
|
||||||
protocol; protocol = protocol->next) {
|
level, option, value, _length);
|
||||||
if (protocol->module->getsockopt)
|
|
||||||
return protocol->module->getsockopt(protocol, level, option,
|
|
||||||
value, _length);
|
|
||||||
}
|
|
||||||
|
|
||||||
return socket_get_option(socket, level, option, value, _length);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1069,14 +1063,8 @@ int
|
|||||||
socket_setsockopt(net_socket *socket, int level, int option, const void *value,
|
socket_setsockopt(net_socket *socket, int level, int option, const void *value,
|
||||||
int length)
|
int length)
|
||||||
{
|
{
|
||||||
for (net_protocol *protocol = socket->first_protocol;
|
return socket->first_protocol->module->setsockopt(socket->first_protocol,
|
||||||
protocol; protocol = protocol->next) {
|
level, option, value, length);
|
||||||
if (protocol->module->setsockopt)
|
|
||||||
return protocol->module->setsockopt(protocol, level, option,
|
|
||||||
value, length);
|
|
||||||
}
|
|
||||||
|
|
||||||
return socket_set_option(socket, level, option, value, length);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user