1 .\" $NetBSD: ipsend.5,v 1.3 2002/12/21 13:29:29 wiz Exp $
5 ipsend \- IP packet description language
7 The \fBipsend\fP program expects, with the \fB-L\fP option, input to be a
8 text file which fits the grammar described below. The purpose of this
9 grammar is to allow IP packets to be described in an arbitary way which
10 also allows encapsulation to be so done to an arbitary level.
14 line ::= iface | arp | send | defrouter | ipv4line .
16 iface ::= ifhdr "{" ifaceopts "}" ";" .
17 ifhdr ::= "interface" | "iface" .
18 ifaceopts ::= "ifname" name | "mtu" mtu | "v4addr" ipaddr |
21 send ::= "send" ";" | "send" "{" sendbodyopts "}" ";" .
22 sendbodyopts ::= sendbody [ sendbodyopts ] .
23 sendbody ::= "ifname" name | "via" ipaddr .
25 defrouter ::= "router" ipaddr .
27 arp ::= "arp" "{" arpbodyopts "}" ";" .
28 arpbodyopts ::= arpbody [ arpbodyopts ] .
29 arpbody ::= "v4addr" ipaddr | "eaddr" eaddr .
31 bodyline ::= ipv4line | tcpline | udpline | icmpline | dataline .
33 ipv4line ::= "ipv4" "{" ipv4bodyopts "}" ";" .
34 ipv4bodyopts ::= ipv4body [ ipv4bodyopts ] | bodyline .
35 ipv4body ::= "proto" protocol | "src" ipaddr | "dst" ipaddr |
36 "off" number | "v" number | "hl" number| "id" number |
37 "ttl" number | "tos" number | "sum" number | "len" number |
38 "opt" "{" ipv4optlist "}" ";" .
39 ipv4optlist ::= ipv4option [ ipv4optlist ] .
40 ipv4optlist = "nop" | "rr" | "zsu" | "mtup" | "mtur" | "encode" | "ts" |
41 "tr" | "sec" | "lsrr" | "e-sec" | "cipso" | "satid" |
42 "ssrr" | "addext" | "visa" | "imitd" | "eip" | "finn" |
43 "secclass" ipv4secclass.
44 ipv4secclass := "unclass" | "confid" | "reserv-1" | "reserv-2" |
45 "reserv-3" | "reserv-4" | "secret" | "topsecret" .
47 tcpline ::= "tcp" "{" tcpbodyopts "}" ";" .
48 tcpbodyopts ::= tcpbody [ tcpbodyopts ] | bodyline .
49 tcpbody ::= "sport" port | "dport" port | "seq" number | "ack" number |
50 "off" number | "urp" number | "win" number | "sum" number |
51 "flags" tcpflags | data .
53 udpline ::= "udp" "{" udpbodyopts "}" ";" .
54 udpbodyopts ::= udpbody [ udpbodyopts ] | bodyline .
55 udpbody ::= "sport" port | "dport" port | "len" number | "sum" number |
58 icmpline ::= "icmp" "{" icmpbodyopts "}" ";" .
59 icmpbodyopts ::= icmpbody [ icmpbodyopts ] | bodyline .
60 icmpbody ::= "type" icmptype [ "code" icmpcode ] .
61 icmptype ::= "echorep" | "echorep" "{" echoopts "}" ";" | "unreach" |
62 "unreach" "{" unreachtype "}" ";" | "squench" | "redir" |
63 "redir" "{" redirtype "}" ";" | "echo" "{" echoopts "}" ";" |
64 "echo" | "routerad" | "routersol" | "timex" |
65 "timex" "{" timextype "}" ";" | "paramprob" |
66 "paramprob" "{" parapptype "}" ";" | "timest" | "timestrep" |
67 "inforeq" | "inforep" | "maskreq" | "maskrep" .
69 echoopts ::= echoopts [ icmpechoopts ] .
70 unreachtype ::= "net-unr" | "host-unr" | "proto-unr" | "port-unr" |
71 "needfrag" | "srcfail" | "net-unk" | "host-unk" | "isolate" |
72 "net-prohib" | "host-prohib" | "net-tos" | "host-tos" |
73 "filter-prohib" | "host-preced" | "cutoff-preced" .
74 redirtype ::= "net-redir" | "host-redir" | "tos-net-redir" |
76 timextype ::= "intrans" | "reass" .
77 paramptype ::= "optabsent" .
79 data ::= "data" "{" databodyopts "}" ";" .
80 databodyopts ::= "len" number | "value" string | "file" filename .
82 icmpechoopts ::= "icmpseq" number | "icmpid" number .
86 Before sending any packets or defining any packets, it is necessary to
87 describe the interface(s) which will be used to send packets out.
90 is used to describe a network interface. The description included need
91 not match the actual configuration currently employed by the operating
95 is used to actually send out a packet across the network. If the
96 destination is not specified, it will attempt to send the packet
97 directly out on the network to the destination without routing it.
100 configures the default router for ipsend, as distinct from the default
101 route installed in the kernel.
104 is used to describe an IP (version 4) packet. IP header fields can be
105 specified, including options, followed by a data section which may contain
106 further protocol headers.
110 manually specifies the IP header length (automatically adjusts with the
111 presence of IP options and defaults to 5);
114 set the IP version. Default is 4.
117 set the type of service (TOS) field in the IP header. Default is 0.
120 manually specifies the length of the IP packet. The length will automatically
121 be adjusted to accommodate data or further protocol headers.
124 sets the fragment offset field of the IP packet. Default is 0.
127 sets the time to live (TTL) field of the IP header. Default is 60.
130 sets the protocol field of the IP header. The protocol can either be a
131 number or a name found in \fB/etc/protocols\fP.
134 manually specifies the checksum for the IP header. If left unset (0), it
135 will be calculated prior to being sent.
138 manually specifies the source address of the IP header. If left unset, it
139 will default to the host's IP address.
142 sets the destination of the IP packet. The default is 0.0.0.0.
145 is used to include IP options in the IP header.
148 is used to indicate the a TCP protocol header is to follow. See the \fBTCP\fP
149 section for TCP header options.
152 is used to indicate the a UDP protocol header is to follow. See the \fBUDP\fP
153 section for UDP header options.
156 is used to indicate the a ICMP protocol header is to follow. See the
157 \fBICMP\fP section for ICMP header options.
160 is used to indicate that raw data is to be included in the IP packet. See the
161 \fBDATA\fP section for details on options available.
163 these keywords indicate that the relevant IP option should be added to the
164 IP header (the header length field will be adjusted appropriately).
167 No Operation [RFC 791] (space filler).
170 Record Router [RFC 791]. The number given specifies the number of
171 \fBbytes\fP to be used for storage. This should be a multiple of 4 for
175 Experimental Measurement.
189 Traceroute [RFC 1393].
191 .B "sec-class <security-level>, sec"
192 Security [RFC 1108]. This option specifies the security label for the packet.
193 Using \fBsec\fP sets up the framework of the security option but unless
194 \fBsec-class\fP is given, the level may not be set.
196 .B "lsrr <ip-address>"
197 Loose Source Route [RFC 791].
200 Extended Security [RFC 1108].
208 .B "ssrr <ip-address>"
209 Strict Source Route [RFC 791].
215 Experimental Access Control.
218 IMI Traffic Descriptor.
224 Experimental Flow Control.
228 sets the source port to the number/name given. Default is 0.
231 sets the destination port to the number/name given. Default is 0.
234 sets the sequence number to the number specified. Default is 0.
237 sets the acknowledge number to the number specified. Default is 0.
240 sets the offset value for the start of data to the number specified. This
241 implies the size of the TCP header. It is automatically adjusted if TCP
242 options are included and defaults to 5.
245 sets the value of the urgent data pointer to the number specified. Default
249 sets the size of the TCP window to the number specified. Default is 4096.
252 manually specifies the checksum for the TCP pseudo-header and data. If left
253 unset, it defaults to 0 and is automatically calculated.
256 sets the TCP flags field to match the flags specified. Valid flags are
257 "S" (SYN), "A" (ACK), "R" (RST), "F" (FIN), "U" (URG), "P" (PUSH).
260 indicates that TCP header options follow. As TCP options are added to the
261 TCP header, the \fBoff\fP field is updated to match.
264 indicates that a data section is to follow and is to be included as raw
265 data, being appended to the header.
267 With a TCP header, it is possible to append a number of header options.
268 The TCP header offset will be updated automatically to reflect the change
269 in size. The valid options are: \fBnop\fP No Operation,
270 \fBeol\fP End Of (option) List, \fBmss [ size ]\fP Maximum Segment Size - this
271 sets the maximum receivable size of a packet containing data,
272 \fBwscale\fP Window Scale, \fBts\fP Timestamp.
276 sets the source port to the number/name given. Default is 0.
279 sets the destination port to the number/name given. Default is 0.
282 manually specifies the length of the UDP header and data. If left unset,
283 it is automatically adjusted to match the header presence and any data if
287 manually specifies the checksum for the UDP pseudo-header and data. If left
288 unset, it defaults to 0 and is automatically calculated.
291 indicates that a data section is to follow and is to be included as raw
292 data, being appended to the header.
296 sets the ICMP type according the to the icmptype tag. This may either be
297 a number or one of the recognised tags (see the \fBICMP TYPES\fP section for a
298 list of names recognised).
304 indicates that a data section is to follow and is to be included as raw
305 data, being appended to the header.
307 Each of the following extend the packet in a different way. \fBLen\fP just
308 increases the length (without adding any content), \fBvalue\fP uses a string
309 and \fBfile\fP a file.
312 extend the length of the packet by \fBnumber\fP bytes (without filling those
313 bytes with any particular data).
316 indicates that the string provided should be added to the current packet as
317 data. A string may be a consecutive list of characters and numbers (with
318 no white spaces) or bounded by "'s (may not contain them, even if \\'d).
319 The \\ character is recognised with the appropriate C escaped values, including
323 reads data in from the specified file and appends it to the current packet.
324 If the new total length would exceed 64k, an error will be reported.
330 .B "unreach [ unreachable-code ]"
331 Generic Unreachable error. This is used to indicate that an error has
332 occurred whilst trying to send the packet across the network and that the
333 destination cannot be reached. The unreachable code names are:
334 \fBnet-unr\fP network unreachable, \fBhost-unr\fP host unreachable,
335 \fBproto-unr\fP protocol unreachable, \fBport-unr\fP port unreachable,
336 \fBneedfrag\fP, \fBsrcfail\fP source route failed,
337 \fBnet-unk\fP network unknown, \fBhost-unk\fP host unknown,
338 \fBisolate\fP, \fBnet-prohib\fP administratively prohibited contact with
340 \fBhost-prohib\fP administratively prohibited contact with host,
341 \fBnet-tos\fP network unreachable with given TOS,
342 \fBhost-tos\fP host unreachable with given TOS,
343 \fBfilter-prohib\fP packet prohibited by packet filter,
350 .B "redir [ redirect-code ]"
351 Redirect (routing). This is used to indicate that the route being chosen
352 for forwarding the packet is suboptimal and that the sender of the packet
353 should be routing packets via another route. The redirect code names are:
354 \fBnet-redir\fP redirect packets for a network,
355 \fBhost-redir\fP redirect packets for a host,
356 \fBtos-net-redir\fP redirect packets for a network with a given TOS,
357 \fBtos-host-redir\fP redirect packets for a host with a given TOS.
363 Router Advertisement.
368 .B "timex [ timexceed-code ]"
369 Time Exceeded. This is used to indicate that the packet failed to reach the
370 destination because it was in transit too long (i.e. ttl reached 0). The
371 valid code names are: \fBintrans\fP,
372 \fBreass\fP could not reassemble packet from fragments within a given time.
374 .B "paramprob [ paramprob-code ]"
375 Parameter problem. There is only one available parameter problem code name:
381 .B "timestrep [ { timestamp-code } ]"
382 Time stamp reply. In a timestamp reply, it is possible to supply the
383 following values: \fBrtime\fP, \fBotime\fP, \fBttime\fP.
392 Address mask request.
403 ipsend(1), iptest(1), hosts(5), protocols(5), services(5)