Revised OpenFlow Library  v0.6.0dev
 All Classes Files Functions Variables Friends Groups Pages
Classes | Public Types | Public Member Functions | Friends | List of all members
rofl::fl2tpv3frame Class Reference

#include <fl2tpv3frame.h>

Classes

struct  l2tpv3_ctl_hdr_ip_encap_t
 
struct  l2tpv3_ctl_hdr_udp_encap_t
 
struct  l2tpv3_data_hdr_ip_encap_t
 
struct  l2tpv3_data_hdr_udp_encap_t
 
struct  l2tpv3_l2ssub_data_hdr_t
 

Public Types

enum  l2tpv3_ip_proto_t { L2TPV3_IP_PROTO = 115 }
 
enum  l2tp_version_t { L2TP_VERSION_2 = 2, L2TP_VERSION_3 = 3 }
 
enum  l2tp_encap_t { L2TP_ENCAP_IP = 1, L2TP_ENCAP_UDP = 2 }
 

Public Member Functions

struct
rofl::fl2tpv3frame::l2tpv3_ctl_hdr_udp_encap_t 
__attribute__ ((packed))
 
struct
rofl::fl2tpv3frame::l2tpv3_data_hdr_udp_encap_t 
__attribute__ ((packed))
 
struct
rofl::fl2tpv3frame::l2tpv3_l2ssub_data_hdr_t 
__attribute__ ((packed))
 
 fl2tpv3frame (enum l2tp_encap_t encap_type, uint8_t *data, size_t datalen)
 
 fl2tpv3frame (enum l2tp_encap_t encap_type, size_t len)
 
virtual void reset2 (enum l2tp_encap_t encap_type, uint8_t *data, size_t datalen)
 
virtual uint8_t * sopdu () const
 Returns pointer to begin of this PDU.
 
virtual size_t pdulen () const
 Returns length of this PDU.
 
virtual uint8_t * sosdu () const
 Returns pointer to begin of SDU encapsulated in this PDU (if any).
 
virtual size_t sdulen () const
 Returns length of this SDU.
 
std::string get_encap () const
 Return L2TPv3 encapsulation mode.
 
bool is_ctl_msg () const
 Returns true, when the message is a control message.
 
bool get_Tbit () const
 Returns L2TPv3 T-bit indicating the message type, true:control packet, false:data packet.
 
void set_Tbit (bool Tbit=true)
 Set L2TPv3 T-bit indicating the message type, true: control packet, false:data packet (default). Side effect: sets also the pseudo session id to 0.
 
bool get_Lbit () const
 Returns L2TPv3 L-bit indicating presence of the message length field (only valid for control messages)
 
void set_Lbit (bool Lbit=true)
 Set L2TPv3 L-bit indicating presence of the message length field (only valid for control messages)
 
bool get_Sbit () const
 Returns L2TPv3 S-bit indicating presence of the message fields Ns and Nr (only valid for control messages)
 
void set_Sbit (bool Sbit=true)
 Set L2TPv3 L-bit indicating presence of the message fields Ns and Nr (only valid for control messages)
 
uint8_t get_version () const
 Returns version of L2TP frame: currently only L2TPv3 is supported.
 
void set_version (uint8_t version=L2TP_VERSION_3)
 Set version of L2TP frame: currently only L2TPv3 is supported.
 
uint32_t get_session_id () const
 Return L2TPv3 session ID. The session ID is also present in a control message as a pseudo session id for IP encapsulation. More...
 
void set_session_id (uint32_t sid)
 Set L2TPv3 session ID. The session ID is also present in a control message as a pseudo session id for IP encapsulation. More...
 
uint16_t get_length () const
 Returns length field from L2TPv3 control message header. More...
 
void set_length (uint16_t len)
 Set length field in L2TPv3 control message header. More...
 
uint32_t get_ccid () const
 Return control connection ID field from L2TPv3 control message header. More...
 
void set_ccid (uint32_t ccid)
 Set control connection ID field in L2TPv3 control message header. More...
 
uint16_t get_Ns () const
 Returns Ns field from L2TPv3 control message header. More...
 
void set_Ns (uint16_t Ns)
 Set Ns field in L2TPv3 control message header. More...
 
uint16_t get_Nr () const
 Returns Nr field from L2TPv3 control message header. More...
 
void set_Nr (uint16_t Nr)
 Set Nr field in L2TPv3 control message header. More...
 
virtual bool complete () const
 
