public class IPv4
extends org.opendaylight.openflowplugin.libraries.liblldp.Packet
Constructor and Description |
---|
IPv4()
Default constructor that sets the version to 4, headerLength to 5,
and flags to 2.
|
IPv4(boolean writeAccess)
The write access to the packet is set in this constructor.
|
Modifier and Type | Method and Description |
---|---|
short |
getChecksum()
Gets the checksum value stored.
|
int |
getDestinationAddress()
Gets the destination IP address stored.
|
byte |
getDiffServ()
Gets the differential services value stored.
|
byte |
getECN()
Gets the ecn bits stored.
|
int |
getfieldnumBits(String fieldName) |
byte |
getFlags()
Gets the flag values stored.
|
short |
getFragmentOffset()
Gets the fragment offset stored.
|
int |
getHeaderLen()
Gets the IP header length stored.
|
int |
getHeaderSize()
Gets the header size in bits.
|
short |
getIdentification()
Gets the identification value stored.
|
byte[] |
getOptions()
gets the Options stored.
|
byte |
getProtocol()
Gets the protocol value stored.
|
int |
getSourceAddress()
Gets the source IP address stored.
|
short |
getTotalLength()
Gets the total length of the IP header in bytes.
|
byte |
getTtl()
Gets the TTL value stored.
|
byte |
getVersion()
Gets the IP version stored.
|
protected void |
postDeserializeCustomOperation(byte[] data,
int startBitOffset)
Method to perform post deserialization - like compare computed checksum with
the one obtained from IP header.
|
protected void |
postSerializeCustomOperation(byte[] data) |
IPv4 |
setDestinationAddress(InetAddress ipDestinationAddress)
Stores the IP destination address from the header.
|
IPv4 |
setDestinationAddress(int ipDestinationAddress)
Stores the IP destination address from the header.
|
IPv4 |
setDiffServ(byte ipdiffServ)
Stores the differential services value from the IP header.
|
IPv4 |
setECN(byte ecn)
Stores the ECN bits from the header.
|
IPv4 |
setFlags(byte ipFlags)
Stores the IP flags value.
|
IPv4 |
setFragmentOffset(short ipFragmentOffset)
Stores the IP fragmentation offset value.
|
void |
setHeaderField(String headerField,
byte[] readValue) |
IPv4 |
setHeaderLength(byte ipheaderLength)
Stores the length of IP header in words (4 bytes).
|
IPv4 |
setIdentification(short ipIdentification)
Stores the identification number from the header.
|
IPv4 |
setOptions(byte[] options)
Store the options from IP header.
|
void |
setPayload(org.opendaylight.openflowplugin.libraries.liblldp.Packet payload) |
IPv4 |
setProtocol(byte ipProtocol)
Stores the protocol value of the IP payload.
|
IPv4 |
setSourceAddress(InetAddress ipSourceAddress)
Stores the IP source address from the header.
|
IPv4 |
setTotalLength(short iptotalLength)
Stores the total length of IP header in bytes.
|
IPv4 |
setTtl(byte ipTtl)
Stores the TTL value.
|
IPv4 |
setVersion(byte ipVersion)
Stores the IP version from the header.
|
public IPv4()
public IPv4(boolean writeAccess)
writeAccess
- - booleanpublic byte getVersion()
public int getHeaderLen()
public int getHeaderSize()
getHeaderSize
in class org.opendaylight.openflowplugin.libraries.liblldp.Packet
public byte getDiffServ()
public byte getECN()
public short getTotalLength()
public short getIdentification()
public byte getFlags()
public byte getTtl()
public byte getProtocol()
public short getChecksum()
public short getFragmentOffset()
public int getSourceAddress()
public int getDestinationAddress()
public byte[] getOptions()
public void setHeaderField(String headerField, byte[] readValue)
setHeaderField
in class org.opendaylight.openflowplugin.libraries.liblldp.Packet
public IPv4 setVersion(byte ipVersion)
ipVersion
- the version to setpublic IPv4 setHeaderLength(byte ipheaderLength)
ipheaderLength
- the headerLength to setpublic IPv4 setDiffServ(byte ipdiffServ)
ipdiffServ
- the diffServ to setpublic IPv4 setECN(byte ecn)
ecn
- ECN bits to setpublic IPv4 setTotalLength(short iptotalLength)
iptotalLength
- the totalLength to setpublic IPv4 setIdentification(short ipIdentification)
ipIdentification
- the identification to setpublic IPv4 setFlags(byte ipFlags)
ipFlags
- the flags to setpublic IPv4 setFragmentOffset(short ipFragmentOffset)
ipFragmentOffset
- the fragmentOffset to setpublic IPv4 setTtl(byte ipTtl)
ipTtl
- the ttl to setpublic IPv4 setProtocol(byte ipProtocol)
ipProtocol
- the protocol to setpublic IPv4 setSourceAddress(InetAddress ipSourceAddress)
ipSourceAddress
- the sourceAddress to setpublic IPv4 setDestinationAddress(InetAddress ipDestinationAddress)
ipDestinationAddress
- the destination Address to setpublic IPv4 setDestinationAddress(int ipDestinationAddress)
ipDestinationAddress
- the destinationAddress to setpublic IPv4 setOptions(byte[] options)
options
- - byte[]public int getfieldnumBits(String fieldName)
getfieldnumBits
in class org.opendaylight.openflowplugin.libraries.liblldp.Packet
protected void postSerializeCustomOperation(byte[] data) throws org.opendaylight.openflowplugin.libraries.liblldp.PacketException
postSerializeCustomOperation
in class org.opendaylight.openflowplugin.libraries.liblldp.Packet
org.opendaylight.openflowplugin.libraries.liblldp.PacketException
public void setPayload(org.opendaylight.openflowplugin.libraries.liblldp.Packet payload)
setPayload
in class org.opendaylight.openflowplugin.libraries.liblldp.Packet
protected void postDeserializeCustomOperation(byte[] data, int startBitOffset)
postDeserializeCustomOperation
in class org.opendaylight.openflowplugin.libraries.liblldp.Packet
Copyright © 2019 OpenDaylight. All rights reserved.