|
SourceForge Jpcap | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.jpcap.net.Packet
net.sourceforge.jpcap.net.EthernetPacket
net.sourceforge.jpcap.net.CDP.Packet
public static class CDP.Packet
CDP Packet class.
| 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 | |
|---|---|
CDP.Packet(int lLen,
byte[] bytes)
Creates a new CDP packet |
|
CDP.Packet(int lLen,
byte[] bytes,
Timeval tv)
Create a new CDP packet. |
|
CDP.Packet(int lLen,
ByteBuffer bb,
Timeval tv)
Create a new CDP packet. |
|
| Method Summary | |
|---|---|
int |
getCDPChecksum()
|
byte[] |
getCDPData()
|
int |
getCDPTimeToLive()
|
int |
getCDPVersion()
|
void |
setCDPData(byte[] data)
Set the CDP data payload. |
void |
setCDPTimeToLive(int ttl)
Set the CDP time-to-live (TTL) |
void |
setCDPVersion(int version)
Set the CDP protocol version |
void |
setChecksums()
Set all the checksums in this packet prior to sending. |
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, 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 |
|---|
public CDP.Packet(int lLen,
byte[] bytes)
public CDP.Packet(int lLen,
byte[] bytes,
Timeval tv)
public CDP.Packet(int lLen,
ByteBuffer bb,
Timeval tv)
lLen - Packet lengthbb - Packet bytes in a ByteBuffertv - TimeValue| Method Detail |
|---|
public int getCDPVersion()
public void setCDPVersion(int version)
version - CDP protocol versionpublic int getCDPChecksum()
public int getCDPTimeToLive()
public void setCDPTimeToLive(int ttl)
ttl - CDP time-to-livepublic void setChecksums()
EthernetPacketPacketOutputStream.writePacket(Packet).
Derived classes must override this abstract method, and must call super.setChecksums(),
after setting their own checksums
(unless super.setChecksums() is abstract, i.e. this method).
Otherwise the lower-level checksums will not be correct.
After calling this method the EthernetPacket.hashCode() of this object will probably change.
setChecksums in class EthernetPacketpublic byte[] getCDPData()
public void setCDPData(byte[] data)
data - Payload data.public String toColoredString(boolean colored)
EthernetPacket
toColoredString in class EthernetPacketcolored - whether or not the string should contain ansi
color escape sequences.
|
Copyright © Patrick Charles & Jonas Lehmann, 2001; Esmond Pitt, 2008. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||