virtual size_t need_bytes () const
 
virtual void validate (uint16_t total_len=0) const
 
virtual void initialize ()
 
virtual void payload_insert (uint8_t *data, size_t datalen) throw (eFrameOutOfRange)
 
virtual uint8_t * payload () const throw (eFrameNoPayload)
 
virtual size_t payloadlen () const throw (eFrameNoPayload)
 
virtual const char * c_str ()
 
- Public Member Functions inherited from rofl::fframe
 fframe (uint8_t *_data=NULL, size_t _datalen=0)
 
 fframe (size_t len=DEFAULT_FFRAME_SIZE)
 
virtual ~fframe ()
 
virtual void reset (uint8_t *_data, size_t _datalen)
 
 fframe (const fframe &frame)
 
fframeoperator= (const fframe &frame)
 
virtual uint8_t & operator[] (size_t index) throw (eFrameOutOfRange)
 
virtual uint8_t * soframe () const
 
virtual size_t framelen () const
 
bool empty () const
 
void shift_left (size_t bytes)
 
void shift_right (size_t bytes)
 

Friends

std::ostream & operator<< (std::ostream &os, fl2tpv3frame const &f)
 

Additional Inherited Members

- Public Attributes inherited from rofl::fframe
fframenext
 
fframeprev
 

Detailed Description

we support UDP transport mode only for now

Inheritance diagram for rofl::fl2tpv3frame:
rofl::fframe

Member Function Documentation

bool fl2tpv3frame::complete ( ) const
virtual

returns boolean value indicating completeness of the packet

Reimplemented from rofl::fframe.

uint32_t fl2tpv3frame::get_ccid ( ) const

Return control connection ID field from L2TPv3 control message header.

Exceptions
eL2tpFrameNoCtlMsg
uint16_t fl2tpv3frame::get_length ( ) const

Returns length field from L2TPv3 control message header.

Exceptions
eL2tpFrameNoCtlMsg
uint16_t fl2tpv3frame::get_Nr ( ) const

Returns Nr field from L2TPv3 control message header.

Exceptions
eL2tpFrameNoCtlMsg
uint16_t fl2tpv3frame::get_Ns ( ) const

Returns Ns field from L2TPv3 control message header.

Exceptions
eL2tpFrameNoCtlMsg
uint32_t fl2tpv3frame::get_session_id ( ) const

Return L2TPv3 session ID. The session ID is also present in a control message as a pseudo session id for IP encapsulation.

Exceptions
eL2tpFrameNoDataMsg
void fl2tpv3frame::initialize ( )
virtual

initialize (set eth_hdr, pppoe_hdr)

Reimplemented from rofl::fframe.

size_t fl2tpv3frame::need_bytes ( ) const
virtual

returns the number of bytes this packet expects from the socket next

Reimplemented from rofl::fframe.

uint8_t * fl2tpv3frame::payload ( ) const
throw (eFrameNoPayload
)
virtual

get payload

Reimplemented from rofl::fframe.

void fl2tpv3frame::payload_insert ( uint8_t *  data,
size_t  datalen 
)
throw (eFrameOutOfRange
)
virtual

insert payload

Reimplemented from rofl::fframe.

size_t fl2tpv3frame::payloadlen ( ) const
throw (eFrameNoPayload
)
virtual

get payload length

Reimplemented from rofl::fframe.

void fl2tpv3frame::set_ccid ( uint32_t  ccid)

Set control connection ID field in L2TPv3 control message header.

Exceptions
eL2tpFrameNoCtlMsg
void fl2tpv3frame::set_length ( uint16_t  len)

Set length field in L2TPv3 control message header.

Exceptions
eL2tpFrameNoCtlMsg
void fl2tpv3frame::set_Nr ( uint16_t  Nr)

Set Nr field in L2TPv3 control message header.

Exceptions
eL2tpFrameNoCtlMsg
void fl2tpv3frame::set_Ns ( uint16_t  Ns)

Set Ns field in L2TPv3 control message header.

Exceptions
eL2tpFrameNoCtlMsg
void fl2tpv3frame::set_session_id ( uint32_t  sid)

Set L2TPv3 session ID. The session ID is also present in a control message as a pseudo session id for IP encapsulation.

Exceptions
eL2tpFrameNoDataMsg
void fl2tpv3frame::validate ( uint16_t  total_len = 0) const
virtual

validate (frame structure)

Reimplemented from rofl::fframe.


The documentation for this class was generated from the following files: