Lines Matching +full:25 +full:ns

21 static struct netstat *lookup_type(struct netstat *ns,  in lookup_type()  argument
24 while (ns != NULL) { in lookup_type()
25 size_t cmp = max(len, strlen(ns->header_name)); in lookup_type()
27 if (!strncmp(ns->header_name, type, cmp)) in lookup_type()
28 return ns; in lookup_type()
29 ns = ns->next; in lookup_type()
34 static struct netstat *lookup_get(struct netstat *ns, in lookup_get() argument
39 ret = lookup_type(ns, type, len); in lookup_get()
50 ret->next = ns; in lookup_get()
57 static struct netstat *lookup_get_column(struct netstat *ns, const char *line) in lookup_get_column() argument
65 return lookup_get(ns, line, column - line); in lookup_get_column()
155 * net-ns, see: in netstat_read()
188 void netstat_free(struct netstat *ns) in netstat_free() argument
190 while (ns != NULL) { in netstat_free()
191 struct netstat *prev = ns; in netstat_free()
194 free(ns->header_name); in netstat_free()
195 for (i = 0; i < ns->counters_nr; i++) in netstat_free()
196 free(ns->counters[i].name); in netstat_free()
197 free(ns->counters); in netstat_free()
198 ns = ns->next; in netstat_free()
207 test_print("%8s %25s: %" PRId64 " => %" PRId64, in __netstat_print_diff()
213 test_print("%8s %25s: %" PRIu64 " => %" PRIu64, nsb->header_name, in __netstat_print_diff()
254 uint64_t netstat_get(struct netstat *ns, const char *name, bool *not_found) in netstat_get() argument
259 while (ns != NULL) { in netstat_get()
262 for (i = 0; i < ns->counters_nr; i++) { in netstat_get()
263 if (!strcmp(name, ns->counters[i].name)) in netstat_get()
264 return ns->counters[i].val; in netstat_get()
267 ns = ns->next; in netstat_get()