diff options
author | Andrey V. Elsukov <ae@FreeBSD.org> | 2018-03-28 12:44:28 +0000 |
---|---|---|
committer | Andrey V. Elsukov <ae@FreeBSD.org> | 2018-03-28 12:44:28 +0000 |
commit | aed0267989e6b7a1bf9847ece91cf5b690e0d5d0 (patch) | |
tree | 28ab095878cd2a585d784456334a2230488a7c13 /sbin/ipfw/ipfw2.h | |
parent | f4043145f233a789237e21f2a43218789b50f174 (diff) | |
download | src-aed0267989e6b7a1bf9847ece91cf5b690e0d5d0.tar.gz src-aed0267989e6b7a1bf9847ece91cf5b690e0d5d0.zip |
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: 222705
Discussed with: melifaro
MFC after: 2 weeks
Sponsored by: Yandex LLC
Notes
Notes:
svn path=/head/; revision=331668
Diffstat (limited to 'sbin/ipfw/ipfw2.h')
-rw-r--r-- | sbin/ipfw/ipfw2.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sbin/ipfw/ipfw2.h b/sbin/ipfw/ipfw2.h index 3fe15e93431b..8acc4b9290d1 100644 --- a/sbin/ipfw/ipfw2.h +++ b/sbin/ipfw/ipfw2.h @@ -56,6 +56,12 @@ struct cmdline_opts { }; +enum { + TIMESTAMP_NONE = 0, + TIMESTAMP_STRING, + TIMESTAMP_NUMERIC, +}; + extern struct cmdline_opts co; /* |