Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Switch - Software
Commits
3cc1e803
Commit
3cc1e803
authored
Feb 23, 2016
by
Adam Wujek
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
userspace/tools: rename network interfaces from wrX to wriX+1 in rtu_stat
Signed-off-by:
Adam Wujek
<
adam.wujek@cern.ch
>
parent
343a89b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
21 deletions
+49
-21
rtu_stat.c
userspace/tools/rtu_stat.c
+49
-21
No files found.
userspace/tools/rtu_stat.c
View file @
3cc1e803
...
...
@@ -102,7 +102,7 @@ char *decode_ports(int dpm, int nports)
for
(
i
=
0
;
i
<
nports
;
i
++
)
{
sprintf
(
str2
,
"%d "
,
i
);
sprintf
(
str2
,
"%d "
,
i
+
1
);
if
(
dpm
&
(
1
<<
i
))
strcat
(
str
,
str2
);
}
...
...
@@ -322,29 +322,57 @@ int main(int argc, char **argv)
isok
=
0
;
if
(
argc
>
1
)
{
if
(
strcmp
(
argv
[
1
],
"remove"
)
==
0
)
{
if
(
strcmp
(
argv
[
1
],
"remove"
)
==
0
)
{
i
=
atoidef
(
argv
[
2
],
-
1
);
if
((
0
<=
i
&&
i
<
18
)
&&
(
rtudexp_clear_entries
(
i
,
atoidef
(
argv
[
3
],
0
))
==
0
))
isok
=
1
;
else
printf
(
"Could not %s entry for wr%d
\n
"
,
argv
[
1
],
i
);
}
else
if
(
strcmp
(
argv
[
1
],
"add"
)
==
0
)
{
if
((
argc
>
3
)
&&
(
rtudexp_add_entry
(
argv
[
2
],
atoi
(
argv
[
3
]),
atoidef
(
argv
[
4
],
0
))
==
0
))
isok
=
1
;
else
printf
(
"Could not %s entry for %s
\n
"
,
argv
[
2
],
argv
[
3
]);
}
else
if
(
strcmp
(
argv
[
1
],
"vlan"
)
==
0
)
{
if
((
argc
>
3
)
&&
(
rtudexp_vlan_entry
(
atoi
(
argv
[
2
]),
atoi
(
argv
[
3
]),
argv
[
4
],
atoidef
(
argv
[
5
],
0
),
atoidef
(
argv
[
6
],
0
),
atoidef
(
argv
[
7
],
0
),
atoidef
(
argv
[
8
],
0
))
==
0
))
isok
=
1
;
else
printf
(
"Could not %s entry for %s
\n
"
,
argv
[
2
],
argv
[
3
]);
exit
(
1
);
}
else
if
(
strcmp
(
argv
[
1
],
"list"
)
==
0
)
isok
=
1
;
/* interface number 1..18*/
if
((
0
<
i
&&
i
<=
18
)
&&
(
rtudexp_clear_entries
(
i
-
1
,
atoidef
(
argv
[
3
],
0
)
)
==
0
))
{
/* ok */
isok
=
1
;
}
else
{
printf
(
"Could not %s entry for wri%d
\n
"
,
argv
[
1
],
i
);
exit
(
1
);
}
}
else
if
(
strcmp
(
argv
[
1
],
"add"
)
==
0
)
{
/* interface number 1..18*/
if
((
argc
>
3
)
&&
(
rtudexp_add_entry
(
argv
[
2
],
atoi
(
argv
[
3
])
-
1
,
atoidef
(
argv
[
4
],
0
)
)
==
0
))
{
/* ok */
isok
=
1
;
}
else
{
printf
(
"Could not %s entry for %s
\n
"
,
argv
[
2
],
argv
[
3
]
-
1
);
exit
(
1
);
}
}
else
if
(
strcmp
(
argv
[
1
],
"vlan"
)
==
0
)
{
if
((
argc
>
3
)
&&
(
rtudexp_vlan_entry
(
atoi
(
argv
[
2
]),
atoi
(
argv
[
3
])
-
1
,
argv
[
4
],
atoidef
(
argv
[
5
],
0
),
atoidef
(
argv
[
6
],
0
),
atoidef
(
argv
[
7
],
0
),
atoidef
(
argv
[
8
],
0
)
)
==
0
))
{
/* ok */
isok
=
1
;
}
else
{
printf
(
"Could not %s entry for %s
\n
"
,
argv
[
2
],
argv
[
3
]);
exit
(
1
);
}
}
else
if
(
strcmp
(
argv
[
1
],
"list"
)
==
0
)
isok
=
1
;
//Does not continue
if
(
!
isok
)
show_help
(
argv
[
0
]);
if
(
!
isok
)
show_help
(
argv
[
0
]);
}
...
...
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