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