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
f4c88749
Commit
f4c88749
authored
Jul 02, 2014
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New legacy-cost interface option for compatibility purpose
parent
f5360dfe
Pipeline
#299
skipped
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
6 deletions
+28
-6
babeld.man
babeld.man
+7
-0
configuration.c
configuration.c
+7
-0
interface.c
interface.c
+1
-0
interface.h
interface.h
+2
-0
neighbour.c
neighbour.c
+11
-6
No files found.
babeld.man
View file @
f4c88749
...
...
@@ -304,6 +304,13 @@ for computing metrics of routes going through this interface depends on
whether link quality estimation is being done. The default is 96 for wired
interfaces, and 256 for wireless ones.
.TP
.BI legacy\-rxcost " cost"
This overrides the interface rxcost when when RTT can not be computed, usually
because the neighbour runs an old version of Babel. This parameter exists
mainly for compatibility purpose and without it, the first nodes that are
upgraded to use RTT-based cost would be overrated. By default, rxcost is not
overridden.
.TP
.BI channel " channel"
Sets the channel for this interface. The value
.I channel
...
...
configuration.c
View file @
f4c88749
...
...
@@ -406,6 +406,12 @@ parse_anonymous_ifconf(int c, gnc_t gnc, void *closure,
if
(
c
<
-
1
||
cost
<=
0
||
cost
>
0xFFFF
)
goto
error
;
if_conf
->
cost
=
cost
;
}
else
if
(
strcmp
(
token
,
"legacy-rxcost"
)
==
0
)
{
int
cost
;
c
=
getint
(
c
,
&
cost
,
gnc
,
closure
);
if
(
c
<
-
1
||
cost
<=
0
||
cost
>
0xFFFF
)
goto
error
;
if_conf
->
legacy_cost
=
cost
;
}
else
if
(
strcmp
(
token
,
"hello-interval"
)
==
0
)
{
int
interval
;
c
=
getthousands
(
c
,
&
interval
,
gnc
,
closure
);
...
...
@@ -569,6 +575,7 @@ merge_ifconf(struct interface_conf *dest,
MERGE
(
hello_interval
);
MERGE
(
update_interval
);
MERGE
(
cost
);
MERGE
(
legacy_cost
);
MERGE
(
wired
);
MERGE
(
split_horizon
);
MERGE
(
lq
);
...
...
interface.c
View file @
f4c88749
...
...
@@ -289,6 +289,7 @@ interface_up(struct interface *ifp, int up)
else
ifp
->
flags
|=
IF_LQ
;
}
ifp
->
legacy_cost
=
IF_CONF
(
ifp
,
legacy_cost
);
if
(
IF_CONF
(
ifp
,
faraway
)
==
CONFIG_YES
)
ifp
->
flags
|=
IF_FARAWAY
;
...
...
interface.h
View file @
f4c88749
...
...
@@ -32,6 +32,7 @@ struct interface_conf {
unsigned
hello_interval
;
unsigned
update_interval
;
unsigned
short
cost
;
unsigned
short
legacy_cost
;
char
wired
;
char
split_horizon
;
char
lq
;
...
...
@@ -94,6 +95,7 @@ struct interface {
time_t
bucket_time
;
unsigned
int
bucket
;
time_t
last_update_time
;
unsigned
short
legacy_cost
;
unsigned
short
hello_seqno
;
unsigned
hello_interval
;
unsigned
update_interval
;
...
...
neighbour.c
View file @
f4c88749
...
...
@@ -267,20 +267,25 @@ check_neighbours()
unsigned
neighbour_rxcost
(
struct
neighbour
*
neigh
)
{
unsigned
delay
;
unsigned
delay
,
cost
;
unsigned
short
reach
=
neigh
->
reach
;
struct
interface
*
ifp
;
delay
=
timeval_minus_msec
(
&
now
,
&
neigh
->
hello_time
);
if
((
reach
&
0xFFF0
)
==
0
||
delay
>=
180000
)
{
if
((
reach
&
0xFFF0
)
==
0
||
delay
>=
180000
)
return
INFINITY
;
}
else
if
((
neigh
->
ifp
->
flags
&
IF_LQ
))
{
ifp
=
neigh
->
ifp
;
cost
=
ifp
->
max_rtt_penalty
&&
!
valid_rtt
(
neigh
)
&&
ifp
->
legacy_cost
?
ifp
->
legacy_cost
:
ifp
->
cost
;
if
((
neigh
->
ifp
->
flags
&
IF_LQ
))
{
int
sreach
=
((
reach
&
0x8000
)
>>
2
)
+
((
reach
&
0x4000
)
>>
1
)
+
(
reach
&
0x3FFF
);
/* 0 <= sreach <= 0x7FFF */
int
cost
=
(
0x8000
*
neigh
->
ifp
->
cost
)
/
(
sreach
+
1
);
cost
=
(
0x8000
*
cost
)
/
(
sreach
+
1
);
/* cost >= interface->cost */
if
(
delay
>=
40000
)
cost
=
(
cost
*
(
delay
-
20000
)
+
10000
)
/
20000
;
...
...
@@ -288,11 +293,11 @@ neighbour_rxcost(struct neighbour *neigh)
}
else
{
/* To lose one hello is a misfortune, to lose two is carelessness. */
if
((
reach
&
0xC000
)
==
0xC000
)
return
neigh
->
ifp
->
cost
;
return
cost
;
else
if
((
reach
&
0xC000
)
==
0
)
return
INFINITY
;
else
if
((
reach
&
0x2000
))
return
neigh
->
ifp
->
cost
;
return
cost
;
else
return
INFINITY
;
}
...
...
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