|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectPacket
public class Packet
A Packet is a protocol data unit used at the interface between a TCPEntity and an Internet. A Packet has a type, identification number, sequence number, source TCPEntity, and destination TCPEntity. All of these attributes except for the identification number and the sequence number are specified when the Packet is constructed and cannot be changed.
The sequence number is normally assigned by the send side of a reliable data transfer protocol when it is initialized. The identification number can be set to simulate filling the packet with data, allowing a fixed set of packets to be reused for the duration of a connection.
Field Summary | |
---|---|
static java.lang.String |
ACK_TYPE
Packet.ACK_TYPE is the type for acknowledgement packets. |
static java.lang.String |
CLOSE_TYPE
Packet.CLOSE_TYPE is the type for packets that close a connection. |
static java.lang.String |
DATA_TYPE
Packet.DATA_TYPE is the type for data packets. |
static java.lang.String |
NACK_TYPE
Packet.NACK_TYPE is the type for negative acknowledgement packets. |
Constructor Summary | |
---|---|
Packet(TCPEntity src,
TCPEntity dest)
new Packet(src, dest) returns a new Packet. |
Method Summary | |
---|---|
Packet |
getCopy()
pkt.getCopy() returns a clone of pkt. |
TCPEntity |
getDestination()
pkt.getDestination() returns the destination TCPEntity of pkt. |
int |
getIdentificationNumber()
pkt.getIdentificationNumber() returns the identification number of pkt. |
int |
getSequenceNumber()
pkt.getSequenceNumber() returns the sequence number of pkt. |
TCPEntity |
getSource()
pkt.getSource() returns the source TCPEntity of pkt. |
java.lang.String |
getType()
pkt.getType() returns the type of pkt. |
void |
setIdentificationNumber(int id)
pkt.setIdentificationNumber(id) sets the identification number of pkt to id. |
void |
setSequenceNumber(int seq)
pkt.setSequenceNumber(seq) sets the sequence number of pkt to seq. |
void |
setType(java.lang.String typ)
pkt.setType(typ) sets the type of pkt to typ. |
java.lang.String |
toString()
pkt.toString() returns a String describing pkt. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DATA_TYPE
public static final java.lang.String ACK_TYPE
public static final java.lang.String NACK_TYPE
public static final java.lang.String CLOSE_TYPE
Constructor Detail |
---|
public Packet(TCPEntity src, TCPEntity dest)
Method Detail |
---|
public Packet getCopy()
public java.lang.String getType()
public void setType(java.lang.String typ)
public int getIdentificationNumber()
public void setIdentificationNumber(int id)
public int getSequenceNumber()
public void setSequenceNumber(int seq)
public TCPEntity getSource()
public TCPEntity getDestination()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |