hdlc
hdlc - configure the HDLC header for a Packet over Sonet frame
SYNOPSIS
hdlc sub-command options
DESCRIPTION
The hdlc command is used to configure the HDLC parameters.
STANDARD OPTIONS
address
The one-byte address field of the HDLC header used in conjunction with Packet over Sonet. Defined values include:
Option |
Value |
Usage |
---|---|---|
pppAddress |
0xff |
(default) |
ciscoAddress |
0x0f |
|
control
The one-byte control field of the HDLC header used in conjunction with Packet over Sonet. Defined values include:
Option |
Value |
Usage |
---|---|---|
pppControl |
0x03 |
(default) |
ciscoControl |
0x00 |
|
protocol
The two-byte protocol field of the HDLC header used in conjunction with Packet over Sonet. Defined values include:
Option |
Value |
Usage |
---|---|---|
pppIp |
0x0021 |
(default) |
ciscoIp |
0x0800 |
|
ciscoIpV6 |
0x86dd |
|
pppPaddingProtocol |
0x0001 |
|
pppOSI |
0x0023 |
|
pppXeroxIDP |
0x0025 |
|
pppDECnet |
0x0027 |
|
pppAppletalk |
0x0029 |
|
pppIPX |
0x002b |
|
pppCompressedTCPIP |
0x002d |
|
pppUncompressedTCPIP |
0x002f |
|
pppBPDU |
0x0031 |
|
pppSTII |
0x0033 |
|
pppBanyanVines |
0x0035 |
|
pppAppleTalkEDDP |
0x0039 |
|
pppAppleTalkSmartBuffered |
0x003b |
|
pppMultiLink |
0x003d |
|
pppFirstChoiceCompression |
0x00fd |
|
pppHelloPackets |
0x0201 |
|
pppIBMSourceRoutingBPDU |
0x0203 |
|
pppLuxcom |
0x0231 |
|
pppSigmaNetworkSystems |
0x0233 |
|
pppIPControlProtocol |
0x8021 |
|
pppOSIControlProtocol |
0x8023 |
|
pppXeroxIDPControlProtocol |
0x8025 |
|
pppDECnetControlProtocol |
0x8027 |
|
pppAppletalkControlProtocol |
0x8029 |
|
pppIPXControlProtocol |
0x802b |
|
pppBridgingNCP |
0x8031 |
|
pppMultiLinkControlProtocol |
0x803d |
|
pppComprControlProtocol |
0x80fd |
|
pppLinkControlProtocol |
0xc021 |
|
pppPasswordAuthProtocol |
0xc023 |
|
pppLinkQualityReport |
0xc025 |
|
COMMANDS
The hdlc command is invoked with the following sub-commands. If no sub-command is specified, returns a list of all sub-commands available.
hdlc cget option
Returns the current value of the configuration option given by option. Option may have any of the values accepted by the hdlc command.
hdlc config option value
Modify the configuration options of the hdlc. If no option is specified, returns a list describing all of the available options (see STANDARD OPTIONS) for hdlc.
hdlc decode capFrame chasID cardID portID [circuitID]
Decodes a captured frame in the capture buffer and makes the data available in the STANDARD OPTIONS through hdlc cget. The capFrame parameter must be obtained through a call to stream packetview. Specific errors are:
- No connection to a chassis
- Invalid port number
- The captured frame is not a valid Hdlc frame
- The port is not a Packet over Sonet port.
hdlc get chasID cardID portID [circuitID]
Gets the current configuration of the hdlc header for port with id portID on card cardID, chassis chasID from its hardware. Call this command before calling hdlc cget option value to get the value of the configuration option. Specific errors are:
- No connection to a chassis
- Invalid port number
- The port is not a Packet over Sonet port.
hdlc set chasID cardID portID [circuitID]
Sets the hdlc configuration of the port with id portID on card cardID, chassis chasID by reading the configuration option values set by the hdlc config option value command. Specific errors are:
- No connection to a chassis
- Invalid port number
- The configured parameters are not valid for this port
- The port is not a Packet over Sonet port.
hdlc setCisco protocolType chasID cardID portID
Sets the configuration of the hdlc header to ciscoAddress and ciscoControl in IxHAL for port with id portID on card cardID, chassis chasID. Specific errors are:
- No connection to a chassis
- Invalid port number
- The configured parameters are not valid for this port
- The port is not a Packet over Sonet port.
- The protocolType is not one of ciscoIp or ciscoIpV6.
hdlc setDefault
Sets to IxTclHal default values for all configuration options.
hdlc setPpp protocolType chasID cardID portID
Sets the configuration of the hdlc header to pppAddress and pppControl in IxHAL for port with id portID on card cardID, chassis chasID. Specific errors are:
- No connection to a chassis
- Invalid port number
- The configured parameters are not valid for this port
- The port is not a Packet over Sonet port.
- The protocolType is not pppIp.
EXAMPLES
package require IxTclHal
set addressByte($::pppAddress) "pppAddress"
set addressByte($::ciscoAddress) "ciscoAddress"
set controlByte($::pppControl) "pppControl"
set controlByte($::ciscoControl) "ciscoControl"
set protocolByte($::pppIp) "pppIp"
set protocolByte($::ciscoIp) "cisco"
set protocolByte($::pppPaddingProtocol) "pppPaddingProtocol"
set protocolByte($::pppOSI) "pppOSI"
set protocolByte($::pppXeroxIDP) "pppXeroxIDP"
set protocolByte($::pppDECnet) "pppDECnet"
set protocolByte($::pppAppletalk) "pppAppletalk"
set protocolByte($::pppIPX) "pppIPX"
set protocolByte($::pppCompressedTCPIP) "pppCompressedTCPIP"
set protocolByte($::pppUncompressedTCPIP) "pppUncompressedTCPIP"
set protocolByte($::pppBPDU) "pppBPDU"
set protocolByte($::pppSTII) "pppSTII"
set protocolByte($::pppBanyanVines) "pppBanyanVines"
set protocolByte($::pppAppleTalkEDDP) "pppAppletalkEDDP"
set protocolByte($::pppMultiLink) "pppMultiLink"
set protocolByte($::pppFirstChoiceCompression) "pppFirstChoiceCompression"
set protocolByte($::pppHelloPackets) "pppHelloPackets"
set protocolByte($::pppIBMSourceRoutingBPDU) "pppIBMSourceRoutingBPDU"
set protocolByte($::pppLuxcom) "pppLuxcom"
set protocolByte($::pppSigmaNetworkSystems) "pppSigmaNetworkSystems"
set protocolByte($::pppIPControlProtocol) "pppIPControlProtocol"
set protocolByte($::pppOSIControlProtocol) "pppOSIControlProtocol"
set protocolByte($::pppXeroxIDPControlProtocol) "pppXeroxIDPControlProtocol"
set protocolByte($::pppDECnetControlProtocol) "pppDECnetControlProtocol"
set protocolByte($::pppAppletalkControlProtocol) "pppAppletalkControlProtocol"
set protocolByte($::pppIPXControlProtocol) "pppIPXControlProtocol"
set protocolByte($::pppBridgingNCP) "pppBridgingNCP"
set protocolByte($::pppMultiLinkControlProtocol) "pppMultiLinkControlProtocol"
set protocolByte($::pppComprControlProtocol) "pppComprControlProtocol"
set protocolByte($::pppLinkControlProtocol) "pppLinkControlProtocol"
set protocolByte($::pppPasswordAuthProtocol) "pppPasswordAuthProtocol"
set protocolByte($::pppLinkQualityReport) "pppPasswordAuthProtocol"
proc printOptions {} \
{
set addr [hdlc cget -address]
set cntrl [hdlc cget -control]
set protocol [hdlc cget -protocol]
# ixPuts "address $addressByte($addr), control $controlByte($cntrl), \
# protocol $protocolByte($protocol)"
ixPuts "address $addr, control $cntrl, protocol $protocol"
}
# Connect to chassis and get chassis ID
set host galaxy
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]
# Assuming that a POS card is in slot 2
set card 2
set portList [list [list $chas $card 1] [list $chas $card 2]]
# 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
}
# Check for missing card
if {[card get $chas $card] != 0} \
{
ixPuts "Card $card does not exist"
break
}
# Get the type of card and check if it's the correct type
set cardType [card cget -type]
if {$cardType != $::cardPOS2Port} \
{
ixPuts "Card $card is not an 2 port POS card"
exit
}
# Set the options to default values
hdlc setDefault
ixWriteConfigToHardware portList
# Get the current hdlc state from the cards
hdlc get $chas $card 1
printOptions
# Set to Cisco values
hdlc setCisco ciscoIp $chas $card 1
ixWritePortsToHardware portList
set x [hdlc cget -address]
if {"0x$x" == $::ciscoAddress} {
ixPuts "OK"
} else {
ixPuts "NG"
}
ixStartPortCapture $chas $card 1
ixStartPortTransmit $chas $card 2
after 2000
capture get $chas $card 1
captureBuffer get $chas $card 1 1 1
captureBuffer getframe 1
set frameData [captureBuffer cget -frame]
# Now have hdlc decode the header
hdlc decode $frameData $chas $card 1
printOptions
# 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
}