A Discrete-Event Network Simulator
API
openflow-interface.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License version 2 as
5  * published by the Free Software Foundation;
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15  *
16  * Author: Blake Hurd <naimorai@gmail.com>
17  */
18 #ifndef OPENFLOW_INTERFACE_H
19 #define OPENFLOW_INTERFACE_H
20 
21 #include <assert.h>
22 #include <errno.h>
23 
24 // Include OFSI code
25 #include "ns3/simulator.h"
26 #include "ns3/log.h"
27 #include "ns3/net-device.h"
28 #include "ns3/packet.h"
29 #include "ns3/address.h"
30 #include "ns3/nstime.h"
31 #include "ns3/mac48-address.h"
32 
33 #include <set>
34 #include <map>
35 #include <limits>
36 
37 // Include main header and Vendor Extension files
38 #include "openflow/openflow.h"
39 #include "openflow/nicira-ext.h"
40 #include "openflow/ericsson-ext.h"
41 
42 extern "C"
43 {
44 // Inexplicably, the OpenFlow implementation uses these two reserved words as member names.
45 #define private _private
46 #define delete _delete
47 #define list List
48 
49 // Include OFSI Library files
50 #include "openflow/private/csum.h"
51 #include "openflow/private/poll-loop.h"
52 #include "openflow/private/rconn.h"
53 #include "openflow/private/stp.h"
54 #include "openflow/private/vconn.h"
55 #include "openflow/private/xtoxll.h"
56 
57 // Include OFSI Switch files
58 #include "openflow/private/chain.h"
59 #include "openflow/private/table.h"
60 #include "openflow/private/datapath.h" // The functions below are defined in datapath.c
61 uint32_t save_buffer (ofpbuf *);
62 ofpbuf * retrieve_buffer (uint32_t id);
63 void discard_buffer (uint32_t id);
64 #include "openflow/private/dp_act.h" // The functions below are defined in dp_act.c
65 void set_vlan_vid (ofpbuf *buffer, sw_flow_key *key, const ofp_action_header *ah);
66 void set_vlan_pcp (ofpbuf *buffer, sw_flow_key *key, const ofp_action_header *ah);
67 void strip_vlan (ofpbuf *buffer, sw_flow_key *key, const ofp_action_header *ah);
68 void set_dl_addr (ofpbuf *buffer, sw_flow_key *key, const ofp_action_header *ah);
69 void set_nw_addr (ofpbuf *buffer, sw_flow_key *key, const ofp_action_header *ah);
70 void set_tp_port (ofpbuf *buffer, sw_flow_key *key, const ofp_action_header *ah);
71 void set_mpls_label (ofpbuf *buffer, sw_flow_key *key, const ofp_action_header *ah);
72 void set_mpls_exp (ofpbuf *buffer, sw_flow_key *key, const ofp_action_header *ah);
73 #include "openflow/private/pt_act.h"
74 
75 #undef list
76 #undef private
77 #undef delete
78 }
79 
80 // Capabilities supported by this implementation.
81 #define OFP_SUPPORTED_CAPABILITIES ( OFPC_FLOW_STATS \
82  | OFPC_TABLE_STATS \
83  | OFPC_PORT_STATS \
84  | OFPC_MULTI_PHY_TX \
85  | OFPC_VPORT_TABLE)
86 
87 // Actions supported by this implementation.
88 #define OFP_SUPPORTED_ACTIONS ( (1 << OFPAT_OUTPUT) \
89  | (1 << OFPAT_SET_VLAN_VID) \
90  | (1 << OFPAT_SET_VLAN_PCP) \
91  | (1 << OFPAT_STRIP_VLAN) \
92  | (1 << OFPAT_SET_DL_SRC) \
93  | (1 << OFPAT_SET_DL_DST) \
94  | (1 << OFPAT_SET_NW_SRC) \
95  | (1 << OFPAT_SET_NW_DST) \
96  | (1 << OFPAT_SET_TP_SRC) \
97  | (1 << OFPAT_SET_TP_DST) \
98  | (1 << OFPAT_SET_MPLS_LABEL) \
99  | (1 << OFPAT_SET_MPLS_EXP) )
100 
101 #define OFP_SUPPORTED_VPORT_TABLE_ACTIONS ( (1 << OFPPAT_OUTPUT) \
102  | (1 << OFPPAT_POP_MPLS) \
103  | (1 << OFPPAT_PUSH_MPLS) \
104  | (1 << OFPPAT_SET_MPLS_LABEL) \
105  | (1 << OFPPAT_SET_MPLS_EXP) ) \
106 
107 namespace ns3 {
108 
109 class OpenFlowSwitchNetDevice;
110 
111 namespace ofi {
112 
121 struct Port
122 {
123  Port () : config (0),
124  state (0),
125  netdev (0),
126  rx_packets (0),
127  tx_packets (0),
128  rx_bytes (0),
129  tx_bytes (0),
130  tx_dropped (0),
132  {
133  }
134 
135  uint32_t config;
136  uint32_t state;
138  unsigned long long int rx_packets, tx_packets;
139  unsigned long long int rx_bytes, tx_bytes;
140  unsigned long long int tx_dropped;
141  unsigned long long int mpls_ttl0_dropped;
142 };
143 
144 class Stats
145 {
146 public:
147  Stats (ofp_stats_types _type, size_t body_len);
148 
157  int DoInit (const void *body, int body_len, void **state);
158 
167  int DoDump (Ptr<OpenFlowSwitchNetDevice> swtch, void *state, ofpbuf *buffer);
168 
176  void DoCleanup (void *state);
177 
182  {
184  sw_table_position position;
185  ofp_flow_stats_request rq;
186  time_t now;
187 
188  ofpbuf *buffer;
189  };
190 
195  {
196  uint32_t num_ports;
197  uint32_t *ports;
198  };
199 
200  ofp_stats_types type;
201 private:
202  int DescStatsDump (void *state, ofpbuf *buffer);
203 
204  int FlowStatsInit (const void *body, int body_len, void **state);
205  int (*FlowDumpCallback)(sw_flow *flow, void *state);
207 
208  int AggregateStatsInit (const void *body, int body_len, void **state);
209  int (*AggregateDumpCallback)(sw_flow *flow, void *state);
210  int AggregateStatsDump (Ptr<OpenFlowSwitchNetDevice> dp, ofp_aggregate_stats_request *s, ofpbuf *buffer);
211 
212  int TableStatsDump (Ptr<OpenFlowSwitchNetDevice> dp, void *state, ofpbuf *buffer);
213 
214  int PortStatsInit (const void *body, int body_len, void **state);
216 
217  int PortTableStatsDump (Ptr<OpenFlowSwitchNetDevice> dp, void *state, ofpbuf *buffer);
218 };
219 
223 struct Action
224 {
229  static bool IsValidType (ofp_action_type type);
230 
240  static uint16_t Validate (ofp_action_type type, size_t len, const sw_flow_key *key, const ofp_action_header *ah);
241 
250  static void Execute (ofp_action_type type, ofpbuf *buffer, sw_flow_key *key, const ofp_action_header *ah);
251 };
252 
257 {
262  static bool IsValidType (ofp_vport_action_type type);
263 
272  static uint16_t Validate (ofp_vport_action_type type, size_t len, const ofp_action_header *ah);
273 
282  static void Execute (ofp_vport_action_type type, ofpbuf *buffer, const sw_flow_key *key, const ofp_action_header *ah);
283 };
284 
289 {
294  static bool IsValidType (er_action_type type);
295 
303  static uint16_t Validate (er_action_type type, size_t len);
304 
313  static void Execute (er_action_type type, ofpbuf *buffer, const sw_flow_key *key, const er_action_header *ah);
314 };
315 
320 {
321  bool done;
322  ofp_stats_request *rq;
323  Stats *s;
324  void *state;
326 };
327 
332 {
334  ofpbuf* buffer;
335  uint16_t protocolNumber;
338 };
339 
345 class Controller : public Object
346 {
347 public:
352  static TypeId GetTypeId (void);
354  virtual ~Controller ();
355 
362 
369  virtual void ReceiveFromSwitch (Ptr<OpenFlowSwitchNetDevice> swtch, ofpbuf* buffer)
370  {
371  }
372 
391 
392 protected:
401  virtual void SendToSwitch (Ptr<OpenFlowSwitchNetDevice> swtch, void * msg, size_t length);
402 
416  ofp_flow_mod* BuildFlow (sw_flow_key key, uint32_t buffer_id, uint16_t command, void* acts, size_t actions_len, int idle_timeout, int hard_timeout);
417 
425  uint8_t GetPacketType (ofpbuf* buffer);
426 
427  typedef std::set<Ptr<OpenFlowSwitchNetDevice> > Switches_t;
429 };
430 
437 {
438 public:
443  static TypeId GetTypeId (void);
444 
445  void ReceiveFromSwitch (Ptr<OpenFlowSwitchNetDevice> swtch, ofpbuf* buffer);
446 };
447 
456 {
457 public:
462  static TypeId GetTypeId (void);
463 
465  {
466  m_learnState.clear ();
467  }
468 
469  void ReceiveFromSwitch (Ptr<OpenFlowSwitchNetDevice> swtch, ofpbuf* buffer);
470 
471 protected:
473  {
474  uint32_t port;
475  };
477  typedef std::map<Mac48Address, LearnedState> LearnState_t;
479 };
480 
492 void ExecuteActions (Ptr<OpenFlowSwitchNetDevice> swtch, uint64_t packet_uid, ofpbuf* buffer, sw_flow_key *key, const ofp_action_header *actions, size_t actions_len, int ignore_no_fwd);
493 
502 uint16_t ValidateActions (const sw_flow_key *key, const ofp_action_header *actions, size_t actions_len);
503 
514 void ExecuteVPortActions (Ptr<OpenFlowSwitchNetDevice> swtch, uint64_t packet_uid, ofpbuf* buffer, sw_flow_key *key, const ofp_action_header *actions, size_t actions_len);
515 
523 uint16_t ValidateVPortActions (const ofp_action_header *actions, size_t actions_len);
524 
532 void ExecuteVendor (ofpbuf *buffer, const sw_flow_key *key, const ofp_action_header *ah);
533 
542 uint16_t ValidateVendor (const sw_flow_key *key, const ofp_action_header *ah, uint16_t len);
543 
544 /*
545  * From datapath.c
546  * Buffers are identified to userspace by a 31-bit opaque ID. We divide the ID
547  * into a buffer number (low bits) and a cookie (high bits). The buffer number
548  * is an index into an array of buffers. The cookie distinguishes between
549  * different packets that have occupied a single buffer. Thus, the more
550  * buffers we have, the lower-quality the cookie...
551  */
552 #define PKT_BUFFER_BITS 8
553 #define N_PKT_BUFFERS (1 << PKT_BUFFER_BITS)
554 #define PKT_BUFFER_MASK (N_PKT_BUFFERS - 1)
555 #define PKT_COOKIE_BITS (32 - PKT_BUFFER_BITS)
556 
557 }
558 
559 }
560 
561 #endif /* OPENFLOW_INTERFACE_H */
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
ns3::ofi::LearningController::m_expirationTime
Time m_expirationTime
Time it takes for learned MAC state entry/created flow to expire.
Definition: openflow-interface.h:476
ns3::ofi::SwitchPacketMetadata::protocolNumber
uint16_t protocolNumber
Protocol type of the Packet when the Packet is received.
Definition: openflow-interface.h:335
ns3::ofi::Stats::PortTableStatsDump
int PortTableStatsDump(Ptr< OpenFlowSwitchNetDevice > dp, void *state, ofpbuf *buffer)
ns3::ofi::Stats::AggregateStatsDump
int AggregateStatsDump(Ptr< OpenFlowSwitchNetDevice > dp, ofp_aggregate_stats_request *s, ofpbuf *buffer)
ns3::ofi::SwitchPacketMetadata
Packet Metadata, allows us to track the packet's metadata as it passes through the switch.
Definition: openflow-interface.h:332
ns3::ofi::Stats::Stats
Stats(ofp_stats_types _type, size_t body_len)
ns3::ofi::Stats::PortStatsState::num_ports
uint32_t num_ports
Number of ports in host byte order.
Definition: openflow-interface.h:196
retrieve_buffer
ofpbuf * retrieve_buffer(uint32_t id)
strip_vlan
void strip_vlan(ofpbuf *buffer, sw_flow_key *key, const ofp_action_header *ah)
ns3::ofi::Port::rx_packets
unsigned long long int rx_packets
Definition: openflow-interface.h:138
ns3::ofi::Stats::FlowStatsInit
int FlowStatsInit(const void *body, int body_len, void **state)
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::ofi::Stats::PortStatsInit
int PortStatsInit(const void *body, int body_len, void **state)
set_dl_addr
void set_dl_addr(ofpbuf *buffer, sw_flow_key *key, const ofp_action_header *ah)
ns3::ofi::ValidateActions
uint16_t ValidateActions(const sw_flow_key *key, const ofp_action_header *actions, size_t actions_len)
Validates a list of flow table actions.
set_vlan_vid
void set_vlan_vid(ofpbuf *buffer, sw_flow_key *key, const ofp_action_header *ah)
ns3::ofi::Stats::PortStatsState
State of the PortStats request/reply.
Definition: openflow-interface.h:195
ns3::ofi::Port::rx_bytes
unsigned long long int rx_bytes
Definition: openflow-interface.h:139
ns3::ofi::StatsDumpCallback::swtch
Ptr< OpenFlowSwitchNetDevice > swtch
The switch that we're requesting data from.
Definition: openflow-interface.h:325
ns3::ofi::Controller::~Controller
virtual ~Controller()
Destructor.
ns3::ofi::Stats::AggregateDumpCallback
int(* AggregateDumpCallback)(sw_flow *flow, void *state)
Definition: openflow-interface.h:209
ns3::ofi::EricssonAction
Class for handling Ericsson Vendor-defined actions.
Definition: openflow-interface.h:289
ns3::ofi::Stats::TableStatsDump
int TableStatsDump(Ptr< OpenFlowSwitchNetDevice > dp, void *state, ofpbuf *buffer)
ns3::ofi::SwitchPacketMetadata::src
Address src
Source Address of the Packet when the Packet is received.
Definition: openflow-interface.h:336
ns3::ofi::LearningController::GetTypeId
static TypeId GetTypeId(void)
Register this type.
ns3::ofi::Action::Execute
static void Execute(ofp_action_type type, ofpbuf *buffer, sw_flow_key *key, const ofp_action_header *ah)
Executes the action.
ns3::ofi::ValidateVPortActions
uint16_t ValidateVPortActions(const ofp_action_header *actions, size_t actions_len)
Validates a list of virtual port table entry actions.
ns3::ofi::LearningController
Demonstration of a Learning controller.
Definition: openflow-interface.h:456
ns3::ofi::SwitchPacketMetadata::dst
Address dst
Destination Address of the Packet when the Packet is received.
Definition: openflow-interface.h:337
assert.h
NS_ASSERT() and NS_ASSERT_MSG() macro definitions.
ns3::ofi::Stats::FlowStatsState::rq
ofp_flow_stats_request rq
Definition: openflow-interface.h:185
ns3::ofi::Port::config
uint32_t config
Some subset of OFPPC_* flags.
Definition: openflow-interface.h:135
ns3::ofi::LearningController::~LearningController
virtual ~LearningController()
Definition: openflow-interface.h:464
ns3::ofi::Stats::PortStatsDump
int PortStatsDump(Ptr< OpenFlowSwitchNetDevice > dp, PortStatsState *s, ofpbuf *buffer)
ns3::ofi::StatsDumpCallback::done
bool done
Whether we are done requesting stats.
Definition: openflow-interface.h:321
ns3::ofi::DropController
Demonstration of a Drop controller.
Definition: openflow-interface.h:437
ns3::ofi::Stats::DoInit
int DoInit(const void *body, int body_len, void **state)
Prepares to dump some kind of statistics on the connected OpenFlowSwitchNetDevice.
ns3::ofi::StatsDumpCallback::s
Stats * s
Handler of the stats request.
Definition: openflow-interface.h:323
ns3::ofi::Stats
Definition: openflow-interface.h:145
ns3::ofi::Port::mpls_ttl0_dropped
unsigned long long int mpls_ttl0_dropped
Definition: openflow-interface.h:141
ns3::ofi::Controller::GetTypeId
static TypeId GetTypeId(void)
Register this type.
ns3::ofi::LearningController::LearnState_t
std::map< Mac48Address, LearnedState > LearnState_t
Definition: openflow-interface.h:477
ns3::ofi::EricssonAction::Execute
static void Execute(er_action_type type, ofpbuf *buffer, const sw_flow_key *key, const er_action_header *ah)
Executes the action.
ns3::ofi::Stats::FlowStatsDump
int FlowStatsDump(Ptr< OpenFlowSwitchNetDevice > dp, FlowStatsState *s, ofpbuf *buffer)
ns3::ofi::SwitchPacketMetadata::packet
Ptr< Packet > packet
The Packet itself.
Definition: openflow-interface.h:333
ns3::ofi::VPortAction::Execute
static void Execute(ofp_vport_action_type type, ofpbuf *buffer, const sw_flow_key *key, const ofp_action_header *ah)
Executes the action.
ns3::ofi::Controller::m_switches
Switches_t m_switches
The collection of switches registered to this controller.
Definition: openflow-interface.h:428
ns3::ofi::VPortAction
Class for handling virtual port table actions.
Definition: openflow-interface.h:257
ns3::Ptr< NetDevice >
ns3::ofi::EricssonAction::Validate
static uint16_t Validate(er_action_type type, size_t len)
Validates the action on whether its data is valid or not.
ns3::ofi::StatsDumpCallback::state
void * state
Stats request state data.
Definition: openflow-interface.h:324
ns3::ofi::Port::tx_dropped
unsigned long long int tx_dropped
Definition: openflow-interface.h:140
ns3::ofi::Controller::ReceiveFromSwitch
virtual void ReceiveFromSwitch(Ptr< OpenFlowSwitchNetDevice > swtch, ofpbuf *buffer)
A switch calls this method to pass a message on to the Controller.
Definition: openflow-interface.h:369
ns3::ofi::SwitchPacketMetadata::buffer
ofpbuf * buffer
The OpenFlow buffer as created from the Packet, with its data and headers.
Definition: openflow-interface.h:334
save_buffer
uint32_t save_buffer(ofpbuf *)
ns3::ofi::Port
Port and its metadata.
Definition: openflow-interface.h:122
ns3::Address
a polymophic address class
Definition: address.h:91
ns3::ofi::LearningController::ReceiveFromSwitch
void ReceiveFromSwitch(Ptr< OpenFlowSwitchNetDevice > swtch, ofpbuf *buffer)
A switch calls this method to pass a message on to the Controller.
ns3::ofi::DropController::GetTypeId
static TypeId GetTypeId(void)
Register this type.
ns3::ofi::Stats::FlowStatsState::buffer
ofpbuf * buffer
Definition: openflow-interface.h:188
ns3::Object
A base class which provides memory management and object aggregation.
Definition: object.h:88
ns3::ofi::ValidateVendor
uint16_t ValidateVendor(const sw_flow_key *key, const ofp_action_header *ah, uint16_t len)
Validates a vendor-defined action.
ns3::ofi::Controller::GetPacketType
uint8_t GetPacketType(ofpbuf *buffer)
Get the packet type on the buffer, which can then be used to determine how to handle the buffer.
ns3::ofi::Stats::DescStatsDump
int DescStatsDump(void *state, ofpbuf *buffer)
ns3::ofi::VPortAction::Validate
static uint16_t Validate(ofp_vport_action_type type, size_t len, const ofp_action_header *ah)
Validates the action on whether its data is valid or not.
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
ns3::ofi::ExecuteVendor
void ExecuteVendor(ofpbuf *buffer, const sw_flow_key *key, const ofp_action_header *ah)
Executes a vendor-defined action.
ns3::ofi::EricssonAction::IsValidType
static bool IsValidType(er_action_type type)
ns3::ofi::ExecuteActions
void ExecuteActions(Ptr< OpenFlowSwitchNetDevice > swtch, uint64_t packet_uid, ofpbuf *buffer, sw_flow_key *key, const ofp_action_header *actions, size_t actions_len, int ignore_no_fwd)
Executes a list of flow table actions.
ns3::ofi::Port::netdev
Ptr< NetDevice > netdev
Definition: openflow-interface.h:137
set_mpls_exp
void set_mpls_exp(ofpbuf *buffer, sw_flow_key *key, const ofp_action_header *ah)
ns3::ofi::Stats::AggregateStatsInit
int AggregateStatsInit(const void *body, int body_len, void **state)
ns3::ofi::Port::tx_bytes
unsigned long long int tx_bytes
Definition: openflow-interface.h:139
set_vlan_pcp
void set_vlan_pcp(ofpbuf *buffer, sw_flow_key *key, const ofp_action_header *ah)
ns3::ofi::Port::Port
Port()
Definition: openflow-interface.h:123
ns3::ofi::Controller::BuildFlow
ofp_flow_mod * BuildFlow(sw_flow_key key, uint32_t buffer_id, uint16_t command, void *acts, size_t actions_len, int idle_timeout, int hard_timeout)
Construct flow data from a matching key to build a flow entry for adding, modifying,...
ns3::ofi::Action::IsValidType
static bool IsValidType(ofp_action_type type)
ns3::ofi::Controller::AddSwitch
virtual void AddSwitch(Ptr< OpenFlowSwitchNetDevice > swtch)
Adds a switch to the controller.
ns3::ofi::Stats::FlowStatsState
State of the FlowStats request/reply.
Definition: openflow-interface.h:182
ns3::ofi::StatsDumpCallback::rq
ofp_stats_request * rq
Current stats request.
Definition: openflow-interface.h:322
ns3::ofi::Stats::FlowStatsState::position
sw_table_position position
Definition: openflow-interface.h:184
ns3::ofi::Stats::DoDump
int DoDump(Ptr< OpenFlowSwitchNetDevice > swtch, void *state, ofpbuf *buffer)
Appends statistics for OpenFlowSwitchNetDevice to 'buffer'.
ns3::ofi::Action
Class for handling flow table actions.
Definition: openflow-interface.h:224
ns3::ofi::Stats::DoCleanup
void DoCleanup(void *state)
Cleans any state created by the init or dump functions.
set_tp_port
void set_tp_port(ofpbuf *buffer, sw_flow_key *key, const ofp_action_header *ah)
ns3::ofi::LearningController::m_learnState
LearnState_t m_learnState
Learned state data.
Definition: openflow-interface.h:478
ns3::ofi::Controller
An interface for a Controller of OpenFlowSwitchNetDevices.
Definition: openflow-interface.h:346
ns3::ofi::Stats::PortStatsState::ports
uint32_t * ports
Array of ports in network byte order.
Definition: openflow-interface.h:197
ns3::ofi::ExecuteVPortActions
void ExecuteVPortActions(Ptr< OpenFlowSwitchNetDevice > swtch, uint64_t packet_uid, ofpbuf *buffer, sw_flow_key *key, const ofp_action_header *actions, size_t actions_len)
Executes a list of virtual port table entry actions.
ns3::ofi::LearningController::LearnedState::port
uint32_t port
Learned port.
Definition: openflow-interface.h:474
ns3::ofi::Controller::Switches_t
std::set< Ptr< OpenFlowSwitchNetDevice > > Switches_t
Definition: openflow-interface.h:427
set_mpls_label
void set_mpls_label(ofpbuf *buffer, sw_flow_key *key, const ofp_action_header *ah)
ns3::ofi::VPortAction::IsValidType
static bool IsValidType(ofp_vport_action_type type)
discard_buffer
void discard_buffer(uint32_t id)
ns3::ofi::Port::state
uint32_t state
Some subset of OFPPS_* flags.
Definition: openflow-interface.h:136
ns3::ofi::Stats::type
ofp_stats_types type
Definition: openflow-interface.h:200
ns3::ofi::DropController::ReceiveFromSwitch
void ReceiveFromSwitch(Ptr< OpenFlowSwitchNetDevice > swtch, ofpbuf *buffer)
A switch calls this method to pass a message on to the Controller.
ns3::ofi::Port::tx_packets
unsigned long long int tx_packets
Definition: openflow-interface.h:138
ns3::ofi::LearningController::LearnedState
Definition: openflow-interface.h:473
ns3::ofi::Controller::StartDump
void StartDump(StatsDumpCallback *cb)
Starts a callback-based, reliable, possibly multi-message reply to a request made by the controller.
ns3::ofi::Stats::FlowDumpCallback
int(* FlowDumpCallback)(sw_flow *flow, void *state)
Definition: openflow-interface.h:205
ns3::ofi::Stats::FlowStatsState::now
time_t now
Definition: openflow-interface.h:186
ns3::ofi::Stats::FlowStatsState::table_idx
int table_idx
Definition: openflow-interface.h:183
set_nw_addr
void set_nw_addr(ofpbuf *buffer, sw_flow_key *key, const ofp_action_header *ah)
ns3::ofi::Controller::SendToSwitch
virtual void SendToSwitch(Ptr< OpenFlowSwitchNetDevice > swtch, void *msg, size_t length)
However the controller is implemented, this method is to be used to pass a message on to a switch.
ns3::ofi::Action::Validate
static uint16_t Validate(ofp_action_type type, size_t len, const sw_flow_key *key, const ofp_action_header *ah)
Validates the action on whether its data is valid or not.
ns3::ofi::StatsDumpCallback
Callback for a stats dump request.
Definition: openflow-interface.h:320