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