Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
babeld
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
babeld
Commits
311aa83c
Commit
311aa83c
authored
Sep 03, 2013
by
Baptiste Jonglez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Send back timestamps with outgoing IHU messages
parent
16cf94d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
4 deletions
+32
-4
message.c
message.c
+32
-4
No files found.
message.c
View file @
311aa83c
...
...
@@ -1289,6 +1289,8 @@ send_ihu(struct neighbour *neigh, struct interface *ifp)
{
int
rxcost
,
interval
;
int
ll
;
int
send_rtt_data
;
int
msglen
;
if
(
neigh
==
NULL
&&
ifp
==
NULL
)
{
struct
interface
*
ifp_aux
;
...
...
@@ -1332,8 +1334,21 @@ send_ihu(struct neighbour *neigh, struct interface *ifp)
ll
=
linklocal
(
neigh
->
address
);
/* Checks whether the RTT data is not too old to be sent. */
if
(
neigh
->
hello_send_us
&&
timeval_minus_msec
(
&
now
,
&
neigh
->
hello_rtt_receive_time
)
<
1000000
)
{
send_rtt_data
=
1
;
}
else
{
neigh
->
hello_send_us
=
0
;
send_rtt_data
=
0
;
}
/* The length depends on the format of the address, and then an
optional 10-bytes sub-TLV for timestamps (used to compute a RTT). */
msglen
=
(
ll
?
14
:
22
)
+
(
send_rtt_data
?
10
:
0
);
if
(
unicast_neighbour
!=
neigh
)
{
start_message
(
ifp
,
MESSAGE_IHU
,
ll
?
14
:
22
);
start_message
(
ifp
,
MESSAGE_IHU
,
msglen
);
accumulate_byte
(
ifp
,
ll
?
3
:
2
);
accumulate_byte
(
ifp
,
0
);
accumulate_short
(
ifp
,
rxcost
);
...
...
@@ -1342,10 +1357,16 @@ send_ihu(struct neighbour *neigh, struct interface *ifp)
accumulate_bytes
(
ifp
,
neigh
->
address
+
8
,
8
);
else
accumulate_bytes
(
ifp
,
neigh
->
address
,
16
);
end_message
(
ifp
,
MESSAGE_IHU
,
ll
?
14
:
22
);
if
(
send_rtt_data
)
{
accumulate_byte
(
ifp
,
SUBTLV_TIMESTAMP
);
accumulate_byte
(
ifp
,
8
);
accumulate_int
(
ifp
,
neigh
->
hello_send_us
);
accumulate_int
(
ifp
,
time_us
(
neigh
->
hello_rtt_receive_time
));
}
end_message
(
ifp
,
MESSAGE_IHU
,
msglen
);
}
else
{
int
rc
;
rc
=
start_unicast_message
(
neigh
,
MESSAGE_IHU
,
ll
?
14
:
22
);
rc
=
start_unicast_message
(
neigh
,
MESSAGE_IHU
,
msglen
);
if
(
rc
<
0
)
return
;
accumulate_unicast_byte
(
neigh
,
ll
?
3
:
2
);
accumulate_unicast_byte
(
neigh
,
0
);
...
...
@@ -1355,7 +1376,14 @@ send_ihu(struct neighbour *neigh, struct interface *ifp)
accumulate_unicast_bytes
(
neigh
,
neigh
->
address
+
8
,
8
);
else
accumulate_unicast_bytes
(
neigh
,
neigh
->
address
,
16
);
end_unicast_message
(
neigh
,
MESSAGE_IHU
,
ll
?
14
:
22
);
if
(
send_rtt_data
)
{
accumulate_unicast_byte
(
neigh
,
SUBTLV_TIMESTAMP
);
accumulate_unicast_byte
(
neigh
,
8
);
accumulate_unicast_int
(
neigh
,
neigh
->
hello_send_us
);
accumulate_unicast_int
(
neigh
,
time_us
(
neigh
->
hello_rtt_receive_time
));
}
end_unicast_message
(
neigh
,
MESSAGE_IHU
,
msglen
);
}
}
...
...
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