Commit 2de0768b authored by Francklin Simo's avatar Francklin Simo

Remove lan_iface from main of these system components: gw, gw_net_acc and st

parent a28db6e9
......@@ -82,11 +82,9 @@
bool init_process(int argc, char **argv,
string &ip_addr,
string &tuntap_iface,
string &lan_iface,
string &conf_path,
tal_id_t &instance_id)
{
// TODO remove lan_iface and handle bridging in daemon
int opt;
bool output_enabled = true;
bool output_stdout = false;
......@@ -94,7 +92,7 @@ bool init_process(int argc, char **argv,
char entity[10];
string lib_external_output_path = "";
/* setting environment agent parameters */
while(!stop && (opt = getopt(argc, argv, "-hqdi:a:t:l:c:e:")) != EOF)
while(!stop && (opt = getopt(argc, argv, "-hqdi:a:t:c:e:")) != EOF)
{
switch(opt)
{
......@@ -118,29 +116,24 @@ bool init_process(int argc, char **argv,
// get TUN/TAP interface name
tuntap_iface = optarg;
break;
case 'l':
// get lan interface name
lan_iface = optarg;
break;
case 'c':
// get the configuration path
conf_path = optarg;
break;
case 'e':
case 'e':
// get library external path
lib_external_output_path = optarg;
break;
case 'h':
case '?':
fprintf(stderr, "usage: %s [-h] [[-q] [-d] -i instance_id -a ip_address "
"-t tuntap_iface -l lan_iface -c conf_path -e lib_ext_output_path\n",
"-t tuntap_iface -c conf_path -e lib_ext_output_path\n",
argv[0]);
fprintf(stderr, "\t-h print this message\n");
fprintf(stderr, "\t-q disable output\n");
fprintf(stderr, "\t-d enable output debug events\n");
fprintf(stderr, "\t-a <ip_address> set the IP address for emulation\n");
fprintf(stderr, "\t-t <tuntap_iface> set the GW TUN/TAP interface name\n");
fprintf(stderr, "\t-l <lan_iface> set the GW lan interface name\n");
fprintf(stderr, "\t-i <instance> set the instance id\n");
fprintf(stderr, "\t-c <conf_path> specify the configuration path\n");
fprintf(stderr, "\t-e <lib_ext_output_path> specify the external output library path\n");
......@@ -196,13 +189,6 @@ bool init_process(int argc, char **argv,
return false;
}
if(lan_iface.size() == 0)
{
DFLTLOG(LEVEL_CRITICAL,
"missing mandatory lan interface name option");
return false;
}
if(conf_path.size() == 0)
{
DFLTLOG(LEVEL_CRITICAL,
......@@ -220,7 +206,6 @@ int main(int argc, char **argv)
bool init_ok;
string ip_addr;
string tuntap_iface;
string lan_iface;
tal_id_t mac_id = 0;
struct la_specific laspecific;
struct sc_specific scspecific;
......@@ -248,7 +233,7 @@ int main(int argc, char **argv)
int is_failure = 1;
// retrieve arguments on command line
init_ok = init_process(argc, argv, ip_addr, tuntap_iface, lan_iface, conf_path, mac_id);
init_ok = init_process(argc, argv, ip_addr, tuntap_iface, conf_path, mac_id);
plugin_conf_path = conf_path + string("plugins/");
......@@ -315,7 +300,6 @@ int main(int argc, char **argv)
// instantiate all blocs
laspecific.tuntap_iface = tuntap_iface;
laspecific.lan_iface = lan_iface;
block_lan_adaptation = Rt::createBlock<BlockLanAdaptation,
BlockLanAdaptation::Upward,
BlockLanAdaptation::Downward,
......
......@@ -75,12 +75,10 @@
*/
bool init_process(int argc, char **argv,
string &tuntap_iface,
string &lan_iface,
tal_id_t &instance_id,
string &interconnect_addr,
string &conf_path)
{
// TODO remove lan_iface and handle bridging in daemon
int opt;
bool output_enabled = true;
bool output_stdout = false;
......@@ -89,7 +87,7 @@ bool init_process(int argc, char **argv,
char entity[10];
/* setting environment agent parameters */
while(!stop && (opt = getopt(argc, argv, "-hqdi:t:l:u:w:c:e:")) != EOF)
while(!stop && (opt = getopt(argc, argv, "-hqdi:t:u:w:c:e:")) != EOF)
{
switch(opt)
{
......@@ -109,10 +107,6 @@ bool init_process(int argc, char **argv,
// get TUN/TAP interface name
tuntap_iface = optarg;
break;
case 'l':
// get lan interface name
lan_iface = optarg;
break;
case 'w':
// Get the interconnect IP address
interconnect_addr = optarg;
......@@ -128,13 +122,12 @@ bool init_process(int argc, char **argv,
case 'h':
case '?':
fprintf(stderr, "usage: %s [-h] [[-q] [-d] -i instance_id "
"-t tuntap_iface -l lan_iface -w interconnect_addr -c conf_path -e lib_ext_output_path\n",
"-t tuntap_iface -w interconnect_addr -c conf_path -e lib_ext_output_path\n",
argv[0]);
fprintf(stderr, "\t-h print this message\n");
fprintf(stderr, "\t-q disable output\n");
fprintf(stderr, "\t-d enable output debug events\n");
fprintf(stderr, "\t-t <tuntap_iface> set the GW TUN/TAP interface name\n");
fprintf(stderr, "\t-l <lan_iface> set the GW lan interface name\n");
fprintf(stderr, "\t-i <instance> set the instance id\n");
fprintf(stderr, "\t-w <interconnect_addr> set the interconnect IP address\n");
fprintf(stderr, "\t-c <conf_path> specify the configuration path\n");
......@@ -182,13 +175,6 @@ bool init_process(int argc, char **argv,
return false;
}
if(lan_iface.size() == 0)
{
DFLTLOG(LEVEL_CRITICAL,
"missing mandatory lan interface name option");
return false;
}
if(conf_path.size() == 0)
{
DFLTLOG(LEVEL_CRITICAL,
......@@ -211,7 +197,6 @@ int main(int argc, char **argv)
struct sched_param param;
bool init_ok;
string tuntap_iface;
string lan_iface;
tal_id_t mac_id = 0;
string interconnect_addr;
struct la_specific spec_la;
......@@ -237,7 +222,7 @@ int main(int argc, char **argv)
int is_failure = 1;
// retrieve arguments on command line
init_ok = init_process(argc, argv, tuntap_iface, lan_iface, mac_id,
init_ok = init_process(argc, argv, tuntap_iface, mac_id,
interconnect_addr, conf_path);
plugin_conf_path = conf_path + string("plugins/");
......@@ -292,7 +277,6 @@ int main(int argc, char **argv)
// instantiate all blocs
spec_la.tuntap_iface = tuntap_iface;
spec_la.lan_iface = lan_iface;
block_lan_adaptation = Rt::createBlock<BlockLanAdaptation,
BlockLanAdaptation::Upward,
BlockLanAdaptation::Downward,
......
......@@ -82,7 +82,6 @@
bool init_process(int argc, char **argv,
string &ip_addr,
string &tuntap_iface,
string &lan_iface,
string &conf_path,
tal_id_t &instance_id)
{
......@@ -93,7 +92,7 @@ bool init_process(int argc, char **argv,
string lib_external_output_path = "";
char entity[10];
/* setting environment agent parameters */
while(!stop && (opt = getopt(argc, argv, "-hqdi:a:t:l:c:e:")) != EOF)
while(!stop && (opt = getopt(argc, argv, "-hqdi:a:t:c:e:")) != EOF)
{
switch(opt)
{
......@@ -117,10 +116,6 @@ bool init_process(int argc, char **argv,
// get TUN/TAP interface name
tuntap_iface = optarg;
break;
case 'l':
// get lan interface name
lan_iface = optarg;
break;
case 'c':
// get the conf path
conf_path = optarg;
......@@ -132,14 +127,13 @@ bool init_process(int argc, char **argv,
case 'h':
case '?':
fprintf(stderr, "usage: %s [-h] [[-q] [-d] -i instance_id -a ip_address "
"-t tuntap_iface -l lan_iface -c conf_path -e lib_ext_output_path\n",
"-t tuntap_iface -c conf_path -e lib_ext_output_path\n",
argv[0]);
fprintf(stderr, "\t-h print this message\n");
fprintf(stderr, "\t-q disable output\n");
fprintf(stderr, "\t-d enable output debug events\n");
fprintf(stderr, "\t-a <ip_address> set the IP address for emulation\n");
fprintf(stderr, "\t-t <tuntap_iface> set the ST TUN/TAP interface name\n");
fprintf(stderr, "\t-l <lan_iface> set the ST lan interface name\n");
fprintf(stderr, "\t-i <instance> set the instance id\n");
fprintf(stderr, "\t-c <conf_path> specify the configuration path\n");
fprintf(stderr, "\t-e <lib_ext_output_path> specify the external output library path\n");
......@@ -194,13 +188,6 @@ bool init_process(int argc, char **argv,
return false;
}
if(lan_iface.size() == 0)
{
DFLTLOG(LEVEL_CRITICAL,
"missing mandatory lan interface name option\n");
return false;
}
if(conf_path.size() == 0)
{
DFLTLOG(LEVEL_CRITICAL,
......@@ -219,7 +206,6 @@ int main(int argc, char **argv)
bool init_ok;
string ip_addr;
string tuntap_iface;
string lan_iface;
tal_id_t mac_id;
struct la_specific laspecific;
struct sc_specific scspecific;
......@@ -247,7 +233,7 @@ int main(int argc, char **argv)
int is_failure = 1;
// retrieve arguments on command line
init_ok = init_process(argc, argv, ip_addr, tuntap_iface, lan_iface, conf_path, mac_id);
init_ok = init_process(argc, argv, ip_addr, tuntap_iface, conf_path, mac_id);
plugin_conf_path = conf_path + string("plugins/");
......@@ -315,7 +301,6 @@ int main(int argc, char **argv)
// instantiate all blocs
// TODO remove lan iface once daemon handles bridging part
laspecific.tuntap_iface = tuntap_iface;
laspecific.lan_iface = lan_iface;
block_lan_adaptation = Rt::createBlock<BlockLanAdaptation,
BlockLanAdaptation::Upward,
BlockLanAdaptation::Downward,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment