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
88b4809d
Commit
88b4809d
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
96dcd728
Pipeline
#300
skipped
Changes
5
Pipelines
1
Show 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 @
88b4809d
...
@@ -305,6 +305,13 @@ for computing metrics of routes going through this interface depends on
...
@@ -305,6 +305,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
whether link quality estimation is being done. The default is 96 for wired
interfaces, and 256 for wireless ones.
interfaces, and 256 for wireless ones.
.TP
.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"
.BI channel " channel"
Sets the channel for this interface. The value
Sets the channel for this interface. The value
.I channel
.I channel
...
...
configuration.c
View file @
88b4809d
...
@@ -406,6 +406,12 @@ parse_anonymous_ifconf(int c, gnc_t gnc, void *closure,
...
@@ -406,6 +406,12 @@ parse_anonymous_ifconf(int c, gnc_t gnc, void *closure,
if
(
c
<
-
1
||
cost
<=
0
||
cost
>
0xFFFF
)
if
(
c
<
-
1
||
cost
<=
0
||
cost
>
0xFFFF
)
goto
error
;
goto
error
;
if_conf
->
cost
=
cost
;
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
)
{
}
else
if
(
strcmp
(
token
,
"hello-interval"
)
==
0
)
{
int
interval
;
int
interval
;
c
=
getthousands
(
c
,
&
interval
,
gnc
,
closure
);
c
=
getthousands
(
c
,
&
interval
,
gnc
,
closure
);
...
@@ -569,6 +575,7 @@ merge_ifconf(struct interface_conf *dest,
...
@@ -569,6 +575,7 @@ merge_ifconf(struct interface_conf *dest,
MERGE
(
hello_interval
);
MERGE
(
hello_interval
);
MERGE
(
update_interval
);
MERGE
(
update_interval
);
MERGE
(
cost
);
MERGE
(
cost
);
MERGE
(
legacy_cost
);
MERGE
(
wired
);
MERGE
(
wired
);
MERGE
(
split_horizon
);
MERGE
(
split_horizon
);
MERGE
(
lq
);
MERGE
(
lq
);
...
...
interface.c
View file @
88b4809d
...
@@ -289,6 +289,7 @@ interface_up(struct interface *ifp, int up)
...
@@ -289,6 +289,7 @@ interface_up(struct interface *ifp, int up)
else
else
ifp
->
flags
|=
IF_LQ
;
ifp
->
flags
|=
IF_LQ
;
}
}
ifp
->
legacy_cost
=
IF_CONF
(
ifp
,
legacy_cost
);
if
(
IF_CONF
(
ifp
,
faraway
)
==
CONFIG_YES
)
if
(
IF_CONF
(
ifp
,
faraway
)
==
CONFIG_YES
)
ifp
->
flags
|=
IF_FARAWAY
;
ifp
->
flags
|=
IF_FARAWAY
;
...
...
interface.h
View file @
88b4809d
...
@@ -32,6 +32,7 @@ struct interface_conf {
...
@@ -32,6 +32,7 @@ struct interface_conf {
unsigned
hello_interval
;
unsigned
hello_interval
;
unsigned
update_interval
;
unsigned
update_interval
;
unsigned
short
cost
;
unsigned
short
cost
;
unsigned
short
legacy_cost
;
char
wired
;
char
wired
;
char
split_horizon
;
char
split_horizon
;
char
lq
;
char
lq
;
...
@@ -94,6 +95,7 @@ struct interface {
...
@@ -94,6 +95,7 @@ struct interface {
time_t
bucket_time
;
time_t
bucket_time
;
unsigned
int
bucket
;
unsigned
int
bucket
;
time_t
last_update_time
;
time_t
last_update_time
;
unsigned
short
legacy_cost
;
unsigned
short
hello_seqno
;
unsigned
short
hello_seqno
;
unsigned
hello_interval
;
unsigned
hello_interval
;
unsigned
update_interval
;
unsigned
update_interval
;
...
...
neighbour.c
View file @
88b4809d
...
@@ -267,20 +267,25 @@ check_neighbours()
...
@@ -267,20 +267,25 @@ check_neighbours()
unsigned
unsigned
neighbour_rxcost
(
struct
neighbour
*
neigh
)
neighbour_rxcost
(
struct
neighbour
*
neigh
)
{
{
unsigned
delay
;
unsigned
delay
,
cost
;
unsigned
short
reach
=
neigh
->
reach
;
unsigned
short
reach
=
neigh
->
reach
;
struct
interface
*
ifp
;
delay
=
timeval_minus_msec
(
&
now
,
&
neigh
->
hello_time
);
delay
=
timeval_minus_msec
(
&
now
,
&
neigh
->
hello_time
);
if
((
reach
&
0xFFF0
)
==
0
||
delay
>=
180000
)
{
if
((
reach
&
0xFFF0
)
==
0
||
delay
>=
180000
)
return
INFINITY
;
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
=
int
sreach
=
((
reach
&
0x8000
)
>>
2
)
+
((
reach
&
0x8000
)
>>
2
)
+
((
reach
&
0x4000
)
>>
1
)
+
((
reach
&
0x4000
)
>>
1
)
+
(
reach
&
0x3FFF
);
(
reach
&
0x3FFF
);
/* 0 <= sreach <= 0x7FFF */
/* 0 <= sreach <= 0x7FFF */
int
cost
=
(
0x8000
*
neigh
->
ifp
->
cost
)
/
(
sreach
+
1
);
cost
=
(
0x8000
*
cost
)
/
(
sreach
+
1
);
/* cost >= interface->cost */
/* cost >= interface->cost */
if
(
delay
>=
40000
)
if
(
delay
>=
40000
)
cost
=
(
cost
*
(
delay
-
20000
)
+
10000
)
/
20000
;
cost
=
(
cost
*
(
delay
-
20000
)
+
10000
)
/
20000
;
...
@@ -288,11 +293,11 @@ neighbour_rxcost(struct neighbour *neigh)
...
@@ -288,11 +293,11 @@ neighbour_rxcost(struct neighbour *neigh)
}
else
{
}
else
{
/* To lose one hello is a misfortune, to lose two is carelessness. */
/* To lose one hello is a misfortune, to lose two is carelessness. */
if
((
reach
&
0xC000
)
==
0xC000
)
if
((
reach
&
0xC000
)
==
0xC000
)
return
neigh
->
ifp
->
cost
;
return
cost
;
else
if
((
reach
&
0xC000
)
==
0
)
else
if
((
reach
&
0xC000
)
==
0
)
return
INFINITY
;
return
INFINITY
;
else
if
((
reach
&
0x2000
))
else
if
((
reach
&
0x2000
))
return
neigh
->
ifp
->
cost
;
return
cost
;
else
else
return
INFINITY
;
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