rip
rip - configure the RIP header parameters for a port on a card on a chassis
SYNOPSIS
rip sub-command options
DESCRIPTION
The rip command is used to configure the RIP header information used when building RIP-type packets. See RFCs 1058 and 1723 for a complete definition of RIP header fields. Note that stream get must be called before this command's get sub-command.
STANDARD OPTIONS
command
The command field of the RIP header. Defined values include:
Option |
Value |
Usage |
---|---|---|
ripRequest |
1 |
(default) a request for the responding system to send all or part of its routing table |
ripResponse |
2 |
response or update information from a sender |
ripTraceOn |
3 |
an obsolete message |
ripTraceOff |
4 |
an obsolete message |
ripReserved |
5 |
reserved for use by Sun Microsystems |
version
The version field of the RIP header. Defined values include:
Option |
Value |
Usage |
---|---|---|
ripVersion1 |
1 |
|
ripVersion2 |
2 |
(default) |
COMMANDS
The rip command is invoked with the following sub-commands. If no sub-command is specified, returns a list of all sub-commands available.
rip cget option
Returns the current value of the configuration option given by option. Option may have any of the values accepted by the rip command.
rip config option value
Modify the RIP configuration options of the port. If no option is specified, returns a list describing all of the available RIP options (see STANDARD OPTIONS) for port.
rip decode capFrame [chasID cardID portID]
Decodes a captured frame in the capture buffer and updates TclHal. rip cget option command can be used after decoding to get the option data. Specific errors are:
- No connection to a chassis
- Invalid port number
- The captured frame is not a valid Rip frame
rip get chasID cardID portID
Gets the current RIP 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 rip cget option to get the value of the configuration option. Specific errors are:
- No connection to a chassis
Invalid port number
rip set chasID cardID portID
Sets the RIP configuration of the port with id portID on card cardID, chassis chasID by reading the configuration option values set by the rip config option value command. Specific errors are:
- No connection to a chassis
- Invalid port number
- The port is being used by another user
The configured parameters are not valid for this port
rip setDefault
Sets to IxTclHal default values for all configuration options.
EXAMPLES
package require IxTclHal
# In this example weĆll generate a RIP packet with two route
# specifications
# Connect to chassis and get chassis ID
set host 400-031561
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 to be used is in slot 1
set card 1
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
}
# Put the port in loopback mode
port setFactoryDefaults $chas $card $port
port setDefault
# Stream: 1 packet at 1%
stream setDefault
stream config -numFrames 1
stream config -dma stopStream
stream config -rateMode usePercentRate
stream config -percentPacketRate 1
# Set up IP: udp with 72 byte packet
ip setDefault
ip config -ipProtocol udp
ip config -totalLength 72
ip set $chas $card $port
# Set up protocol
protocol setDefault
protocol config -ethernetType ethernetII
protocol config -name ipV4
protocol config -appName Rip
# Set up UDP
udp setDefault
udp config -sourcePort ripPort
udp config -destPort ripPort
udp set $chas $card $port
# Set up Rip in general
rip setDefault
rip config -command ripResponse
rip config -version 2
# Set up Rip Routes
ripRoute setDefault
ripRoute config -familyId 2
ripRoute config -routeTag 0
ripRoute config -metric 10
ripRoute config -ipAddress 192.168.36.1
ripRoute config -subnetMask 255.255.255.0
ripRoute config -nextHop 192.168.46.254
ripRoute set 1
ripRoute config -metric 20
ripRoute config -ipAddress 0.0.0.0
ripRoute config -nextHop 192.168.46.1
ripRoute set 2
rip set $chas $card $port
stream set $chas $card $port 1
port set $chas $card $port
ixWritePortsToHardware 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
}