|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jnetpcap.nio.JMemory
org.jnetpcap.nio.JBuffer
org.jnetpcap.packet.JHeader
org.jnetpcap.packet.JHeaderMap<Ip4>
org.jnetpcap.protocol.network.Ip4
@Protocol(suite=NETWORK)
@Header(name="Ip4",
nicname="Ip",
osi=NETWORK,
suite=NETWORK,
spec="RFC792",
description="ip version 4")
public class Ip4IP version 4. Network layer internet protocol version 4. This is the main header file for Internet Protocol version 4. The header file defines various accessor methods for reading directly out of the Ip4 data structure found within the packet data buffer. The header is peered with the packet at appropriate offset into the buffer and data can be accessed via friendly accessor methods defined by this header, or by using JBuffer accessors. The header also performs decoding of the header, sepecifically decoding and attaching optional sub-headers to this header.
Ip4 header is the backbone of the internet.
| Nested Class Summary | |
|---|---|
static class |
Ip4.AddressExtension
The Class AddressExtension. |
static class |
Ip4.Encode
The Class Encode. |
static class |
Ip4.ExperimentalAccessControl
The Class ExperimentalAccessControl. |
static class |
Ip4.ExperimentalFlowControl
The Class ExperimentalFlowControl. |
static class |
Ip4.ExperimentalMeasurement
The Class ExperimentalMeasurement. |
static class |
Ip4.ExtendedIp
The Class ExtendedIp. |
static class |
Ip4.Flag
Enum table for Ip4.flags field. |
static class |
Ip4.IMITrafficDescriptor
The Class IMITrafficDescriptor. |
static class |
Ip4.Ip4Type
A table of IpTypes and their names. |
static class |
Ip4.IpOption
Baseclass for all Ip option headers. |
static class |
Ip4.LooseSourceRoute
Ip4 optional Loose Source Route header. |
static class |
Ip4.MtuProbe
The Class MtuProbe. |
static class |
Ip4.MtuReply
The Class MtuReply. |
static class |
Ip4.NoOp
Ip4 optional No Operation header. |
static class |
Ip4.RecordRoute
Ip4 optional Record Route header. |
static class |
Ip4.RouterAlert
The Class RouterAlert. |
static class |
Ip4.Routing
Ip4 optional Routing header. |
static class |
Ip4.Security
Ip4 optional Security header. |
static class |
Ip4.SelectiveDirectedBroadcastMode
The Class SelectiveDirectedBroadcastMode. |
static class |
Ip4.StreamId
Ip4 optional Stream ID header. |
static class |
Ip4.StrictSourceRoute
Ip4 optional Strict Source Route header. |
static class |
Ip4.Timestamp
Ip4 optional Timestamp header. |
static class |
Ip4.Traceroute
The Class Traceroute. |
| Nested classes/interfaces inherited from class org.jnetpcap.packet.JHeader |
|---|
JHeader.State |
| Nested classes/interfaces inherited from class org.jnetpcap.nio.JMemory |
|---|
JMemory.Type |
| Field Summary | |
|---|---|
static int |
DIFF_CODEPOINT
The Constant DIFF_CODEPOINT. |
static int |
DIFF_ECE
The Constant DIFF_ECE. |
static int |
DIFF_ECT
The Constant DIFF_ECT. |
static int |
FLAG_DONT_FRAGMENT
The Constant FLAG_DONT_FRAGMENT. |
static int |
FLAG_MORE_FRAGMENTS
The Constant FLAG_MORE_FRAGMENTS. |
static int |
FLAG_RESERVED
The Constant FLAG_RESERVED. |
static int |
ID
The Constant ID. |
| Fields inherited from class org.jnetpcap.packet.JHeaderMap |
|---|
MAX_HEADERS, optionsBitmap, optionsLength, optionsOffsets, X_HEADERS |
| Fields inherited from class org.jnetpcap.packet.JHeader |
|---|
annotatedHeader, BYTE, EMPTY_HEADER_ARRAY, isSubHeader, packet, state |
| Fields inherited from class org.jnetpcap.nio.JMemory |
|---|
JNETPCAP_LIBRARY_NAME, MAX_DIRECT_MEMORY_DEFAULT, POINTER |
| Constructor Summary | |
|---|---|
Ip4()
|
|
| Method Summary | |
|---|---|
int |
calculateChecksum()
Calculates a checksum using protocol specification for a header. |
int |
checksum()
Retrieves the header's checksum. |
void |
checksum(int value)
Checksum. |
java.lang.String |
checksumDescription()
Checksum description. |
boolean |
checkType(int type)
Check type. |
void |
clearFlags(int flags)
Clear flags. |
protected void |
decodeHeader()
Decode header. |
byte[] |
destination()
Destination. |
void |
destination(byte[] value)
Destination. |
byte[] |
destinationToByteArray(byte[] address)
Destination to byte array. |
int |
destinationToInt()
Converts the 32 bit Ip4 destination address to a java signed 32 bit integer. |
int |
flags_DF()
Flags_ df. |
java.lang.String |
flags_DFDescription()
Flags_ df description. |
int |
flags_MF()
Flags_ mf. |
java.lang.String |
flags_MFDescription()
Flags_ mf description. |
int |
flags_Reserved()
Flags_ reserved. |
int |
flags()
Retrives the flags header field as an unsigned integer, length of 3 bits, that has each Ip4 flag encoded as a bit field. |
void |
flags(int flags)
A setter method that changes the flag bits directly in the peered Ip4 header structure within the packet data buffer. |
java.util.Set<Ip4.Flag> |
flagsEnum()
Retrieves the flags field as a collection's set of enum constants that represent each flag. |
static int |
getHeaderLength(JBuffer buffer,
int offset)
Gets the header length. |
int |
hashCode()
Hash code. |
int |
hlen()
Hlen. |
void |
hlen(int value)
Hlen. |
java.lang.String |
hlenDescription()
Hlen description. |
int |
id()
Id. |
void |
id(int value)
Id. |
boolean |
isChecksumValid()
Checks if the checksum is valid, even for fragmented packets. |
boolean |
isFragment()
Checks if this is ip fragment of a larger PDU. |
int |
length()
Length. |
void |
length(int value)
Length. |
int |
offset()
Offset. |
void |
offset(int offset)
Offset. |
java.lang.String |
offsetDescription()
Offset description. |
byte[] |
source()
Converts the 32 bit Ip4 source address to a java signed 32 bit integer. |
void |
source(byte[] value)
Source. |
byte[] |
sourceToByteArray(byte[] address)
Source to byte array. |
int |
sourceToInt()
Source to int. |
int |
tos_Codepoint()
Tos_ codepoint. |
java.lang.String |
tos_CodepointDescription()
Tos_ codepoint description. |
int |
tos_ECE()
Tos_ ece. |
java.lang.String |
tos_ECEDescription()
Tos_ ece description. |
int |
tos_ECN()
Tos_ ecn. |
java.lang.String |
tos_ECNDescription()
Tos_ ecn description. |
int |
tos()
Tos. |
void |
tos(int value)
Tos. |
int |
ttl()
Ttl. |
void |
ttl(int value)
Ttl. |
int |
type()
Type. |
void |
type(int value)
Type. |
void |
type(Ip4.Ip4Type type)
Type. |
java.lang.String |
typeDescription()
Type description. |
Ip4.Ip4Type |
typeEnum()
Type enum. |
int |
version()
Version. |
void |
version(int value)
Version. |
| Methods inherited from class org.jnetpcap.packet.JHeaderMap |
|---|
getSubHeader, getSubHeaders, hasSubHeader, hasSubHeader, hasSubHeaders, setSubHeader, setSubHeaders |
| Methods inherited from class org.jnetpcap.nio.JBuffer |
|---|
findUTF8String, getByte, getByteArray, getByteArray, getByteArray, getDouble, getFloat, getInt, getLong, getShort, getUByte, getUInt, getUShort, getUTF8Char, getUTF8String, getUTF8String, getUTF8String, getUTF8String, isReadonly, order, order, peer, peer, peer, peer, setByte, setByteArray, setByteBuffer, setDouble, setFloat, setInt, setLong, setShort, setShort0, setUByte, setUInt, setUShort, transferFrom, transferFrom, transferFrom, transferTo, transferTo, transferTo |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int DIFF_CODEPOINT
public static final int DIFF_ECE
public static final int DIFF_ECT
public static final int FLAG_DONT_FRAGMENT
public static final int FLAG_MORE_FRAGMENTS
public static final int FLAG_RESERVED
public static final int ID
| Constructor Detail |
|---|
public Ip4()
| Method Detail |
|---|
@HeaderLength
public static int getHeaderLength(JBuffer buffer,
int offset)
buffer - the bufferoffset - the offset
@Dynamic(value=DESCRIPTION) public java.lang.String checksumDescription()
@Field(offset=80,
length=16,
format="%x")
public int checksum()
checksum in interface JHeaderChecksum@FieldSetter public void checksum(int value)
value - the valuepublic boolean checkType(int type)
type - the type
public void clearFlags(int flags)
flags - the flagsprotected void decodeHeader()
decodeHeader in class JHeaderJHeader.decodeHeader()
@Field(offset=128,
length=32,
format="#ip4#")
@FlowKey(index=0)
public byte[] destination()
@FieldSetter public void destination(byte[] value)
value - the valuepublic byte[] destinationToByteArray(byte[] address)
address - the address
public int destinationToInt()
@Field(offset=48,
length=3,
format="%x")
public int flags()
public java.util.Set<Ip4.Flag> flagsEnum()
@FieldSetter public void flags(int flags)
flags - new flags to set
@Field(parent="flags",
offset=2,
length=1,
display="reserved")
public int flags_Reserved()
@Field(parent="flags",
offset=1,
length=1,
display="DF: do not fragment")
public int flags_DF()
@Dynamic(value=DESCRIPTION) public java.lang.String flags_DFDescription()
@Field(parent="flags",
offset=0,
length=1,
display="MF: more fragments",
nicname="M")
public int flags_MF()
@Dynamic(value=DESCRIPTION) public java.lang.String flags_MFDescription()
public int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()
@Field(offset=4,
length=4,
format="%d")
public int hlen()
@FieldSetter public void hlen(int value)
value - the value@Dynamic(value=DESCRIPTION) public java.lang.String hlenDescription()
@Field(offset=32,
length=16,
format="%x")
public int id()
@FieldSetter public void id(int value)
value - the valuepublic boolean isFragment()
@Field(offset=16,
length=16,
format="%d")
public int length()
@FieldSetter public void length(int value)
value - the value@Dynamic(value=DESCRIPTION) public java.lang.String offsetDescription()
@Field(offset=51,
length=13,
format="%d")
public int offset()
@FieldSetter public void offset(int offset)
offset - the offset
@Field(offset=96,
length=32,
format="#ip4#")
@FlowKey(index=0)
public byte[] source()
@FieldSetter public void source(byte[] value)
value - the valuepublic byte[] sourceToByteArray(byte[] address)
address - the address
public int sourceToInt()
@Field(offset=8,
length=8,
format="%x",
display="diffserv")
public int tos()
@FieldSetter public void tos(int value)
value - the value
@Field(parent="tos",
offset=2,
length=6,
display="code point")
public int tos_Codepoint()
@Dynamic(value=DESCRIPTION) public java.lang.String tos_CodepointDescription()
@Field(parent="tos",
offset=0,
length=1,
display="ECE bit")
public int tos_ECE()
@Dynamic(value=DESCRIPTION) public java.lang.String tos_ECEDescription()
@Field(parent="tos",
offset=1,
length=1,
display="ECN bit")
public int tos_ECN()
@Dynamic(value=DESCRIPTION) public java.lang.String tos_ECNDescription()
@Field(offset=64,
length=8,
format="%d",
description="time to live")
public int ttl()
@FieldSetter public void ttl(int value)
value - the value
@Field(offset=72,
length=8,
format="%d")
@FlowKey(index=1)
public int type()
@FieldSetter public void type(int value)
value - the valuepublic void type(Ip4.Ip4Type type)
type - the type@Dynamic(value=DESCRIPTION) public java.lang.String typeDescription()
public Ip4.Ip4Type typeEnum()
@Field(offset=0,
length=4,
format="%d")
public int version()
@FieldSetter public void version(int value)
value - the valuepublic int calculateChecksum()
calculateChecksum in interface JHeaderChecksumpublic boolean isChecksumValid()
isChecksumValid in interface JHeaderChecksum
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||