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
fc88b140
Commit
fc88b140
authored
Oct 18, 2008
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tweak network structure.
parent
daf5fa4f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
network.c
network.c
+4
-4
network.h
network.h
+9
-9
No files found.
network.c
View file @
fc88b140
...
@@ -266,7 +266,7 @@ network_up(struct network *net, int up)
...
@@ -266,7 +266,7 @@ network_up(struct network *net, int up)
if
(
net
->
ll
)
if
(
net
->
ll
)
free
(
net
->
ll
);
free
(
net
->
ll
);
net
->
nll
=
0
;
net
->
n
um
ll
=
0
;
net
->
ll
=
NULL
;
net
->
ll
=
NULL
;
rc
=
kernel_ll_addresses
(
net
->
ifname
,
net
->
ifindex
,
ll
,
32
);
rc
=
kernel_ll_addresses
(
net
->
ifname
,
net
->
ifindex
,
ll
,
32
);
if
(
rc
<
0
)
{
if
(
rc
<
0
)
{
...
@@ -276,7 +276,7 @@ network_up(struct network *net, int up)
...
@@ -276,7 +276,7 @@ network_up(struct network *net, int up)
if
(
net
->
ll
==
NULL
)
{
if
(
net
->
ll
==
NULL
)
{
perror
(
"malloc(ll)"
);
perror
(
"malloc(ll)"
);
}
else
{
}
else
{
net
->
nll
=
rc
;
net
->
n
um
ll
=
rc
;
memcpy
(
net
->
ll
,
ll
,
rc
*
16
);
memcpy
(
net
->
ll
,
ll
,
rc
*
16
);
}
}
}
}
...
@@ -306,7 +306,7 @@ network_up(struct network *net, int up)
...
@@ -306,7 +306,7 @@ network_up(struct network *net, int up)
if
(
net
->
ll
)
if
(
net
->
ll
)
free
(
net
->
ll
);
free
(
net
->
ll
);
net
->
ll
=
NULL
;
net
->
ll
=
NULL
;
net
->
nll
=
0
;
net
->
n
um
ll
=
0
;
}
}
update_network_metric
(
net
);
update_network_metric
(
net
);
...
@@ -325,7 +325,7 @@ network_ll_address(struct network *net, const unsigned char *address)
...
@@ -325,7 +325,7 @@ network_ll_address(struct network *net, const unsigned char *address)
if
(
!
net
->
up
)
if
(
!
net
->
up
)
return
0
;
return
0
;
for
(
i
=
0
;
i
<
net
->
nll
;
i
++
)
for
(
i
=
0
;
i
<
net
->
n
um
ll
;
i
++
)
if
(
memcmp
(
net
->
ll
[
i
],
address
,
16
)
==
0
)
if
(
memcmp
(
net
->
ll
[
i
],
address
,
16
)
==
0
)
return
1
;
return
1
;
...
...
network.h
View file @
fc88b140
...
@@ -22,9 +22,9 @@ THE SOFTWARE.
...
@@ -22,9 +22,9 @@ THE SOFTWARE.
struct
network
{
struct
network
{
struct
network
*
next
;
struct
network
*
next
;
int
up
;
char
up
;
char
wired
;
unsigned
int
ifindex
;
unsigned
int
ifindex
;
int
wired
;
unsigned
short
cost
;
unsigned
short
cost
;
struct
timeval
hello_time
;
struct
timeval
hello_time
;
struct
timeval
hello_timeout
;
struct
timeval
hello_timeout
;
...
@@ -34,15 +34,15 @@ struct network {
...
@@ -34,15 +34,15 @@ struct network {
struct
timeval
update_timeout
;
struct
timeval
update_timeout
;
char
ifname
[
IF_NAMESIZE
];
char
ifname
[
IF_NAMESIZE
];
unsigned
char
*
ipv4
;
unsigned
char
*
ipv4
;
int
nll
;
int
n
um
ll
;
unsigned
char
(
*
ll
)[
16
];
unsigned
char
(
*
ll
)[
16
];
int
buffered
;
int
buffered
;
struct
timeval
flush_timeout
;
struct
timeval
flush_timeout
;
int
bufsize
;
int
bufsize
;
int
have_buffered_hello
;
char
have_buffered_hello
;
int
have_buffered_id
;
char
have_buffered_id
;
int
have_buffered_nh
;
char
have_buffered_nh
;
int
have_buffered_prefix
;
char
have_buffered_prefix
;
unsigned
char
buffered_id
[
16
];
unsigned
char
buffered_id
[
16
];
unsigned
char
buffered_nh
[
4
];
unsigned
char
buffered_nh
[
4
];
unsigned
char
buffered_prefix
[
16
];
unsigned
char
buffered_prefix
[
16
];
...
@@ -51,8 +51,8 @@ struct network {
...
@@ -51,8 +51,8 @@ struct network {
unsigned
int
bucket
;
unsigned
int
bucket
;
time_t
activity_time
;
time_t
activity_time
;
unsigned
short
hello_seqno
;
unsigned
short
hello_seqno
;
unsigned
in
t
hello_interval
;
unsigned
shor
t
hello_interval
;
unsigned
in
t
self_update_interval
;
unsigned
shor
t
self_update_interval
;
};
};
extern
struct
network
*
networks
;
extern
struct
network
*
networks
;
...
...
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