Revised OpenFlow Library  v0.6.0dev
 All Classes Files Functions Variables Friends Groups Pages
pppoe_matches.h
1 #ifndef PPPOE_MATCHES
2 #define PPPOE_MATCHES 1
3 
4 #include <rofl/common/openflow/coxmatch.h>
5 
6 namespace rofl {
7 namespace openflow {
8 namespace experimental {
9 namespace pppoe {
10 
11 static uint16_t const OFPXMC_EXPERIMENTER = 0xffff;
12 
13 /* OXM Flow match field types for OpenFlow Experimental */
14 enum oxm_ofx_match_fields {
15  /* PPP/PPPoE related extensions */
16  OFPXMT_OFX_PPPOE_CODE = 21, /* PPPoE code */
17  OFPXMT_OFX_PPPOE_TYPE = 22, /* PPPoE type */
18  OFPXMT_OFX_PPPOE_SID = 23, /* PPPoE session id */
19  OFPXMT_OFX_PPP_PROT = 24, /* PPP protocol */
20 };
21 
22 /* OXM Flow match field types for OpenFlow basic class. */
23 enum oxm_tlv_match_fields {
24  OXM_TLV_EXPR_PPPOE_CODE = (OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_PPPOE_CODE << 9) | 1,
25  OXM_TLV_EXPR_PPPOE_TYPE = (OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_PPPOE_TYPE << 9) | 1,
26  OXM_TLV_EXPR_PPPOE_SID = (OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_PPPOE_SID << 9) | 2,
27  OXM_TLV_EXPR_PPP_PROT = (OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_PPP_PROT << 9) | 2,
28 };
29 
30 
35 public:
37  uint8_t code) :
38  coxmatch(OXM_TLV_EXPR_PPPOE_CODE, code) {};
40  coxmatch const& oxm) :
41  coxmatch(oxm) {};
42  virtual
44  friend std::ostream&
45  operator<< (std::ostream& os, coxmatch_ofx_pppoe_code const& oxm) {
46  os << dynamic_cast<coxmatch const&>(oxm);
47  os << indent(2) << "<pppoe-code: "
48  << (int)oxm.get_u8value()
49  << " >" << std::endl;
50  return os;
51  };
52 };
53 
54 
59 public:
61  uint8_t type) :
62  coxmatch(OXM_TLV_EXPR_PPPOE_TYPE, type) {};
64  coxmatch const& oxm) :
65  coxmatch(oxm) {};
66  virtual
68  friend std::ostream&
69  operator<< (std::ostream& os, coxmatch_ofx_pppoe_type const& oxm) {
70  os << dynamic_cast<coxmatch const&>(oxm);
71  os << indent(2) << "<pppoe-type: "
72  << (int)oxm.get_u8value()
73  << " >" << std::endl;
74  return os;
75  };
76 };
77 
78 
83 public:
85  uint16_t sid) :
86  coxmatch(OXM_TLV_EXPR_PPPOE_SID, sid) {};
88  coxmatch const& oxm) :
89  coxmatch(oxm) {};
90  virtual
92  friend std::ostream&
93  operator<< (std::ostream& os, coxmatch_ofx_pppoe_sid const& oxm) {
94  os << dynamic_cast<coxmatch const&>(oxm);
95  os << indent(2) << "<pppoe-sid: "
96  << (int)oxm.get_u16value()
97  << " >" << std::endl;
98  return os;
99  };
100 };
101 
102 
107 public:
109  uint16_t prot) :
110  coxmatch(OXM_TLV_EXPR_PPP_PROT, prot) {};
112  coxmatch const& oxm) :
113  coxmatch(oxm) {};
114  virtual
115  ~coxmatch_ofx_ppp_prot() {};
116  friend std::ostream&
117  operator<< (std::ostream& os, coxmatch_ofx_ppp_prot const& oxm) {
118  os << dynamic_cast<coxmatch const&>(oxm);
119  os << indent(2) << "<ppp-prot: "
120  << (int)oxm.get_u16value()
121  << " >" << std::endl;
122  return os;
123  };
124 };
125 
126 }; // end of namespace pppoe
127 }; // end of namespace experimental
128 }; // end of namespace openflow
129 }; // end of namespace rofl
130 
131 #endif
Definition: coxmatch.h:49
Definition: logging.h:76