From patchwork Sat Aug 25 08:57:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Lindner X-Patchwork-Id: 2300 Return-Path: Received: from nm16.bullet.mail.ukl.yahoo.com (nm16.bullet.mail.ukl.yahoo.com [217.146.183.190]) by open-mesh.org (Postfix) with SMTP id 3557C6010A0 for ; Sat, 25 Aug 2012 10:58:45 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=pass reason="1024-bit key; insecure key" header.i=@yahoo.de header.b=DJTjrrZA; dkim-adsp=pass; dkim-atps=neutral Received: from [217.12.10.83] by nm16.bullet.mail.ukl.yahoo.com with NNFMP; 25 Aug 2012 08:58:44 -0000 Received: from [77.238.184.65] by tm17.bullet.mail.ukl.yahoo.com with NNFMP; 25 Aug 2012 08:58:44 -0000 Received: from [127.0.0.1] by smtp134.mail.ukl.yahoo.com with NNFMP; 25 Aug 2012 08:58:44 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1345885124; bh=PCfy14c4yfwkHIOFsH4MwQHArZzhZxofova4KNuJHIA=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References; b=DJTjrrZAbhWyZCRqJDoVDfEttG6wYvJYwyc/DtyuphDBWbsKcwUVksloVdFNheoEdHE/opcPP0mxQz4eAm62VqJ0vVBIyhETLhmmtiqm0MFCuzwmbHDhX1JOgwu9TaolFL0MdtU16+4vBMCZfn7TU1pjh8ta3cihQxu/6H5OuZE= X-Yahoo-Newman-Id: 856211.59039.bm@smtp134.mail.ukl.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: HbVKhXoVM1lK08YgKRt4AQmo3oS782oAN54y34XOKmxmD4M TGrEKgQs.BedFqlav03M4tfXnZBXx0alfWY1swBEHv7aScV6NSWeiNt8Y8Nv jMFQNYlpbJZAujyiWwK0ek92AvSgItZtrqmyyDnUvwKxoQ4BSWPFykijgxvV _wD2hpyrkZMgRXPEfUHYGHWkybFG33jYPjqLm2BkwdObPgYRVLqcPTOqcL6r aqQF3FjCiNbBOhddG8m783FrTTZZBq6AlNi1a3sbRA8QaHKn8BuVfzpN499n cfKMz9W5vf95nUtind77dSYR.So2laQ4nT9BRi.G034QXRzW2eyKYI988Pe4 mCABpaVfxYreLPaYHmnKJVIrlLNQEz61Pg12bMwP1bTJy9D.UcQRORY.y8kX TjSGN6t8q5WGBu6ecL5nL X-Yahoo-SMTP: tW.h3tiswBBMXO2coYcbPigGD5Lt6zY_.Zc- Received: from localhost (lindner_marek@217.227.176.84 with plain) by smtp134.mail.ukl.yahoo.com with SMTP; 25 Aug 2012 08:58:44 +0000 GMT From: Marek Lindner To: b.a.t.m.a.n@lists.open-mesh.org Date: Sat, 25 Aug 2012 10:57:59 +0200 Message-Id: <1345885079-23652-2-git-send-email-lindner_marek@yahoo.de> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1345885079-23652-1-git-send-email-lindner_marek@yahoo.de> References: <1345885079-23652-1-git-send-email-lindner_marek@yahoo.de> Cc: Marek Lindner Subject: [B.A.T.M.A.N.] [PATCHv2 2/2] batctl: make bisect_* a compile time option X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Aug 2012 08:58:45 -0000 Signed-off-by: Marek Lindner --- v2: Use CPPFLAGS instead of CFLAGS. Makefile | 16 +++++++++++++--- main.c | 4 ++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index efe57c1..4379837 100755 --- a/Makefile +++ b/Makefile @@ -18,9 +18,14 @@ # 02110-1301, USA # +# changing the CONFIG_* line to 'y' enables the related feature +# batctl advanced debugging tool bisect: +export CONFIG_BATCTL_BISECT=n + # batctl build BINARY_NAME = batctl -OBJ = main.o bat-hosts.o functions.o sys.o debug.o ping.o traceroute.o tcpdump.o list-batman.o hash.o vis.o debugfs.o bisect_iv.o ioctl.o +OBJ = main.o bat-hosts.o functions.o sys.o debug.o ping.o traceroute.o tcpdump.o hash.o vis.o debugfs.o ioctl.o list-batman.o +OBJ_BISECT = bisect_iv.o MANPAGE = man/batctl.8 # batctl flags and options @@ -38,6 +43,11 @@ endif endif # standard build tools +ifeq ($(CONFIG_BATCTL_BISECT),y) +OBJ += $(OBJ_BISECT) +CPPFLAGS += -DBATCTL_BISECT +endif + CC ?= gcc RM ?= rm -f INSTALL ?= install @@ -70,7 +80,7 @@ $(BINARY_NAME): $(OBJ) $(LINK.o) $^ $(LDLIBS) -o $@ clean: - $(RM) $(BINARY_NAME) $(OBJ) $(DEP) + $(RM) $(BINARY_NAME) $(OBJ) $(OBJ_BISECT) $(DEP) install: $(BINARY_NAME) $(MKDIR) $(DESTDIR)$(SBINDIR) @@ -79,7 +89,7 @@ install: $(BINARY_NAME) $(INSTALL) -m 0644 $(MANPAGE) $(DESTDIR)$(MANDIR)/man8 # load dependencies -DEP = $(OBJ:.o=.d) +DEP = $(OBJ:.o=.d) $(OBJ_BISECT:.o=.d) -include $(DEP) .PHONY: all clean install diff --git a/main.c b/main.c index 390736d..01a435b 100644 --- a/main.c +++ b/main.c @@ -85,7 +85,9 @@ void print_usage(void) printf(" \tping|p \tping another batman adv host via layer 2\n"); printf(" \ttraceroute|tr \ttraceroute another batman adv host via layer 2\n"); printf(" \ttcpdump|td \ttcpdump layer 2 traffic on the given interface\n"); +#ifdef BATCTL_BISECT printf(" \tbisect_iv .. \tanalyze given batman iv log files for routing stability\n"); +#endif } int main(int argc, char **argv) @@ -172,9 +174,11 @@ int main(int argc, char **argv) ret = ioctl_statistics_get(mesh_iface); +#ifdef BATCTL_BISECT } else if ((strcmp(argv[1], "bisect_iv") == 0)) { ret = bisect_iv(argc - 1, argv + 1); +#endif } else {