net.sourceforge.jpcap.net
Class IGMPPacket
java.lang.Object
|
+--net.sourceforge.jpcap.net.Packet
|
+--net.sourceforge.jpcap.net.EthernetPacket
|
+--net.sourceforge.jpcap.net.IPPacket
|
+--net.sourceforge.jpcap.net.IGMPPacket
- All Implemented Interfaces:
- EthernetFields, IGMPFields, IPFields
- public class IGMPPacket
- extends IPPacket
- implements IGMPFields
An IGMP packet.
Extends an IP packet, adding an IGMP header and IGMP data payload.
Fields inherited from interface net.sourceforge.jpcap.net.IPFields |
IP_CODE_LEN, IP_CODE_POS, IP_CSUM_LEN, IP_CSUM_POS, IP_DST_POS, IP_FRAG_LEN, IP_FRAG_POS, IP_HEADER_LEN, IP_ID_LEN, IP_ID_POS, IP_LEN_LEN, IP_LEN_POS, IP_SRC_POS, IP_TOS_LEN, IP_TOS_POS, IP_TTL_LEN, IP_TTL_POS, IP_VER_LEN, IP_VER_POS |
Constructor Summary |
IGMPPacket(int lLen,
byte[] bytes)
|
Method Summary |
int |
getChecksum()
Fetch the IGMP header checksum. |
java.lang.String |
getColor()
Fetch ascii escape sequence of the color associated with this packet type. |
byte[] |
getData()
fetch the IGMP data as a byte array |
java.lang.String |
getGroupAddress()
Fetch the IGMP group address. |
byte[] |
getHeader()
fetch the IGMP header as a byte array |
int |
getIGMPChecksum()
Fetch the IGMP header checksum. |
byte[] |
getIGMPData()
fetch the IGMP data as a byte array |
byte[] |
getIGMPHeader()
fetch the IGMP header a byte array |
int |
getMaxResponseTime()
Fetch the IGMP max response time. |
int |
getMessageType()
Fetch the IGMP message type, including subcode. |
java.lang.String |
toColoredString(boolean colored)
Generate string with contents describing this IGMP packet. |
java.lang.String |
toString()
Convert this IGMP packet to a readable string. |
Methods inherited from class net.sourceforge.jpcap.net.IPPacket |
computeReceiverChecksum, computeReceiverIPChecksum, computeSenderChecksum, computeSenderIPChecksum, getDestinationAddress, getDestinationAddressAsLong, getDestinationAddressBytes, getFragmentFlags, getFragmentOffset, getHeaderLength, getId, getIPChecksum, getIPData, getIPHeader, getIpHeaderLength, getIPHeaderLength, getIPProtocol, getLength, getProtocol, getSourceAddress, getSourceAddressAsLong, getSourceAddressBytes, getTimeToLive, getTypeOfService, getVersion, isValidChecksum, isValidIPChecksum, onesCompSum, toColoredVerboseString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
IGMPPacket
public IGMPPacket(int lLen,
byte[] bytes)
getIGMPHeader
public byte[] getIGMPHeader()
- fetch the IGMP header a byte array
getHeader
public byte[] getHeader()
- fetch the IGMP header as a byte array
- Overrides:
getHeader
in class IPPacket
getIGMPData
public byte[] getIGMPData()
- fetch the IGMP data as a byte array
getData
public byte[] getData()
- fetch the IGMP data as a byte array
- Overrides:
getData
in class IPPacket
getMessageType
public int getMessageType()
- Fetch the IGMP message type, including subcode. Return value can be
used with IGMPMessage.getDescription().
- Returns:
- a 2-byte value containing the message type in the high byte
and the message type subcode in the low byte.
getMaxResponseTime
public int getMaxResponseTime()
- Fetch the IGMP max response time.
getIGMPChecksum
public int getIGMPChecksum()
- Fetch the IGMP header checksum.
getChecksum
public int getChecksum()
- Fetch the IGMP header checksum.
- Overrides:
getChecksum
in class IPPacket
getGroupAddress
public java.lang.String getGroupAddress()
- Fetch the IGMP group address.
toString
public java.lang.String toString()
- Convert this IGMP packet to a readable string.
- Overrides:
toString
in class IPPacket
toColoredString
public java.lang.String toColoredString(boolean colored)
- Generate string with contents describing this IGMP packet.
- Overrides:
toColoredString
in class IPPacket
- Parameters:
colored
- whether or not the string should contain ansi
color escape sequences.
getColor
public java.lang.String getColor()
- Fetch ascii escape sequence of the color associated with this packet type.
- Overrides:
getColor
in class IPPacket