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
133aeede
Commit
133aeede
authored
10 years ago
by
Fabian Nack
Browse files
Options
Downloads
Patches
Plain Diff
sys/nhdp: Add interface specific packet sequence number
parent
ba141496
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/net/routing/nhdp/nhdp.c
+2
-0
2 additions, 0 deletions
sys/net/routing/nhdp/nhdp.c
sys/net/routing/nhdp/nhdp.h
+1
-0
1 addition, 0 deletions
sys/net/routing/nhdp/nhdp.h
sys/net/routing/nhdp/nhdp_writer.c
+15
-0
15 additions, 0 deletions
sys/net/routing/nhdp/nhdp_writer.c
with
18 additions
and
0 deletions
sys/net/routing/nhdp/nhdp.c
+
2
−
0
View file @
133aeede
...
@@ -170,6 +170,8 @@ int nhdp_register_if(kernel_pid_t if_pid, uint8_t *addr, size_t addr_size, uint8
...
@@ -170,6 +170,8 @@ int nhdp_register_if(kernel_pid_t if_pid, uint8_t *addr, size_t addr_size, uint8
if_entry
->
validity_time
.
microseconds
=
MS_IN_USEC
*
val_time_ms
;
if_entry
->
validity_time
.
microseconds
=
MS_IN_USEC
*
val_time_ms
;
timex_normalize
(
&
if_entry
->
hello_interval
);
timex_normalize
(
&
if_entry
->
hello_interval
);
timex_normalize
(
&
if_entry
->
validity_time
);
timex_normalize
(
&
if_entry
->
validity_time
);
/* Reset sequence number */
if_entry
->
seq_no
=
0
;
/* Everything went well */
/* Everything went well */
nhdp_decrement_addr_usage
(
nhdp_addr
);
nhdp_decrement_addr_usage
(
nhdp_addr
);
...
...
This diff is collapsed.
Click to expand it.
sys/net/routing/nhdp/nhdp.h
+
1
−
0
View file @
133aeede
...
@@ -92,6 +92,7 @@ typedef struct nhdp_if_entry_t {
...
@@ -92,6 +92,7 @@ typedef struct nhdp_if_entry_t {
vtimer_t
if_timer
;
/**< Vtimer used for the periodic signaling */
vtimer_t
if_timer
;
/**< Vtimer used for the periodic signaling */
timex_t
hello_interval
;
/**< Interval time for periodic HELLOs */
timex_t
hello_interval
;
/**< Interval time for periodic HELLOs */
timex_t
validity_time
;
/**< Validity time for propagated information */
timex_t
validity_time
;
/**< Validity time for propagated information */
uint16_t
seq_no
;
/**< Sequence number of last send RFC5444 packet */
struct
rfc5444_writer_target
wr_target
;
/**< Interface specific writer target */
struct
rfc5444_writer_target
wr_target
;
/**< Interface specific writer target */
}
nhdp_if_entry_t
;
}
nhdp_if_entry_t
;
...
...
This diff is collapsed.
Click to expand it.
sys/net/routing/nhdp/nhdp_writer.c
+
15
−
0
View file @
133aeede
...
@@ -46,6 +46,8 @@ static void _nhdp_add_hello_msg_header_cb(struct rfc5444_writer *wr,
...
@@ -46,6 +46,8 @@ static void _nhdp_add_hello_msg_header_cb(struct rfc5444_writer *wr,
struct
rfc5444_writer_message
*
msg
);
struct
rfc5444_writer_message
*
msg
);
static
void
_nhdp_add_message_tlvs_cb
(
struct
rfc5444_writer
*
wr
);
static
void
_nhdp_add_message_tlvs_cb
(
struct
rfc5444_writer
*
wr
);
static
void
_nhdp_add_addresses_cb
(
struct
rfc5444_writer
*
wr
);
static
void
_nhdp_add_addresses_cb
(
struct
rfc5444_writer
*
wr
);
static
void
_nhdp_add_packet_header_cb
(
struct
rfc5444_writer
*
writer
,
struct
rfc5444_writer_target
*
rfc5444_target
);
static
void
netaddr_from_nhdp_address
(
struct
netaddr
*
target
,
nhdp_addr_t
*
n_addr
);
static
void
netaddr_from_nhdp_address
(
struct
netaddr
*
target
,
nhdp_addr_t
*
n_addr
);
/* Array containing the known Address TLVs */
/* Array containing the known Address TLVs */
...
@@ -108,6 +110,8 @@ void nhdp_writer_register_if(struct rfc5444_writer_target *new_if)
...
@@ -108,6 +110,8 @@ void nhdp_writer_register_if(struct rfc5444_writer_target *new_if)
{
{
mutex_lock
(
&
mtx_packet_write
);
mutex_lock
(
&
mtx_packet_write
);
/* Add packet header callback to writer target of the interface */
new_if
->
addPacketHeader
=
_nhdp_add_packet_header_cb
;
/* Register target interface in writer */
/* Register target interface in writer */
rfc5444_writer_register_target
(
&
nhdp_writer
,
new_if
);
rfc5444_writer_register_target
(
&
nhdp_writer
,
new_if
);
...
@@ -212,6 +216,17 @@ static void _nhdp_add_addresses_cb(struct rfc5444_writer *wr)
...
@@ -212,6 +216,17 @@ static void _nhdp_add_addresses_cb(struct rfc5444_writer *wr)
nhdp_reset_addresses_tmp_usg
();
nhdp_reset_addresses_tmp_usg
();
}
}
/**
* Add packet header with sequence number to current packet
* Called by oonf_api during packet creation
*/
static
void
_nhdp_add_packet_header_cb
(
struct
rfc5444_writer
*
writer
,
struct
rfc5444_writer_target
*
rfc5444_target
)
{
rfc5444_writer_set_pkt_header
(
writer
,
rfc5444_target
,
true
);
rfc5444_writer_set_pkt_seqno
(
writer
,
rfc5444_target
,
++
nhdp_wr_curr_if_entry
->
seq_no
);
}
/**
/**
* Construct a netaddr from a given NHDP address
* Construct a netaddr from a given NHDP address
*/
*/
...
...
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