|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjpcap.packet.Packet
jpcap.packet.IPPacket
public class IPPacket
This class represents an IP packet.
Both IPv4 and IPv6 are supported.
Field Summary | |
---|---|
boolean |
d_flag
IP flag bit: [D]elay (v4) |
boolean |
dont_frag
Don't fragment flag (v4) |
java.net.InetAddress |
dst_ip
Destination IP address |
int |
flow_label
Flow label (v6) |
short |
hop_limit
Hop Limit, Time To Live (TTL) (v4/v6) |
int |
ident
IDENTIFICATION (v4) |
static short |
IPPROTO_HOPOPT
Protocol number for IPv6 hop-by-hop option |
static short |
IPPROTO_ICMP
Protocol number for ICMP |
static short |
IPPROTO_IGMP
Protocol number for IGMP |
static short |
IPPROTO_IP
Protocol number for IP in IP |
static short |
IPPROTO_IPv6
Protocol number for IPv6 |
static short |
IPPROTO_IPv6_Frag
Protocol number for fragment header for IPv6 |
static short |
IPPROTO_IPv6_ICMP
Protocol number for IPv6 ICMP |
static short |
IPPROTO_IPv6_NoNxt
Protocol number for no next header header for IPv6 |
static short |
IPPROTO_IPv6_Opts
Protocol number for destination option for IPv6 |
static short |
IPPROTO_IPv6_Route
Protocol number for routing header for IPv6 |
static short |
IPPROTO_TCP
Protocol number for TCP |
static short |
IPPROTO_UDP
Protocol number for UDP |
short |
length
Packet length (v4/v6) |
boolean |
more_frag
More fragment flag (v4) |
short |
offset
Fragment offset (v4) |
byte[] |
option
Option in IPv4 header (v4) |
java.util.List |
options
Option headers in IPv6Option (v6) |
byte |
priority
Priority (class) (v4/v6) |
short |
protocol
Protocol (v4/v6) |
boolean |
r_flag
IP flag bit: [R]eliability (v4) |
boolean |
rsv_frag
Fragmentation reservation flag (v4) |
byte |
rsv_tos
Type of Service (TOS) (v4/v6) |
java.net.InetAddress |
src_ip
Source IP address |
boolean |
t_flag
IP flag bit: [T]hrough (v4) |
byte |
version
IP version (v4/v6) |
Fields inherited from class jpcap.packet.Packet |
---|
caplen, data, datalink, EOF, header, len, sec, usec |
Constructor Summary | |
---|---|
IPPacket()
|
Method Summary | |
---|---|
void |
setIPv4Parameter(int priority,
boolean d_flag,
boolean t_flag,
boolean r_flag,
int rsv_tos,
boolean rsv_frag,
boolean dont_frag,
boolean more_frag,
int offset,
int ident,
int ttl,
int protocol,
java.net.InetAddress src,
java.net.InetAddress dst)
Sets the IPv4 parameters |
void |
setIPv6Parameter(int cls,
int flowlabel,
int nxt_hdr,
int hop_limit,
java.net.InetAddress src,
java.net.InetAddress dst)
Sets the IPv6 parameters |
java.lang.String |
toString()
Returns a string represenation of this packet. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public byte version
public byte priority
public boolean d_flag
public boolean t_flag
public boolean r_flag
public byte rsv_tos
public short length
public boolean rsv_frag
public boolean dont_frag
public boolean more_frag
public short offset
public short hop_limit
public short protocol
public static final short IPPROTO_ICMP
public static final short IPPROTO_IGMP
public static final short IPPROTO_IP
public static final short IPPROTO_TCP
public static final short IPPROTO_UDP
public static final short IPPROTO_IPv6
public static final short IPPROTO_HOPOPT
public static final short IPPROTO_IPv6_Route
public static final short IPPROTO_IPv6_Frag
public static final short IPPROTO_IPv6_ICMP
public static final short IPPROTO_IPv6_NoNxt
public static final short IPPROTO_IPv6_Opts
public int ident
public int flow_label
public java.net.InetAddress src_ip
public java.net.InetAddress dst_ip
public byte[] option
public java.util.List options
Constructor Detail |
---|
public IPPacket()
Method Detail |
---|
public void setIPv4Parameter(int priority, boolean d_flag, boolean t_flag, boolean r_flag, int rsv_tos, boolean rsv_frag, boolean dont_frag, boolean more_frag, int offset, int ident, int ttl, int protocol, java.net.InetAddress src, java.net.InetAddress dst)
d_flag
- IP flag bit: [D]elayt_flag
- IP flag bit: [T]hroughr_flag
- IP flag bit: [R]eliabilityrsv_tos
- Type of Service (TOS)priority
- Priorityrsv_frag
- Fragmentation Reservation flagdont_frag
- Don't fragment flagmore_frag
- More fragment flagoffset
- Offsetident
- Identifierttl
- Time To Liveprotocol
- Protocol src
- Source IP addressdst
- Destination IP addresspublic void setIPv6Parameter(int cls, int flowlabel, int nxt_hdr, int hop_limit, java.net.InetAddress src, java.net.InetAddress dst)
cls
- classflowlabel
- flow labelnxt_hdr
- next headerhop_limit
- hop limitsrc
- source addressdst
- destination addresspublic java.lang.String toString()
Format(IPv4): src_ip->dst_ip protocol(protocol) priority(priority) [D][T][R] hop(hop_limit) [RF/][DF/][MF] offset(offset) ident(ident)
Format(IPv6): src_ip->dst_ip protocol(protocol) priority(priority) flowlabel(flow_label) hop(hop_limit)
toString
in class Packet
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |