Package org.onlab.packet
Class PPPoED
- java.lang.Object
-
- org.onlab.packet.BasePacket
-
- org.onlab.packet.PPPoED
-
- All Implemented Interfaces:
IPacket
public class PPPoED extends BasePacket
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPPPoED.Type
-
Field Summary
Fields Modifier and Type Field Description protected bytecodeprotected shortpayloadLengthstatic bytePPPOED_CODE_PADIstatic bytePPPOED_CODE_PADOstatic bytePPPOED_CODE_PADRstatic bytePPPOED_CODE_PADSstatic bytePPPOED_CODE_PADTprotected shortsessionIdprotected java.util.List<PPPoEDTag>tagsprotected bytetypeprotected byteversion-
Fields inherited from class org.onlab.packet.BasePacket
parent, payload
-
-
Constructor Summary
Constructors Constructor Description PPPoED()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Deserializer<PPPoED>deserializer()Deserializer for PPPoED packets.bytegetCode()shortgetPayloadLength()shortgetSessionId()PPPoEDTaggetTag(short tagType)Gets a tag from the packet.java.util.ArrayList<PPPoEDTag>getTagList(short tagType)Gets a list of tags from the packet.java.util.List<PPPoEDTag>getTags()bytegetType()bytegetVersion()byte[]serialize()Sets all payloads parent packet if applicable, then serializes this packet and all payloads.voidsetCode(byte code)voidsetPayloadLength(short payloadLength)voidsetSessionId(short sessionId)PPPoEDTagsetTag(short tagType, byte[] value)Sets a tag in the packet.voidsetTags(java.util.List<PPPoEDTag> tags)voidsetType(byte type)voidsetVersion(byte version)java.lang.StringtoString()-
Methods inherited from class org.onlab.packet.BasePacket
clone, equals, getParent, getPayload, hashCode, resetChecksum, setParent, setPayload
-
-
-
-
Field Detail
-
version
protected byte version
-
type
protected byte type
-
code
protected byte code
-
sessionId
protected short sessionId
-
payloadLength
protected short payloadLength
-
tags
protected java.util.List<PPPoEDTag> tags
-
PPPOED_CODE_PADI
public static final byte PPPOED_CODE_PADI
- See Also:
- Constant Field Values
-
PPPOED_CODE_PADO
public static final byte PPPOED_CODE_PADO
- See Also:
- Constant Field Values
-
PPPOED_CODE_PADR
public static final byte PPPOED_CODE_PADR
- See Also:
- Constant Field Values
-
PPPOED_CODE_PADS
public static final byte PPPOED_CODE_PADS
- See Also:
- Constant Field Values
-
PPPOED_CODE_PADT
public static final byte PPPOED_CODE_PADT
- See Also:
- Constant Field Values
-
-
Method Detail
-
getVersion
public byte getVersion()
-
setVersion
public void setVersion(byte version)
-
getType
public byte getType()
-
setType
public void setType(byte type)
-
getCode
public byte getCode()
-
setCode
public void setCode(byte code)
-
getSessionId
public short getSessionId()
-
setSessionId
public void setSessionId(short sessionId)
-
getPayloadLength
public short getPayloadLength()
-
setPayloadLength
public void setPayloadLength(short payloadLength)
-
getTags
public java.util.List<PPPoEDTag> getTags()
-
setTags
public void setTags(java.util.List<PPPoEDTag> tags)
-
getTagList
public java.util.ArrayList<PPPoEDTag> getTagList(short tagType)
Gets a list of tags from the packet.- Parameters:
tagType- the type field of the required tags- Returns:
- List of the tags that match the type or an empty list if there is none
-
getTag
public PPPoEDTag getTag(short tagType)
Gets a tag from the packet.- Parameters:
tagType- the type field of the required tag- Returns:
- the first tag that matches the type or null if does not exist
-
setTag
public PPPoEDTag setTag(short tagType, byte[] value)
Sets a tag in the packet.- Parameters:
tagType- the type field of the tag to setvalue- value to be set- Returns:
- reference to the tag object
-
deserializer
public static Deserializer<PPPoED> deserializer()
Deserializer for PPPoED packets.- Returns:
- deserializer
-
serialize
public byte[] serialize()
Description copied from interface:IPacketSets all payloads parent packet if applicable, then serializes this packet and all payloads.- Returns:
- a byte[] containing this packet and payloads
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-