udp

udp - configure the UDP parameters for a port on a card on a chassis

SYNOPSIS

DESCRIPTION

The udp command is used to configure the UDP-specific information used when building UDP type packets if ip config -ipProtocol has been set to Udp. See RFC 768 for a complete definition of UDP header fields. Note that stream get must be called before this command's get sub-command.

Note that when using ATM ports, different types of ATM encapsulation result in different length headers, as discussed in atmHeader. The data portion of the packet normally follows the header, except in the case of the two LLC Bridged Ethernet choices, where 12 octets of MAC address and 2 octets of Ethernet type follow the header. The offsets used in this command are with respect to the beginning of the AAL5 packet and must be adjusted by hand to account for the header.

STANDARD OPTIONS
checksum

Value of the checksum in the valid udp stream. Valid only if the stream set is performed and enableChecksumOverride is true. (default = {00 00})

checksumMode

Indicates whether a valid checksum should be inserted in the packet or not.

Option

Value

Usage

validChecksum

0

(default) a valid checksum is used

invalidChecksum

1

the checksum indicated in the checksum option is used

destPort

The port of the destination process. Well-known port values include:

Option

Value

Usage

echoServerPort

7

(default)

discardPacketPort

9

 

usersServerPort

11

 

dayAndTimeServerPort

13

 

quoteOfTheDayServerPort

17

 

characterGeneratorPort

19

 

timeServerPort

37

 

whoIsServerPort

43

 

domainNameServerPort

53

 

unassignedPort

63

 

bootpServerPort

67

 

bootpClientPort

68

 

tftpProtocolPort

69

 

remoteWhoServerPort

513

 

ripPort

520

 

ptpEventPort

319

 

ptpGeneralPort

320

 

enableChecksum

true/false

If set to true, a valid UDP checksum is calculated for each frame. If set to false, the UDP checksum is invalid. (default = false)

enableChecksum

Override true/false

If set to true, the calculated checksum is replaced with the value in checksum. (default = false)

length

Length of the datagram including header and the data. (default = 0)

lengthOverride true/false

Allows to change the length in udp header. (default = false)

sourcePort

The port of the sending process. Well-known port values include:

Option

Value

Usage

echoServerPort

7

(default)

discardPacketPort

9

 

usersServerPort

11

 

dayAndTimeServerPort

13

 

quoteOfTheDayServerPort

17

 

characterGeneratorPort

19

 

timeServerPort

37

 

whoIsServerPort

43

 

domainNameServerPort

53

 

unassignedPort

63

 

bootpServerPort

67

 

bootpClientPort

68

 

tftpProtocolPort

69

 

remoteWhoServerPort

513

 

ripPort

520

 

ptpEventPort

319

 

ptpGeneralPort

320

 

DEPRECATED OPTIONS
enableChecksum

This option is deprecated.

COMMANDS

The udp command is invoked with the following sub-commands. If no sub-command is specified, returns a list of all sub-commands available.

udp cget option

Returns the current value of the configuration option given by option. Option may have any of the values accepted by the udp command.

udp config option value

Modify the UDP configuration options of the port. If no option is specified, returns a list describing all of the available UDP options (see STANDARD OPTIONS) for port.

udp decode capFrame [chasID cardID portID]

Decodes a captured frame in the capture buffer and updates TclHal. udp cget option command can be used after decoding to get the option data.

udp get chasID cardID portID

Gets the current UDP configuration of the port with id portID on card cardID, chassis chasID. Note that stream get must be called before this command's get sub-command. Call this command before calling udp cget option to get the value of the configuration option.

udp set chasID cardID portID

Sets the UDP configuration of the indicated port by reading the configuration option values set by the udp config option value command.

udp setDefault

Sets to IxTclHal default values for all configuration options.

EXAMPLES

package require IxTclHal

# Connect to chassis and get chassis ID

set host localhost

set username user

# Check if we're running on UNIX - connect to the TCL Server

# which must be running on the chassis

if [isUNIX] {

if [ixConnectToTclServer $host] {

ixPuts "Could not connect to $host"

return 1

}

}

# Now connect to the chassis

if [ixConnectToChassis $host] {

ixPuts $::ixErrorInfo

return 1

}

# Get the chassis ID to use in port lists

set chas [ixGetChassisID $host]

# Assume card 4 has a TXS4, with every UDF function

set card 68

set port 1

set portList [list [list $chas $card $port]]

# Login before taking ownership

if [ixLogin $username] {

ixPuts $::ixErrorInfo

return 1

}

# Take ownership of the ports we'll use

if [ixTakeOwnership $portList] {

ixPuts $::ixErrorInfo

return 1

}

# Make sure the port is at factory default

port setFactoryDefaults $chas $card $port

stream setDefault

# UDF 3: normal counter mode, 8 bits counting up continuously

# from 0

udf setDefault

udf config -enable true

udf config -offset 12

udf config -udfSize c8

udf config -counterMode udfCounterMode

udf config -continuousCount true

udf config -updown uuuu

udf config -initval 00

# Set UDF 3

udf set 3

# UDF 1: 24-bits at offset 12 in packet

# Two ranges: start = 0x4200, increment by 14, repeat 100

# start = 0x100000, increment by 100, repeat 2

# Remove all existing range list items

udf clearRangeList

udf setDefault

udf config -enable true

udf config -counterMode udfRangeListMode

udf config -offset 12

udf config -udfSize c24

udf config -initval {00 00 42 00}

udf config -repeat 100

udf config -step 14

# Add the range to the UDF

udf addRange

udf config -initval {00 10 00 00}

udf config -repeat 2

udf config -step 100

# Add the second range to the UDF

udf addRange

# Set UDF 1

udf set 1

# UDF 2: 8-bits at offset 12 in packet

# Value list mode. Values are: 0x01, 0x10, 0x42

udf setDefault

udf config -enable true

udf config -counterMode udfValueListMode

udf config -offset 12

udf config -udfSize c8

udf config -valueList { { 00 00 00 01 } \

{ 00 00 00 10 } \

{ 00 00 00 42 } }

# Set UDF 2

udf set 2

# UDF4: 16 bits at offset 12

# Nested counters: Outer: start at 0x0100, step by 10,

# repeat 100 times

# Inner: repeat each value 2 times,

# step by 4, repeat 3 times

udf setDefault

udf config -enable true

udf config -offset 12

udf config -udfSize c16

udf config -counterMode udfNestedCounterMode

udf config -initval {01 00}

udf config -repeat 100

udf config -step 10

udf config -innerRepeat 2

udf config -innerStep 4

udf config -innerLoop 3

# Set UDF 4

udf set 4

# Make sure to use stream set to set the UDFs

stream set $chas $card $port 1

ixWriteConfigToHardware portList

# Let go of the ports that we reserved

ixClearOwnership $portList

# Disconnect from the chassis we're using

ixDisconnectFromChassis $host

# If we're running on UNIX, disconnect from the TCL Server

if [isUNIX] {

ixDisconnectTclServer $host

}

SEE ALSO

stream, protocol, ip