OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
services_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_SERVICES_INIT__
6 #define __VNSW_SERVICES_INIT__
7 
8 #include <sandesh/sandesh_trace.h>
9 #include <pkt/proto.h>
12 #include <services/arp_proto.h>
13 
14 #define MPLS_OVER_UDP_OLD_DEST_PORT 51234
15 #define MPLS_OVER_UDP_NEW_DEST_PORT 6635
16 #define VXLAN_UDP_DEST_PORT 4789
17 
18 class MetadataProxy;
19 
21 public:
22  enum ServiceList {
27  };
28  ServicesModule(Agent *agent, const std::string &metadata_secret);
30 
31  Agent *agent() { return agent_; }
33 
34  void Init(bool run_with_vrouter);
35  void ConfigInit();
36  void Shutdown();
37  void IoShutdown();
39  return icmp_error_proto_.get();
40  }
41 
42  ArpProto *arp_proto() const {
43  return arp_proto_.get();
44  }
45  void ReserveLocalPorts();
46  void FreeLocalPortBindings();
47 
48 private:
49  bool AllocateFd(uint16_t port_number, uint8_t ip_proto);
51  std::string metadata_secret_key_;
52  boost::scoped_ptr<DhcpProto> dhcp_proto_;
53  boost::scoped_ptr<Dhcpv6Proto> dhcpv6_proto_;
54  boost::scoped_ptr<DnsProto> dns_proto_;
55  boost::scoped_ptr<ArpProto> arp_proto_;
56  boost::scoped_ptr<BfdProto> bfd_proto_;
57  boost::scoped_ptr<IcmpProto> icmp_proto_;
58  boost::scoped_ptr<Icmpv6Proto> icmpv6_proto_;
59  boost::scoped_ptr<IcmpErrorProto> icmp_error_proto_;
60  boost::scoped_ptr<Icmpv6ErrorProto> icmpv6_error_proto_;
61  boost::scoped_ptr<IgmpProto> igmp_proto_;
62  boost::scoped_ptr<MetadataProxy> metadata_proxy_;
63  std::vector<int> reserved_port_fd_list_;
64 };
65 
73 
74 #endif
SandeshTraceBufferPtr Dhcpv6TraceBuf
MetadataProxy * metadataproxy()
Definition: services_init.h:32
SandeshTraceBufferPtr ArpTraceBuf
SandeshTraceBufferPtr BfdTraceBuf
boost::scoped_ptr< Icmpv6ErrorProto > icmpv6_error_proto_
Definition: services_init.h:60
boost::scoped_ptr< IgmpProto > igmp_proto_
Definition: services_init.h:61
std::vector< int > reserved_port_fd_list_
Definition: services_init.h:63
SandeshTraceBufferPtr IgmpTraceBuf
boost::scoped_ptr< DnsProto > dns_proto_
Definition: services_init.h:54
void ReserveLocalPorts()
boost::shared_ptr< TraceBuffer< SandeshTrace > > SandeshTraceBufferPtr
Definition: sandesh_trace.h:18
boost::scoped_ptr< DhcpProto > dhcp_proto_
Definition: services_init.h:52
ServicesModule(Agent *agent, const std::string &metadata_secret)
boost::scoped_ptr< Dhcpv6Proto > dhcpv6_proto_
Definition: services_init.h:53
SandeshTraceBufferPtr DhcpTraceBuf
boost::scoped_ptr< IcmpErrorProto > icmp_error_proto_
Definition: services_init.h:59
void FreeLocalPortBindings()
boost::scoped_ptr< MetadataProxy > metadata_proxy_
Definition: services_init.h:62
Definition: agent.h:358
Agent * agent()
Definition: services_init.h:31
IcmpErrorProto * icmp_error_proto() const
Definition: services_init.h:38
ArpProto * arp_proto() const
Definition: services_init.h:42
boost::scoped_ptr< Icmpv6Proto > icmpv6_proto_
Definition: services_init.h:58
void Init(bool run_with_vrouter)
std::string metadata_secret_key_
Definition: services_init.h:51
boost::scoped_ptr< BfdProto > bfd_proto_
Definition: services_init.h:56
boost::scoped_ptr< IcmpProto > icmp_proto_
Definition: services_init.h:57
bool AllocateFd(uint16_t port_number, uint8_t ip_proto)
SandeshTraceBufferPtr MetadataTraceBuf
SandeshTraceBufferPtr Icmpv6TraceBuf
boost::scoped_ptr< ArpProto > arp_proto_
Definition: services_init.h:55