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
a903a1f3
Commit
a903a1f3
authored
Jun 17, 2007
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Call back into babel when a route changes.
parent
458af5c3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
4 deletions
+17
-4
babel.c
babel.c
+8
-1
kernel.c
kernel.c
+8
-2
kernel.h
kernel.h
+1
-1
No files found.
babel.c
View file @
a903a1f3
...
...
@@ -79,6 +79,7 @@ struct network *add_network(char *ifname, int ifindex, int bufsize,
int
wired
,
unsigned
int
cost
,
int
hello_interval
);
void
expire_routes
(
void
);
static
int
kernel_routes_changed
(
void
*
closure
);
static
void
init_signals
(
void
);
static
void
dump_tables
(
FILE
*
out
);
...
...
@@ -407,7 +408,7 @@ main(int argc, char **argv)
break
;
if
(
kernel_socket
>=
0
&&
FD_ISSET
(
kernel_socket
,
&
readfds
))
{
kernel_callback
();
kernel_callback
(
kernel_routes_changed
,
NULL
);
}
if
(
FD_ISSET
(
protocol_socket
,
&
readfds
))
{
...
...
@@ -620,6 +621,12 @@ dump_tables(FILE *out)
fflush
(
out
);
}
static
int
kernel_routes_changed
(
void
*
closure
)
{
return
0
;
}
struct
network
*
add_network
(
char
*
ifname
,
int
ifindex
,
int
mtu
,
int
wired
,
unsigned
int
cost
,
int
hello_interval
)
...
...
kernel.c
View file @
a903a1f3
...
...
@@ -790,10 +790,16 @@ kernel_routes(int maxplen, struct kernel_route *routes, int maxroutes)
}
int
kernel_callback
()
kernel_callback
(
int
(
*
fn
)(
void
*
),
void
*
closure
)
{
int
rc
;
if
(
nl_listen
.
sock
<
0
)
return
-
1
;
return
netlink_listen
(
monitor_kernel_route
,
NULL
);
rc
=
netlink_listen
(
monitor_kernel_route
,
NULL
);
if
(
rc
)
return
fn
(
closure
);
return
0
;
}
kernel.h
View file @
a903a1f3
...
...
@@ -42,4 +42,4 @@ int kernel_route(int operation, const unsigned char *dest, unsigned short plen,
const
unsigned
char
*
gate
,
int
ifindex
,
unsigned
int
metric
,
unsigned
int
newmetric
);
int
kernel_routes
(
int
maxplen
,
struct
kernel_route
*
routes
,
int
maxroutes
);
int
kernel_callback
(
void
);
int
kernel_callback
(
int
(
*
fn
)(
void
*
),
void
*
closure
);
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