A Discrete-Event Network Simulator
API
ofswitch13-learning-controller.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 University of Campinas (Unicamp)
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Luciano Jerez Chaves <ljerezchaves@gmail.com>
18  */
19 
20 #ifndef OFSWITCH13_LEARNING_CONTROLLER_H
21 #define OFSWITCH13_LEARNING_CONTROLLER_H
22 
23 #include "ofswitch13-controller.h"
24 
25 namespace ns3
26 {
27 
33 {
34  public:
37 
42  static TypeId GetTypeId();
43 
45  void DoDispose() override;
46 
57  ofl_err HandlePacketIn(struct ofl_msg_packet_in* msg,
59  uint32_t xid) override;
60 
70  ofl_err HandleFlowRemoved(struct ofl_msg_flow_removed* msg,
72  uint32_t xid) override;
73 
74  protected:
75  // Inherited from OFSwitch13Controller
77 
78  private:
80  typedef std::map<Ipv4Address, Mac48Address> IpMacMap_t;
82 
86  //\{
88  typedef std::map<Mac48Address, uint32_t> L2Table_t;
89 
91  typedef std::map<uint64_t, L2Table_t> DatapathMap_t;
92 
95  //\}
96 };
97 
98 } // namespace ns3
99 #endif /* OFSWITCH13_LEARNING_CONTROLLER_H */
OpenFlow 1.3 controller base class that can handle a collection of OpenFlow switches and provides the...
An Learning OpenFlow 1.3 controller (works as L2 switch)
ofl_err HandlePacketIn(struct ofl_msg_packet_in *msg, Ptr< const RemoteSwitch > swtch, uint32_t xid) override
Handle packet-in messages sent from switch to this controller.
ofl_err HandleFlowRemoved(struct ofl_msg_flow_removed *msg, Ptr< const RemoteSwitch > swtch, uint32_t xid) override
Handle flow removed messages sent from switch to this controller.
DatapathMap_t m_learnedInfo
Switching information for all dapataths.
OFSwitch13LearningController()
Default constructor.
void HandshakeSuccessful(Ptr< const RemoteSwitch > swtch) override
Function invoked after a successfully handshake procedure between this controller and a remote switch...
std::map< uint64_t, L2Table_t > DatapathMap_t
Map datapathID to L2SwitchingTable.
IpMacMap_t m_arpTable
ARP resolution table.
void DoDispose() override
Destructor implementation.
static TypeId GetTypeId()
Register this type.
std::map< Mac48Address, uint32_t > L2Table_t
L2SwitchingTable: map MacAddress to port.
~OFSwitch13LearningController() override
Dummy destructor.
std::map< Ipv4Address, Mac48Address > IpMacMap_t
Map saving <IPv4 address / MAC address>
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
a unique identifier for an interface.
Definition: type-id.h:60
Every class exported by the ns3 library is enclosed in the ns3 namespace.