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
a28c9e3a
Commit
a28c9e3a
authored
May 16, 2014
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace the field enable_timestamps with an interface flag.
Makes it consistent with the other interface flags.
parent
210445b1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
interface.c
interface.c
+1
-1
interface.h
interface.h
+1
-1
message.c
message.c
+6
-6
No files found.
interface.c
View file @
a28c9e3a
...
...
@@ -294,7 +294,7 @@ interface_up(struct interface *ifp, int up)
ifp
->
flags
|=
IF_FARAWAY
;
if
(
IF_CONF
(
ifp
,
enable_timestamps
)
==
CONFIG_YES
)
ifp
->
enable_timestamps
=
1
;
ifp
->
flags
|=
IF_TIMESTAMPS
;
if
(
IF_CONF
(
ifp
,
hello_interval
)
>
0
)
ifp
->
hello_interval
=
IF_CONF
(
ifp
,
hello_interval
);
...
...
interface.h
View file @
a28c9e3a
...
...
@@ -54,6 +54,7 @@ struct interface_conf {
#define IF_SPLIT_HORIZON (1 << 2)
#define IF_LQ (1 << 3)
#define IF_FARAWAY (1 << 4)
#define IF_TIMESTAMPS (1 << 5)
/* Only INTERFERING can appear on the wire. */
#define IF_CHANNEL_UNKNOWN 0
...
...
@@ -96,7 +97,6 @@ struct interface {
unsigned
short
hello_seqno
;
unsigned
hello_interval
;
unsigned
update_interval
;
int
enable_timestamps
;
/* A higher value means we forget old RTT samples faster. Must be
between 1 and 256, inclusive. */
unsigned
int
rtt_exponential_decay
;
...
...
message.c
View file @
a28c9e3a
...
...
@@ -284,7 +284,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
/* Content of the RTT sub-TLV on IHU messages. */
unsigned
int
hello_send_us
=
0
,
hello_rtt_receive_time
=
0
;
if
(
ifp
->
enable_timestamps
)
{
if
(
ifp
->
flags
&
IF_TIMESTAMPS
)
{
/* We want to track exactly when we received this packet. */
gettime
(
&
now
);
}
...
...
@@ -664,7 +664,7 @@ check_bucket(struct interface *ifp)
static
int
fill_rtt_message
(
struct
interface
*
ifp
)
{
if
(
ifp
->
enable_timestamps
&&
(
ifp
->
buffered_hello
>=
0
))
{
if
(
(
ifp
->
flags
&
IF_TIMESTAMPS
)
&&
(
ifp
->
buffered_hello
>=
0
))
{
if
(
ifp
->
sendbuf
[
ifp
->
buffered_hello
+
8
]
==
SUBTLV_PADN
&&
ifp
->
sendbuf
[
ifp
->
buffered_hello
+
9
]
==
4
)
{
unsigned
int
time
;
...
...
@@ -903,19 +903,19 @@ send_hello_noupdate(struct interface *ifp, unsigned interval)
debugf
(
"Sending hello %d (%d) to %s.
\n
"
,
ifp
->
hello_seqno
,
interval
,
ifp
->
name
);
start_message
(
ifp
,
MESSAGE_HELLO
,
ifp
->
enable_timestamps
?
12
:
6
);
start_message
(
ifp
,
MESSAGE_HELLO
,
(
ifp
->
flags
&
IF_TIMESTAMPS
)
?
12
:
6
);
ifp
->
buffered_hello
=
ifp
->
buffered
-
2
;
accumulate_short
(
ifp
,
0
);
accumulate_short
(
ifp
,
ifp
->
hello_seqno
);
accumulate_short
(
ifp
,
interval
>
0xFFFF
?
0xFFFF
:
interval
);
if
(
ifp
->
enable_timestamps
)
{
if
(
ifp
->
flags
&
IF_TIMESTAMPS
)
{
/* Sub-TLV containing the local time of emission. We use a
Pad4 sub-TLV, which we'll fill just before sending. */
accumulate_byte
(
ifp
,
SUBTLV_PADN
);
accumulate_byte
(
ifp
,
4
);
accumulate_int
(
ifp
,
0
);
}
end_message
(
ifp
,
MESSAGE_HELLO
,
ifp
->
enable_timestamps
?
12
:
6
);
end_message
(
ifp
,
MESSAGE_HELLO
,
(
ifp
->
flags
&
IF_TIMESTAMPS
)
?
12
:
6
);
}
void
...
...
@@ -1439,7 +1439,7 @@ send_ihu(struct neighbour *neigh, struct interface *ifp)
ll
=
linklocal
(
neigh
->
address
);
if
(
ifp
->
enable_timestamps
&&
neigh
->
hello_send_us
if
(
(
ifp
->
flags
&
IF_TIMESTAMPS
)
&&
neigh
->
hello_send_us
/* Checks whether the RTT data is not too old to be sent. */
&&
timeval_minus_msec
(
&
now
,
&
neigh
->
hello_rtt_receive_time
)
<
1000000
)
{
send_rtt_data
=
1
;
...
...
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