xref: /freebsd/sbin/ipf/iplang/BNF (revision 41edb306f05651fcaf6c74f9e3557f59f80292e1)
1*41edb306SCy Schubertline ::= iface | arp | send | defrouter | ipv4line .
2*41edb306SCy Schubert
3*41edb306SCy Schubertiface ::= ifhdr "{" ifaceopts "}" ";" .
4*41edb306SCy Schubertifhdr ::= "interface" | "iface" .
5*41edb306SCy Schubertifaceopts ::= "ifname" name | "mtu" mtu | "v4addr" ipaddr |
6*41edb306SCy Schubert	      "eaddr" eaddr .
7*41edb306SCy Schubert
8*41edb306SCy Schubertsend ::= "send" ";" | "send" "{" sendbodyopts "}" ";" .
9*41edb306SCy Schubertsendbodyopts ::= sendbody [ sendbodyopts ] .
10*41edb306SCy Schubertsendbody ::= "ifname" name | "via" ipaddr .
11*41edb306SCy Schubert
12*41edb306SCy Schubertdefrouter ::= "router" ipaddr .
13*41edb306SCy Schubert
14*41edb306SCy Schubertarp ::= "arp" "{" arpbodyopts "}" ";" .
15*41edb306SCy Schubertarpbodyopts ::= arpbody [ arpbodyopts ] .
16*41edb306SCy Schubertarpbody ::= "v4addr" ipaddr | "eaddr" eaddr .
17*41edb306SCy Schubert
18*41edb306SCy Schubertbodyline ::= ipv4line | tcpline | udpline | icmpline | dataline .
19*41edb306SCy Schubert
20*41edb306SCy Schubertipv4line ::= "ipv4" "{" ipv4bodyopts "}" ";" .
21*41edb306SCy Schubertipv4bodyopts ::= ipv4body [ ipv4bodyopts ] | bodyline .
22*41edb306SCy Schubertipv4body ::= "proto" protocol | "src" ipaddr | "dst" ipaddr |
23*41edb306SCy Schubert	     "off" number | "v" number | "hl" number| "id" number |
24*41edb306SCy Schubert	     "ttl" number | "tos" number | "sum" number | "len" number |
25*41edb306SCy Schubert	     "opt" "{" ipv4optlist "}" ";" .
26*41edb306SCy Schubertipv4optlist ::= ipv4option [ ipv4optlist ] .
27*41edb306SCy Schubertipv4optlist = "nop" | "rr" | "zsu" | "mtup" | "mtur" | "encode" | "ts" |
28*41edb306SCy Schubert	      "tr" | "sec" | "lsrr" | "e-sec" | "cipso" | "satid" |
29*41edb306SCy Schubert	      "ssrr" | "addext" | "visa" | "imitd" | "eip" | "finn" |
30*41edb306SCy Schubert	      "secclass" ipv4secclass.
31*41edb306SCy Schubertipv4secclass := "unclass" | "confid" | "reserv-1" | "reserv-2" |
32*41edb306SCy Schubert		"reserv-3" | "reserv-4" | "secret" | "topsecret" .
33*41edb306SCy Schubert
34*41edb306SCy Schuberttcpline ::= "tcp" "{" tcpbodyopts "}" ";" .
35*41edb306SCy Schuberttcpbodyopts ::= tcpbody [ tcpbodyopts ] | bodyline .
36*41edb306SCy Schuberttcpbody ::= "sport" port | "dport" port | "seq" number | "ack" number |
37*41edb306SCy Schubert	    "off" number | "urp" number | "win" number | "sum" number |
38*41edb306SCy Schubert	    "flags" tcpflags | data .
39*41edb306SCy Schubert
40*41edb306SCy Schubertudpline ::= "udp" "{" udpbodyopts "}" ";" .
41*41edb306SCy Schubertudpbodyopts ::= udpbody [ udpbodyopts ] | bodyline .
42*41edb306SCy Schubertudpbody ::= "sport" port | "dport" port | "len" number | "sum" number |
43*41edb306SCy Schubert	    data .
44*41edb306SCy Schubert
45*41edb306SCy Schuberticmpline ::= "icmp" "{" icmpbodyopts "}" ";" .
46*41edb306SCy Schuberticmpbodyopts ::= icmpbody [ icmpbodyopts ] | bodyline .
47*41edb306SCy Schuberticmpbody ::= "type" icmptype [ "code" icmpcode ] .
48*41edb306SCy Schuberticmptype ::= "echorep" | "echorep" "{" echoopts "}" ";" | "unreach" |
49*41edb306SCy Schubert	     "unreach" "{" unreachtype "}" ";" | "squench" | "redir" |
50*41edb306SCy Schubert	     "redir" "{" redirtype "}" ";" | "echo" "{" echoopts "}" ";" |
51*41edb306SCy Schubert	     "echo" | "routerad" | "routersol" | "timex" |
52*41edb306SCy Schubert	     "timex" "{" timextype "}" ";" | "paramprob" |
53*41edb306SCy Schubert	     "paramprob" "{" parapptype "}" ";" | "timest" | "timestrep" |
54*41edb306SCy Schubert	     "inforeq" | "inforep" | "maskreq" | "maskrep" .
55*41edb306SCy Schubert
56*41edb306SCy Schubertechoopts ::= echoopts [ icmpechoopts ] .
57*41edb306SCy Schubertunreachtype ::= "net-unr" | "host-unr" | "proto-unr" | "port-unr" |
58*41edb306SCy Schubert	     "needfrag" | "srcfail" | "net-unk" | "host-unk" | "isolate" |
59*41edb306SCy Schubert	     "net-prohib" | "host-prohib" | "net-tos" | "host-tos" |
60*41edb306SCy Schubert	     "filter-prohib" | "host-preced" | "cutoff-preced" .
61*41edb306SCy Schubertredirtype ::= "net-redir" | "host-redir" | "tos-net-redir" |
62*41edb306SCy Schubert	      "tos-host-redir" .
63*41edb306SCy Schuberttimextype ::= "intrans" | "reass" .
64*41edb306SCy Schubertparamptype ::= "optabsent" .
65*41edb306SCy Schubert
66*41edb306SCy Schubertdata	::= "data" "{" databodyopts "}" ";" .
67*41edb306SCy Schubertdatabodyopts ::= "len" number | "value" string | "file" filename .
68*41edb306SCy Schubert
69*41edb306SCy Schuberticmpechoopts ::= "icmpseq" number | "icmpid" number .
70