diff options
author | Michael Larson <slioch@eng-140.vyatta.com> | 2008-02-05 16:13:28 -0800 |
---|---|---|
committer | Michael Larson <slioch@eng-140.vyatta.com> | 2008-02-05 16:13:28 -0800 |
commit | feaee77ba7c7003bac53c4858eab26ac339e6aa8 (patch) | |
tree | e138ef78aa6423976739084db89f68b67f6ecf35 /src | |
parent | f350c6bdc9d1fba54fc695039341c87eb50b573a (diff) | |
download | vyatta-wanloadbalance-feaee77ba7c7003bac53c4858eab26ac339e6aa8.tar.gz vyatta-wanloadbalance-feaee77ba7c7003bac53c4858eab26ac339e6aa8.zip |
changed port definition to be consistent with fw/nat (i.e. single port line allow multi-port configuration). init script fix
Diffstat (limited to 'src')
-rw-r--r-- | src/lbdata.cc | 6 | ||||
-rw-r--r-- | src/lbdata.hh | 6 | ||||
-rw-r--r-- | src/lbdatafactory.cc | 14 | ||||
-rw-r--r-- | src/lbdecision.cc | 14 |
4 files changed, 12 insertions, 28 deletions
diff --git a/src/lbdata.cc b/src/lbdata.cc index 57050d2..70d1f50 100644 --- a/src/lbdata.cc +++ b/src/lbdata.cc @@ -165,13 +165,11 @@ LBData::dump() cout << " " << r_iter->second._proto << endl; cout << " " << r_iter->second._s_addr << endl; cout << " " << r_iter->second._s_net << endl; - cout << " " << r_iter->second._s_port_num << endl; - cout << " " << r_iter->second._s_port_name << endl; + cout << " " << r_iter->second._s_port << endl; cout << " " << r_iter->second._d_addr << endl; cout << " " << r_iter->second._d_net << endl; - cout << " " << r_iter->second._d_port_num << endl; - cout << " " << r_iter->second._d_port_name << endl; + cout << " " << r_iter->second._d_port << endl; LBRule::InterfaceDistIter ri_iter = r_iter->second._iface_dist_coll.begin(); while (ri_iter != r_iter->second._iface_dist_coll.end()) { diff --git a/src/lbdata.hh b/src/lbdata.hh index d05bf2d..c466e20 100644 --- a/src/lbdata.hh +++ b/src/lbdata.hh @@ -50,13 +50,11 @@ class LBRule { string _proto; string _s_addr; string _s_net; - string _s_port_num; - string _s_port_name; + string _s_port; string _d_addr; string _d_net; - string _d_port_num; - string _d_port_name; + string _d_port; InterfaceDistColl _iface_dist_coll; }; diff --git a/src/lbdatafactory.cc b/src/lbdatafactory.cc index d422c95..15322a9 100644 --- a/src/lbdatafactory.cc +++ b/src/lbdatafactory.cc @@ -290,11 +290,8 @@ LBDataFactory::process_rule_source(const string &key, const string &value) else if (key == "network") { _rule_iter->second._s_net = value; } - else if (key == "port-name") { - _rule_iter->second._s_port_name = value; - } - else if (key == "port-number") { - _rule_iter->second._s_port_num = value; + else if (key == "port") { + _rule_iter->second._s_port = value; } } @@ -314,11 +311,8 @@ LBDataFactory::process_rule_destination(const string &key, const string &value) else if (key == "network") { _rule_iter->second._d_net = value; } - else if (key == "port-name") { - _rule_iter->second._d_port_name = value; - } - else if (key == "port-number") { - _rule_iter->second._d_port_num = value; + else if (key == "port") { + _rule_iter->second._d_port = value; } } diff --git a/src/lbdecision.cc b/src/lbdecision.cc index 64bc600..4893a64 100644 --- a/src/lbdecision.cc +++ b/src/lbdecision.cc @@ -314,18 +314,12 @@ LBDecision::get_application_cmd(LBRule &rule) filter += "--destination " + rule._d_net + " "; } - if (rule._s_port_name.empty() == false) { - filter += "--source-port " + rule._s_port_name + " "; - } - else if (rule._s_port_num.empty() == false) { - filter += "--source-port " + rule._s_port_num + " "; + if (rule._s_port.empty() == false) { + filter += "-m multiport --source-port " + rule._s_port + " "; } - if (rule._d_port_name.empty() == false) { - filter += "--destination-port " + rule._d_port_name + " "; - } - else if (rule._d_port_num.empty() == false) { - filter += "--destination-port " + rule._d_port_num + " "; + if (rule._d_port.empty() == false) { + filter += "-m multiport --destination-port " + rule._d_port + " "; } } |