net.floodlightcontroller.packet
Class BasePacket

java.lang.Object
  extended by net.floodlightcontroller.packet.BasePacket
All Implemented Interfaces:
IPacket
Direct Known Subclasses:
ARP, BPDU, BSN, BSNPROBE, Data, DHCP, Ethernet, ICMP, IPv4, LLC, LLDP, TCP, UDP

public abstract class BasePacket
extends java.lang.Object
implements IPacket

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

Field Summary
static org.slf4j.Logger log
           
protected  IPacket parent
           
protected  IPacket payload
           
 
Constructor Summary
BasePacket()
           
 
Method Summary
 java.lang.Object clone()
          Clone this packet and its payload packet but not its parent.
 boolean equals(java.lang.Object obj)
           
 IPacket getParent()
           
 IPacket getPayload()
           
 int hashCode()
           
 void resetChecksum()
          Reset any checksums as needed, and call resetChecksum on all parents
 IPacket setParent(IPacket parent)
           
 IPacket setPayload(IPacket payload)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.floodlightcontroller.packet.IPacket
deserialize, serialize
 

Field Detail

log

public static final org.slf4j.Logger log

parent

protected IPacket parent

payload

protected IPacket payload
Constructor Detail

BasePacket

public BasePacket()
Method Detail

getParent

public IPacket getParent()
Specified by:
getParent in interface IPacket
Returns:
the parent

setParent

public IPacket setParent(IPacket parent)
Specified by:
setParent in interface IPacket
Parameters:
parent - the parent to set
Returns:

getPayload

public IPacket getPayload()
Specified by:
getPayload in interface IPacket
Returns:
the payload

setPayload

public IPacket setPayload(IPacket payload)
Specified by:
setPayload in interface IPacket
Parameters:
payload - the payload to set
Returns:

resetChecksum

public void resetChecksum()
Description copied from interface: IPacket
Reset any checksums as needed, and call resetChecksum on all parents

Specified by:
resetChecksum in interface IPacket

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

clone

public java.lang.Object clone()
Description copied from interface: IPacket
Clone this packet and its payload packet but not its parent.

Specified by:
clone in interface IPacket
Overrides:
clone in class java.lang.Object
Returns: