OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
tor_agent_param.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
3  */
4 
5 #ifndef SRC_VNSW_AGENT_PHYSICAL_DEVICES_OVS_TOR_AGENT_TOR_AGENT_PARAM_H_
6 #define SRC_VNSW_AGENT_PHYSICAL_DEVICES_OVS_TOR_AGENT_TOR_AGENT_PARAM_H_
7 
8 #include <init/agent_param.h>
9 #include <string>
10 
11 // Class handling agent configuration parameters from config file and
12 // arguments
13 class TorAgentParam : public AgentParam {
14  public:
15  enum TorType {
18  };
19 
20  struct TorInfo {
22  std::string type_;
25  std::string id_;
26  // Protocol to connect to ToR
27  std::string protocol_;
28  // SSL certificates required for SSL protocol
29  std::string ssl_cert_;
30  std::string ssl_privkey_;
31  std::string ssl_cacert_;
32  uint16_t port_;
33  // keepalive interval in milli seconds, -1 for unconfigured
34  // 0 for no keep alive
36  // interval in milliseconds to keep unicast local routes as HA
37  // stale routes on connection close, -1 for unconfigured
39  };
40 
41  explicit TorAgentParam();
42  virtual ~TorAgentParam();
43 
44  virtual int Validate();
45 
46  void AddOptions();
47  std::string tor_id() const { return tor_info_.id_; }
48  std::string tor_protocol() const { return tor_info_.protocol_; }
49  Ip4Address tor_ip() const { return tor_info_.ip_; }
50  Ip4Address tsn_ip() const { return tor_info_.tsn_ip_; }
51  uint16_t tor_port() const { return tor_info_.port_; }
52  std::string ssl_cert() const { return tor_info_.ssl_cert_; }
53  std::string ssl_privkey() const { return tor_info_.ssl_privkey_; }
54  std::string ssl_cacert() const { return tor_info_.ssl_cacert_; }
58  }
59 
60  private:
61  virtual void ProcessArguments();
62  virtual void ParseTorArguments();
63 
65  uint16_t local_port_;
67 };
68 
69 #endif // SRC_VNSW_AGENT_PHYSICAL_DEVICES_OVS_TOR_AGENT_TOR_AGENT_PARAM_H_
Ip4Address tsn_ip() const
int keepalive_interval() const
virtual void ParseTorArguments()
DISALLOW_COPY_AND_ASSIGN(TorAgentParam)
Ip4Address tor_ip() const
virtual void ProcessArguments()
uint16_t local_port_
std::string tor_protocol() const
std::string ssl_privkey() const
std::string tor_id() const
std::string ssl_cert() const
boost::asio::ip::address_v4 Ip4Address
Definition: address.h:14
virtual ~TorAgentParam()
int ha_stale_route_interval() const
uint16_t tor_port() const
std::string ssl_cacert() const
virtual int Validate()