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

Function ipfw_list_values

tools/ipfw/tables.c:2043–2070  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2041}
2042
2043void
2044ipfw_list_values(int ac __unused, char *av[] __unused)
2045{
2046 char buf[128];
2047 ipfw_obj_lheader *olh;
2048 struct _table_value *v;
2049 uint32_t i, vmask;
2050 int error;
2051
2052 error = table_do_get_vlist(&olh);
2053 if (error != 0)
2054 err(EX_OSERR, "Unable to request value list");
2055
2056 vmask = 0x7FFFFFFF; /* Similar to IPFW_VTYPE_LEGACY */
2057
2058 table_print_valheader(buf, sizeof(buf), vmask);
2059 printf("HEADER: %s\n", buf);
2060 v = (struct _table_value *)(olh + 1);
2061 qsort(v, olh->count, olh->objsize, compare_values);
2062 for (i = 0; i < olh->count; i++) {
2063 table_show_value(buf, sizeof(buf), (ipfw_table_value *)v,
2064 vmask, 0);
2065 printf("[%u] refs=%lu %s\n", v->spare1, (u_long)v->refcnt, buf);
2066 v = (struct _table_value *)((caddr_t)v + olh->objsize);
2067 }
2068
2069 free(olh);
2070}
2071
2072int
2073table_check_name(const char *tablename)

Callers 1

ipfw_internal_handlerFunction · 0.85

Calls 6

table_do_get_vlistFunction · 0.85
table_print_valheaderFunction · 0.85
qsortFunction · 0.85
table_show_valueFunction · 0.85
printfFunction · 0.50
freeFunction · 0.50

Tested by

no test coverage detected