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