Changeset View
Changeset View
Standalone View
Standalone View
tests/sys/netgraph/util.c
Show First 20 Lines • Show All 249 Lines • ▼ Show 20 Lines | |||||
_ng_init(char const *file, size_t line) | _ng_init(char const *file, size_t line) | ||||
{ | { | ||||
if (cs >= 0) /* prevent reinit */ | if (cs >= 0) /* prevent reinit */ | ||||
return; | return; | ||||
CHECK(, 0 == NgMkSockNode(NULL, &cs, &ds)); | CHECK(, 0 == NgMkSockNode(NULL, &cs, &ds)); | ||||
NgSetDebug(3); | NgSetDebug(3); | ||||
} | } | ||||
#define GD(x) void \ | |||||
get_data##x(void *data, size_t len, void *ctx) {\ | |||||
int *cnt = ctx; \ | |||||
\ | |||||
(void)data; \ | |||||
(void)len; \ | |||||
cnt[x]++; \ | |||||
} | |||||
GD(0) | |||||
GD(1) | |||||
GD(2) | |||||
GD(3) | |||||
GD(4) | |||||
GD(5) | |||||
GD(6) | |||||
GD(7) | |||||
GD(8) | |||||
GD(9) |