summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-01-06 11:14:08 -0500
committerimarom <imarom@cisco.com>2016-01-07 04:52:14 -0500
commit72ca9e76d4c6a5fe48e8cd7e1e49b9e54e40fca9 (patch)
tree5506f556a6f39d539e4753f4e27d9eb14214a81a /src/main.cpp
parent2dfd6cf68403a487ab612767601a0f2e33696921 (diff)
more options to the stateless simulation
Diffstat (limited to 'src/main.cpp')
-rwxr-xr-xsrc/main.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/main.cpp b/src/main.cpp
index ea8e1e44..a2d06067 100755
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -36,7 +36,8 @@ using namespace std;
// An enum for all the option types
enum { OPT_HELP, OPT_CFG, OPT_NODE_DUMP, OP_STATS,
OPT_FILE_OUT, OPT_UT, OPT_PCAP, OPT_IPV6, OPT_MAC_FILE,
- OPT_SL, OPT_DP_CORE_COUNT, OPT_DP_CORE_INDEX, OPT_LIMIT};
+ OPT_SL, OPT_DP_CORE_COUNT, OPT_DP_CORE_INDEX, OPT_LIMIT,
+ OPT_DRY_RUN};
@@ -75,16 +76,12 @@ static CSimpleOpt::SOption parser_options[] =
{ OPT_DP_CORE_COUNT, "--cores", SO_REQ_SEP },
{ OPT_DP_CORE_INDEX, "--core_index", SO_REQ_SEP },
{ OPT_LIMIT, "--limit", SO_REQ_SEP },
+ { OPT_DRY_RUN, "--dry", SO_NONE },
SO_END_OF_OPTIONS
};
-
-static bool in_range(int x, int low, int high) {
- return ( (x >= low) && (x <= high) );
-}
-
static int usage(){
printf(" Usage: bp_sim [OPTION] -f cfg.yaml -o outfile.erf \n");
@@ -189,6 +186,10 @@ static int parse_options(int argc,
params["limit"] = atoi(args.OptionArg());
break;
+ case OPT_DRY_RUN:
+ params["dry"] = 1;
+ break;
+
default:
usage();
return -1;
@@ -277,12 +278,18 @@ int main(int argc , char * argv[]){
params["limit"] = 5000;
}
+ if (params.count("dry") == 0) {
+ params["dry"] = 0;
+ }
+
return st.run(CGlobalInfo::m_options.cfg_file,
CGlobalInfo::m_options.out_file,
2,
params["dp_core_count"],
params["dp_core_index"],
- params["limit"]);
+ params["limit"],
+ (params["dry"] == 1)
+ );
}
}
}