Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
0f9d266a
You need to sign in or sign up before continuing.
Unverified
Commit
0f9d266a
authored
7 years ago
by
Martine Lenders
Browse files
Options
Downloads
Patches
Plain Diff
shell: adapt `nib route` command for route lifetime
parent
e7bb0ed6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sys/shell/commands/sc_gnrc_ipv6_nib.c
+6
-2
6 additions, 2 deletions
sys/shell/commands/sc_gnrc_ipv6_nib.c
with
6 additions
and
2 deletions
sys/shell/commands/sc_gnrc_ipv6_nib.c
+
6
−
2
View file @
0f9d266a
...
@@ -72,7 +72,7 @@ static void _usage_nib_prefix(char **argv)
...
@@ -72,7 +72,7 @@ static void _usage_nib_prefix(char **argv)
static
void
_usage_nib_route
(
char
**
argv
)
static
void
_usage_nib_route
(
char
**
argv
)
{
{
printf
(
"usage: %s %s [show|add|del|help]
\n
"
,
argv
[
0
],
argv
[
1
]);
printf
(
"usage: %s %s [show|add|del|help]
\n
"
,
argv
[
0
],
argv
[
1
]);
printf
(
" %s %s add <iface> <prefix>[/<prefix_len>] <next_hop>
\n
"
,
printf
(
" %s %s add <iface> <prefix>[/<prefix_len>] <next_hop>
[<ltime in sec>]
\n
"
,
argv
[
0
],
argv
[
1
]);
argv
[
0
],
argv
[
1
]);
printf
(
" %s %s del <iface> <prefix>[/<prefix_len>]
\n
"
,
argv
[
0
],
argv
[
1
]);
printf
(
" %s %s del <iface> <prefix>[/<prefix_len>]
\n
"
,
argv
[
0
],
argv
[
1
]);
printf
(
" %s %s show <iface>
\n
"
,
argv
[
0
],
argv
[
1
]);
printf
(
" %s %s show <iface>
\n
"
,
argv
[
0
],
argv
[
1
]);
...
@@ -202,6 +202,7 @@ static int _nib_route(int argc, char **argv)
...
@@ -202,6 +202,7 @@ static int _nib_route(int argc, char **argv)
ipv6_addr_t
pfx
=
IPV6_ADDR_UNSPECIFIED
,
next_hop
;
ipv6_addr_t
pfx
=
IPV6_ADDR_UNSPECIFIED
,
next_hop
;
unsigned
iface
=
atoi
(
argv
[
3
]);
unsigned
iface
=
atoi
(
argv
[
3
]);
unsigned
pfx_len
=
ipv6_addr_split_prefix
(
argv
[
4
]);
unsigned
pfx_len
=
ipv6_addr_split_prefix
(
argv
[
4
]);
uint16_t
ltime
=
0
;
if
(
ipv6_addr_from_str
(
&
pfx
,
argv
[
4
])
==
NULL
)
{
if
(
ipv6_addr_from_str
(
&
pfx
,
argv
[
4
])
==
NULL
)
{
/* check if string equals "default"
/* check if string equals "default"
...
@@ -215,7 +216,10 @@ static int _nib_route(int argc, char **argv)
...
@@ -215,7 +216,10 @@ static int _nib_route(int argc, char **argv)
_usage_nib_route
(
argv
);
_usage_nib_route
(
argv
);
return
1
;
return
1
;
}
}
gnrc_ipv6_nib_ft_add
(
&
pfx
,
pfx_len
,
&
next_hop
,
iface
);
if
(
argc
>
6
)
{
ltime
=
(
uint16_t
)
atoi
(
argv
[
6
]);
}
gnrc_ipv6_nib_ft_add
(
&
pfx
,
pfx_len
,
&
next_hop
,
iface
,
ltime
);
}
}
else
if
((
argc
>
4
)
&&
(
strcmp
(
argv
[
2
],
"del"
)
==
0
))
{
else
if
((
argc
>
4
)
&&
(
strcmp
(
argv
[
2
],
"del"
)
==
0
))
{
ipv6_addr_t
pfx
;
ipv6_addr_t
pfx
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment