net.floodlightcontroller.packet
Interface IPacket

All Known Implementing Classes:
ARP, BasePacket, BPDU, BSN, BSNPROBE, Data, DHCP, Ethernet, ICMP, IPv4, LLC, LLDP, TCP, UDP

public interface IPacket

Author:
David Erickson (daviderickson@cs.stanford.edu)

Method Summary
 java.lang.Object clone()
          Clone this packet and its payload packet but not its parent.
 IPacket deserialize(byte[] data, int offset, int length)
          Deserializes this packet layer and all possible payloads
 IPacket getParent()
           
 IPacket getPayload()
           
 void resetChecksum()
          Reset any checksums as needed, and call resetChecksum on all parents
 byte[] serialize()
          Sets all payloads parent packet if applicable, then serializes this packet and all payloads
 IPacket setParent(IPacket packet)
           
 IPacket setPayload(IPacket packet)
           
 

Method Detail

getPayload

IPacket getPayload()
Returns:

setPayload

IPacket setPayload(IPacket packet)
Parameters:
packet -
Returns:

getParent

IPacket getParent()
Returns:

setParent

IPacket setParent(IPacket packet)
Parameters:
packet -
Returns:

resetChecksum

void resetChecksum()
Reset any checksums as needed, and call resetChecksum on all parents


serialize

byte[] serialize()
Sets all payloads parent packet if applicable, then serializes this packet and all payloads

Returns:
a byte[] containing this packet and payloads

deserialize

IPacket deserialize(byte[] data,
                    int offset,
                    int length)
                    throws PacketParsingException
Deserializes this packet layer and all possible payloads

Parameters:
data -
offset - offset to start deserializing from
length - length of the data to deserialize
Returns:
the deserialized data
Throws:
PacketParsingException

clone

java.lang.Object clone()
Clone this packet and its payload packet but not its parent.

Returns: