From patchwork Fri Aug 24 23:39:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Lindner X-Patchwork-Id: 2303 Return-Path: Received: from nm5-vm0.bullet.mail.ukl.yahoo.com (nm5-vm0.bullet.mail.ukl.yahoo.com [217.146.183.232]) by open-mesh.org (Postfix) with SMTP id 0EEBE6010EE for ; Sat, 25 Aug 2012 01:40:19 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=pass reason="1024-bit key; insecure key" header.i=@yahoo.de header.b=51r7AJr9; dkim-adsp=pass; dkim-atps=neutral Received: from [217.146.183.216] by nm5.bullet.mail.ukl.yahoo.com with NNFMP; 24 Aug 2012 23:40:14 -0000 Received: from [77.238.184.68] by tm9.bullet.mail.ukl.yahoo.com with NNFMP; 24 Aug 2012 23:40:14 -0000 Received: from [127.0.0.1] by smtp137.mail.ukl.yahoo.com with NNFMP; 24 Aug 2012 23:40:14 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1345851614; bh=WYCFICd5zwRnC9fLMK6PsclBpyakfVptwDCTu8CtG9c=; 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=51r7AJr9vlrxotSIEp//Jt8PVbNtzK9UTMYByZqETK6hcxBX4/oU+Up72j4869Bn73ROukFHCSjzHEOZ4zZMkla6RJ63MRGojYln9YlNNpClPruliky/Xfu+4ly1OxDzDz3O4fT+uFt+9sonadzmDpO0+GSJxylJH5b3in3Zl8g= X-Yahoo-Newman-Id: 588278.47323.bm@smtp137.mail.ukl.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: DJKFvl8VM1kcw6eNOwYitNOp_sZpJxFTqDpgBUljRQiB5li 9ycL79DBopG_pdtlhRKVf2YS963WqE65Y7hsUaRyJ4HeFCTGgb_jFnkS6leX KamjuXnbNvc9LU4dfORUjKlwSnd6gmwRlcEPSq4y1T3CIYHGmjVFmKdpM63w 9_.3utuR3n2nCccgouAEaosX2NEig3NX1mT6JmT2z1gqlTWo_rSMUmVEmUoR D9_SH0h3DGwRb2ePjEiFiI7rlVOl5mndr.QEvdSpQn3TU06GYltxNQq2zbWm KztGF3pnlYalcBDnqJhV5na2dnT4cnaeNI8q.LOHpXRfNLl5dwUqiWpYkNLf JUSCInNBtWd1GpwjKbcRvCXTDWjMUbHVwqBuVClR.d1X.iJ6.94OY5yoerEU hx4J8BTg6czVQ7RSnpQ9bxw-- X-Yahoo-SMTP: tW.h3tiswBBMXO2coYcbPigGD5Lt6zY_.Zc- Received: from localhost (lindner_marek@217.254.166.133 with plain) by smtp137.mail.ukl.yahoo.com with SMTP; 24 Aug 2012 23:40:14 +0000 GMT From: Marek Lindner To: b.a.t.m.a.n@lists.open-mesh.org Date: Sat, 25 Aug 2012 01:39:17 +0200 Message-Id: <1345851557-8085-2-git-send-email-lindner_marek@yahoo.de> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1345851557-8085-1-git-send-email-lindner_marek@yahoo.de> References: <1345851557-8085-1-git-send-email-lindner_marek@yahoo.de> Cc: Marek Lindner Subject: [B.A.T.M.A.N.] [PATCH 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: Fri, 24 Aug 2012 23:40:20 -0000 Signed-off-by: Marek Lindner --- Makefile | 16 +++++++++++++--- main.c | 4 ++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index efe57c1..9b2d3ef 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) +CFLAGS += -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 {