HomeFreeBSD

Description

MFC r331668:

Rework ipfw rules parsing and printing code.

Introduce show_state structure to keep information about printed opcodes.
Split show_static_rule() function into several smaller functions. Make
parsing and printing opcodes into several passes. Each printed opcode
is marked in show_state structure and will be skipped in next passes.
Now show_static_rule() function is simple, it just prints each part
of rule separately: action, modifiers, proto, src and dst addresses,
options. The main goal of this change is avoiding occurrence of wrong
result of `ifpw show` command, that can not be parsed by ipfw(8).
Also now it is possible to make some simple static optimizations
by reordering of opcodes in the rule.

PR:		[[ https://bugs.freebsd.org/222705 | 222705 ]]

Details

Provenance
aeAuthored on Apr 11 2018, 10:24 AM
Parents
rG1d69d16c5e0e: MFC r308490 by syrinx:
Branches
Unknown
Tags
Unknown

Event Timeline

Why is the function show_prerequisites removed?

In the pre-existing code, the flags variable was set at various places and show_prerequisites uses the values set in flags to print the output. But in the new code, the flags variable is not set in most of the places. Doesn't this change the behavior?