Skip to content

Commit

Permalink
For Discovey agent client initialization use port value as set in age…
Browse files Browse the repository at this point in the history
…nt param.

Change-Id: I4a2597950d8efce2a02cd111ff8e454a5e9b75af
Closes-Bug: #1580109
  • Loading branch information
krharsh committed Jul 14, 2016
1 parent 4a8243d commit 0934704
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/vnsw/agent/cfg/discovery_agent.cc
Expand Up @@ -19,7 +19,7 @@ using namespace boost::asio;

void DiscoveryAgentClient::Init(AgentParam *param) {
param_ = param;
uint32_t port = agent_cfg_->agent()->discovery_server_port();
uint32_t port = param_->discovery_server_port();
if (!port) {
port = DISCOVERY_SERVER_PORT;
}
Expand Down
8 changes: 4 additions & 4 deletions src/vnsw/agent/init/agent_param.cc
Expand Up @@ -297,7 +297,7 @@ void AgentParam::ParseVirtualHost() {

void AgentParam::ParseDiscovery() {
GetValueFromTree<string>(dss_server_, "DISCOVERY.server");
GetValueFromTree<uint16_t>(dss_port_, "DISCOVERY.port");
GetValueFromTree<uint32_t>(dss_port_, "DISCOVERY.port");
GetValueFromTree<uint16_t>(xmpp_instance_count_,
"DISCOVERY.max_control_nodes");
}
Expand Down Expand Up @@ -594,7 +594,7 @@ void AgentParam::ParseVirtualHostArguments
void AgentParam::ParseDiscoveryArguments
(const boost::program_options::variables_map &var_map) {
GetOptValue<string>(var_map, dss_server_, "DISCOVERY.server");
GetOptValue<uint16_t>(var_map, dss_port_, "DISCOVERY.port");
GetOptValue<uint32_t>(var_map, dss_port_, "DISCOVERY.port");
if (!GetOptValue<uint16_t>(var_map, xmpp_instance_count_,
"DISCOVERY.max_control_nodes")) {
xmpp_instance_count_ = MAX_XMPP_SERVERS;
Expand Down Expand Up @@ -1142,7 +1142,7 @@ AgentParam::AgentParam(Agent *agent, bool enable_flow_options,
eth_port_no_arp_(false), eth_port_encap_type_(),
xmpp_instance_count_(),
dns_port_1_(ContrailPorts::DnsServerPort()),
dns_port_2_(ContrailPorts::DnsServerPort()),
dns_port_2_(ContrailPorts::DnsServerPort()), dss_port_(0),
mgmt_ip_(), hypervisor_mode_(MODE_KVM), xen_ll_(),
tunnel_type_(), metadata_shared_secret_(), max_vm_flows_(),
linklocal_system_flows_(), linklocal_vm_flows_(),
Expand Down Expand Up @@ -1211,7 +1211,7 @@ AgentParam::AgentParam(Agent *agent, bool enable_flow_options,
"Run agent in vrouter / tsn / tor mode")
("DEFAULT.agent_base_directory", opt::value<string>(),
"Base directory used by the agent")
("DISCOVERY.port", opt::value<uint16_t>()->default_value(DISCOVERY_SERVER_PORT),
("DISCOVERY.port", opt::value<uint32_t>()->default_value(DISCOVERY_SERVER_PORT),
"Listen port of discovery server")
("DISCOVERY.server", opt::value<string>()->default_value("127.0.0.1"),
"IP address of discovery server")
Expand Down
3 changes: 2 additions & 1 deletion src/vnsw/agent/init/agent_param.h
Expand Up @@ -147,6 +147,7 @@ class AgentParam {
return collector_server_list_;
}
uint16_t http_server_port() const { return http_server_port_; }
uint32_t discovery_server_port() const { return dss_port_; }
const std::string &host_name() const { return host_name_; }
int agent_stats_interval() const { return agent_stats_interval_; }
int flow_stats_interval() const { return flow_stats_interval_; }
Expand Down Expand Up @@ -359,7 +360,7 @@ class AgentParam {
uint16_t dns_port_1_;
uint16_t dns_port_2_;
std::string dss_server_;
uint16_t dss_port_;
uint32_t dss_port_;
Ip4Address mgmt_ip_;
HypervisorMode hypervisor_mode_;
PortInfo xen_ll_;
Expand Down

0 comments on commit 0934704

Please sign in to comment.