OpenSDN source code
pkt_init.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3  * Copyright Contributors to the OpenSDN project
4  */
5 
6 #ifndef __VNSW_PKT_INIT__
7 #define __VNSW_PKT_INIT__
8 
9 #include <sandesh/sandesh_trace.h>
10 
11 class PktHandler;
12 class FlowTable;
13 class FlowProto;
15 class ControlInterface;
16 class FlowMgmtManager;
17 
18 // Packet Module
19 class PktModule {
20 public:
22  virtual ~PktModule();
23 
24  typedef std::vector<FlowMgmtManager *> FlowMgmtManagerList;
25  void Init(bool run_with_vrouter);
26  void Shutdown();
27  void IoShutdown();
28  void FlushFlows();
29  void InitDone();
30 
31  Agent *agent() const { return agent_; }
32  PktHandler *pkt_handler() const { return pkt_handler_.get(); }
33  FlowTable *flow_table(uint16_t index) const;
35  return packet_buffer_manager_.get();
36  }
39  }
40  FlowMgmtManager *flow_mgmt_manager(uint16_t index) const {
41  assert(index < flow_mgmt_manager_list_.size());
42  return flow_mgmt_manager_list_[index];
43  }
44  FlowProto *get_flow_proto() const { return flow_proto_.get(); }
45 
48 
49  std::vector<FlowMgmtManager *>::const_iterator
51  return flow_mgmt_manager_list_.begin();
52  }
53  std::vector<FlowMgmtManager *>::const_iterator
55  return flow_mgmt_manager_list_.end();
56  }
57  void CreateInterfaces();
58 
59 private:
62  boost::scoped_ptr<PktHandler> pkt_handler_;
63  boost::scoped_ptr<FlowProto> flow_proto_;
64  boost::scoped_ptr<PacketBufferManager> packet_buffer_manager_;
67 };
68 
70 
71 #endif // __VNSW_PKT_INIT__
Definition: agent.h:361
FlowProto * get_flow_proto() const
Definition: pkt_init.h:44
FlowMgmtManagerList flow_mgmt_manager_list_
Definition: pkt_init.h:65
PacketBufferManager * packet_buffer_manager() const
Definition: pkt_init.h:34
void set_control_interface(ControlInterface *val)
Definition: pkt_init.cc:55
FlowMgmtManagerList flow_mgmt_manager_list() const
Definition: pkt_init.h:37
void InitDone()
Definition: pkt_init.cc:51
void Init(bool run_with_vrouter)
Definition: pkt_init.cc:31
PktModule(Agent *agent)
Definition: pkt_init.cc:22
void FlushFlows()
Definition: pkt_init.cc:80
boost::scoped_ptr< PktHandler > pkt_handler_
Definition: pkt_init.h:62
boost::scoped_ptr< PacketBufferManager > packet_buffer_manager_
Definition: pkt_init.h:64
FlowMgmtManager * flow_mgmt_manager(uint16_t index) const
Definition: pkt_init.h:40
PktHandler * pkt_handler() const
Definition: pkt_init.h:32
Agent * agent() const
Definition: pkt_init.h:31
std::vector< FlowMgmtManager * >::const_iterator flow_mgmt_manager_iterator_begin() const
Definition: pkt_init.h:50
boost::scoped_ptr< FlowProto > flow_proto_
Definition: pkt_init.h:63
std::vector< FlowMgmtManager * >::const_iterator flow_mgmt_manager_iterator_end() const
Definition: pkt_init.h:54
Agent * agent_
Definition: pkt_init.h:60
void Shutdown()
Definition: pkt_init.cc:59
FlowTable * flow_table(uint16_t index) const
Definition: pkt_init.cc:98
void CreateInterfaces()
Definition: pkt_init.cc:84
std::vector< FlowMgmtManager * > FlowMgmtManagerList
Definition: pkt_init.h:24
DISALLOW_COPY_AND_ASSIGN(PktModule)
void IoShutdown()
Definition: pkt_init.cc:76
ControlInterface * control_interface() const
Definition: pkt_init.h:47
ControlInterface * control_interface_
Definition: pkt_init.h:61
virtual ~PktModule()
Definition: pkt_init.cc:28
SandeshTraceBufferPtr PacketTraceBuf
boost::shared_ptr< TraceBuffer< SandeshTrace > > SandeshTraceBufferPtr
Definition: sandesh_trace.h:19