summaryrefslogtreecommitdiffstats
path: root/contrib/tcpdump/token.h
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1999-02-20 11:18:00 +0000
committerjulian <julian@FreeBSD.org>1999-02-20 11:18:00 +0000
commit16c8d9e8d0ca48475483b6c811b4af317c734ab0 (patch)
treee3e5ce3fffddfb7abb04759c7f4a6af8d76a18c1 /contrib/tcpdump/token.h
parent0fd1dd9aabd45a0d145034aef2766eb2a88c1185 (diff)
downloadFreeBSD-src-16c8d9e8d0ca48475483b6c811b4af317c734ab0.zip
FreeBSD-src-16c8d9e8d0ca48475483b6c811b4af317c734ab0.tar.gz
World, I'd like you to meet the first FreeBSD token Ring driver.
This is for various Olicom cards. An IBM driver is following. This patch also adds support to tcpdump to decode packets on tokenring. Congratulations to the proud father.. (below) Submitted by: Larry Lile <lile@stdio.com>
Diffstat (limited to 'contrib/tcpdump/token.h')
-rw-r--r--contrib/tcpdump/token.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/contrib/tcpdump/token.h b/contrib/tcpdump/token.h
new file mode 100644
index 0000000..6f28a1e
--- /dev/null
+++ b/contrib/tcpdump/token.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 1998, Larry Lile
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#define TOKEN_HDR_LEN 14
+#define IS_SOURCE_ROUTED (tp->ether_shost[0] & 0x80)
+#define RIF_LENGTH ((ntohs(tp->rcf) & 0x1f00) >> 8)
+#define TOKEN_RING_MAC_LEN 6
+#define ROUTING_SEGMENT_MAX 16
+
+struct token_header {
+ u_char ac;
+ u_char fc;
+ u_char ether_dhost[TOKEN_RING_MAC_LEN];
+ u_char ether_shost[TOKEN_RING_MAC_LEN];
+ u_short rcf;
+ u_short rseg[ROUTING_SEGMENT_MAX];
+};
+
OpenPOWER on IntegriCloud