Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_subr.c
Show First 20 Lines • Show All 353 Lines • ▼ Show 20 Lines | static struct tcp_function_block tcp_def_funcblk = { | ||||
.tfb_tcp_block_name = "freebsd", | .tfb_tcp_block_name = "freebsd", | ||||
.tfb_tcp_output = tcp_default_output, | .tfb_tcp_output = tcp_default_output, | ||||
.tfb_tcp_do_segment = tcp_do_segment, | .tfb_tcp_do_segment = tcp_do_segment, | ||||
.tfb_tcp_ctloutput = tcp_default_ctloutput, | .tfb_tcp_ctloutput = tcp_default_ctloutput, | ||||
.tfb_tcp_handoff_ok = tcp_default_handoff_ok, | .tfb_tcp_handoff_ok = tcp_default_handoff_ok, | ||||
.tfb_tcp_fb_init = tcp_default_fb_init, | .tfb_tcp_fb_init = tcp_default_fb_init, | ||||
.tfb_tcp_fb_fini = tcp_default_fb_fini, | .tfb_tcp_fb_fini = tcp_default_fb_fini, | ||||
.tfb_switch_failed = tcp_default_switch_failed, | .tfb_switch_failed = tcp_default_switch_failed, | ||||
.tfb_flags = TCP_FUNC_DEFAULT_OK, | |||||
}; | }; | ||||
static int tcp_fb_cnt = 0; | static int tcp_fb_cnt = 0; | ||||
struct tcp_funchead t_functions; | struct tcp_funchead t_functions; | ||||
VNET_DEFINE_STATIC(struct tcp_function_block *, tcp_func_set_ptr) = &tcp_def_funcblk; | VNET_DEFINE_STATIC(struct tcp_function_block *, tcp_func_set_ptr) = &tcp_def_funcblk; | ||||
#define V_tcp_func_set_ptr VNET(tcp_func_set_ptr) | #define V_tcp_func_set_ptr VNET(tcp_func_set_ptr) | ||||
void | void | ||||
▲ Show 20 Lines • Show All 300 Lines • ▼ Show 20 Lines | sysctl_net_inet_default_tcp_functions(SYSCTL_HANDLER_ARGS) | ||||
if (error != 0 || req->newptr == NULL) | if (error != 0 || req->newptr == NULL) | ||||
return(error); | return(error); | ||||
rw_wlock(&tcp_function_lock); | rw_wlock(&tcp_function_lock); | ||||
blk = find_tcp_functions_locked(&fs); | blk = find_tcp_functions_locked(&fs); | ||||
if ((blk == NULL) || | if ((blk == NULL) || | ||||
(blk->tfb_flags & TCP_FUNC_BEING_REMOVED)) { | (blk->tfb_flags & TCP_FUNC_BEING_REMOVED)) { | ||||
error = ENOENT; | error = ENOENT; | ||||
goto done; | |||||
} | |||||
if ((blk->tfb_flags & TCP_FUNC_DEFAULT_OK) == 0) { | |||||
error = EINVAL; | |||||
goto done; | goto done; | ||||
} | } | ||||
V_tcp_func_set_ptr = blk; | V_tcp_func_set_ptr = blk; | ||||
done: | done: | ||||
rw_wunlock(&tcp_function_lock); | rw_wunlock(&tcp_function_lock); | ||||
return (error); | return (error); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 4,030 Lines • Show Last 20 Lines |