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

Function table_do_create

tools/ipfw/tables.c:517–530  ·  view source on GitHub ↗

* Creates new table * * Request: [ ipfw_obj_header ipfw_xtable_info ] * * Returns 0 on success. */

Source from the content-addressed store, hash-verified

515 * Returns 0 on success.
516 */
517static int
518table_do_create(ipfw_obj_header *oh, ipfw_xtable_info *i)
519{
520 char tbuf[sizeof(ipfw_obj_header) + sizeof(ipfw_xtable_info)];
521 int error;
522
523 memcpy(tbuf, oh, sizeof(*oh));
524 memcpy(tbuf + sizeof(*oh), i, sizeof(*i));
525 oh = (ipfw_obj_header *)tbuf;
526
527 error = do_set3(IP_FW_TABLE_XCREATE, &oh->opheader, sizeof(tbuf));
528
529 return (error);
530}
531
532/*
533 * Modifies existing table

Callers 2

table_createFunction · 0.85
table_modify_recordFunction · 0.85

Calls 2

do_set3Function · 0.85
memcpyFunction · 0.50

Tested by

no test coverage detected