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

Function table_do_modify

tools/ipfw/tables.c:572–585  ·  view source on GitHub ↗

* Modifies existing table. * * Request: [ ipfw_obj_header ipfw_xtable_info ] * * Returns 0 on success. */

Source from the content-addressed store, hash-verified

570 * Returns 0 on success.
571 */
572static int
573table_do_modify(ipfw_obj_header *oh, ipfw_xtable_info *i)
574{
575 char tbuf[sizeof(ipfw_obj_header) + sizeof(ipfw_xtable_info)];
576 int error;
577
578 memcpy(tbuf, oh, sizeof(*oh));
579 memcpy(tbuf + sizeof(*oh), i, sizeof(*i));
580 oh = (ipfw_obj_header *)tbuf;
581
582 error = do_set3(IP_FW_TABLE_XMODIFY, &oh->opheader, sizeof(tbuf));
583
584 return (error);
585}
586
587/*
588 * Locks or unlocks given table

Callers 2

table_modifyFunction · 0.85
table_lockFunction · 0.85

Calls 2

do_set3Function · 0.85
memcpyFunction · 0.50

Tested by

no test coverage detected