Expand PMF_FN_* macros.
[netbsd-mini2440.git] / dist / ipf / BNF
blobef35d25e9f8a9ef6a6e6eb04a4f37ed4c6d935ce
1 filter-rule = [ insert ] action in-out [ options ] [ tos ] [ ttl ]
2               [ proto ] [ ip ] [ group ] [ tag ] [ pps ] .
4 insert  = "@" decnumber .
5 action  = block | "pass" | log | "count" | auth | call .
6 in-out  = "in" | "out" .
7 options = [ log ] [ "quick" ] [ onif [ dup ] [ froute ] ] .
8 tos     = "tos" decnumber | "tos" hexnumber .
9 ttl     = "ttl" decnumber .
10 proto   = "proto" protocol .
11 ip      = srcdst [ flags ] [ with withopt ] [ icmp ] [ keep ] .
12 group   = [ "head" decnumber ] [ "group" decnumber ] .
13 pps     = "pps" decnumber .
15 onif    = "on" interface-name [ "out-via" interface-name ] .
16 block   = "block" [ return-icmp[return-code] | "return-rst" ] .
17 auth    = "auth" | "preauth" .
18 log     = "log" [ "body" ] [ "first" ] [ "or-block" ] [ "level" loglevel ] .
19 tag     = "tag" tagid .
20 call    = "call" [ "now" ] function-name "/" decnumber.
21 dup     = "dup-to" interface-name[":"ipaddr] .
22 froute  = "fastroute" | "to" interface-name .
23 replyto = "reply-to" interface-name [ ":" ipaddr ] .
24 protocol = "tcp/udp" | "udp" | "tcp" | "icmp" | decnumber .
25 srcdst  = "all" | fromto .
26 fromto  = "from" object "to" object .
28 return-icmp = "return-icmp" | "return-icmp-as-dest" .
29 loglevel = facility"."priority | priority .
30 object  = addr [ port-comp | port-range ] .
31 addr    = "any" | nummask | host-name [ "mask" ipaddr | "mask" hexnumber ] .
32 port-comp = "port" compare port-num .
33 port-range = "port" port-num range port-num .
34 flags   = "flags" flag { flag } [ "/" flag { flag } ] .
35 with    = "with" | "and" .
36 icmp    = "icmp-type" icmp-type [ "code" decnumber ] .
37 return-code = "("icmp-code")" .
38 keep    = "keep" "state" [ "limit" number ] | "keep" "frags" .
40 nummask = host-name [ "/" decnumber ] .
41 host-name = ipaddr | hostname | "any" .
42 ipaddr  = host-num "." host-num "." host-num "." host-num .
43 host-num = digit [ digit [ digit ] ] .
44 port-num = service-name | decnumber .
46 withopt = [ "not" | "no" ] opttype [ [ "," ] withopt ] .
47 opttype = "ipopts" | "short" | "nat" | "bad-src" | "lowttl" | "frag" |
48           "mbcast" | "opt" ipopts  .
49 optname = ipopts [ "," optname ] .
50 ipopts  = optlist | "sec-class" [ secname ] .
51 secname = seclvl [ "," secname ] .
52 seclvl  = "unclass" | "confid" | "reserv-1" | "reserv-2" | "reserv-3" |
53           "reserv-4" | "secret" | "topsecret" .
54 icmp-type = "unreach" | "echo" | "echorep" | "squench" | "redir" |
55             "timex" | "paramprob" | "timest" | "timestrep" | "inforeq" |
56             "inforep" | "maskreq" | "maskrep"  | "routerad" |
57             "routersol" | decnumber .
58 icmp-code = decumber | "net-unr" | "host-unr" | "proto-unr" | "port-unr" |
59             "needfrag" | "srcfail" | "net-unk" | "host-unk" | "isolate" |
60             "net-prohib" | "host-prohib" | "net-tos" | "host-tos" |
61             "filter-prohib" | "host-preced" | "cutoff-preced" .
62 optlist = "nop" | "rr" | "zsu" | "mtup" | "mtur" | "encode" | "ts" | "tr" |
63           "sec" | "lsrr" | "e-sec" | "cipso" | "satid" | "ssrr" | "addext" |
64           "visa" | "imitd" | "eip" | "finn" .
65 facility = "kern" | "user" | "mail" | "daemon" | "auth" | "syslog" |
66            "lpr" | "news" | "uucp" | "cron" | "ftp" | "authpriv" |
67            "audit" | "logalert" | "local0" | "local1" | "local2" |
68            "local3" | "local4" | "local5" | "local6" | "local7" .
69 priority = "emerg" | "alert" | "crit" | "err" | "warn" | "notice" |
70            "info" | "debug" .
72 hexnumber = "0" "x" hexstring .
73 hexstring = hexdigit [ hexstring ] .
74 decnumber = digit [ decnumber ] .
76 compare = "=" | "!=" | "<" | ">" | "<=" | ">=" | "eq" | "ne" | "lt" | "gt" |
77           "le" | "ge" .
78 range   = "<>" | "><" .
79 hexdigit = digit | "a" | "b" | "c" | "d" | "e" | "f" .
80 digit   = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" .
81 flag    = "F" | "S" | "R" | "P" | "A" | "U" | "C" | "W" .