Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/netstat/inet.c
Show First 20 Lines • Show All 153 Lines • ▼ Show 20 Lines | |||||
int | int | ||||
sotoxsocket(struct socket *so, struct xsocket *xso) | sotoxsocket(struct socket *so, struct xsocket *xso) | ||||
{ | { | ||||
struct protosw proto; | struct protosw proto; | ||||
struct domain domain; | struct domain domain; | ||||
bzero(xso, sizeof *xso); | bzero(xso, sizeof *xso); | ||||
xso->xso_len = sizeof *xso; | xso->xso_len = sizeof *xso; | ||||
xso->xso_so = so; | xso->xso_so = (uint64_t)so; | ||||
xso->so_type = so->so_type; | xso->so_type = so->so_type; | ||||
xso->so_options = so->so_options; | xso->so_options = so->so_options; | ||||
xso->so_linger = so->so_linger; | xso->so_linger = so->so_linger; | ||||
xso->so_state = so->so_state; | xso->so_state = so->so_state; | ||||
xso->so_pcb = so->so_pcb; | xso->so_pcb = (uint64_t)so->so_pcb; | ||||
if (kread((uintptr_t)so->so_proto, &proto, sizeof(proto)) != 0) | if (kread((uintptr_t)so->so_proto, &proto, sizeof(proto)) != 0) | ||||
return (-1); | return (-1); | ||||
xso->xso_protocol = proto.pr_protocol; | xso->xso_protocol = proto.pr_protocol; | ||||
if (kread((uintptr_t)proto.pr_domain, &domain, sizeof(domain)) != 0) | if (kread((uintptr_t)proto.pr_domain, &domain, sizeof(domain)) != 0) | ||||
return (-1); | return (-1); | ||||
xso->xso_family = domain.dom_family; | xso->xso_family = domain.dom_family; | ||||
xso->so_timeo = so->so_timeo; | xso->so_timeo = so->so_timeo; | ||||
xso->so_error = so->so_error; | xso->so_error = so->so_error; | ||||
▲ Show 20 Lines • Show All 1,231 Lines • Show Last 20 Lines |