Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
wr-switch-sw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
white-rabbit
wr-switch-sw
Commits
6ffe505a
Commit
6ffe505a
authored
Jun 12, 2014
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools/wrsw_vlans: fix '--debug' and report minipc errors
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
32e1f1a6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
wrsw_vlans.c
userspace/tools/wrsw_vlans.c
+12
-5
No files found.
userspace/tools/wrsw_vlans.c
View file @
6ffe505a
...
...
@@ -23,6 +23,7 @@
#include <getopt.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <minipc.h>
#include <rtud_exports.h>
...
...
@@ -130,8 +131,6 @@ int main(int argc, char *argv[])
prgname
);
return
-
1
;
}
if
(
debug
)
minipc_set_logfile
(
rtud_ch
,
stderr
);
/*parse parameters*/
while
(
(
c
=
getopt_long
(
argc
,
argv
,
"h"
,
ropts
,
NULL
))
!=
-
1
)
{
...
...
@@ -211,6 +210,8 @@ int main(int argc, char *argv[])
case
0
:
break
;
case
OPT_LIST
:
if
(
debug
)
minipc_set_logfile
(
rtud_ch
,
stderr
);
list_rtu_vlans
();
break
;
case
'?'
:
...
...
@@ -220,9 +221,10 @@ int main(int argc, char *argv[])
}
}
if
(
debug
)
if
(
debug
)
{
minipc_set_logfile
(
rtud_ch
,
stderr
);
print_config
(
vlans
);
}
apply_settings
(
vlans
);
free_rtu_vlans
(
rtu_vlans
);
...
...
@@ -279,6 +281,7 @@ int apply_settings(struct s_port_vlans *vlans)
int
i
;
for_each_port
(
i
)
{
printf
(
"port %i
\n
"
,
i
);
//TODO: call apropriate ioctls to configure tagging/untagging
}
...
...
@@ -331,7 +334,11 @@ void list_rtu_vlans(void)
printf
(
" VID FID MASK DROP PRIO PRIO_OVERRIDE
\n
"
);
printf
(
"-----------------------------------------------------------
\n
"
);
do
{
minipc_call
(
rtud_ch
,
MINIPC_TIMEOUT
,
&
rtud_export_get_vd_list
,
&
vlist
,
idx
);
if
(
minipc_call
(
rtud_ch
,
MINIPC_TIMEOUT
,
&
rtud_export_get_vd_list
,
&
vlist
,
idx
)
<
0
)
{
fprintf
(
stderr
,
"%s: minipc_call: %s
\n
"
,
prgname
,
strerror
(
errno
));
return
;
}
for
(
i
=
0
;
i
<
vlist
.
num_entries
;
++
i
)
{
ventry
=
&
vlist
.
list
[
i
];
printf
(
"%4d %4d 0x%8x "
,
ventry
->
vid
,
ventry
->
fid
,
ventry
->
port_mask
);
...
...
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