mirror of
https://github.com/opnsense/src.git
synced 2026-06-07 07:42:26 -04:00
pfctl: print_rule: rename opts -> ropts
no binary change
1/2 from Lawrence Teo <lteo at devio dot us>
ok sthen dlg myself and gcc
Obtained from: OpenBSD, henning <henning@openbsd.org>, 6992ade79a
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D47800
This commit is contained in:
parent
f1ddd7f1da
commit
d7e9df4fc6
1 changed files with 33 additions and 33 deletions
|
|
@ -837,7 +837,7 @@ print_rule(struct pfctl_rule *r, const char *anchor_call, int verbose, int numer
|
|||
static const char *anchortypes[] = { "anchor", "anchor", "anchor",
|
||||
"anchor", "nat-anchor", "nat-anchor", "binat-anchor",
|
||||
"binat-anchor", "rdr-anchor", "rdr-anchor" };
|
||||
int i, opts;
|
||||
int i, ropts;
|
||||
char *p;
|
||||
|
||||
if (verbose)
|
||||
|
|
@ -1044,72 +1044,72 @@ print_rule(struct pfctl_rule *r, const char *anchor_call, int verbose, int numer
|
|||
}
|
||||
printf(" probability %s%%", buf);
|
||||
}
|
||||
opts = 0;
|
||||
ropts = 0;
|
||||
if (r->max_states || r->max_src_nodes || r->max_src_states)
|
||||
opts = 1;
|
||||
ropts = 1;
|
||||
if (r->rule_flag & PFRULE_NOSYNC)
|
||||
opts = 1;
|
||||
ropts = 1;
|
||||
if (r->rule_flag & PFRULE_SRCTRACK)
|
||||
opts = 1;
|
||||
ropts = 1;
|
||||
if (r->rule_flag & PFRULE_IFBOUND)
|
||||
opts = 1;
|
||||
ropts = 1;
|
||||
if (r->rule_flag & PFRULE_STATESLOPPY)
|
||||
opts = 1;
|
||||
ropts = 1;
|
||||
if (r->rule_flag & PFRULE_PFLOW)
|
||||
opts = 1;
|
||||
for (i = 0; !opts && i < PFTM_MAX; ++i)
|
||||
ropts = 1;
|
||||
for (i = 0; !ropts && i < PFTM_MAX; ++i)
|
||||
if (r->timeout[i])
|
||||
opts = 1;
|
||||
if (opts) {
|
||||
ropts = 1;
|
||||
if (ropts) {
|
||||
printf(" (");
|
||||
if (r->max_states) {
|
||||
printf("max %u", r->max_states);
|
||||
opts = 0;
|
||||
ropts = 0;
|
||||
}
|
||||
if (r->rule_flag & PFRULE_NOSYNC) {
|
||||
if (!opts)
|
||||
if (!ropts)
|
||||
printf(", ");
|
||||
printf("no-sync");
|
||||
opts = 0;
|
||||
ropts = 0;
|
||||
}
|
||||
if (r->rule_flag & PFRULE_SRCTRACK) {
|
||||
if (!opts)
|
||||
if (!ropts)
|
||||
printf(", ");
|
||||
printf("source-track");
|
||||
if (r->rule_flag & PFRULE_RULESRCTRACK)
|
||||
printf(" rule");
|
||||
else
|
||||
printf(" global");
|
||||
opts = 0;
|
||||
ropts = 0;
|
||||
}
|
||||
if (r->max_src_states) {
|
||||
if (!opts)
|
||||
if (!ropts)
|
||||
printf(", ");
|
||||
printf("max-src-states %u", r->max_src_states);
|
||||
opts = 0;
|
||||
ropts = 0;
|
||||
}
|
||||
if (r->max_src_conn) {
|
||||
if (!opts)
|
||||
if (!ropts)
|
||||
printf(", ");
|
||||
printf("max-src-conn %u", r->max_src_conn);
|
||||
opts = 0;
|
||||
ropts = 0;
|
||||
}
|
||||
if (r->max_src_conn_rate.limit) {
|
||||
if (!opts)
|
||||
if (!ropts)
|
||||
printf(", ");
|
||||
printf("max-src-conn-rate %u/%u",
|
||||
r->max_src_conn_rate.limit,
|
||||
r->max_src_conn_rate.seconds);
|
||||
opts = 0;
|
||||
ropts = 0;
|
||||
}
|
||||
if (r->max_src_nodes) {
|
||||
if (!opts)
|
||||
if (!ropts)
|
||||
printf(", ");
|
||||
printf("max-src-nodes %u", r->max_src_nodes);
|
||||
opts = 0;
|
||||
ropts = 0;
|
||||
}
|
||||
if (r->overload_tblname[0]) {
|
||||
if (!opts)
|
||||
if (!ropts)
|
||||
printf(", ");
|
||||
printf("overload <%s>", r->overload_tblname);
|
||||
if (r->flush)
|
||||
|
|
@ -1118,30 +1118,30 @@ print_rule(struct pfctl_rule *r, const char *anchor_call, int verbose, int numer
|
|||
printf(" global");
|
||||
}
|
||||
if (r->rule_flag & PFRULE_IFBOUND) {
|
||||
if (!opts)
|
||||
if (!ropts)
|
||||
printf(", ");
|
||||
printf("if-bound");
|
||||
opts = 0;
|
||||
ropts = 0;
|
||||
}
|
||||
if (r->rule_flag & PFRULE_STATESLOPPY) {
|
||||
if (!opts)
|
||||
if (!ropts)
|
||||
printf(", ");
|
||||
printf("sloppy");
|
||||
opts = 0;
|
||||
ropts = 0;
|
||||
}
|
||||
if (r->rule_flag & PFRULE_PFLOW) {
|
||||
if (!opts)
|
||||
if (!ropts)
|
||||
printf(", ");
|
||||
printf("pflow");
|
||||
opts = 0;
|
||||
ropts = 0;
|
||||
}
|
||||
for (i = 0; i < PFTM_MAX; ++i)
|
||||
if (r->timeout[i]) {
|
||||
int j;
|
||||
|
||||
if (!opts)
|
||||
if (!ropts)
|
||||
printf(", ");
|
||||
opts = 0;
|
||||
ropts = 0;
|
||||
for (j = 0; pf_timeouts[j].name != NULL;
|
||||
++j)
|
||||
if (pf_timeouts[j].timeout == i)
|
||||
|
|
|
|||
Loading…
Reference in a new issue