public class CapturedPacket
extends java.lang.Object
CapturedPacket represents a packet captured from the network.| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
contentType
HTTP content-type (if this is an HTTP packet).
|
private int |
flagACK
TCP flag ACK (if this is a TCP packet).
|
private int |
flagCWR
TCP flag CWR (if this is a TCP packet).
|
private int |
flagECN
TCP flag ECN (if this is a TCP packet).
|
private int |
flagFIN
TCP flag FIN (if this is a TCP packet).
|
private int |
flagPSH
TCP flag PSH (if this is a TCP packet).
|
private int |
flagRST
TCP flag RST (if this is a TCP packet).
|
private int |
flagSYN
TCP flag SYN (if this is a TCP packet).
|
private int |
flagURG
TCP flag URG (if this is a TCP packet).
|
private java.lang.String |
localIP
Local IP address of the packet.
|
private int |
localPort
Local transport layer port of the packet.
|
private char |
packetDirection
Direction of the packet.
|
private int |
packetSize
Size of the packet in Bytes.
|
private java.lang.String |
protocolName
Transport layer protocol name.
|
private java.lang.String |
remoteIP
Remote IP address of the packet.
|
private int |
remotePort
Remote transport layer port of the packet.
|
private long |
timestamp
Timestamp of the packet.
|
| Constructor and Description |
|---|
CapturedPacket()
Constructs the object.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getContentType()
Gets HTTP content-type (used for HTTP packets)
|
int |
getFlagACK()
Gets TCP ACK flag of the packet.
|
int |
getFlagCWR()
Gets TCP CWR flag of the packet.
|
int |
getFlagECN()
Gets TCP ECN flag of the packet.
|
int |
getFlagFIN()
Gets TCP FIN flag of the packet.
|
int |
getFlagPSH()
Gets TCP PSH flag of the packet.
|
int |
getFlagRST()
Gets TCP RST flag of the packet.
|
int |
getFlagSYN()
Gets TCP SYN flag of the packet.
|
int |
getFlagURG()
Gets TCP URG flag of the packet.
|
java.lang.String |
getLocalIP()
Gets local IP of the packet.
|
int |
getLocalPort()
Gets local transport layer port of the packet.
|
char |
getPacketDirection()
Gets direction of the packet.
|
int |
getPacketSize()
Gets size of the packet.
|
java.lang.String |
getProtocolName()
Gets transport layer protocol name.
|
java.lang.String |
getRemoteIP()
Gets remote IP of the packet.
|
int |
getRemotePort()
Gets remote transport layer port of the packet.
|
long |
getTimestamp()
Gets timestamp of the packet.
|
int |
hashCode()
Gets hash of the packet.
|
void |
setContentType(java.lang.String contentType)
Sets HTTP content-type (used for HTTP packets)
|
void |
setFlagACK(boolean flag)
Sets TCP ACK flag of the packet.
|
void |
setFlagCWR(boolean flag)
Sets TCP CWR flag of the packet.
|
void |
setFlagECN(boolean flag)
Sets TCP ECN flag of the packet.
|
void |
setFlagFIN(boolean flag)
Sets TCP FIN flag of the packet.
|
void |
setFlagPSH(boolean flag)
Sets TCP PSH flag of the packet.
|
void |
setFlagRST(boolean flag)
Sets TCP RST flag of the packet.
|
void |
setFlagSYN(boolean flag)
Sets TCP SYN flag of the packet.
|
void |
setFlagURG(boolean flag)
Sets TCP URG flag of the packet.
|
void |
setLocalIP(java.lang.String localIP)
Sets local IP address of the packet.
|
void |
setLocalPort(int localPort)
Sets local transport layer port of the packet.
|
void |
setPacketDirection(char packetDirection)
Sets direction of the packet.
|
void |
setPacketSize(int packetSize)
Sets size of the packet.
|
void |
setProtocolName(java.lang.String protocolName)
Sets transport layer protocol name of the packet.
|
void |
setRemoteIP(java.lang.String remoteIP)
Sets remote IP address of the packet.
|
void |
setRemotePort(int remotePort)
Sets remote transport layer port of the packet.
|
void |
setTimestamp(long usec)
Sets timestamp of the packet.
|
private java.lang.String localIP
private java.lang.String remoteIP
private int localPort
private int remotePort
private java.lang.String protocolName
private java.lang.String contentType
private char packetDirection
private int packetSize
private long timestamp
private int flagCWR
private int flagECN
private int flagURG
private int flagACK
private int flagPSH
private int flagRST
private int flagSYN
private int flagFIN
public void setLocalIP(java.lang.String localIP)
localIP - local IP addresspublic void setRemoteIP(java.lang.String remoteIP)
remoteIP - remote IP addresspublic void setLocalPort(int localPort)
localPort - local portpublic void setRemotePort(int remotePort)
remotePort - remote portpublic void setProtocolName(java.lang.String protocolName)
protocolName - public void setContentType(java.lang.String contentType)
contentType - content typepublic void setPacketDirection(char packetDirection)
packetDirection - direction of the packet: I = inbound, O = outbound.public void setPacketSize(int packetSize)
packetSize - size of the packet, measured in Bytespublic void setTimestamp(long usec)
usec - timestamp of the packet, measured in microsecondspublic void setFlagACK(boolean flag)
flag - flag: 0 = not exists, 1 = existspublic void setFlagCWR(boolean flag)
flag - flag: 0 = not exists, 1 = existspublic void setFlagECN(boolean flag)
flag - flag: 0 = not exists, 1 = existspublic void setFlagFIN(boolean flag)
flag - flag: 0 = not exists, 1 = existspublic void setFlagPSH(boolean flag)
flag - flag: 0 = not exists, 1 = existspublic void setFlagRST(boolean flag)
flag - flag: 0 = not exists, 1 = existspublic void setFlagSYN(boolean flag)
flag - flag: 0 = not exists, 1 = existspublic void setFlagURG(boolean flag)
flag - flag: 0 = not exists, 1 = existspublic java.lang.String getLocalIP()
public java.lang.String getRemoteIP()
public int getLocalPort()
public int getRemotePort()
public java.lang.String getProtocolName()
public java.lang.String getContentType()
public char getPacketDirection()
public int getPacketSize()
public long getTimestamp()
public int getFlagACK()
public int getFlagCWR()
public int getFlagECN()
public int getFlagFIN()
public int getFlagPSH()
public int getFlagRST()
public int getFlagSYN()
public int getFlagURG()
public int hashCode()
hashCode in class java.lang.Object