Commit 35fa9495 authored by Antoine Kaufmann's avatar Antoine Kaufmann
Browse files

sims/net/switch: add switch '-u' to disable synchronization

parent 9cbb526d
...@@ -232,15 +232,17 @@ static void switch_pkt(struct SimbricksNetIf *nsif, size_t iport) { ...@@ -232,15 +232,17 @@ static void switch_pkt(struct SimbricksNetIf *nsif, size_t iport) {
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
int c; int c;
int bad_option = 0; int bad_option = 0;
int sync_eth = 1;
int sync_mode = SIMBRICKS_PROTO_SYNC_SIMBRICKS; int sync_mode = SIMBRICKS_PROTO_SYNC_SIMBRICKS;
pcap_t *pc = nullptr; pcap_t *pc = nullptr;
// Parse command line argument // Parse command line argument
while ((c = getopt(argc, argv, "s:S:E:m:p:")) != -1 && !bad_option) { while ((c = getopt(argc, argv, "s:uS:E:m:p:")) != -1 && !bad_option) {
switch (c) { switch (c) {
case 's': { case 's': {
struct SimbricksNetIf nsif; struct SimbricksNetIf nsif;
int sync = 1; int sync = sync_eth;
fprintf(stderr, "Switch connecting to: %s\n", optarg);
if (SimbricksNetIfInit(&nsif, optarg, &sync) != 0) { if (SimbricksNetIfInit(&nsif, optarg, &sync) != 0) {
fprintf(stderr, "connecting to %s failed\n", optarg); fprintf(stderr, "connecting to %s failed\n", optarg);
return EXIT_FAILURE; return EXIT_FAILURE;
...@@ -249,6 +251,10 @@ int main(int argc, char *argv[]) { ...@@ -249,6 +251,10 @@ int main(int argc, char *argv[]) {
break; break;
} }
case 'u':
sync_eth = 0;
break;
case 'S': case 'S':
sync_period = strtoull(optarg, NULL, 0) * 1000ULL; sync_period = strtoull(optarg, NULL, 0) * 1000ULL;
break; break;
......
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