Changeset View
Changeset View
Standalone View
Standalone View
sys/net/debugnet.c
Show First 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | |||||
int debugnet_npolls = 2000; | int debugnet_npolls = 2000; | ||||
SYSCTL_INT(_net_debugnet, OID_AUTO, npolls, CTLFLAG_RWTUN, | SYSCTL_INT(_net_debugnet, OID_AUTO, npolls, CTLFLAG_RWTUN, | ||||
&debugnet_npolls, 0, | &debugnet_npolls, 0, | ||||
"Number of times to poll before assuming packet loss (0.5ms per poll)"); | "Number of times to poll before assuming packet loss (0.5ms per poll)"); | ||||
int debugnet_nretries = 10; | int debugnet_nretries = 10; | ||||
SYSCTL_INT(_net_debugnet, OID_AUTO, nretries, CTLFLAG_RWTUN, | SYSCTL_INT(_net_debugnet, OID_AUTO, nretries, CTLFLAG_RWTUN, | ||||
&debugnet_nretries, 0, | &debugnet_nretries, 0, | ||||
"Number of retransmit attempts before giving up"); | "Number of retransmit attempts before giving up"); | ||||
int debugnet_fib = RT_DEFAULT_FIB; | |||||
SYSCTL_INT(_net_debugnet, OID_AUTO, fib, CTLFLAG_RWTUN, | |||||
&debugnet_fib, 0, | |||||
"Fib to use when sending dump"); | |||||
static bool g_debugnet_pcb_inuse; | static bool g_debugnet_pcb_inuse; | ||||
static struct debugnet_pcb g_dnet_pcb; | static struct debugnet_pcb g_dnet_pcb; | ||||
/* | /* | ||||
* Simple accessors for opaque PCB. | * Simple accessors for opaque PCB. | ||||
*/ | */ | ||||
const unsigned char * | const unsigned char * | ||||
▲ Show 20 Lines • Show All 551 Lines • ▼ Show 20 Lines | if (pcb->dp_client == INADDR_ANY || pcb->dp_gateway == INADDR_ANY || | ||||
memset(&dest_sin, 0, sizeof(dest_sin)); | memset(&dest_sin, 0, sizeof(dest_sin)); | ||||
dest_sin = (struct sockaddr_in) { | dest_sin = (struct sockaddr_in) { | ||||
.sin_len = sizeof(dest_sin), | .sin_len = sizeof(dest_sin), | ||||
.sin_family = AF_INET, | .sin_family = AF_INET, | ||||
.sin_addr.s_addr = pcb->dp_server, | .sin_addr.s_addr = pcb->dp_server, | ||||
}; | }; | ||||
CURVNET_SET(vnet0); | CURVNET_SET(vnet0); | ||||
nh = fib4_lookup_debugnet(RT_DEFAULT_FIB, dest_sin.sin_addr, 0, | nh = fib4_lookup_debugnet(debugnet_fib, dest_sin.sin_addr, 0, | ||||
NHR_NONE); | NHR_NONE); | ||||
CURVNET_RESTORE(); | CURVNET_RESTORE(); | ||||
if (nh == NULL) { | if (nh == NULL) { | ||||
printf("%s: Could not get route for that server.\n", | printf("%s: Could not get route for that server.\n", | ||||
__func__); | __func__); | ||||
error = ENOENT; | error = ENOENT; | ||||
goto cleanup; | goto cleanup; | ||||
▲ Show 20 Lines • Show All 403 Lines • Show Last 20 Lines |