simplegobacknpacket.java
来自「The Java Network Simulator is a Java imp」· Java 代码 · 共 49 行
JAVA
49 行
package jns.agent;
/**
SimpleGoBackNPacket implements the packets that are sent by the
SimpleGoBackN class. Packets of this type are put inside IP packets for
transfer.
*/
public class SimpleGoBackNPacket
{
// Header size in bytes. 16 sounds like a good number
public final static int HEADER_SIZE = 16;
// Connection setup and teardown flags
public final static int SYN = 1;
public final static int ACK = 2;
public final static int FIN = 4;
// Source port number
public int source_port;
// Destination port number
public int destination_port;
// Sequence number
public int sequence;
// ACK number
public int ack;
// Total length of this packet in bytes (including header)
public int length;
// Flags consisting of the constants defined above (for connection
// setup and teardown)
public int flags;
public Object data;
public SimpleGoBackNPacket()
{
source_port = destination_port = 0;
sequence = ack = 0;
flags = 0;
data = null;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?