public class IPV4Datagram extends java.lang.Object implements Datagram, DatagramPatch
Modifier and Type | Method and Description |
---|---|
boolean |
fromByteBuffer(java.nio.ByteBuffer b)
From ByteBuffer.
|
byte[] |
getChecksum()
Get the checksum
|
byte |
getChecksumLength()
Get the checksum size
|
byte[] |
getData()
Get payload
|
Address |
getDstAddress()
Get dst address.
|
int |
getDstPort()
Get dst port.
|
byte |
getFlags()
Get the flags
|
byte[] |
getHeader()
Get header
|
byte |
getHeaderLength()
Get the header len
|
int |
getLength()
Get the length of the data, i.e.
|
byte[] |
getPayload()
Get payload
|
byte |
getProtocol()
Get the protocol
|
Address |
getSrcAddress()
Get src address.
|
int |
getSrcPort()
Get src port.
|
short |
getTotalLength()
Get the total len
|
int |
getTTL()
Get the TTL
|
Datagram |
setDstAddress(Address addr)
Set the dst address
|
Datagram |
setDstPort(int p)
Set the dst port
|
Datagram |
setProtocol(int p)
Set the protocol
|
Datagram |
setSrcAddress(Address addr)
Set the src address
|
Datagram |
setSrcPort(int p)
Set the src port
|
Datagram |
setTTL(int ttl)
Set the TTL
|
java.nio.ByteBuffer |
toByteBuffer()
To ByteBuffer.
|
java.lang.String |
toString()
To String
|
boolean |
TTLReduce()
Reduce TTL and return true if packet still valid
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getChecksum, getChecksumLength, getData, getDstPort, getFlags, getHeader, getHeaderLength, getLength, getPayload, getProtocol, getSrcPort, getTotalLength, getTTL, setDstAddress, setDstPort, setProtocol, setSrcAddress, setSrcPort, setTTL, TTLReduce
fromByteBuffer, toByteBuffer
public Address getSrcAddress()
getSrcAddress
in interface Datagram
public Address getDstAddress()
getDstAddress
in interface Datagram
public int getLength()
public byte getHeaderLength()
getHeaderLength
in interface Datagram
public short getTotalLength()
getTotalLength
in interface Datagram
public byte getChecksumLength()
getChecksumLength
in interface Datagram
public byte getProtocol()
getProtocol
in interface Datagram
public Datagram setProtocol(int p)
setProtocol
in interface Datagram
public Datagram setSrcAddress(Address addr)
setSrcAddress
in interface Datagram
public Datagram setDstAddress(Address addr)
setDstAddress
in interface Datagram
public int getSrcPort()
getSrcPort
in interface Datagram
public Datagram setSrcPort(int p)
setSrcPort
in interface Datagram
public int getDstPort()
getDstPort
in interface Datagram
public Datagram setDstPort(int p)
setDstPort
in interface Datagram
public boolean TTLReduce()
public byte[] getPayload()
getPayload
in interface Datagram
public byte[] getChecksum()
getChecksum
in interface Datagram
public java.nio.ByteBuffer toByteBuffer()
toByteBuffer
in interface DatagramPatch
public boolean fromByteBuffer(java.nio.ByteBuffer b)
fromByteBuffer
in interface DatagramPatch
public java.lang.String toString()
toString
in class java.lang.Object
User Space Routing 0.10.3