Changeset View
Changeset View
Standalone View
Standalone View
head/lib/libprocstat/libprocstat.c
Show First 20 Lines • Show All 1,331 Lines • ▼ Show 20 Lines | |||||
static int | static int | ||||
procstat_get_vnode_info_sysctl(struct filestat *fst, struct vnstat *vn, | procstat_get_vnode_info_sysctl(struct filestat *fst, struct vnstat *vn, | ||||
char *errbuf) | char *errbuf) | ||||
{ | { | ||||
struct statfs stbuf; | struct statfs stbuf; | ||||
struct kinfo_file *kif; | struct kinfo_file *kif; | ||||
struct kinfo_vmentry *kve; | struct kinfo_vmentry *kve; | ||||
char *name, *path; | |||||
uint64_t fileid; | uint64_t fileid; | ||||
uint64_t size; | uint64_t size; | ||||
char *name, *path; | uint64_t fsid; | ||||
uint32_t fsid; | uint64_t rdev; | ||||
uint16_t mode; | uint16_t mode; | ||||
uint32_t rdev; | |||||
int vntype; | int vntype; | ||||
int status; | int status; | ||||
assert(fst); | assert(fst); | ||||
assert(vn); | assert(vn); | ||||
bzero(vn, sizeof(*vn)); | bzero(vn, sizeof(*vn)); | ||||
if (fst->fs_typedep == NULL) | if (fst->fs_typedep == NULL) | ||||
return (1); | return (1); | ||||
▲ Show 20 Lines • Show All 186 Lines • ▼ Show 20 Lines | procstat_get_socket_info_sysctl(struct filestat *fst, struct sockstat *sock, | ||||
/* | /* | ||||
* Fill in known data. | * Fill in known data. | ||||
*/ | */ | ||||
sock->type = kif->kf_sock_type; | sock->type = kif->kf_sock_type; | ||||
sock->proto = kif->kf_sock_protocol; | sock->proto = kif->kf_sock_protocol; | ||||
sock->dom_family = kif->kf_sock_domain; | sock->dom_family = kif->kf_sock_domain; | ||||
sock->so_pcb = kif->kf_un.kf_sock.kf_sock_pcb; | sock->so_pcb = kif->kf_un.kf_sock.kf_sock_pcb; | ||||
strlcpy(sock->dname, kif->kf_path, sizeof(sock->dname)); | strlcpy(sock->dname, kif->kf_path, sizeof(sock->dname)); | ||||
bcopy(&kif->kf_sa_local, &sock->sa_local, kif->kf_sa_local.ss_len); | bcopy(&kif->kf_un.kf_sock.kf_sa_local, &sock->sa_local, | ||||
bcopy(&kif->kf_sa_peer, &sock->sa_peer, kif->kf_sa_peer.ss_len); | kif->kf_un.kf_sock.kf_sa_local.ss_len); | ||||
bcopy(&kif->kf_un.kf_sock.kf_sa_peer, &sock->sa_peer, | |||||
kif->kf_un.kf_sock.kf_sa_peer.ss_len); | |||||
/* | /* | ||||
* Protocol specific data. | * Protocol specific data. | ||||
*/ | */ | ||||
switch(sock->dom_family) { | switch(sock->dom_family) { | ||||
case AF_INET: | case AF_INET: | ||||
case AF_INET6: | case AF_INET6: | ||||
if (sock->proto == IPPROTO_TCP) | if (sock->proto == IPPROTO_TCP) | ||||
▲ Show 20 Lines • Show All 1,025 Lines • Show Last 20 Lines |