1 #ifndef PPPOE_ACTIONS_H
2 #define PPPOE_ACTIONS_H 1
7 #include <rofl/common/logging.h>
8 #include <rofl/common/cmemory.h>
12 namespace experimental {
16 PPPOE_EXP_ID = 0x5555a780,
19 enum pppoe_action_type_t {
20 PPPOE_ACTION_PUSH_PPPOE,
21 PPPOE_ACTION_POP_PPPOE,
28 } __attribute__((packed));
34 } __attribute__((packed));
40 } __attribute__((packed));
54 set_exp_type(exptype);
105 get_exp_type()
const {
115 set_exp_type(uint16_t exptype) {
125 get_exp_len()
const {
135 set_exp_len(uint16_t explen) {
145 os <<
rofl::indent(0) <<
"<cofaction_exp_body_pppoe exp-type: 0x" <<
146 std::hex << (
unsigned int)body.get_exp_type() << std::dec
149 os << dynamic_cast<const rofl::cmemory&>( body );
163 uint16_t ethertype = 0) :
165 PPPOE_ACTION_PUSH_PPPOE,
167 set_ether_type(ethertype);
217 get_ether_type()
const {
227 set_ether_type(uint16_t ethertype) {
237 os <<
rofl::indent(0) <<
"<cofaction_push_pppoe ether-type: 0x" <<
238 std::hex << (
unsigned int)action.get_ether_type() << std::dec
241 os << dynamic_cast<const rofl::cmemory&>( action );
257 uint16_t ethertype = 0) :
259 PPPOE_ACTION_POP_PPPOE,
261 set_ether_type(ethertype);
311 get_ether_type()
const {
321 set_ether_type(uint16_t ethertype) {
331 os <<
rofl::indent(0) <<
"<cofaction_pop_pppoe ether-type: 0x" <<
332 std::hex << (
unsigned int)action.get_ether_type() << std::dec
335 os << dynamic_cast<const rofl::cmemory&>( action );
Definition: pppoe_actions.h:44
size_t memlen() const
Returns length of allocated memory area.
Definition: cmemory.cc:109
Definition: pppoe_actions.h:24
Definition: pppoe_actions.h:156
uint8_t * somem() const
Returns pointer to start of allocated memory area.
Definition: cmemory.cc:101
Definition: pppoe_actions.h:30
Definition: pppoe_actions.h:250
Definition: croflexception.h:65
Definition: pppoe_actions.h:36
C++ abstraction for malloc'ed memory areas.
Definition: cmemory.h:44
cmemory & operator=(cmemory const &m)
Assignment operator.
Definition: cmemory.cc:85