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

Function table_do_swap

tools/ipfw/tables.c:648–662  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

646}
647
648static int
649table_do_swap(ipfw_obj_header *oh, char *second)
650{
651 char tbuf[sizeof(ipfw_obj_header) + sizeof(ipfw_obj_ntlv)];
652 int error;
653
654 memset(tbuf, 0, sizeof(tbuf));
655 memcpy(tbuf, oh, sizeof(*oh));
656 oh = (ipfw_obj_header *)tbuf;
657 table_fill_ntlv((ipfw_obj_ntlv *)(oh + 1), second, oh->ntlv.set, 1);
658
659 error = do_set3(IP_FW_TABLE_XSWAP, &oh->opheader, sizeof(tbuf));
660
661 return (error);
662}
663
664/*
665 * Swaps given table with @second one.

Callers 1

table_swapFunction · 0.85

Calls 4

memsetFunction · 0.85
table_fill_ntlvFunction · 0.85
do_set3Function · 0.85
memcpyFunction · 0.50

Tested by

no test coverage detected