Lines Matching defs:netstat
14 struct netstat {
16 struct netstat *next;
21 static struct netstat *lookup_type(struct netstat *ns,
34 static struct netstat *lookup_get(struct netstat *ns,
37 struct netstat *ret;
43 ret = malloc(sizeof(struct netstat));
57 static struct netstat *lookup_get_column(struct netstat *ns, const char *line)
63 test_error("can't parse netstat file");
68 static void netstat_read_type(FILE *fnetstat, struct netstat **dest, char *line)
70 struct netstat *type = lookup_get_column(*dest, line);
92 test_error("Unexpected netstat format (%c)", tmp);
115 test_error("Unexpected netstat format");
119 static void snmp6_read(FILE *fnetstat, struct netstat **dest)
121 struct netstat *type = lookup_get(*dest, snmp6_name, strlen(snmp6_name));
145 struct netstat *netstat_read(void)
147 struct netstat *ret = 0;
159 fnetstat = fopen("/proc/thread-self/net/netstat", "r");
161 test_error("failed to open /proc/net/netstat");
188 void netstat_free(struct netstat *ns)
191 struct netstat *prev = ns;
204 __netstat_print_diff(uint64_t a, struct netstat *nsb, size_t i)
217 void netstat_print_diff(struct netstat *nsa, struct netstat *nsb)
254 uint64_t netstat_get(struct netstat *ns, const char *name, bool *not_found)