tpws: unify pools.c with nfqws

This commit is contained in:
bol-van 2024-10-29 17:36:49 +03:00
parent acfd844a49
commit daac1d2127
2 changed files with 7 additions and 0 deletions

View File

@ -481,3 +481,9 @@ bool port_filters_in_range(const struct port_filters_head *head, uint16_t port)
} }
return false; return false;
} }
bool port_filters_deny_if_empty(struct port_filters_head *head)
{
port_filter pf;
if (LIST_FIRST(head)) return true;
return pf_parse("0",&pf) && port_filter_add(head,&pf);
}

View File

@ -140,3 +140,4 @@ LIST_HEAD(port_filters_head, port_filter_item);
bool port_filter_add(struct port_filters_head *head, const port_filter *pf); bool port_filter_add(struct port_filters_head *head, const port_filter *pf);
void port_filters_destroy(struct port_filters_head *head); void port_filters_destroy(struct port_filters_head *head);
bool port_filters_in_range(const struct port_filters_head *head, uint16_t port); bool port_filters_in_range(const struct port_filters_head *head, uint16_t port);
bool port_filters_deny_if_empty(struct port_filters_head *head);