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
d6e8d734
Commit
d6e8d734
authored
Dec 18, 2007
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename route->nexthop to route->neigh.
parent
078fe553
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
32 additions
and
32 deletions
+32
-32
babel.c
babel.c
+2
-2
filter.c
filter.c
+1
-1
filter.h
filter.h
+1
-1
message.c
message.c
+3
-3
neighbour.c
neighbour.c
+1
-1
route.c
route.c
+21
-21
route.h
route.h
+3
-3
No files found.
babel.c
View file @
d6e8d734
...
...
@@ -706,8 +706,8 @@ dump_tables(FILE *out)
id
?
format_address
(
routes
[
i
].
src
->
address
)
:
""
,
(
int
)
routes
[
i
].
seqno
,
(
int
)(
now
.
tv_sec
-
routes
[
i
].
time
),
routes
[
i
].
ne
xthop
->
network
->
ifname
,
format_address
(
routes
[
i
].
ne
xthop
->
address
),
routes
[
i
].
ne
igh
->
network
->
ifname
,
format_address
(
routes
[
i
].
ne
igh
->
address
),
routes
[
i
].
installed
?
" (installed)"
:
route_feasible
(
&
routes
[
i
])
?
" (feasible)"
:
""
);
}
...
...
filter.c
View file @
d6e8d734
...
...
@@ -27,7 +27,7 @@ THE SOFTWARE.
int
import_filter
(
const
unsigned
char
*
id
,
const
unsigned
char
*
prefix
,
unsigned
short
plen
,
const
unsigned
char
*
ne
xthop
)
const
unsigned
char
*
ne
igh
)
{
if
(
plen
>=
96
&&
v4mapped
(
prefix
))
return
1
;
...
...
filter.h
View file @
d6e8d734
...
...
@@ -22,6 +22,6 @@ THE SOFTWARE.
int
import_filter
(
const
unsigned
char
*
id
,
const
unsigned
char
*
prefix
,
unsigned
short
plen
,
const
unsigned
char
*
ne
xthop
);
const
unsigned
char
*
ne
igh
);
int
export_filter
(
const
unsigned
char
*
id
,
const
unsigned
char
*
prefix
,
unsigned
short
plen
);
message.c
View file @
d6e8d734
...
...
@@ -248,7 +248,7 @@ handle_request(struct neighbour *neigh, const unsigned char *prefix,
if
(
router_hash
==
hash_id
(
route
->
src
->
address
)
&&
seqno_compare
(
seqno
,
route
->
seqno
)
>
0
)
{
if
(
hop_count
>
1
)
{
send_unicast_request
(
route
->
ne
xthop
,
prefix
,
plen
,
send_unicast_request
(
route
->
ne
igh
,
prefix
,
plen
,
hop_count
-
1
,
seqno
,
router_hash
);
record_request
(
prefix
,
plen
,
seqno
,
router_hash
,
neigh
->
network
,
0
);
...
...
@@ -570,7 +570,7 @@ flushupdates(void)
buffered_updates
[
i
].
plen
);
if
(
route
)
{
if
(
split_horizon
&&
net
->
wired
&&
route
->
ne
xthop
->
network
==
net
)
net
->
wired
&&
route
->
ne
igh
->
network
==
net
)
continue
;
seqno
=
route
->
seqno
;
metric
=
MIN
((
int
)
route
->
metric
+
add_cost
,
INFINITY
);
...
...
@@ -760,7 +760,7 @@ send_neighbour_update(struct neighbour *neigh, struct network *net)
{
int
i
;
for
(
i
=
0
;
i
<
numroutes
;
i
++
)
{
if
(
routes
[
i
].
installed
&&
routes
[
i
].
ne
xthop
==
neigh
)
if
(
routes
[
i
].
installed
&&
routes
[
i
].
ne
igh
==
neigh
)
send_update
(
net
,
0
,
routes
[
i
].
src
->
prefix
,
routes
[
i
].
src
->
plen
);
}
}
...
...
neighbour.c
View file @
d6e8d734
...
...
@@ -205,7 +205,7 @@ update_neighbour(struct neighbour *neigh, int hello, int hello_interval)
struct
route
*
route
=
NULL
;
if
(
!
martian_prefix
(
neigh
->
id
,
128
))
route
=
find_installed_route
(
neigh
->
id
,
128
);
if
(
!
route
||
route
->
metric
>=
INFINITY
||
route
->
ne
xthop
==
neigh
)
if
(
!
route
||
route
->
metric
>=
INFINITY
||
route
->
ne
igh
==
neigh
)
send_unicast_request
(
neigh
,
NULL
,
0
,
0
,
0
,
0
);
}
return
rc
;
...
...
route.c
View file @
d6e8d734
...
...
@@ -45,11 +45,11 @@ int route_gc_delay = 180;
struct
route
*
find_route
(
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
struct
neighbour
*
ne
xthop
)
struct
neighbour
*
ne
igh
)
{
int
i
;
for
(
i
=
0
;
i
<
numroutes
;
i
++
)
{
if
(
routes
[
i
].
ne
xthop
==
nexthop
&&
if
(
routes
[
i
].
ne
igh
==
neigh
&&
source_match
(
routes
[
i
].
src
,
prefix
,
plen
))
return
&
routes
[
i
];
}
...
...
@@ -102,7 +102,7 @@ flush_neighbour_routes(struct neighbour *neigh)
i
=
0
;
while
(
i
<
numroutes
)
{
if
(
routes
[
i
].
ne
xthop
==
neigh
)
{
if
(
routes
[
i
].
ne
igh
==
neigh
)
{
flush_route
(
routes
+
i
);
continue
;
}
...
...
@@ -130,8 +130,8 @@ install_route(struct route *route)
return
;
rc
=
kernel_route
(
ROUTE_ADD
,
route
->
src
->
prefix
,
route
->
src
->
plen
,
route
->
ne
xthop
->
address
,
route
->
ne
xthop
->
network
->
ifindex
,
route
->
ne
igh
->
address
,
route
->
ne
igh
->
network
->
ifindex
,
metric_to_kernel
(
route
->
metric
),
NULL
,
0
,
0
);
if
(
rc
<
0
)
{
perror
(
"kernel_route(ADD)"
);
...
...
@@ -150,8 +150,8 @@ uninstall_route(struct route *route)
return
;
rc
=
kernel_route
(
ROUTE_FLUSH
,
route
->
src
->
prefix
,
route
->
src
->
plen
,
route
->
ne
xthop
->
address
,
route
->
ne
xthop
->
network
->
ifindex
,
route
->
ne
igh
->
address
,
route
->
ne
igh
->
network
->
ifindex
,
metric_to_kernel
(
route
->
metric
),
NULL
,
0
,
0
);
if
(
rc
<
0
)
perror
(
"kernel_route(FLUSH)"
);
...
...
@@ -177,9 +177,9 @@ change_route(struct route *old, struct route *new)
return
;
rc
=
kernel_route
(
ROUTE_MODIFY
,
old
->
src
->
prefix
,
old
->
src
->
plen
,
old
->
ne
xthop
->
address
,
old
->
nexthop
->
network
->
ifindex
,
old
->
ne
igh
->
address
,
old
->
neigh
->
network
->
ifindex
,
metric_to_kernel
(
old
->
metric
),
new
->
ne
xthop
->
address
,
new
->
nexthop
->
network
->
ifindex
,
new
->
ne
igh
->
address
,
new
->
neigh
->
network
->
ifindex
,
metric_to_kernel
(
new
->
metric
));
if
(
rc
>=
0
)
{
old
->
installed
=
0
;
...
...
@@ -195,11 +195,11 @@ change_route_metric(struct route *route, int newmetric)
if
(
route
->
installed
)
{
rc
=
kernel_route
(
ROUTE_MODIFY
,
route
->
src
->
prefix
,
route
->
src
->
plen
,
route
->
ne
xthop
->
address
,
route
->
ne
xthop
->
network
->
ifindex
,
route
->
ne
igh
->
address
,
route
->
ne
igh
->
network
->
ifindex
,
metric_to_kernel
(
route
->
metric
),
route
->
ne
xthop
->
address
,
route
->
ne
xthop
->
network
->
ifindex
,
route
->
ne
igh
->
address
,
route
->
ne
igh
->
network
->
ifindex
,
metric_to_kernel
(
newmetric
));
if
(
rc
<
0
)
{
perror
(
"kernel_route(MODIFY)"
);
...
...
@@ -282,7 +282,7 @@ update_route_metric(struct route *route)
}
newmetric
=
INFINITY
;
}
else
{
newmetric
=
MIN
(
route
->
refmetric
+
neighbour_cost
(
route
->
ne
xthop
),
newmetric
=
MIN
(
route
->
refmetric
+
neighbour_cost
(
route
->
ne
igh
),
INFINITY
);
}
...
...
@@ -297,7 +297,7 @@ update_neighbour_metric(struct neighbour *neigh)
i
=
0
;
while
(
i
<
numroutes
)
{
if
(
routes
[
i
].
ne
xthop
==
neigh
)
if
(
routes
[
i
].
ne
igh
==
neigh
)
update_route_metric
(
&
routes
[
i
]);
i
++
;
}
...
...
@@ -307,7 +307,7 @@ update_neighbour_metric(struct neighbour *neigh)
struct
route
*
update_route
(
const
unsigned
char
*
a
,
const
unsigned
char
*
p
,
unsigned
char
plen
,
unsigned
short
seqno
,
unsigned
short
refmetric
,
struct
neighbour
*
ne
xthop
)
struct
neighbour
*
ne
igh
)
{
struct
route
*
route
;
struct
source
*
src
;
...
...
@@ -319,7 +319,7 @@ update_route(const unsigned char *a, const unsigned char *p, unsigned char plen,
return
NULL
;
}
if
(
import_filter
(
a
,
p
,
plen
,
ne
xthop
->
id
))
if
(
import_filter
(
a
,
p
,
plen
,
ne
igh
->
id
))
return
NULL
;
src
=
find_source
(
a
,
p
,
plen
,
1
,
seqno
);
...
...
@@ -327,8 +327,8 @@ update_route(const unsigned char *a, const unsigned char *p, unsigned char plen,
return
NULL
;
feasible
=
update_feasible
(
a
,
p
,
plen
,
seqno
,
refmetric
);
route
=
find_route
(
p
,
plen
,
ne
xthop
);
metric
=
MIN
((
int
)
refmetric
+
neighbour_cost
(
ne
xthop
),
INFINITY
);
route
=
find_route
(
p
,
plen
,
ne
igh
);
metric
=
MIN
((
int
)
refmetric
+
neighbour_cost
(
ne
igh
),
INFINITY
);
if
(
route
)
{
struct
source
*
oldsrc
;
...
...
@@ -384,7 +384,7 @@ update_route(const unsigned char *a, const unsigned char *p, unsigned char plen,
route
->
refmetric
=
refmetric
;
route
->
seqno
=
seqno
;
route
->
metric
=
metric
;
route
->
ne
xthop
=
nexthop
;
route
->
ne
igh
=
neigh
;
route
->
time
=
now
.
tv_sec
;
route
->
origtime
=
now
.
tv_sec
;
route
->
installed
=
0
;
...
...
@@ -543,7 +543,7 @@ expire_routes(void)
if
(
route
->
installed
&&
route
->
refmetric
<
INFINITY
)
{
if
(
route
->
time
<
now
.
tv_sec
-
MAX
(
10
,
route_timeout_delay
-
25
))
send_unicast_request
(
route
->
ne
xthop
,
send_unicast_request
(
route
->
ne
igh
,
route
->
src
->
prefix
,
route
->
src
->
plen
,
0
,
0
,
0
);
}
...
...
route.h
View file @
d6e8d734
...
...
@@ -25,7 +25,7 @@ struct route {
unsigned
short
metric
;
unsigned
short
refmetric
;
unsigned
short
seqno
;
struct
neighbour
*
ne
xthop
;
struct
neighbour
*
ne
igh
;
int
time
;
int
origtime
;
int
installed
;
...
...
@@ -38,7 +38,7 @@ extern int route_timeout_delay;
extern
int
route_gc_delay
;
struct
route
*
find_route
(
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
struct
neighbour
*
ne
xthop
);
struct
neighbour
*
ne
igh
);
struct
route
*
find_installed_route
(
const
unsigned
char
*
prefix
,
unsigned
char
plen
);
void
flush_route
(
struct
route
*
route
);
...
...
@@ -60,7 +60,7 @@ void update_route_metric(struct route *route);
struct
route
*
update_route
(
const
unsigned
char
*
a
,
const
unsigned
char
*
p
,
unsigned
char
plen
,
unsigned
short
seqno
,
unsigned
short
refmetric
,
struct
neighbour
*
ne
xthop
);
struct
neighbour
*
ne
igh
);
void
consider_route
(
struct
route
*
route
);
void
send_triggered_update
(
struct
route
*
route
,
struct
source
*
oldsrc
,
int
oldmetric
);
...
...
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