MCPcopy Index your code
hub / github.com/F-Stack/f-stack / nhgrp_print

Function nhgrp_print

tools/netstat/nhgrp.c:329–354  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

327}
328
329void
330nhgrp_print(int fibnum, int af)
331{
332 size_t intsize;
333 int numfibs;
334
335 intsize = sizeof(int);
336 if (fibnum == -1 &&
337 sysctlbyname("net.my_fibnum", &fibnum, &intsize, NULL, 0) == -1)
338 fibnum = 0;
339 if (sysctlbyname("net.fibs", &numfibs, &intsize, NULL, 0) == -1)
340 numfibs = 1;
341 if (fibnum < 0 || fibnum > numfibs - 1)
342 errx(EX_USAGE, "%d: invalid fib", fibnum);
343
344 ifmap = prepare_ifmap(&ifmap_size);
345 prepare_nh_map(fibnum, af);
346
347 xo_open_container("route-nhgrp-information");
348 xo_emit("{T:Nexthop groups data}");
349 if (fibnum)
350 xo_emit(" ({L:fib}: {:fib/%d})", fibnum);
351 xo_emit("\n");
352 print_nhgrp_sysctl(fibnum, af);
353 xo_close_container("route-nhgrp-information");
354}
355

Callers 1

main.cFile · 0.85

Calls 7

sysctlbynameFunction · 0.85
prepare_ifmapFunction · 0.85
prepare_nh_mapFunction · 0.85
xo_open_containerFunction · 0.85
xo_emitFunction · 0.85
print_nhgrp_sysctlFunction · 0.85
xo_close_containerFunction · 0.85

Tested by

no test coverage detected