From patchwork Tue Apr 12 08:51:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 15958 X-Patchwork-Delegate: mareklindner@neomailbox.ch Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id AF226824DE; Tue, 12 Apr 2016 10:51:35 +0200 (CEST) Authentication-Results: open-mesh.org; dmarc=none header.from=open-mesh.com Authentication-Results: open-mesh.org; dkim=fail reason="verification failed; unprotected key" header.d=open-mesh-com.20150623.gappssmtp.com header.i=@open-mesh-com.20150623.gappssmtp.com header.b=eUNY3ASY; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received-SPF: Neutral (access neither permitted nor denied) identity=mailfrom; client-ip=2a00:1450:400c:c09::230; helo=mail-wm0-x230.google.com; envelope-from=sven.eckelmann@open-mesh.com; receiver=b.a.t.m.a.n@lists.open-mesh.org Authentication-Results: open-mesh.org; dmarc=none header.from=open-mesh.com Received: from mail-wm0-x230.google.com (mail-wm0-x230.google.com [IPv6:2a00:1450:400c:c09::230]) by open-mesh.org (Postfix) with ESMTPS id 32E01824DB for ; Tue, 12 Apr 2016 10:51:34 +0200 (CEST) Received: by mail-wm0-x230.google.com with SMTP id a140so44327071wma.0 for ; Tue, 12 Apr 2016 01:51:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=open-mesh-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=wN5aJNeL5MJqDQMO6uGjN/LfrtveQFY4L+Ak1Og6fDI=; b=eUNY3ASYVEIOljRQlDwEjF9hq1dAtiTYwT/IpAaNh7LPdQsA55t2O2mukw1kGXu8lo IL2xd2HxYqS16TFZ3RpP8Bd8uyxNn3sJm7ix1kT/4nQ3lPEpRln7FGdRn42DGUdUUrAG p6XxlqRYwWNij6nS/n+IG3epvLqcCbELG0o56T+4L9N77uram1lM/niQsV+4HxQ++5Le 4nxk2EzXfQxvnkIZbLiMVbbgevImkwYC0ziHkM/UKyTijz0x/S6E3rlPD+qzcqlyphp7 15pORwgVabsI9kPKrspG4+k1hqI8m1QfbWO0JrZifZRmPtnXwA5XN6196yPjmvXjWKaF cdmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=wN5aJNeL5MJqDQMO6uGjN/LfrtveQFY4L+Ak1Og6fDI=; b=Kqm2j7VEsRj/2Myn36f4ZBcPgV5SaFo+C3kYfhHFNUioU5o5XUFWpTru/jX9qEhZDE 0kYacDfGwVirzV06gwjtMbvhQy30xK0YKRAzPFnz6r02WRB9hZvvFRWDw0Aew7MasOlh +694A5IyPcIZTIm8liFw1fUcOg1b5MpHp5qBg+b1tilA4VktEgDD5nfDgttV7YWZuapH 7WZDXJZXKxu8VRze2H2CrnZ2uOLjPsdbrTATRN9c5wh8WZOXjV+3E9Sby40nB77/O7y4 cJi6wgEeAagU1hcGfzK1JOgHMRbF9g9Imep9SqxYvmU+APYulVu+C3+hWZjd/gGebTIn h6ug== X-Gm-Message-State: AOPr4FXTGt9K3/Q5dCQJzJqEdn8bIvHYY+HH3xTOPu/9zh/FroY2rPQeXtYs1FfESCUlyKlz X-Received: by 10.194.87.103 with SMTP id w7mr2194099wjz.13.1460451093822; Tue, 12 Apr 2016 01:51:33 -0700 (PDT) Received: from sven-desktop.home.narfation.org (x4d0d5022.dyn.telefonica.de. [77.13.80.34]) by smtp.gmail.com with ESMTPSA id m6sm32041533wje.21.2016.04.12.01.51.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Apr 2016 01:51:33 -0700 (PDT) From: Sven Eckelmann X-Google-Original-From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Tue, 12 Apr 2016 10:51:27 +0200 Message-Id: <1460451087-18450-1-git-send-email-sven@open-mesh.com> X-Mailer: git-send-email 2.8.0.rc3 Cc: Sven Eckelmann Subject: [B.A.T.M.A.N.] [PATCH] batctl: tcpdump - Add support for bla loopdetect X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" From: Sven Eckelmann Complex bridge loop detection was added to batman-adv. It uses so called BLA LOOPDETECT ARP packets to find out if there is a loop. The bla2 claim function of tcpdump extracts the same information which also batadv_bla_send_claim uses for its debug output. Signed-off-by: Sven Eckelmann --- packet.h | 1 + tcpdump.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/packet.h b/packet.h index 0796dfd..372128d 100644 --- a/packet.h +++ b/packet.h @@ -175,6 +175,7 @@ enum batadv_bla_claimframe { BATADV_CLAIM_TYPE_UNCLAIM = 0x01, BATADV_CLAIM_TYPE_ANNOUNCE = 0x02, BATADV_CLAIM_TYPE_REQUEST = 0x03, + BATADV_CLAIM_TYPE_LOOPDETECT = 0x04, }; /** diff --git a/tcpdump.c b/tcpdump.c index a30e34b..e969d7d 100644 --- a/tcpdump.c +++ b/tcpdump.c @@ -366,6 +366,12 @@ static int dump_bla2_claim(struct ether_header *eth_hdr, printf("dst backbone %s\n", get_name_by_macaddr((struct ether_addr *)eth_hdr->ether_dhost, read_opt)); break; + case BATADV_CLAIM_TYPE_LOOPDETECT: + printf("BLA LOOPDETECT, src backbone %s, ", + get_name_by_macaddr((struct ether_addr *)eth_hdr->ether_shost, read_opt)); + printf("dst backbone %s\n", + get_name_by_macaddr((struct ether_addr *)eth_hdr->ether_dhost, read_opt)); + break; default: printf("BLA UNKNOWN, type %hhu\n", bla_dst->type); break;