The *.d depends files for make just list the files used when building an object file. Removing a file listed in such a dependency file causes make to search for a way to recreate it. This usually cannot work because these files aren't autogenerated.
The gcc option -MP can be used to generate empty rule for these files. Removing a file in a dependency list will then execute this empty rule and continue with the execution of the creation of the object file. This compilation process will then automatically correct the dependency file.
Signed-off-by: Sven Eckelmann sven@narfation.org --- Makefile | 2 +- vis/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile index aeee2e8..ec9dc11 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ BINARY_NAME = alfred OBJ = main.o server.o client.o netsock.o send.o recv.o hash.o unix_sock.o util.o debugfs.o batadv_query.o
# alfred flags and options -CFLAGS += -pedantic -Wall -W -std=gnu99 -fno-strict-aliasing -MD +CFLAGS += -pedantic -Wall -W -std=gnu99 -fno-strict-aliasing -MD -MP LDLIBS += -lrt
# disable verbose output diff --git a/vis/Makefile b/vis/Makefile index 8585f9a..9bf72c9 100644 --- a/vis/Makefile +++ b/vis/Makefile @@ -23,7 +23,7 @@ BINARY_NAME = vis OBJ = vis.o debugfs.o
# alfred flags and options -CFLAGS += -pedantic -Wall -W -std=gnu99 -fno-strict-aliasing -MD +CFLAGS += -pedantic -Wall -W -std=gnu99 -fno-strict-aliasing -MD -MP LDLIBS += -lrt
# disable verbose output
Signed-off-by: Sven Eckelmann sven@narfation.org --- vis/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vis/Makefile b/vis/Makefile index 9bf72c9..bd83877 100644 --- a/vis/Makefile +++ b/vis/Makefile @@ -49,7 +49,7 @@ PREFIX = /usr/local SBINDIR = $(PREFIX)/sbin
# try to generate revision -REVISION= $(shell if [ -d .git ]; then \ +REVISION= $(shell if [ -d ../.git ]; then \ echo $$(git describe --always --dirty --match "v*" |sed 's/^v//' 2> /dev/null || echo "[unknown]"); \ fi) ifneq ($(REVISION),)
The name vis is to ambiguous and already taken by the batmand vis server. Distributions like Gentoo or OpenWrt would have a conflict between these packages just because they share a common name. This makes the situation unnecessary complex.
A better name may also help an user to find this tool.
Reported-by: Braden Aran bradenaran@gmail.com Signed-off-by: Sven Eckelmann sven@narfation.org --- README | 27 ++++++++++++++------------- vis/Makefile | 6 +++--- vis/vis.c | 2 +- 3 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/README b/README index a9013f4..50c36ad 100644 --- a/README +++ b/README @@ -33,13 +33,13 @@ To compile alfred, simply type:
$ make
-This will compile both alfred and vis. To install, use +This will compile both alfred and batadv-vis. To install, use
$ make install
(with the right privileges).
-If you don't want to compile vis, add the directive CONFIG_ALFRED_VIS=n: +If you don't want to compile batadv-vis, add the directive CONFIG_ALFRED_VIS=n:
$ make CONFIG_ALFRED_VIS=n $ make CONFIG_ALFRED_VIS=n install @@ -113,22 +113,23 @@ machines (slaves send information to masters). Vis ---
-Vis can be used to visualize your batman-adv mesh network. It read the neighbor -information and local client table and distributes this information via alfred -in the network. By gathering this local information, any vis node can get the -whole picture of the network. +batadv-vis can be used to visualize your batman-adv mesh network. It read the +neighbor information and local client table and distributes this information via +alfred in the network. By gathering this local information, any vis node can get +the whole picture of the network.
-Vis, similar to to alfred, combines server (daemon) and client functionality in -the 'vis' binary. The vis server must be started to let vis work: +batadv-vis, similar to to alfred, combines server (daemon) and client +functionality in the 'batadv-vis' binary. The batadv-vis server must be started +to let batadv-vis work:
- $ vis -i bat0 -s + $ batadv-vis -i bat0 -s
This server will read the neighbor and client information from batman-adv every 10 seconds and set it in alfred via unix socket. Obviously, the alfred server must run too to get this information set.
To get a graphviz-compatible vis output, simply type: - $ vis + $ batadv-vis digraph { subgraph "cluster_fe:f0:00:00:04:01" { "fe:f0:00:00:04:01" @@ -153,7 +154,7 @@ digraph {
For a json formatted output, use:
- $ vis -f json + $ batadv-vis -f json { "primary" : "fe:f0:00:00:04:01" } { "router" : "fe:f0:00:00:04:01", "neighbor" : "fe:f0:00:00:05:01", "label" : "1.000" } { "router" : "fe:f0:00:00:04:01", "neighbor" : "fe:f0:00:00:03:01", "label" : "1.008" } @@ -171,8 +172,8 @@ For a json formatted output, use: License -------
-alfred and vis are licensed under the terms of version 2 of the GNU General -Public License (GPL). Please see the LICENSE file. +alfred and batadv-vis are licensed under the terms of version 2 of the GNU +General Public License (GPL). Please see the LICENSE file.
The file "packet.h" is an exception and not licensed with the GPL. Instead, it is licensed using ISC license (see the head of this file). This allows diff --git a/vis/Makefile b/vis/Makefile index bd83877..4db27d9 100644 --- a/vis/Makefile +++ b/vis/Makefile @@ -18,11 +18,11 @@ # 02110-1301, USA #
-# alfred build -BINARY_NAME = vis +# batadv-vis build +BINARY_NAME = batadv-vis OBJ = vis.o debugfs.o
-# alfred flags and options +# batadv-vis flags and options CFLAGS += -pedantic -Wall -W -std=gnu99 -fno-strict-aliasing -MD -MP LDLIBS += -lrt
diff --git a/vis/vis.c b/vis/vis.c index 36ea7fe..ad7f530 100644 --- a/vis/vis.c +++ b/vis/vis.c @@ -608,7 +608,7 @@ static int vis_get_data(struct globals *globals)
static void vis_usage(void) { - printf("Usage: vis [options]\n"); + printf("Usage: batadv-vis [options]\n"); printf(" -i, --interface specify the batman-adv interface configured on the system (default: bat0)\n"); printf(" -s, --server start up in server mode, which regularly updates vis data from batman-adv\n"); printf(" -f, --format <format> specify the output format for client mode (either "json" or "dot")\n");
manpages are a soft requirement for many distributions and it is a nice feature for the end users. The stubs are only the restructured version of the README but provides a start for more useful manpages.
Reported-by: Braden Aran bradenaran@gmail.com Signed-off-by: Sven Eckelmann sven@narfation.org --- Makefile | 4 ++ man/alfred.8 | 136 +++++++++++++++++++++++++++++++++++++++++++++++++++ vis/Makefile | 4 ++ vis/man/batadv-vis.8 | 116 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 260 insertions(+) create mode 100644 man/alfred.8 create mode 100644 vis/man/batadv-vis.8
diff --git a/Makefile b/Makefile index ec9dc11..7b13d7b 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,7 @@ # alfred build BINARY_NAME = alfred OBJ = main.o server.o client.o netsock.o send.o recv.o hash.o unix_sock.o util.o debugfs.o batadv_query.o +MANPAGE = man/alfred.8
# alfred flags and options CFLAGS += -pedantic -Wall -W -std=gnu99 -fno-strict-aliasing -MD -MP @@ -47,6 +48,7 @@ LINK.o = $(Q_LD)$(CC) $(CFLAGS) $(LDFLAGS) $(TARGET_ARCH) # standard install paths PREFIX = /usr/local SBINDIR = $(PREFIX)/sbin +MANDIR = $(PREFIX)/share/man
# try to generate revision REVISION= $(shell if [ -d .git ]; then \ @@ -79,7 +81,9 @@ clean: $(VIS_CLEAN)
install: $(BINARY_NAME) $(VIS_INSTALL) $(MKDIR) $(DESTDIR)$(SBINDIR) + $(MKDIR) $(DESTDIR)$(MANDIR)/man8 $(INSTALL) -m 0755 $(BINARY_NAME) $(DESTDIR)$(SBINDIR) + $(INSTALL) -m 0644 $(MANPAGE) $(DESTDIR)$(MANDIR)/man8
vis-install: $(MAKE) -C vis install diff --git a/man/alfred.8 b/man/alfred.8 new file mode 100644 index 0000000..5eb48aa --- /dev/null +++ b/man/alfred.8 @@ -0,0 +1,136 @@ +." Hey, EMACS: -*- nroff -*- +." First parameter, NAME, should be all caps +." Second parameter, SECTION, should be 1-8, maybe w/ subsection +." other parameters are allowed: see man(7), man(1) +.TH "ALFRED" "8" "Sep 21, 2013" "Linux" "Almighty Lightweight Fact Remote Exchange Daemon" +." Please adjust this date whenever revising the manpage. +." +." Some roff macros, for reference: +." .nh disable hyphenation +." .hy enable hyphenation +." .ad l left justify +." .ad b justify to both left and right margins +." .nf disable filling +." .fi enable filling +." .br insert line break +." .sp <n> insert n+1 empty lines +." for manpage-specific macros, see man(7) +." -------------------------------------------------------------------------- +." Process this file with +." groff -man alfred.8 -Tutf8 +." Retrieve format warnings with +." man --warnings alfred.8 > /dev/null +." -------------------------------------------------------------------------- +.ad l +.SH NAME +alfred - Almighty Lightweight Fact Remote Exchange Daemon +.SH SYNOPSIS +.B alfred [\fIoptions\fP] +.br +.SH DESCRIPTION +alfred is a user space daemon for distributing arbitrary local information over +the mesh/network in a decentralized fashion. This data can be anything which +appears to be useful - originally designed to replace the batman-adv +visualization (vis), you may distribute hostnames, phone books, administration +information, DNS information, the local weather forecast ... +.PP +alfred runs as daemon in the background of the system. A user may insert +information by using the alfred binary on the command line, or use special +programs to communicate with alfred (done via unix sockets). alfred then takes +care of distributing the local information to other alfred servers on other +nodes. This is done via IPv6 link-local multicast, and does not require any +configuration. A user can request data from alfred, and will receive the +information available from all alfred servers in the network. +.PP +.PP +.SH OPTIONS +.TP +\fB-v\fP, \fB--version\fP +Print the version +.TP +\fB-h\fP, \fB--help\fP +Display a brief help message. +. +.SH CLIENT OPTIONS +.TP +\fB-s\fP, \fB--set-data\fP \fIdata-type\fP +Sets new data to distribute from stdin for the supplied data type (0-255). + +Note that 0 - 63 are reserved (please send an e-mail to the authors if you want +to register a datatype), and can not be used on the commandline. Information +must be periodically written again to alfred, otherwise it will timeout and +alfred will forget about it (after 10 minutes). +.TP +\fB-r\fP, \fB--request\fP \fIdata-type\fP +Collect data from the network and prints it on the network +.TP +\fB-V\fP, \fB--req-version\fP \fIversion\fP +Specify the data version set for \fB-s\fP + +Skipping the parameter entirely has the same effect as setting the parameter +to 0 ('\fB-V\fP 0'). +.TP +\fB-M\fP, \fB--modeswitch\fP \fImode\fP +.nf +\fBmaster\fP + Switch daemon to mode master +\fBslave\fP + Switch daemon to mode slave +.fi +. +.SH SERVER OPTIONS +.TP +\fB-i\fP, \fB--interface\fP \fiface\fP +Specify the interface to listen on +.TP +\fB-b\fP \fIbatmanif\fP +Specify the batman-adv interface configured on the system (default: bat0). +Use 'none' to disable the batman-adv based best server selection. + +The \fB-b\fP option is optional, and only needed if you run alfred on a +batman-adv interface not called bat0, or if you don't use batman-adv at all +(use '\fB-b\fP none'). In this case, alfred will still work but will not be +able to find the best next master server based on metrics. +.TP +\fB-m\fP, \fB--master\fP +Start up the daemon in master mode, which accepts data from slaves and synces +it with other masters. + +alfred servers may either run as master or slave in the network. Masters will +announce their status via broadcast, so that slaves can find them. Slaves will +then send their data to their nearest master (based on TQ). Masters will +exchange their data (which they have received from slaves or got on their own) +with other masters. By using masters and slaves, overhead can be reduced while +still keeping redundancy (by having multiple masters). Obviously, at least one +master must be present in the network to let any data exchange happen. Also +having all nodes in master mode is possible (for maximum decentrality and +overhead). +. +.SH EXAMPLES +Start an alfred server listening on bridge br0 (assuming that this bridge +includes the batman interface bat0): +.br +\fB alfred -i br0 -m\fP +.br + +Send data to the alfred server and store it under id 65: +.br +\fB cat /etc/hostname | alfred -s 65\fP + +Retreive all data stored as id 65 from all connected alfred servers: +.br +\fB alfred -r 65\fP +.nf + { "fe:f1:00:00:01:01", "OpenWRT-node-1\x0a" }, + { "fe:f1:00:00:02:01", "OpenWRT-node-2\x0a" }, + { "fe:f1:00:00:03:01", "OpenWRT-node-3\x0a" }, +.fi +.br +. +.SH SEE ALSO +.BR batadv-vis (8), +.BR batctl (8) +.SH AUTHOR +alfred was written by Simon Wunderlich siwu@hrz.tu-chemnitz.de and Sven Eckelmann sven@open-mesh.com. +.PP +This manual page was written by Simon Wunderlich siwu@hrz.tu-chemnitz.de and Sven Eckelmann sven@open-mesh.com. diff --git a/vis/Makefile b/vis/Makefile index 4db27d9..586c1cd 100644 --- a/vis/Makefile +++ b/vis/Makefile @@ -21,6 +21,7 @@ # batadv-vis build BINARY_NAME = batadv-vis OBJ = vis.o debugfs.o +MANPAGE = man/batadv-vis.8
# batadv-vis flags and options CFLAGS += -pedantic -Wall -W -std=gnu99 -fno-strict-aliasing -MD -MP @@ -47,6 +48,7 @@ LINK.o = $(Q_LD)$(CC) $(CFLAGS) $(LDFLAGS) $(TARGET_ARCH) # standard install paths PREFIX = /usr/local SBINDIR = $(PREFIX)/sbin +MANDIR = $(PREFIX)/share/man
# try to generate revision REVISION= $(shell if [ -d ../.git ]; then \ @@ -72,7 +74,9 @@ clean:
install: $(BINARY_NAME) $(MKDIR) $(DESTDIR)$(SBINDIR) + $(MKDIR) $(DESTDIR)$(MANDIR)/man8 $(INSTALL) -m 0755 $(BINARY_NAME) $(DESTDIR)$(SBINDIR) + $(INSTALL) -m 0644 $(MANPAGE) $(DESTDIR)$(MANDIR)/man8
# load dependencies DEP = $(OBJ:.o=.d) diff --git a/vis/man/batadv-vis.8 b/vis/man/batadv-vis.8 new file mode 100644 index 0000000..dfa2604 --- /dev/null +++ b/vis/man/batadv-vis.8 @@ -0,0 +1,116 @@ +." Hey, EMACS: -*- nroff -*- +." First parameter, NAME, should be all caps +." Second parameter, SECTION, should be 1-8, maybe w/ subsection +." other parameters are allowed: see man(7), man(1) +.TH "BATADV-VIS" "8" "Sep 21, 2013" "Linux" "batman-adv visualization server" +." Please adjust this date whenever revising the manpage. +." +." Some roff macros, for reference: +." .nh disable hyphenation +." .hy enable hyphenation +." .ad l left justify +." .ad b justify to both left and right margins +." .nf disable filling +." .fi enable filling +." .br insert line break +." .sp <n> insert n+1 empty lines +." for manpage-specific macros, see man(7) +." -------------------------------------------------------------------------- +." Process this file with +." groff -man batadv-vis.8 -Tutf8 +." Retrieve format warnings with +." man --warnings batadv-vis.8 > /dev/null +." -------------------------------------------------------------------------- +.ad l +.SH NAME +batadv-vis - batman-adv visualization server +.SH SYNOPSIS +.B batadv-vis [\fIoptions\fP] +.br +.SH DESCRIPTION +batadv-vis can be used to visualize your batman-adv mesh network. It read the +neighbor information and local client table and distributes this information via +alfred in the network. By gathering this local information, any vis node can get +the whole picture of the network. +.PP +.PP +.SH OPTIONS +.TP +\fB-v\fP, \fB--version\fP +Print the version +.TP +\fB-h\fP, \fB--help\fP +Display a brief help message. +.TP +\fB-i\fP, \fB--interface\fP \fIiface\fP +Specify the batman-adv interface configured on the system (default: bat0) +.TP +\fB-s\fP, \fB--server\fP +Start up in server mode. This server will read the neighbor and client +information from batman-adv every 10 seconds and set it in alfred via unix +socket. The alfred server must run too to get this information set. +.TP +\fB-f\fP, \fB--format\fP \fIformat\fP +Specify the output format for client mode (either "json" or "dot") +. +.SH EXAMPLES +Start an batadv-vis server which is fetching the information for bat0: +.br +\fB batadv-vis -i bat0 -s\fP +.br + +To get a graphviz-compatible vis output: +.br +\fB batadv-vis\fP +.nf + digraph { + subgraph "cluster_fe:f0:00:00:04:01" { + "fe:f0:00:00:04:01" + } + "fe:f0:00:00:04:01" -> "fe:f0:00:00:05:01" [label="1.000"] + "fe:f0:00:00:04:01" -> "fe:f0:00:00:03:01" [label="1.004"] + "fe:f0:00:00:04:01" -> "00:00:43:05:00:04" [label="TT"] + "fe:f0:00:00:04:01" -> "fe:f1:00:00:04:01" [label="TT"] + subgraph "cluster_fe:f0:00:00:02:01" { + "fe:f0:00:00:02:01" + } + "fe:f0:00:00:02:01" -> "fe:f0:00:00:03:01" [label="1.000"] + "fe:f0:00:00:02:01" -> "fe:f0:00:00:01:01" [label="1.008"] + "fe:f0:00:00:02:01" -> "fe:f0:00:00:08:01" [label="1.000"] + "fe:f0:00:00:02:01" -> "fe:f1:00:00:02:01" [label="TT"] + "fe:f0:00:00:02:01" -> "00:00:43:05:00:02" [label="TT"] + subgraph "cluster_fe:f0:00:00:08:01" { + "fe:f0:00:00:08:01" + } + [...] + } +.fi +.br + +To get a json vis output: +.br +\fB batadv-vis -f json\fP +.nf + { "primary" : "fe:f0:00:00:04:01" } + { "router" : "fe:f0:00:00:04:01", "neighbor" : "fe:f0:00:00:05:01", "label" : "1.000" } + { "router" : "fe:f0:00:00:04:01", "neighbor" : "fe:f0:00:00:03:01", "label" : "1.008" } + { "router" : "fe:f0:00:00:04:01", "gateway" : "00:00:43:05:00:04", "label" : "TT" } + { "router" : "fe:f0:00:00:04:01", "gateway" : "fe:f1:00:00:04:01", "label" : "TT" } + { "primary" : "fe:f0:00:00:02:01" } + { "router" : "fe:f0:00:00:02:01", "neighbor" : "fe:f0:00:00:03:01", "label" : "1.000" } + { "router" : "fe:f0:00:00:02:01", "neighbor" : "fe:f0:00:00:01:01", "label" : "1.016" } + { "router" : "fe:f0:00:00:02:01", "neighbor" : "fe:f0:00:00:08:01", "label" : "1.000" } + { "router" : "fe:f0:00:00:02:01", "gateway" : "fe:f1:00:00:02:01", "label" : "TT" } + { "router" : "fe:f0:00:00:02:01", "gateway" : "00:00:43:05:00:02", "label" : "TT" } + { "primary" : "fe:f0:00:00:08:01" } + [...] +.fi +.br +. +.SH SEE ALSO +.BR alfred (8), +.BR batctl (8) +.SH AUTHOR +batadv-vis was written by Simon Wunderlich siwu@hrz.tu-chemnitz.de. +.PP +This manual page was written by Simon Wunderlich siwu@hrz.tu-chemnitz.de and Sven Eckelmann sven@open-mesh.com.
On Sat, Sep 21, 2013 at 04:31:14PM +0200, Sven Eckelmann wrote:
The *.d depends files for make just list the files used when building an object file. Removing a file listed in such a dependency file causes make to search for a way to recreate it. This usually cannot work because these files aren't autogenerated.
The gcc option -MP can be used to generate empty rule for these files. Removing a file in a dependency list will then execute this empty rule and continue with the execution of the creation of the object file. This compilation process will then automatically correct the dependency file.
Signed-off-by: Sven Eckelmann sven@narfation.org
Applied the whole series (133331a, add63f6, ada988e, ea03057). I was a little unsure about the renaming thing (I don't like long names), but it's probably the best thing to do.
Thanks! Simon
b.a.t.m.a.n@lists.open-mesh.org