Skip to content

Commit

Permalink
Parse optimize_snat for backward comptibility with R2.21.x
Browse files Browse the repository at this point in the history
Change-Id: Ib230746eb4690bef77234a21c13661b21a1a6a8b
Partial-Bug: 1554175
  • Loading branch information
Nischal Sheth committed Apr 18, 2016
1 parent d58f5da commit 8cac2ae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/control-node/options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ void Options::Initialize(EventManager &evm,
"Enable control-node to run in test-mode")
("DEFAULT.tcp_hold_time", opt::value<int>()->default_value(30),
"Configurable TCP hold time")
("DEFAULT.optimize_snat", opt::bool_switch(&optimize_snat_),
"Enable control-node optimizations for SNAT (deprecated)")

("DEFAULT.xmpp_server_port",
opt::value<uint16_t>()->default_value(default_xmpp_port),
Expand Down
2 changes: 2 additions & 0 deletions src/control-node/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class Options {
const bool test_mode() const { return test_mode_; }
const bool collectors_configured() const { return collectors_configured_; }
const int tcp_hold_time() const { return tcp_hold_time_; }
const bool optimize_snat() const { return optimize_snat_; }
const uint32_t sandesh_send_rate_limit() const { return sandesh_ratelimit_; }

private:
Expand Down Expand Up @@ -95,6 +96,7 @@ class Options {
bool test_mode_;
bool collectors_configured_;
int tcp_hold_time_;
bool optimize_snat_;
uint32_t sandesh_ratelimit_;
std::vector<std::string> default_collector_server_list_;
boost::program_options::options_description config_file_options_;
Expand Down
2 changes: 2 additions & 0 deletions src/control-node/test/options_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ TEST_F(OptionsTest, CustomConfigFile) {
"log_level=SYS_DEBUG\n"
"log_local=false\n"
"test_mode=0\n"
"optimize_snat=1\n"
"xmpp_auth_enable=true\n"
"xmpp_server_cert=/etc/server.pem\n"
"xmpp_server_key=/etc/server.key\n"
Expand Down Expand Up @@ -275,6 +276,7 @@ TEST_F(OptionsTest, CustomConfigFile) {
EXPECT_EQ(options_.ifmap_certs_store(), "test-store");
EXPECT_EQ(options_.xmpp_port(), 100);
EXPECT_EQ(options_.test_mode(), false);
EXPECT_EQ(options_.optimize_snat(), true);
EXPECT_EQ(options_.xmpp_auth_enabled(), true);
EXPECT_EQ(options_.xmpp_server_cert(), "/etc/server.pem");
EXPECT_EQ(options_.xmpp_server_key(), "/etc/server.key");
Expand Down

0 comments on commit 8cac2ae

Please sign in to comment.