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