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 class
PPPoED.Type
-
Field Summary
Fields Modifier and Type Field Description protected byte
code
protected short
payloadLength
static byte
PPPOED_CODE_PADI
static byte
PPPOED_CODE_PADO
static byte
PPPOED_CODE_PADR
static byte
PPPOED_CODE_PADS
static byte
PPPOED_CODE_PADT
protected short
sessionId
protected List<PPPoEDTag>
tags
protected byte
type
protected byte
version
-
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.byte
getCode()
short
getPayloadLength()
short
getSessionId()
PPPoEDTag
getTag(short tagType)
Gets a tag from the packet.ArrayList<PPPoEDTag>
getTagList(short tagType)
Gets a list of tags from the packet.List<PPPoEDTag>
getTags()
byte
getType()
byte
getVersion()
byte[]
serialize()
Sets all payloads parent packet if applicable, then serializes this packet and all payloads.void
setCode(byte code)
void
setPayloadLength(short payloadLength)
void
setSessionId(short sessionId)
PPPoEDTag
setTag(short tagType, byte[] value)
Sets a tag in the packet.void
setTags(List<PPPoEDTag> tags)
void
setType(byte type)
void
setVersion(byte version)
String
toString()
-
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
-
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)
-
getTagList
public 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:IPacket
Sets all payloads parent packet if applicable, then serializes this packet and all payloads.- Returns:
- a byte[] containing this packet and payloads
-
-