b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven.eckelmann@open-mesh.com>
To: b.a.t.m.a.n@lists.open-mesh.org
Cc: Sven Eckelmann <sven.eckelmann@open-mesh.com>
Subject: [B.A.T.M.A.N.] [PATCH] batctl: tcpdump - Add support for bla loopdetect
Date: Tue, 12 Apr 2016 10:51:27 +0200	[thread overview]
Message-ID: <1460451087-18450-1-git-send-email-sven@open-mesh.com> (raw)

From: Sven Eckelmann <sven.eckelmann@open-mesh.com>

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 <sven.eckelmann@open-mesh.com>
---
 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;
-- 
2.8.0.rc3


             reply	other threads:[~2016-04-12  8:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-12  8:51 Sven Eckelmann [this message]
2016-04-14 16:54 ` [B.A.T.M.A.N.] [PATCH] batctl: tcpdump - Add support for bla loopdetect Marek Lindner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1460451087-18450-1-git-send-email-sven@open-mesh.com \
    --to=sven.eckelmann@open-mesh.com \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).