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
b8fea1a2
Commit
b8fea1a2
authored
10 years ago
by
Martine Lenders
Browse files
Options
Downloads
Plain Diff
Merge pull request #2735 from authmillenon/ipv6_netif/feat/hl
ipv6_netif: expand interface
parents
a5325162
25b568e6
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
sys/include/net/ng_ipv6.h
+0
-9
0 additions, 9 deletions
sys/include/net/ng_ipv6.h
sys/include/net/ng_ipv6/netif.h
+26
-3
26 additions, 3 deletions
sys/include/net/ng_ipv6/netif.h
sys/net/network_layer/ng_ipv6/netif/ng_ipv6_netif.c
+7
-6
7 additions, 6 deletions
sys/net/network_layer/ng_ipv6/netif/ng_ipv6_netif.c
with
33 additions
and
18 deletions
sys/include/net/ng_ipv6.h
+
0
−
9
View file @
b8fea1a2
...
@@ -29,15 +29,6 @@
...
@@ -29,15 +29,6 @@
extern
"C"
{
extern
"C"
{
#endif
#endif
/**
* @brief Default maximum transition unit
*
* @see <a href="https://tools.ietf.org/html/rfc2460#section-5">
* RFC 2460, section 5
* </a>
*/
#define NG_IPV6_DEFAULT_MTU (1280)
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
...
...
This diff is collapsed.
Click to expand it.
sys/include/net/ng_ipv6/netif.h
+
26
−
3
View file @
b8fea1a2
...
@@ -47,6 +47,27 @@ extern "C" {
...
@@ -47,6 +47,27 @@ extern "C" {
#endif
#endif
#endif
#endif
/**
* @brief Default MTU
*
* @see <a href="https://tools.ietf.org/html/rfc2460#section-5">
* RFC 2460, section 5
* </a>
*/
#define NG_IPV6_NETIF_DEFAULT_MTU (1280)
/**
* @brief Default hop limit
*
* @see <a href="https://tools.ietf.org/html/rfc4861#section-6.3.2">
* RFC 4861, section 6.3.2
* </a>
* @see <a href="http://www.iana.org/assignments/ip-parameters/ip-parameters.xhtml#ip-parameters-2">
* IANA, IP TIME TO LIVE PARAMETER
* </a>
*/
#define NG_IPV6_NETIF_DEFAULT_HL (64)
/**
/**
* @{
* @{
* @name Flags for a registered IPv6 address.
* @name Flags for a registered IPv6 address.
...
@@ -56,8 +77,8 @@ extern "C" {
...
@@ -56,8 +77,8 @@ extern "C" {
* RFC 4291, section 2.6
* RFC 4291, section 2.6
* </a>
* </a>
*/
*/
#define NG_IPV6_NETIF_FLAGS_UNICAST (0x00)
/**< unicast address */
#define NG_IPV6_NETIF_
ADDR_
FLAGS_UNICAST
(0x00)
/**< unicast address */
#define NG_IPV6_NETIF_FLAGS_NON_UNICAST (0x01)
/**< non-unicast address */
#define NG_IPV6_NETIF_
ADDR_
FLAGS_NON_UNICAST
(0x01)
/**< non-unicast address */
/**
/**
* @}
* @}
*/
*/
...
@@ -80,6 +101,8 @@ typedef struct {
...
@@ -80,6 +101,8 @@ typedef struct {
mutex_t
mutex
;
/**< mutex for the interface */
mutex_t
mutex
;
/**< mutex for the interface */
kernel_pid_t
pid
;
/**< PID of the interface */
kernel_pid_t
pid
;
/**< PID of the interface */
uint16_t
mtu
;
/**< Maximum Transmission Unit (MTU) of the interface */
uint16_t
mtu
;
/**< Maximum Transmission Unit (MTU) of the interface */
uint8_t
cur_hl
;
/**< current hop limit for the interface */
uint8_t
flags
;
/**< flags for 6LoWPAN and Neighbor Discovery */
}
ng_ipv6_netif_t
;
}
ng_ipv6_netif_t
;
/**
/**
...
@@ -244,7 +267,7 @@ ng_ipv6_addr_t *ng_ipv6_netif_find_best_src_addr(kernel_pid_t pid, const ng_ipv6
...
@@ -244,7 +267,7 @@ ng_ipv6_addr_t *ng_ipv6_netif_find_best_src_addr(kernel_pid_t pid, const ng_ipv6
static
inline
bool
ng_ipv6_netif_addr_is_non_unicast
(
const
ng_ipv6_addr_t
*
addr
)
static
inline
bool
ng_ipv6_netif_addr_is_non_unicast
(
const
ng_ipv6_addr_t
*
addr
)
{
{
return
(
bool
)(
container_of
(
addr
,
ng_ipv6_netif_addr_t
,
addr
)
->
flags
&
return
(
bool
)(
container_of
(
addr
,
ng_ipv6_netif_addr_t
,
addr
)
->
flags
&
NG_IPV6_NETIF_FLAGS_NON_UNICAST
);
NG_IPV6_NETIF_
ADDR_
FLAGS_NON_UNICAST
);
}
}
...
...
This diff is collapsed.
Click to expand it.
sys/net/network_layer/ng_ipv6/netif/ng_ipv6_netif.c
+
7
−
6
View file @
b8fea1a2
...
@@ -20,7 +20,6 @@
...
@@ -20,7 +20,6 @@
#include
"kernel_types.h"
#include
"kernel_types.h"
#include
"mutex.h"
#include
"mutex.h"
#include
"net/ng_ipv6.h"
#include
"net/ng_ipv6/addr.h"
#include
"net/ng_ipv6/addr.h"
#include
"net/ng_netif.h"
#include
"net/ng_netif.h"
...
@@ -55,12 +54,12 @@ static int _add_addr_to_entry(ng_ipv6_netif_t *entry, const ng_ipv6_addr_t *addr
...
@@ -55,12 +54,12 @@ static int _add_addr_to_entry(ng_ipv6_netif_t *entry, const ng_ipv6_addr_t *addr
entry
->
addrs
[
i
].
prefix_len
=
NG_IPV6_ADDR_BIT_LEN
;
entry
->
addrs
[
i
].
prefix_len
=
NG_IPV6_ADDR_BIT_LEN
;
}
}
entry
->
addrs
[
i
].
flags
=
NG_IPV6_NETIF_FLAGS_NON_UNICAST
;
entry
->
addrs
[
i
].
flags
=
NG_IPV6_NETIF_
ADDR_
FLAGS_NON_UNICAST
;
}
}
else
{
else
{
entry
->
addrs
[
i
].
prefix_len
=
prefix_len
;
entry
->
addrs
[
i
].
prefix_len
=
prefix_len
;
entry
->
addrs
[
i
].
flags
=
NG_IPV6_NETIF_FLAGS_UNICAST
;
entry
->
addrs
[
i
].
flags
=
NG_IPV6_NETIF_
ADDR_
FLAGS_UNICAST
;
}
}
return
0
;
return
0
;
...
@@ -99,9 +98,11 @@ void ng_ipv6_netif_add(kernel_pid_t pid)
...
@@ -99,9 +98,11 @@ void ng_ipv6_netif_add(kernel_pid_t pid)
DEBUG
(
"Add IPv6 interface %"
PRIkernel_pid
" (i = %d)
\n
"
,
pid
,
i
);
DEBUG
(
"Add IPv6 interface %"
PRIkernel_pid
" (i = %d)
\n
"
,
pid
,
i
);
ipv6_ifs
[
i
].
pid
=
pid
;
ipv6_ifs
[
i
].
pid
=
pid
;
DEBUG
(
" * pid = %"
PRIkernel_pid
"
\n
"
,
ipv6_ifs
[
i
].
pid
);
DEBUG
(
" * pid = %"
PRIkernel_pid
" "
,
ipv6_ifs
[
i
].
pid
);
ipv6_ifs
[
i
].
mtu
=
NG_IPV6_DEFAULT_MTU
;
ipv6_ifs
[
i
].
mtu
=
NG_IPV6_NETIF_DEFAULT_MTU
;
DEBUG
(
" * mtu = %d
\n
"
,
ipv6_ifs
[
i
].
mtu
);
DEBUG
(
"mtu = %d "
,
ipv6_ifs
[
i
].
mtu
);
ipv6_ifs
[
i
].
cur_hl
=
NG_IPV6_NETIF_DEFAULT_HL
;
DEBUG
(
"cur_hl = %d "
,
ipv6_ifs
[
i
].
cur_hl
);
_add_addr_to_entry
(
&
ipv6_ifs
[
i
],
&
addr
,
NG_IPV6_ADDR_BIT_LEN
,
0
);
_add_addr_to_entry
(
&
ipv6_ifs
[
i
],
&
addr
,
NG_IPV6_ADDR_BIT_LEN
,
0
);
...
...
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