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

Function vxlan_ftable_sysctl_dump

freebsd/net/if_vxlan.c:703–742  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

701}
702
703static int
704vxlan_ftable_sysctl_dump(SYSCTL_HANDLER_ARGS)
705{
706 struct rm_priotracker tracker;
707 struct sbuf sb;
708 struct vxlan_softc *sc;
709 struct vxlan_ftable_entry *fe;
710 size_t size;
711 int i, error;
712
713 /*
714 * This is mostly intended for debugging during development. It is
715 * not practical to dump an entire large table this way.
716 */
717
718 sc = arg1;
719 size = PAGE_SIZE; /* Calculate later. */
720
721 sbuf_new(&sb, NULL, size, SBUF_FIXEDLEN);
722 sbuf_putc(&sb, '\n');
723
724 VXLAN_RLOCK(sc, &tracker);
725 for (i = 0; i < VXLAN_SC_FTABLE_SIZE; i++) {
726 LIST_FOREACH(fe, &sc->vxl_ftable[i], vxlfe_hash) {
727 if (sbuf_error(&sb) != 0)
728 break;
729 vxlan_ftable_entry_dump(fe, &sb);
730 }
731 }
732 VXLAN_RUNLOCK(sc, &tracker);
733
734 if (sbuf_len(&sb) == 1)
735 sbuf_setpos(&sb, 0);
736
737 sbuf_finish(&sb);
738 error = sysctl_handle_string(oidp, sbuf_data(&sb), sbuf_len(&sb), req);
739 sbuf_delete(&sb);
740
741 return (error);
742}
743
744static struct vxlan_ftable_entry *
745vxlan_ftable_entry_alloc(void)

Callers

nothing calls this directly

Calls 10

sbuf_newFunction · 0.85
sbuf_putcFunction · 0.85
sbuf_errorFunction · 0.85
vxlan_ftable_entry_dumpFunction · 0.85
sbuf_lenFunction · 0.85
sbuf_setposFunction · 0.85
sbuf_finishFunction · 0.85
sysctl_handle_stringFunction · 0.85
sbuf_dataFunction · 0.85
sbuf_deleteFunction · 0.85

Tested by

no test coverage detected