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
8186abb6
Commit
8186abb6
authored
Oct 31, 2013
by
Baptiste Jonglez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print RTT values in milliseconds rather than microseconds
parent
72ded7c1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
4 deletions
+15
-4
babeld.c
babeld.c
+2
-2
local.c
local.c
+2
-2
util.c
util.c
+10
-0
util.h
util.h
+1
-0
No files found.
babeld.c
View file @
8186abb6
...
@@ -1053,13 +1053,13 @@ dump_tables(FILE *out)
...
@@ -1053,13 +1053,13 @@ dump_tables(FILE *out)
FOR_ALL_NEIGHBOURS
(
neigh
)
{
FOR_ALL_NEIGHBOURS
(
neigh
)
{
fprintf
(
out
,
"Neighbour %s dev %s reach %04x rxcost %d txcost %d "
fprintf
(
out
,
"Neighbour %s dev %s reach %04x rxcost %d txcost %d "
"rtt %
d
rttcost %d chan %d%s.
\n
"
,
"rtt %
s
rttcost %d chan %d%s.
\n
"
,
format_address
(
neigh
->
address
),
format_address
(
neigh
->
address
),
neigh
->
ifp
->
name
,
neigh
->
ifp
->
name
,
neigh
->
reach
,
neigh
->
reach
,
neighbour_rxcost
(
neigh
),
neighbour_rxcost
(
neigh
),
neigh
->
txcost
,
neigh
->
txcost
,
neigh
->
rtt
,
format_thousands
(
neigh
->
rtt
)
,
neighbour_rttcost
(
neigh
),
neighbour_rttcost
(
neigh
),
neigh
->
ifp
->
channel
,
neigh
->
ifp
->
channel
,
if_up
(
neigh
->
ifp
)
?
""
:
" (down)"
);
if_up
(
neigh
->
ifp
)
?
""
:
" (down)"
);
...
...
local.c
View file @
8186abb6
...
@@ -138,8 +138,8 @@ local_notify_neighbour_1(int s, struct neighbour *neigh, int kind)
...
@@ -138,8 +138,8 @@ local_notify_neighbour_1(int s, struct neighbour *neigh, int kind)
rttbuf
[
0
]
=
'\0'
;
rttbuf
[
0
]
=
'\0'
;
if
(
valid_rtt
(
neigh
))
{
if
(
valid_rtt
(
neigh
))
{
rc
=
snprintf
(
rttbuf
,
64
,
" rtt %
d rttcost %d"
,
neigh
->
rtt
,
rc
=
snprintf
(
rttbuf
,
64
,
" rtt %
s rttcost %d"
,
neighbour_rttcost
(
neigh
));
format_thousands
(
neigh
->
rtt
),
neighbour_rttcost
(
neigh
));
if
(
rc
<
0
||
rc
>=
64
)
if
(
rc
<
0
||
rc
>=
64
)
rttbuf
[
0
]
=
'\0'
;
rttbuf
[
0
]
=
'\0'
;
}
}
...
...
util.c
View file @
8186abb6
...
@@ -295,6 +295,16 @@ format_eui64(const unsigned char *eui)
...
@@ -295,6 +295,16 @@ format_eui64(const unsigned char *eui)
return
buf
[
i
];
return
buf
[
i
];
}
}
const
char
*
format_thousands
(
unsigned
int
value
)
{
static
char
buf
[
4
][
30
];
static
int
i
=
0
;
i
=
(
i
+
1
)
%
4
;
snprintf
(
buf
[
i
],
30
,
"%d.%.3d"
,
value
/
1000
,
value
%
1000
);
return
buf
[
i
];
}
int
int
parse_address
(
const
char
*
address
,
unsigned
char
*
addr_r
,
int
*
af_r
)
parse_address
(
const
char
*
address
,
unsigned
char
*
addr_r
,
int
*
af_r
)
{
{
...
...
util.h
View file @
8186abb6
...
@@ -98,6 +98,7 @@ unsigned char *mask_prefix(unsigned char *restrict ret,
...
@@ -98,6 +98,7 @@ unsigned char *mask_prefix(unsigned char *restrict ret,
const
char
*
format_address
(
const
unsigned
char
*
address
);
const
char
*
format_address
(
const
unsigned
char
*
address
);
const
char
*
format_prefix
(
const
unsigned
char
*
address
,
unsigned
char
prefix
);
const
char
*
format_prefix
(
const
unsigned
char
*
address
,
unsigned
char
prefix
);
const
char
*
format_eui64
(
const
unsigned
char
*
eui
);
const
char
*
format_eui64
(
const
unsigned
char
*
eui
);
const
char
*
format_thousands
(
unsigned
int
value
);
int
parse_address
(
const
char
*
address
,
unsigned
char
*
addr_r
,
int
*
af_r
);
int
parse_address
(
const
char
*
address
,
unsigned
char
*
addr_r
,
int
*
af_r
);
int
parse_net
(
const
char
*
net
,
unsigned
char
*
prefix_r
,
unsigned
char
*
plen_r
,
int
parse_net
(
const
char
*
net
,
unsigned
char
*
prefix_r
,
unsigned
char
*
plen_r
,
int
*
af_r
);
int
*
af_r
);
...
...
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