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

Function pfr_validate_table

freebsd/netpfil/pf/pf_table.c:1706–1725  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1704}
1705
1706static int
1707pfr_validate_table(struct pfr_table *tbl, int allowedflags, int no_reserved)
1708{
1709 int i;
1710
1711 if (!tbl->pfrt_name[0])
1712 return (-1);
1713 if (no_reserved && !strcmp(tbl->pfrt_anchor, PF_RESERVED_ANCHOR))
1714 return (-1);
1715 if (tbl->pfrt_name[PF_TABLE_NAME_SIZE-1])
1716 return (-1);
1717 for (i = strlen(tbl->pfrt_name); i < PF_TABLE_NAME_SIZE; i++)
1718 if (tbl->pfrt_name[i])
1719 return (-1);
1720 if (pfr_fix_anchor(tbl->pfrt_anchor))
1721 return (-1);
1722 if (tbl->pfrt_flags & ~allowedflags)
1723 return (-1);
1724 return (0);
1725}
1726
1727/*
1728 * Rewrite anchors referenced by tables to remove slashes

Callers 13

pfr_clr_addrsFunction · 0.85
pfr_add_addrsFunction · 0.85
pfr_del_addrsFunction · 0.85
pfr_set_addrsFunction · 0.85
pfr_tst_addrsFunction · 0.85
pfr_get_addrsFunction · 0.85
pfr_get_astatsFunction · 0.85
pfr_clr_astatsFunction · 0.85
pfr_add_tablesFunction · 0.85
pfr_del_tablesFunction · 0.85
pfr_clr_tstatsFunction · 0.85
pfr_set_tflagsFunction · 0.85

Calls 2

strcmpFunction · 0.85
pfr_fix_anchorFunction · 0.85

Tested by

no test coverage detected