public class IPv6 extends BasePacket implements IExtensionHeader
| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
destinationAddress |
static byte |
FIXED_HEADER_LENGTH |
protected int |
flowLabel |
protected byte |
hopLimit |
protected byte |
nextHeader |
protected short |
payloadLength |
static byte |
PROTOCOL_AH |
static Map<Byte,Deserializer<? extends IPacket>> |
PROTOCOL_DESERIALIZER_MAP |
static byte |
PROTOCOL_DSTOPT |
static byte |
PROTOCOL_ESP |
static byte |
PROTOCOL_FRAG |
static byte |
PROTOCOL_HOPOPT |
static byte |
PROTOCOL_ICMP6 |
static byte |
PROTOCOL_ROUTING |
static byte |
PROTOCOL_TCP |
static byte |
PROTOCOL_UDP |
protected byte[] |
sourceAddress |
protected byte |
trafficClass |
protected byte |
version |
parent, payload| Constructor and Description |
|---|
IPv6()
Default constructor that sets the version to 6.
|
| Modifier and Type | Method and Description |
|---|---|
IPacket |
deserialize(byte[] data,
int offset,
int length)
Deserialize this packet layer and all possible payloads.
|
static Deserializer<IPv6> |
deserializer()
Deserializer function for IPv6 packets.
|
boolean |
equals(Object obj) |
byte[] |
getDestinationAddress()
Gets destination address.
|
int |
getFlowLabel()
Gets flow label.
|
byte |
getHopLimit()
Gets hop limit.
|
byte |
getNextHeader()
Gets the type of next header.
|
byte[] |
getSourceAddress()
Gets source address.
|
byte |
getTrafficClass()
Gets traffic class.
|
byte |
getVersion()
Gets IP version.
|
int |
hashCode() |
byte[] |
serialize()
Sets all payloads parent packet if applicable, then serializes this
packet and all payloads.
|
IPv6 |
setDestinationAddress(byte[] destinationAddress)
Sets destination address.
|
IPv6 |
setFlowLabel(int flowLabel)
Sets flow label.
|
IPv6 |
setHopLimit(byte hopLimit)
Sets hop limit.
|
IPv6 |
setNextHeader(byte nextHeader)
Sets the type of next header.
|
IPv6 |
setSourceAddress(byte[] sourceAddress)
Sets source address.
|
IPv6 |
setTrafficClass(byte trafficClass)
Sets traffic class.
|
IPv6 |
setVersion(byte version)
Sets IP version.
|
String |
toString() |
clone, getParent, getPayload, resetChecksum, setParent, setPayloadpublic static final byte FIXED_HEADER_LENGTH
public static final byte PROTOCOL_TCP
public static final byte PROTOCOL_UDP
public static final byte PROTOCOL_ICMP6
public static final byte PROTOCOL_HOPOPT
public static final byte PROTOCOL_ROUTING
public static final byte PROTOCOL_FRAG
public static final byte PROTOCOL_ESP
public static final byte PROTOCOL_AH
public static final byte PROTOCOL_DSTOPT
public static final Map<Byte,Deserializer<? extends IPacket>> PROTOCOL_DESERIALIZER_MAP
protected byte version
protected byte trafficClass
protected int flowLabel
protected short payloadLength
protected byte nextHeader
protected byte hopLimit
protected byte[] sourceAddress
protected byte[] destinationAddress
public byte getVersion()
public IPv6 setVersion(byte version)
version - the IP version to setpublic byte getTrafficClass()
public IPv6 setTrafficClass(byte trafficClass)
trafficClass - the traffic class to setpublic int getFlowLabel()
public IPv6 setFlowLabel(int flowLabel)
flowLabel - the flow label to setpublic byte getNextHeader()
IExtensionHeadergetNextHeader in interface IExtensionHeaderpublic IPv6 setNextHeader(byte nextHeader)
IExtensionHeadersetNextHeader in interface IExtensionHeadernextHeader - the next header to setpublic byte getHopLimit()
public IPv6 setHopLimit(byte hopLimit)
hopLimit - the hop limit to setpublic byte[] getSourceAddress()
public IPv6 setSourceAddress(byte[] sourceAddress)
sourceAddress - the IPv6 source address to setpublic byte[] getDestinationAddress()
public IPv6 setDestinationAddress(byte[] destinationAddress)
destinationAddress - the IPv6 destination address to setpublic byte[] serialize()
IPacketpublic IPacket deserialize(byte[] data, int offset, int length)
IPacketdeserialize in interface IPacketdata - bytes to deserializeoffset - offset to start deserializing fromlength - length of the data to deserializepublic int hashCode()
hashCode in class BasePacketpublic boolean equals(Object obj)
equals in class BasePacketpublic static Deserializer<IPv6> deserializer()
Copyright © 2016. All rights reserved.