|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nachos.machine.Packet
public class Packet
A link-layer packet.
NetworkLink
Field Summary | |
---|---|
byte[] |
contents
The contents of this packet, excluding the link-layer header. |
int |
dstLink
The address of the destination link of this packet. |
static int |
headerLength
The number of bytes in a link-layer packet header. |
static int |
linkAddressLimit
The upper limit on Nachos link addresses. |
static int |
maxContentsLength
The maximum number of content bytes (not including the header). |
static int |
maxPacketLength
The maximum length, in bytes, of a packet that can be sent or received on the network. |
byte[] |
packetBytes
This packet, as an array of bytes that can be sent on a network. |
int |
srcLink
The address of the source link of this packet. |
Constructor Summary | |
---|---|
Packet(byte[] packetBytes)
Allocate a new packet using the specified array of bytes received from the network. |
|
Packet(int dstLink,
int srcLink,
byte[] contents)
Allocate a new packet to be sent, using the specified parameters. |
Method Summary |
---|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public byte[] packetBytes
public int dstLink
public int srcLink
public byte[] contents
public static final int headerLength
offset | size | value |
0 | 1 | network ID (collision detecting) |
1 | 1 | destination link address |
2 | 1 | source link address |
3 | 1 | length of contents |
public static final int maxPacketLength
public static final int maxContentsLength
public static final int linkAddressLimit
Constructor Detail |
---|
public Packet(int dstLink, int srcLink, byte[] contents) throws MalformedPacketException
dstLink
- the destination link address.srcLink
- the source link address.contents
- the contents of the packet.
MalformedPacketException
public Packet(byte[] packetBytes) throws MalformedPacketException
packetBytes
- the bytes making up this packet.
MalformedPacketException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |