Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
35fa9495
Commit
35fa9495
authored
Aug 04, 2021
by
Antoine Kaufmann
Browse files
sims/net/switch: add switch '-u' to disable synchronization
parent
9cbb526d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
sims/net/switch/net_switch.cc
sims/net/switch/net_switch.cc
+8
-2
No files found.
sims/net/switch/net_switch.cc
View file @
35fa9495
...
@@ -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:
u
S: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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment