File: nexp-udp.5

package info (click to toggle)
netexpect 0.22-2
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 8,672 kB
  • ctags: 3,840
  • sloc: ansic: 19,903; sh: 14,032; xml: 3,280; yacc: 1,179; lex: 469; makefile: 185
file content (136 lines) | stat: -rw-r--r-- 3,287 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
.\"     Title: nexp-udp
.\"    Author: 
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
.\"      Date: 26 June 2007
.\"    Manual: 
.\"    Source: 
.\"
.TH "NEXP\-UDP" "5" "26 June 2007" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
nexp-udp \- User Datagram Protocol (UDP) support for Network Expect
.SH "SYNOPSIS"
.PP
PDU definition:
.HP 4
\fBudp\fR( [\fBsrc\fR=\fInum\fR,] [\fBdst\fR=\fInum\fR,] [\fBcksum\fR=\fInum\fR,] [\fBlength\fR=\fInum\fR] )
    
.PP
PDU decoding:
.PP

\fI$udp(srcport)\fR,
\fI$udp(dstport)\fR,
\fI$udp(length)\fR,
\fI$udperror(srcport)\fR,
\fI$udperror(dstport)\fR,
\fI$udperror(length)\fR
.SH "PDU DEFINITION"
.PP
\fBsrc\fR = \fINUMSPEC\fR
.RS 4
Specifies the source UDP port\&. Default: 1073\&.
.RE
.PP
\fBdst\fR = \fINUMSPEC\fR
.RS 4
Specifies the destination UDP port\&.
.RE
.PP
\fBcksum\fR = \fINUMSPEC\fR
.RS 4
Forces a specific UDP checksum\&. Default: valid, auto\-calculated checksum of the UDP datagram\&.
.RE
.PP
\fBlength\fR = \fINUMSPEC\fR
.RS 4
Forces a specific UDP length\&. Default: valid, auto\-calculated length of the UDP datagram\&.
.RE
.SH "PDU DECODING"
.PP
The following Tcl variables are available to Tcl scripts after any
\fBNetwork Expect\fR
command that reads and decodes packets has decoded a packet\&. Commands that read and decode packets include the
\fBexpect_network\fR
family of commands as well as the
\fBpdu decode\fR
command\&.
.PP
$udp(srcport)
.RS 4
The UDP source port the received UDP datagram\&.
.RE
.PP
$udp(dstport)
.RS 4
The UDP destination port of the received UDP datagram\&.
.RE
.PP
$udp(length)
.RS 4
The 16\-bit
\fIlength\fR
field of the received UDP datagram\&.
.RE
.SH "SEND_EXPECT SUPPORT"
.PP

\fBNetwork Expect\fR
UDP PDUs support the
\fBsend_expect\fR
command\&.
.PP
The hash of an UDP PDU is the bitwise XOR of the source and destination UDP ports, which is a 16\-bit value\&.
.PP
A received UDP PDU is considered to be a response to an injected stimulus if the hash of the received UDP datagram is the same as that of the injected stimulus
\fIand\fR
the following conditions are met:
.sp
.RS 4
\h'-04'\(bu\h'+03'The source port of the injected UDP datagram is the same as the destination port of the received UDP datagram\&.
.RE
.sp
.RS 4
\h'-04'\(bu\h'+03'The destination port of the injected UDP datagram is the same as the source port of the received UDP datagram\&.
.RE
.SH "EXAMPLES"
.sp
.RS 4
\h'-04' 1.\h'+02'A simple UDP datagram:
.sp
.RS 4
.nf
ip(dst = www\&.example\&.com)/udp(src = random, dst = 53)/raw(\'ABCDEFG\')
	
.fi
.RE
.RE
.sp
.RS 4
\h'-04' 2.\h'+02'A definition for an UDP datagram that forces a bogus length field in the UDP header:
.sp
.RS 4
.nf
ip(dst = www\&.example\&.com)/udp(src = random, dst = 53, \e
   length = 5)/raw(\'ABCDEFG\')
	
.fi
.RE
.RE
.SH "VERSION"
.PP
This man page is correct for version 1\&.0 of
\fBNetwork Expect\fR\&.
.SH "SEE ALSO"
.PP
nexp(1), nexp\-numspec(1)
.SH "AUTHOR"
.PP
UDP support for
\fBNetwork Expect\fR
was written by Eloy Paris <peloy@netexpect\&.org>\&. The "Send and Expect" functionality of the UDP module was borrowed from Scapy, the packet manipulation program written in Python by Philippe Biondi\&.
.PP
This man page was written by Eloy Paris\&.