MCPcopy Create free account
hub / github.com/F-Stack/f-stack / print_nhops_sysctl

Function print_nhops_sysctl

tools/netstat/nhops.c:400–443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

398}
399
400static void
401print_nhops_sysctl(int fibnum, int af)
402{
403 struct nhops_dump nd;
404 struct nhop_external *nh;
405 int fam;
406 struct rt_msghdr *rtm;
407
408 dump_nhops_sysctl(fibnum, af, &nd);
409
410 xo_open_container("nhop-table");
411 xo_open_list("rt-family");
412 if (nd.nh_count > 0) {
413 nh = (struct nhop_external *)(nd.nh_map[0].rtm + 1);
414 fam = nh->nh_family;
415
416 wid_dst = WID_GW_DEFAULT(fam);
417 wid_gw = WID_GW_DEFAULT(fam);
418 wid_nhidx = 5;
419 wid_nhtype = 12;
420 wid_refcnt = 6;
421 wid_flags = 6;
422 wid_pksent = 8;
423 wid_mtu = 6;
424 wid_if = WID_IF_DEFAULT(fam);
425 xo_open_instance("rt-family");
426 pr_family(fam);
427 xo_open_list("nh-entry");
428
429 print_nhop_header(fam);
430
431 for (size_t i = 0; i < nd.nh_count; i++) {
432 rtm = nd.nh_map[i].rtm;
433 nh = (struct nhop_external *)(rtm + 1);
434 print_nhop_entry_sysctl("nh-entry", rtm, nh);
435 }
436
437 xo_close_list("nh-entry");
438 xo_close_instance("rt-family");
439 }
440 xo_close_list("rt-family");
441 xo_close_container("nhop-table");
442 free(nd.nh_buf);
443}
444
445#ifndef FSTACK
446static void

Callers 1

nhops_printFunction · 0.85

Calls 11

dump_nhops_sysctlFunction · 0.85
xo_open_containerFunction · 0.85
xo_open_listFunction · 0.85
xo_open_instanceFunction · 0.85
pr_familyFunction · 0.85
print_nhop_headerFunction · 0.85
print_nhop_entry_sysctlFunction · 0.85
xo_close_listFunction · 0.85
xo_close_instanceFunction · 0.85
xo_close_containerFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected