SourceForge Jpcap

net.sourceforge.jpcap.net
Class STP.Packet

java.lang.Object
  extended by net.sourceforge.jpcap.net.Packet
      extended by net.sourceforge.jpcap.net.EthernetPacket
          extended by net.sourceforge.jpcap.net.STP.Packet
All Implemented Interfaces:
Serializable, EthernetFields
Enclosing interface:
STP

public static class STP.Packet
extends EthernetPacket

Encapsulates an Ethernet 802.3 Spanning Tree Protocol (STP) packet.

Since:
2.0.0.
Version:
$Revision: 1.1 $
Author:
Esmond Pitt
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sourceforge.jpcap.net.EthernetPacket
_byteBuffer, _bytes, _ethOffset, _timeval
 
Fields inherited from interface net.sourceforge.jpcap.net.EthernetFields
ETH_CODE_LEN, ETH_CODE_POS, ETH_DST_POS, ETH_HEADER_LEN, ETH_SRC_POS
 
Constructor Summary
STP.Packet(int lLen, byte[] bytes)
          Create a new STP packet.
STP.Packet(int lLen, byte[] bytes, Timeval tv)
          Create a new STP packet.
STP.Packet(int lLen, ByteBuffer bb, Timeval tv)
          Create a new STP packet.
 
Method Summary
 int getSTPBPDUFlags()
           
 int getSTPBPDUType()
           
 byte[] getSTPBridgeIdentifier()
           
 int getSTPForwardDelay()
           
 int getSTPHelloTime()
           
 int getSTPMaxAge()
           
 int getSTPMessageAge()
           
 int getSTPPortIdentifier()
           
 byte[] getSTPRootIdentifier()
           
 int getSTPRootPathCost()
           
 int getSTPVersion()
           
 void setSTPBPDUFlags(int flags)
          Set the BPDU flags
 void setSTPBPDUType(int type)
          Set the BPDU type
 void setSTPBridgeIdentifier(byte[] bridgeIdent)
          Set the Bridge Identifier
 void setSTPForwardDelay(int delay)
          Set the Forward Delay
 void setSTPHelloTime(int time)
          Set the HelloTime
 void setSTPMaxAge(int maxAge)
          Set the maximum age
 void setSTPMessageAge(int age)
          Set the Message Age
 void setSTPPortIdentifier(int id)
          Set the Port Identifier
 void setSTPRootIdentifier(byte[] rootIdent)
          Set the RootIdentifier
 void setSTPRootPathCost(int cost)
          Set the Root Path Cost
 void setSTPVersion(int version)
          Set the STP protocol version
 String toColoredString(boolean colored)
          Generate string with contents describing this packet.
 
Methods inherited from class net.sourceforge.jpcap.net.EthernetPacket
equals, getColor, getData, getDestinationHwAddress, getDestinationMACAddress, getEthernetCRC32, getEthernetData, getEthernetHeader, getEthernetHeaderLength, getEthernetProtocol, getHeader, getHeaderLength, getPacketData, getPacketLength, getProtocol, getSourceHwAddress, getSourceMACAddress, getTimeval, hashCode, setChecksums, setDestinationMACAddress, setEthernetProtocol, setSourceMACAddress, toByteArray, toString
 
Methods inherited from class net.sourceforge.jpcap.net.Packet
getChecksum, ipChecksum, isValidChecksum
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

STP.Packet

public STP.Packet(int lLen,
                  byte[] bytes)
Create a new STP packet.

Parameters:
lLen - Packet length
bytes - Packet bytes

STP.Packet

public STP.Packet(int lLen,
                  byte[] bytes,
                  Timeval tv)
Create a new STP packet.

Parameters:
lLen - Packet length
bytes - Packet bytes
tv - TimeValue

STP.Packet

public STP.Packet(int lLen,
                  ByteBuffer bb,
                  Timeval tv)
Create a new STP packet.

Parameters:
lLen - Packet length
bb - Packet bytes in a ByteBuffer
tv - TimeValue
Method Detail

getSTPVersion

public int getSTPVersion()
Returns:
the STP protocol version

setSTPVersion

public void setSTPVersion(int version)
Set the STP protocol version

Parameters:
version - STP protocol version

getSTPBPDUType

public int getSTPBPDUType()
Returns:
the BPDU type

setSTPBPDUType

public void setSTPBPDUType(int type)
Set the BPDU type

Parameters:
type - BPDU type

getSTPBPDUFlags

public int getSTPBPDUFlags()
Returns:
the BPDU flags

setSTPBPDUFlags

public void setSTPBPDUFlags(int flags)
Set the BPDU flags

Parameters:
flags - BPDU flags

getSTPRootIdentifier

public byte[] getSTPRootIdentifier()
Returns:
the Root Identifier

setSTPRootIdentifier

public void setSTPRootIdentifier(byte[] rootIdent)
Set the RootIdentifier

Parameters:
rootIdent - RootIdentifier

getSTPRootPathCost

public int getSTPRootPathCost()
Returns:
the Root path cost

setSTPRootPathCost

public void setSTPRootPathCost(int cost)
Set the Root Path Cost

Parameters:
cost - Root Path Cost

getSTPBridgeIdentifier

public byte[] getSTPBridgeIdentifier()
Returns:
the Bridge Identifier

setSTPBridgeIdentifier

public void setSTPBridgeIdentifier(byte[] bridgeIdent)
Set the Bridge Identifier

Parameters:
bridgeIdent - Bridge Identifier

getSTPPortIdentifier

public int getSTPPortIdentifier()
Returns:
the Port identifier

setSTPPortIdentifier

public void setSTPPortIdentifier(int id)
Set the Port Identifier

Parameters:
id - Port Identifier

getSTPMessageAge

public int getSTPMessageAge()
Returns:
the Message Age

setSTPMessageAge

public void setSTPMessageAge(int age)
Set the Message Age

Parameters:
age - Message Age

getSTPMaxAge

public int getSTPMaxAge()
Returns:
the maximum age

setSTPMaxAge

public void setSTPMaxAge(int maxAge)
Set the maximum age

Parameters:
maxAge - Maximum age

getSTPHelloTime

public int getSTPHelloTime()
Returns:
the Hello time

setSTPHelloTime

public void setSTPHelloTime(int time)
Set the HelloTime

Parameters:
time - Time

getSTPForwardDelay

public int getSTPForwardDelay()
Returns:
the forward delay

setSTPForwardDelay

public void setSTPForwardDelay(int delay)
Set the Forward Delay

Parameters:
delay - Delay

toColoredString

public String toColoredString(boolean colored)
Description copied from class: EthernetPacket
Generate string with contents describing this packet.

Overrides:
toColoredString in class EthernetPacket
Parameters:
colored - whether or not the string should contain ansi color escape sequences.

Copyright © Patrick Charles & Jonas Lehmann, 2001; Esmond Pitt, 2008.