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

Function table_modify

tools/ipfw/tables.c:537–563  ·  view source on GitHub ↗

* Modifies existing table * * ipfw table NAME modify [ limit number ] */

Source from the content-addressed store, hash-verified

535 * ipfw table NAME modify [ limit number ]
536 */
537static void
538table_modify(ipfw_obj_header *oh, int ac, char *av[])
539{
540 ipfw_xtable_info xi;
541 int tcmd;
542
543 memset(&xi, 0, sizeof(xi));
544
545 while (ac > 0) {
546 tcmd = get_token(tablenewcmds, *av, "option");
547 ac--; av++;
548
549 switch (tcmd) {
550 case TOK_LIMIT:
551 NEED1("limit value required");
552 xi.limit = strtol(*av, NULL, 10);
553 xi.mflags |= IPFW_TMFLAGS_LIMIT;
554 ac--; av++;
555 break;
556 default:
557 errx(EX_USAGE, "cmd is not supported for modification");
558 }
559 }
560
561 if (table_do_modify(oh, &xi) != 0)
562 err(EX_OSERR, "Table modification failed");
563}
564
565/*
566 * Modifies existing table.

Callers 1

ipfw_table_handlerFunction · 0.85

Calls 4

memsetFunction · 0.85
strtolFunction · 0.85
table_do_modifyFunction · 0.85
get_tokenFunction · 0.70

Tested by

no test coverage detected