nexp-udp — User Datagram Protocol (UDP) support for Network Expect
PDU definition:
udp
( [src
=num
,] [dst
=num
,] [cksum
=num
,] [length
=num
] )
PDU decoding:
$udp(srcport)
, $udp(dstport)
,
$udp(length)
,
$udperror(srcport)
,
$udperror(dstport)
, $udperror(length)
src
= NUMSPEC
Specifies the source UDP port. Default: 1073.
dst
= NUMSPEC
Specifies the destination UDP port.
cksum
= NUMSPEC
Forces a specific UDP checksum. Default: valid, auto-calculated checksum of the UDP datagram.
length
= NUMSPEC
Forces a specific UDP length. Default: valid, auto-calculated length of the UDP datagram.
The following Tcl variables are available to Tcl scripts after any Network Expect command that reads and decodes packets has decoded a packet. Commands that read and decode packets include the expect_network family of commands as well as the pdu decode command.
The UDP source port the received UDP datagram.
The UDP destination port of the received UDP datagram.
The 16-bit length
field of the
received UDP datagram.
Network Expect UDP PDUs support the send_expect command.
The hash of an UDP PDU is the bitwise XOR of the source and destination UDP ports, which is a 16-bit value.
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 and the following conditions are met:
The source port of the injected UDP datagram is the same as the destination port of the received UDP datagram.
The destination port of the injected UDP datagram is the same as the source port of the received UDP datagram.