summaryrefslogtreecommitdiff
path: root/sbin/pfctl/parse.y
AgeCommit message (Collapse)Author
2009-04-061) scrub rules are completely gone.Henning Brauer
2) packet reassembly: only one method remains, full reassembly. crop and drop-ovl are gone. . set reassemble yes|no [no-df] if no-df is given fragments (and only fragments!) with the df bit set have it cleared before entering the fragment cache, and thus the reassembled packet doesn't have df set either. it does NOT touch non-fragmented packets. 3) regular rules can have scrub options. . pass scrub(no-df, min-ttl 64, max-mss 1400, set-tos lowdelay) . match scrub(reassemble tcp, random-id) of course all options are optional. the individual options still do what they used to do on scrub rules, but everything is stateful now. 4) match rules "match" is a new action, just like pass and block are, and can be used like they do. opposed to pass or block, they do NOT change the pass/block state of a packet. i. e. . pass . match passes the packet, and . block . match blocks it. Every time (!) a match rule matches, i. e. not only when it is the last matching rule, the following actions are set: -queue assignment. can be overwritten later, the last rule that set a queue wins. note how this is different from the last matching rule wins, if the last matching rule has no queue assignments and the second last matching rule was a match rule with queue assignments, these assignments are taken. -rtable assignments. works the same as queue assignments. -set-tos, min-ttl, max-mss, no-df, random-id, reassemble tcp, all work like the above -logging. every matching rule causes the packet to be logged. this means a single packet can get logged more than once (think multiple log interfaces with different receivers, like pflogd and spamlogd) . almost entirely hacked at n2k9 in basel, could not be committed close to release. this really should have been multiple diffs, but splitting them now is not feasible any more. input from mcbride and dlg, and frantzen about the fragment handling. speedup around 7% for the common case, the more the more scrub rules were in use. manpage not up to date, being worked on.
2009-02-19spacingTheo de Raadt
2008-10-17in findeol(), do not skip the pushback buffer. fixes PR 5952 by sthen@ andHenning Brauer
should make the pushback buffer really transparent. diagnosis by me, fix with mpf, some input deraadt, ok mpf
2008-10-02implement "set state-defaults X", where X is a list of state options asHenning Brauer
permitted keep state(X). applies to all rules which do not have keep state explicitely. e. g. "set state-defaults pflow, no-sync" ok phessler deraadt
2008-09-10do not try to print $$ when it has not been setTheo de Raadt
2008-09-09welcome pflow(4), a netflow v5 compatible flow export interface.Henning Brauer
flows export data gathered from pf states. initial implementation by Joerg Goltermann <jg@osn.de>, guidance and many changes by me. 'put it in' theo
2008-08-07correctly copy the log interface spec when expanding an antispoof rule thatHenning Brauer
covers loopback addresses. ok ryan problem report from Harald Dunkel <harald.dunkel@aixigo.de>
2008-07-03do not forget to initialize other member of $$ in qname; noted by mark shroyerTheo de Raadt
ok henning
2008-06-10Make counters on table addresses optional and disabled by default.Ryan Thomas McBride
Use the 'counters' table option in pf.conf if you actually need them. If enabled, memory is not allocated until packets match an address. This saves about 40% memory if counters are not being used, and paves the way for some more significant cleanups coming soon. ok henning mpf deraadt
2008-06-10new state option "sloppy" to use the sloppy tcp state tracker insteadHenning Brauer
of the good one. ok theo ryan reyk
2008-05-09Replace a crockpot of semi-cloned productions for handling portTheo de Raadt
numbers with one, and fix a few other bugs along the way ok mpf henning
2008-05-09convert port byte order in the production; add port keyword; ok deraadt@Markus Friedl
2008-05-09divert packets to local socket without modifying the ip header;Markus Friedl
makes transparent proxies much easier; ok beck@, feedback claudio@
2008-05-08make "to any" optional in binat, or well, the implied default.Theo de Raadt
requested by reyk, ok reyk mpf
2008-05-08Loosen grammer to permit any number of newlines within most kinds of { }Theo de Raadt
blocks, as requested by reyk; ok reyk mpf henning
2008-05-08Bring back (in a more yacc friendly way) support for setting variablesTheo de Raadt
to a sequence of strings and numbers, which get folded together into one string (and later, when used, is re-lexed) ok mpf
2008-05-07do not assume PF_INOUT is 0 in the enum; ok mcbrideTheo de Raadt
2008-05-07scrub packets based on tags; ok henningMarkus Friedl
2008-05-07allow setting TOS with scrub; ok mcbride, claudioMarkus Friedl
2008-04-21optnl is a crutch for those who do not understand yacc. itTheo de Raadt
leads to a variety of errors; ok mcbride
2008-02-01Enable the rest of the filter_opts to be used on anchors. These were acceptedRyan Thomas McBride
by the parser but not passed to the kernel. This allows filtering based on uid, gid, icmp options, tcp flags, os fingerprint, tos, tags, and probability; It also allows the label to be set. State options and tagging are not permitted. ok henning mpf
2007-11-13Bring back the number converter for 'set hostid'.Marco Pfatschbacher
I forgot to think about hex numbers when I removed it. OK deraadt@
2007-11-12Remove space/tab compression function from lgetc() and replaceMarco Pfatschbacher
it with a simple filter in the yylex() loop. The compression in lgetc() didn't happen for quoted strings, thus creating a regression when tabs were used in variables. Some testing by todd@ and pyr@ OK deraadt@
2007-10-25Fix probability rules w/ numbers (e.g probability 0.4).Marco Pfatschbacher
Add support for probablities of 0% and 100%. With and OK deraadt@
2007-10-22sync with daemon parser code.Pierre-Yves Ritschard
ok deraadt@
2007-10-22pfctl does not need file secrecyTheo de Raadt
2007-10-16Allow unquoted numbers in variables.Marco Pfatschbacher
Change 'set hostid' to NUMBER and remove unneeded converter. Add '=' to allowed_to_end_number(x) to make varsets like 4=5 illegal. OK deraadt@
2007-10-16in the lex... even inside quotes, a \ followed by space or tab shouldTheo de Raadt
expand to space or tab, and a \ followed by newline should be ignored (as a line continuation). compatible with the needs of hoststated (which has the most strict quoted string requirements), and ifstated (where one commonly does line continuations in strings). pointed out by mpf, discussed with pyr
2007-10-13support an include directive; file of course must also be "secure" likeTheo de Raadt
the main configuration file; ok henning
2007-10-13in all these programs using the same pfctl-derived parse.y, re-unify theTheo de Raadt
yylex implementation and the code which interacts with yylex. this also brings the future potential for include support to all of the parsers. in the future please do not silly modifications to one of these files without checking if you are de-unifying the code. checked by developers in all these areas.
2007-10-11next step in the yylex unification: handle quoted strings in a nicer fashionTheo de Raadt
as found in hoststated, and make all the code diff as clean as possible. a few issues remain mostly surrounding include support, which will likely be added to more of the grammers soon. ok norby pyr, others
2007-10-01Backout NUMBER to string conversion.Marco Pfatschbacher
Requested by deraadt@
2007-09-27Add loginterface support for groups.Marco Pfatschbacher
Using a group sums up the statistics of all members. Modify pfctl(1) slightly to allow a groupname "all", which gives us an overall pf(4) statistic. OK henning@, markus@
2007-09-23Allow numbers to be used as unquoted strings again.Marco Pfatschbacher
While there, also restrict the use of concatenated, unquoted strings for variable assignments only. Eyeballed by markus@, OK henning@
2007-09-12add a missing range check for rtable ids; ok cloder henningTheo de Raadt
2007-09-12Add support to the lex for parsing number out of the stream. handleTheo de Raadt
this in the parser. because the new numbers are int64_t, many new range checks for < 0 are needed. re-check and improve all the existing rangechecks while at it. thanks for help by cloder and dhartmei
2007-08-30add support for address ranges ("from 10.1.2.50 - 10.1.3.75") in from/toDaniel Hartmeier
criteria. ok mcbride@
2007-06-21always initialize logif, from max laier, ok ryanHenning Brauer
2007-06-20Allow "log" for nat rules without "pass".Marco Pfatschbacher
OK henning@, ``passt scho'' markus@
2007-02-03in decide_address_family(), only limit a rule to a specific address familyDaniel Hartmeier
when ALL entries have this specific AF (when even just one entry has no specific AF, use any). found by Maurice Janssen, ok henning@
2006-11-07Unbreak authpf by handling non-inline anchors separately from the { } anchorsRyan Thomas McBride
as pf_find_or_create_ruleset() will mangle relative anchor names and wildcards. Also fixes some nits with nesting and printing inline anchors. ok deraadt@
2006-10-31Allow pfctl ruleset optimizer to be controlled from the ruleset.Ryan Thomas McBride
"set" "ruleset-optimization" [ "none" | "basic" | "profile" ] You can optionally control ruleset optimization with these keywords on the command line with the -o option; the command line setting will override the pf.conf setting. The existing -o/-oo flags continue to work as expected. cleanup and ok henning@
2006-10-31- don't allow anchors with _* names to be cleared or loaded from theRyan Thomas McBride
command line (but they can still be viewed) - don't allow users to specify _* as an anchor name in the ruleset - don't print _* anchor names with pfctl -sA unless -v is specified 'looks sensible' deraadt@
2006-10-28Load all rules into memory before loading into the kernel, and add supportRyan Thomas McBride
for anchors loaded inline in pf.conf, enclosed in a brace-delimited block ("{" "}"). anchor on fxp0 { pass in proto tcp port 22 } The anchor name is optional on inline loaded anchors. testing ckuethe@ ok henning@ dhartmei@
2006-10-25make absolutely sure logif is 0 unless set specifically, even if log is 0.Henning Brauer
logif is to be considered invalid unless log is set, but we need this to please the optimizer...
2006-10-25and another nit, $$.log should be set to 0 explicitely on quick without logHenning Brauer
2006-10-25urgs, $$.quick needs to be set to 0 explicitely on log (without quick)Henning Brauer
2006-10-25allow the log interface to be selected likeHenning Brauer
pass log(to pflog5) block out log(to pflog2) input & ok mcbride
2006-10-17Don't automatically set 'flags S/SA' on stateless rules.Ryan Thomas McBride
pointed out by david@ ok mpf@ dhartmei@
2006-10-11quotes around filename, pr 5253, sthen@zephyr.spacehopper.orgTheo de Raadt