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
4d9d1080
Commit
4d9d1080
authored
Sep 28, 2008
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make metrics unsigned.
parent
702ecb20
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
15 deletions
+16
-15
route.c
route.c
+11
-10
route.h
route.h
+5
-5
No files found.
route.c
View file @
4d9d1080
...
@@ -41,7 +41,7 @@ THE SOFTWARE.
...
@@ -41,7 +41,7 @@ THE SOFTWARE.
struct
route
*
routes
=
NULL
;
struct
route
*
routes
=
NULL
;
int
numroutes
=
0
,
maxroutes
=
0
;
int
numroutes
=
0
,
maxroutes
=
0
;
int
kernel_metric
=
0
;
unsigned
kernel_metric
=
0
;
int
route_timeout_delay
=
160
;
int
route_timeout_delay
=
160
;
int
route_gc_delay
=
180
;
int
route_gc_delay
=
180
;
...
@@ -75,7 +75,8 @@ flush_route(struct route *route)
...
@@ -75,7 +75,8 @@ flush_route(struct route *route)
{
{
int
n
;
int
n
;
struct
source
*
src
;
struct
source
*
src
;
int
oldmetric
,
lost
=
0
;
unsigned
oldmetric
;
int
lost
=
0
;
n
=
route
-
routes
;
n
=
route
-
routes
;
assert
(
n
>=
0
&&
n
<
numroutes
);
assert
(
n
>=
0
&&
n
<
numroutes
);
...
@@ -129,11 +130,9 @@ flush_neighbour_routes(struct neighbour *neigh)
...
@@ -129,11 +130,9 @@ flush_neighbour_routes(struct neighbour *neigh)
}
}
}
}
unsigned
int
unsigned
metric_to_kernel
(
int
metric
)
metric_to_kernel
(
unsigned
metric
)
{
{
assert
(
metric
>=
0
);
if
(
metric
>=
INFINITY
)
if
(
metric
>=
INFINITY
)
return
KERNEL_INFINITY
;
return
KERNEL_INFINITY
;
else
else
...
@@ -211,7 +210,7 @@ switch_routes(struct route *old, struct route *new)
...
@@ -211,7 +210,7 @@ switch_routes(struct route *old, struct route *new)
}
}
void
void
change_route_metric
(
struct
route
*
route
,
int
newmetric
)
change_route_metric
(
struct
route
*
route
,
unsigned
newmetric
)
{
{
int
rc
;
int
rc
;
...
@@ -522,9 +521,11 @@ consider_route(struct route *route)
...
@@ -522,9 +521,11 @@ consider_route(struct route *route)
}
}
void
void
send_triggered_update
(
struct
route
*
route
,
struct
source
*
oldsrc
,
int
oldmetric
)
send_triggered_update
(
struct
route
*
route
,
struct
source
*
oldsrc
,
unsigned
oldmetric
)
{
{
int
urgent
=
0
,
newmetric
,
diff
;
int
urgent
=
0
;
unsigned
newmetric
,
diff
;
if
(
!
route
->
installed
)
if
(
!
route
->
installed
)
return
;
return
;
...
@@ -599,7 +600,7 @@ route_changed(struct route *route,
...
@@ -599,7 +600,7 @@ route_changed(struct route *route,
/* We just lost the installed route to a given destination. */
/* We just lost the installed route to a given destination. */
void
void
route_lost
(
struct
source
*
src
,
int
oldmetric
)
route_lost
(
struct
source
*
src
,
unsigned
oldmetric
)
{
{
struct
route
*
new_route
;
struct
route
*
new_route
;
new_route
=
find_best_route
(
src
->
prefix
,
src
->
plen
,
1
,
NULL
);
new_route
=
find_best_route
(
src
->
prefix
,
src
->
plen
,
1
,
NULL
);
...
...
route.h
View file @
4d9d1080
...
@@ -33,7 +33,7 @@ struct route {
...
@@ -33,7 +33,7 @@ struct route {
extern
struct
route
*
routes
;
extern
struct
route
*
routes
;
extern
int
numroutes
,
maxroutes
;
extern
int
numroutes
,
maxroutes
;
extern
int
kernel_metric
;
extern
unsigned
kernel_metric
;
extern
int
route_timeout_delay
;
extern
int
route_timeout_delay
;
extern
int
route_gc_delay
;
extern
int
route_gc_delay
;
...
@@ -43,11 +43,11 @@ struct route *find_installed_route(const unsigned char *prefix,
...
@@ -43,11 +43,11 @@ struct route *find_installed_route(const unsigned char *prefix,
unsigned
char
plen
);
unsigned
char
plen
);
void
flush_route
(
struct
route
*
route
);
void
flush_route
(
struct
route
*
route
);
void
flush_neighbour_routes
(
struct
neighbour
*
neigh
);
void
flush_neighbour_routes
(
struct
neighbour
*
neigh
);
unsigned
int
metric_to_kernel
(
int
metric
);
unsigned
metric_to_kernel
(
unsigned
metric
);
void
install_route
(
struct
route
*
route
);
void
install_route
(
struct
route
*
route
);
void
uninstall_route
(
struct
route
*
route
);
void
uninstall_route
(
struct
route
*
route
);
void
switch_route
(
struct
route
*
old
,
struct
route
*
new
);
void
switch_route
(
struct
route
*
old
,
struct
route
*
new
);
void
change_route_metric
(
struct
route
*
route
,
int
newmetric
);
void
change_route_metric
(
struct
route
*
route
,
unsigned
newmetric
);
int
route_feasible
(
struct
route
*
route
);
int
route_feasible
(
struct
route
*
route
);
int
update_feasible
(
const
unsigned
char
*
id
,
int
update_feasible
(
const
unsigned
char
*
id
,
const
unsigned
char
*
p
,
unsigned
char
plen
,
const
unsigned
char
*
p
,
unsigned
char
plen
,
...
@@ -70,8 +70,8 @@ void send_unfeasible_request(struct neighbour *neigh, int force,
...
@@ -70,8 +70,8 @@ void send_unfeasible_request(struct neighbour *neigh, int force,
const
unsigned
char
*
prefix
,
unsigned
char
plen
);
const
unsigned
char
*
prefix
,
unsigned
char
plen
);
void
consider_route
(
struct
route
*
route
);
void
consider_route
(
struct
route
*
route
);
void
send_triggered_update
(
struct
route
*
route
,
void
send_triggered_update
(
struct
route
*
route
,
struct
source
*
oldsrc
,
int
oldmetric
);
struct
source
*
oldsrc
,
unsigned
oldmetric
);
void
route_changed
(
struct
route
*
route
,
void
route_changed
(
struct
route
*
route
,
struct
source
*
oldsrc
,
unsigned
short
oldmetric
);
struct
source
*
oldsrc
,
unsigned
short
oldmetric
);
void
route_lost
(
struct
source
*
src
,
int
oldmetric
);
void
route_lost
(
struct
source
*
src
,
unsigned
oldmetric
);
void
expire_routes
(
void
);
void
expire_routes
(
void
);
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