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
60e20d98
Commit
60e20d98
authored
Dec 15, 2015
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Generate babeld's version automatically, display in control interface.
parent
0e4611f9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
51 additions
and
12 deletions
+51
-12
.gitignore
.gitignore
+1
-0
Makefile
Makefile
+10
-3
babeld.c
babeld.c
+15
-9
babeld.man
babeld.man
+3
-0
generate-version.sh
generate-version.sh
+13
-0
local.c
local.c
+9
-0
No files found.
.gitignore
View file @
60e20d98
*.o
babeld
babeld.html
version.h
Makefile
View file @
60e20d98
...
...
@@ -20,6 +20,15 @@ OBJS = babeld.o net.o kernel.o util.o interface.o source.o neighbour.o \
babeld
:
$(OBJS)
$(CC)
$(CFLAGS)
$(LDFLAGS)
-o
babeld
$(OBJS)
$(LDLIBS)
babeld.o
:
babeld.c version.h
local.o
:
local.c version.h
kernel.o
:
kernel_netlink.c kernel_socket.c
version.h
:
./generate-version.sh
>
version.h
.SUFFIXES
:
.man .html
.man.html
:
...
...
@@ -49,6 +58,4 @@ uninstall:
-
rm
-f
$(TARGET)$(MANDIR)
/man8/babeld.8
clean
:
-
rm
-f
babeld babeld.html
*
.o
*
~ core TAGS gmon.out
kernel.o
:
kernel_netlink.c kernel_socket.c
-
rm
-f
babeld babeld.html version.h
*
.o
*
~ core TAGS gmon.out
babeld.c
View file @
60e20d98
...
...
@@ -53,6 +53,7 @@ THE SOFTWARE.
#include "configuration.h"
#include "local.h"
#include "rule.h"
#include "version.h"
struct
timeval
now
;
...
...
@@ -172,7 +173,7 @@ main(int argc, char **argv)
while
(
1
)
{
opt
=
getopt
(
argc
,
argv
,
"m:p:h:H:i:k:A:sruS:d:g:lwz:M:t:T:c:C:DL:I:"
);
"m:p:h:H:i:k:A:sruS:d:g:lwz:M:t:T:c:C:DL:I:
V
"
);
if
(
opt
<
0
)
break
;
...
...
@@ -307,6 +308,10 @@ main(int argc, char **argv)
case
'I'
:
pidfile
=
optarg
;
break
;
case
'V'
:
fprintf
(
stderr
,
"%s
\n
"
,
BABELD_VERSION
);
exit
(
0
);
break
;
default:
goto
usage
;
}
...
...
@@ -842,19 +847,20 @@ main(int argc, char **argv)
usage:
fprintf
(
stderr
,
"Syntax: %s "
"[-m multicast_address] [-p port] [-S state-file]
\n
"
" "
"%s
\n
"
"Syntax: babeld "
"[-V] [-m multicast_address] [-p port] [-S state-file]
\n
"
" "
"[-h hello] [-H wired_hello] [-z kind[,factor]]
\n
"
"
"
" "
"[-k metric] [-A metric] [-s] [-l] [-w] [-r] [-u] [-g port]
\n
"
"
"
" "
"[-t table] [-T table] [-c file] [-C statement]
\n
"
"
"
" "
"[-d level] [-D] [-L logfile] [-I pidfile]
\n
"
"
"
" "
"[id] interface...
\n
"
,
argv
[
0
]
);
BABELD_VERSION
);
exit
(
1
);
fail:
...
...
babeld.man
View file @
60e20d98
...
...
@@ -17,6 +17,9 @@ While it is optimised for wireless mesh networks, Babel will also work
efficiently on wired networks.
.SH OPTIONS
.TP
.BI \-V
Display babeld's version and quit.
.TP
.BI \-m " multicast-address"
Specify the link-local multicast address to be used by the protocol.
The default is
...
...
generate-version.sh
0 → 100755
View file @
60e20d98
#!/bin/sh
set
-e
if
[
-d
.git
]
;
then
version
=
"
$(
git describe
)
"
elif
[
-f
version
]
;
then
version
=
"
$(
cat
version
)
"
else
version
=
"(unknown version)"
fi
echo
"#define BABELD_VERSION
\"
$version
\"
"
local.c
View file @
60e20d98
...
...
@@ -36,6 +36,7 @@ THE SOFTWARE.
#include "route.h"
#include "util.h"
#include "local.h"
#include "version.h"
#ifdef NO_LOCAL_INTERFACE
...
...
@@ -266,6 +267,7 @@ local_notify_all_1(int s)
int
rc
;
struct
neighbour
*
neigh
;
const
char
*
header
=
"BABEL 0.0
\n
"
;
char
buf
[
512
];
struct
xroute_stream
*
xroutes
;
struct
route_stream
*
routes
;
...
...
@@ -273,6 +275,13 @@ local_notify_all_1(int s)
if
(
rc
<
0
)
goto
fail
;
rc
=
snprintf
(
buf
,
512
,
"version %s
\n
"
,
BABELD_VERSION
);
if
(
rc
<
0
||
rc
>=
512
)
goto
fail
;
rc
=
write_timeout
(
s
,
buf
,
rc
);
if
(
rc
<
0
)
goto
fail
;
local_notify_self_1
(
s
);
FOR_ALL_NEIGHBOURS
(
neigh
)
{
local_notify_neighbour_1
(
s
,
neigh
,
LOCAL_ADD
);
...
...
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