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
5eef5ad1
Commit
5eef5ad1
authored
Sep 24, 2008
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement neighbour_txcost.
parent
be630fae
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
neighbour.c
neighbour.c
+8
-2
neighbour.h
neighbour.h
+1
-0
No files found.
neighbour.c
View file @
5eef5ad1
...
@@ -256,6 +256,13 @@ reset_txcost(struct neighbour *neigh)
...
@@ -256,6 +256,13 @@ reset_txcost(struct neighbour *neigh)
return
0
;
return
0
;
}
}
int
neighbour_txcost
(
struct
neighbour
*
neigh
)
{
reset_txcost
(
neigh
);
return
neigh
->
txcost
;
}
int
int
check_neighbours
()
check_neighbours
()
{
{
...
@@ -340,8 +347,7 @@ neighbour_cost(struct neighbour *neigh)
...
@@ -340,8 +347,7 @@ neighbour_cost(struct neighbour *neigh)
if
(
!
neigh
->
network
->
up
)
if
(
!
neigh
->
network
->
up
)
return
INFINITY
;
return
INFINITY
;
reset_txcost
(
neigh
);
a
=
neighbour_txcost
(
neigh
);
a
=
neigh
->
txcost
;
if
(
a
>=
INFINITY
)
if
(
a
>=
INFINITY
)
return
INFINITY
;
return
INFINITY
;
...
...
neighbour.h
View file @
5eef5ad1
...
@@ -51,5 +51,6 @@ struct neighbour *add_neighbour(const unsigned char *id,
...
@@ -51,5 +51,6 @@ struct neighbour *add_neighbour(const unsigned char *id,
struct
network
*
net
);
struct
network
*
net
);
int
update_neighbour
(
struct
neighbour
*
neigh
,
int
hello
,
int
hello_interval
);
int
update_neighbour
(
struct
neighbour
*
neigh
,
int
hello
,
int
hello_interval
);
int
check_neighbours
(
void
);
int
check_neighbours
(
void
);
int
neighbour_txcost
(
struct
neighbour
*
neigh
);
int
neighbour_rxcost
(
struct
neighbour
*
neigh
);
int
neighbour_rxcost
(
struct
neighbour
*
neigh
);
int
neighbour_cost
(
struct
neighbour
*
neigh
);
int
neighbour_cost
(
struct
neighbour
*
neigh
);
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