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