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
889ef335
Commit
889ef335
authored
Sep 21, 2008
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make it possible to compile-out the local interface.
Run make EXTRA_DEFINES=-DNO_LOCAL_INTERFACE.
parent
95d3784a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
0 deletions
+27
-0
babel.c
babel.c
+8
-0
local.c
local.c
+8
-0
local.h
local.h
+11
-0
No files found.
babel.c
View file @
889ef335
...
@@ -200,9 +200,11 @@ main(int argc, char **argv)
...
@@ -200,9 +200,11 @@ main(int argc, char **argv)
}
else
if
(
strcmp
(
*
arg
,
"-d"
)
==
0
)
{
}
else
if
(
strcmp
(
*
arg
,
"-d"
)
==
0
)
{
SHIFTE
();
SHIFTE
();
debug
=
atoi
(
*
arg
);
debug
=
atoi
(
*
arg
);
#ifndef NO_LOCAL_INTERFACE
}
else
if
(
strcmp
(
*
arg
,
"-g"
)
==
0
)
{
}
else
if
(
strcmp
(
*
arg
,
"-g"
)
==
0
)
{
SHIFTE
();
SHIFTE
();
local_server_port
=
atoi
(
*
arg
);
local_server_port
=
atoi
(
*
arg
);
#endif
}
else
if
(
strcmp
(
*
arg
,
"-l"
)
==
0
)
{
}
else
if
(
strcmp
(
*
arg
,
"-l"
)
==
0
)
{
link_detect
=
1
;
link_detect
=
1
;
}
else
if
(
strcmp
(
*
arg
,
"-w"
)
==
0
)
{
}
else
if
(
strcmp
(
*
arg
,
"-w"
)
==
0
)
{
...
@@ -509,6 +511,7 @@ main(int argc, char **argv)
...
@@ -509,6 +511,7 @@ main(int argc, char **argv)
SHIFT
();
SHIFT
();
}
}
#ifndef NO_LOCAL_INTERFACE
if
(
local_server_port
>=
0
)
{
if
(
local_server_port
>=
0
)
{
local_server_socket
=
tcp_server_socket
(
local_server_port
,
1
);
local_server_socket
=
tcp_server_socket
(
local_server_port
,
1
);
if
(
local_server_socket
<
0
)
{
if
(
local_server_socket
<
0
)
{
...
@@ -516,6 +519,7 @@ main(int argc, char **argv)
...
@@ -516,6 +519,7 @@ main(int argc, char **argv)
goto
fail
;
goto
fail
;
}
}
}
}
#endif
init_signals
();
init_signals
();
resize_receive_buffer
(
1500
);
resize_receive_buffer
(
1500
);
...
@@ -584,6 +588,7 @@ main(int argc, char **argv)
...
@@ -584,6 +588,7 @@ main(int argc, char **argv)
FD_SET
(
kernel_socket
,
&
readfds
);
FD_SET
(
kernel_socket
,
&
readfds
);
maxfd
=
MAX
(
maxfd
,
kernel_socket
);
maxfd
=
MAX
(
maxfd
,
kernel_socket
);
}
}
#ifndef NO_LOCAL_INTERFACE
if
(
local_socket
>=
0
)
{
if
(
local_socket
>=
0
)
{
FD_SET
(
local_socket
,
&
readfds
);
FD_SET
(
local_socket
,
&
readfds
);
maxfd
=
MAX
(
maxfd
,
local_socket
);
maxfd
=
MAX
(
maxfd
,
local_socket
);
...
@@ -591,6 +596,7 @@ main(int argc, char **argv)
...
@@ -591,6 +596,7 @@ main(int argc, char **argv)
FD_SET
(
local_server_socket
,
&
readfds
);
FD_SET
(
local_server_socket
,
&
readfds
);
maxfd
=
MAX
(
maxfd
,
local_server_socket
);
maxfd
=
MAX
(
maxfd
,
local_server_socket
);
}
}
#endif
rc
=
select
(
maxfd
+
1
,
&
readfds
,
NULL
,
NULL
,
&
tv
);
rc
=
select
(
maxfd
+
1
,
&
readfds
,
NULL
,
NULL
,
&
tv
);
if
(
rc
<
0
)
{
if
(
rc
<
0
)
{
if
(
errno
!=
EINTR
)
{
if
(
errno
!=
EINTR
)
{
...
@@ -634,6 +640,7 @@ main(int argc, char **argv)
...
@@ -634,6 +640,7 @@ main(int argc, char **argv)
}
}
}
}
#ifndef NO_LOCAL_INTERFACE
if
(
local_server_socket
>=
0
&&
if
(
local_server_socket
>=
0
&&
FD_ISSET
(
local_server_socket
,
&
readfds
))
{
FD_ISSET
(
local_server_socket
,
&
readfds
))
{
if
(
local_socket
>=
0
)
{
if
(
local_socket
>=
0
)
{
...
@@ -658,6 +665,7 @@ main(int argc, char **argv)
...
@@ -658,6 +665,7 @@ main(int argc, char **argv)
local_socket
=
-
1
;
local_socket
=
-
1
;
}
}
}
}
#endif
if
(
changed
)
{
if
(
changed
)
{
kernel_dump_time
=
now
.
tv_sec
;
kernel_dump_time
=
now
.
tv_sec
;
...
...
local.c
View file @
889ef335
...
@@ -35,6 +35,12 @@ THE SOFTWARE.
...
@@ -35,6 +35,12 @@ THE SOFTWARE.
#include "util.h"
#include "util.h"
#include "local.h"
#include "local.h"
#ifdef NO_LOCAL_INTERFACE
int
dummy
;
#else
int
int
local_read
(
int
s
)
local_read
(
int
s
)
{
{
...
@@ -247,3 +253,5 @@ local_dump()
...
@@ -247,3 +253,5 @@ local_dump()
shutdown
(
local_socket
,
1
);
shutdown
(
local_socket
,
1
);
return
;
return
;
}
}
#endif
local.h
View file @
889ef335
...
@@ -28,9 +28,20 @@ struct xroute;
...
@@ -28,9 +28,20 @@ struct xroute;
#define LOCAL_ADD 1
#define LOCAL_ADD 1
#define LOCAL_CHANGE 2
#define LOCAL_CHANGE 2
#ifndef NO_LOCAL_INTERFACE
int
local_read
(
int
s
);
int
local_read
(
int
s
);
void
local_notify_self
(
void
);
void
local_notify_self
(
void
);
void
local_notify_neighbour
(
struct
neighbour
*
neigh
,
int
kind
);
void
local_notify_neighbour
(
struct
neighbour
*
neigh
,
int
kind
);
void
local_notify_xroute
(
struct
xroute
*
xroute
,
int
kind
);
void
local_notify_xroute
(
struct
xroute
*
xroute
,
int
kind
);
void
local_notify_route
(
struct
route
*
route
,
int
kind
);
void
local_notify_route
(
struct
route
*
route
,
int
kind
);
void
local_dump
(
void
);
void
local_dump
(
void
);
#else
#define local_notify_self() do {} while(0)
#define local_notify_neighbour(n, k) do {} while(0)
#define local_notify_xroute(x, k) do {} while(0)
#define local_notify_route(r, k) do {} while(0)
#define local_dump() do {} while 0
#endif
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