From cf131d9e168b68d69b326f4df3a40861360f8455 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Thu, 29 Jan 2004 10:58:28 +0000 Subject: [PATCH] The DLT_ value 127 is being used for the BSD radio header, and the current CVS libpcap uses 163 for the AVS radio header (127 was never used for the AVS radio header). Redo the Wiretap encapsulation values for that (and shuffle them to put the 802.11 Wiretap values together). svn path=/trunk/; revision=9904 --- packet-tzsp.c | 7 ++-- packet-wlancap.c | 4 +-- wiretap/libpcap.c | 6 ++-- wiretap/wtap.c | 17 ++++++---- wiretap/wtap.h | 83 ++++++++++++++++++++++++----------------------- 5 files changed, 62 insertions(+), 55 deletions(-) diff --git a/packet-tzsp.c b/packet-tzsp.c index c88d6360fb..dde6cc2e90 100644 --- a/packet-tzsp.c +++ b/packet-tzsp.c @@ -1,6 +1,6 @@ /* packet-tzsp.c * - * $Id: packet-tzsp.c,v 1.5 2003/12/15 00:08:57 guy Exp $ + * $Id: packet-tzsp.c,v 1.6 2004/01/29 10:58:28 guy Exp $ * * Copyright 2002, Tazmen Technologies Inc * @@ -82,12 +82,13 @@ static int hf_sensormac = -1; /* ************************************************************************* */ /* Encapsulation type values */ +/* Note that these are not all the same as DLT_ values */ /* ************************************************************************* */ #define TZSP_ENCAP_ETHERNET 1 #define TZSP_ENCAP_IEEE_802_11 18 #define TZSP_ENCAP_PRISM_HEADER 119 -#define TZSP_ENCAP_WLAN_HEADER 127 +#define TZSP_ENCAP_WLAN_AVS 127 /* ************************************************************************* */ /* Generic header options */ @@ -254,7 +255,7 @@ struct encap_map { static const struct encap_map map_table[] = { { TZSP_ENCAP_ETHERNET, WTAP_ENCAP_ETHERNET }, { TZSP_ENCAP_PRISM_HEADER, WTAP_ENCAP_PRISM_HEADER }, - { TZSP_ENCAP_WLAN_HEADER, WTAP_ENCAP_WLAN_HEADER }, + { TZSP_ENCAP_WLAN_AVS, WTAP_ENCAP_IEEE_802_11_WLAN_AVS }, { TZSP_ENCAP_IEEE_802_11, WTAP_ENCAP_IEEE_802_11 }, { 0, -1 } }; diff --git a/packet-wlancap.c b/packet-wlancap.c index 51ceb98ab8..508c0de623 100644 --- a/packet-wlancap.c +++ b/packet-wlancap.c @@ -10,7 +10,7 @@ * * By Solomon Peachy * - * $Id: packet-wlancap.c,v 1.3 2003/12/04 05:59:35 gram Exp $ + * $Id: packet-wlancap.c,v 1.4 2004/01/29 10:58:28 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -280,5 +280,5 @@ proto_reg_handoff_wlancap(void) wlancap_handle = create_dissector_handle(dissect_wlancap, proto_wlancap); - dissector_add("wtap_encap", WTAP_ENCAP_WLAN_HEADER, wlancap_handle); + dissector_add("wtap_encap", WTAP_ENCAP_IEEE_802_11_WLAN_AVS, wlancap_handle); } diff --git a/wiretap/libpcap.c b/wiretap/libpcap.c index a6de62c3fc..378c51f943 100644 --- a/wiretap/libpcap.c +++ b/wiretap/libpcap.c @@ -1,6 +1,6 @@ /* libpcap.c * - * $Id: libpcap.c,v 1.110 2004/01/28 01:24:29 guy Exp $ + * $Id: libpcap.c,v 1.111 2004/01/29 10:58:28 guy Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez @@ -270,7 +270,7 @@ static const struct { { 121, WTAP_ENCAP_HHDLC }, /* HiPath HDLC */ { 122, WTAP_ENCAP_IP_OVER_FC }, /* RFC 2625 IP-over-FC */ { 123, WTAP_ENCAP_ATM_PDUS }, /* SunATM */ - { 127, WTAP_ENCAP_WLAN_HEADER }, /* 802.11 plus WLAN header */ + { 127, WTAP_ENCAP_IEEE_802_11_WLAN_BSD }, /* 802.11 plus BSD WLAN header */ { 128, WTAP_ENCAP_TZSP }, /* Tazmen Sniffer Protocol */ { 129, WTAP_ENCAP_ARCNET_LINUX }, @@ -306,6 +306,8 @@ static const struct { { 161, WTAP_ENCAP_USER14 }, { 162, WTAP_ENCAP_USER15 }, + { 163, WTAP_ENCAP_IEEE_802_11_WLAN_AVS }, /* 802.11 plus AVS WLAN header */ + /* * To repeat: * diff --git a/wiretap/wtap.c b/wiretap/wtap.c index 9df0f367a3..900e92b24c 100644 --- a/wiretap/wtap.c +++ b/wiretap/wtap.c @@ -1,6 +1,6 @@ /* wtap.c * - * $Id: wtap.c,v 1.88 2004/01/28 01:24:29 guy Exp $ + * $Id: wtap.c,v 1.89 2004/01/29 10:58:28 guy Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez @@ -122,9 +122,18 @@ static const struct encap_type_info { /* WTAP_ENCAP_IEEE_802_11 */ { "IEEE 802.11 Wireless LAN", "ieee-802-11" }, + /* WTAP_ENCAP_PRISM_HEADER */ + { "IEEE 802.11 plus Prism II monitor mode header", "prism" }, + /* WTAP_ENCAP_IEEE_802_11_WITH_RADIO */ { "IEEE 802.11 Wireless LAN with radio information", "ieee-802-11-radio" }, + /* WTAP_ENCAP_IEEE_802_11_WLAN_BSD */ + { "IEEE 802.11 plus BSD WLAN header", "ieee-802-11-bsd" }, + + /* WTAP_ENCAP_IEEE_802_11_WLAN_AVS */ + { "IEEE 802.11 plus AVS WLAN header", "ieee-802-11-avs" }, + /* WTAP_ENCAP_SLL */ { "Linux cooked-mode capture", "linux-sll" }, @@ -143,9 +152,6 @@ static const struct encap_type_info { /* WTAP_ENCAP_LOCALTALK */ { "Localtalk", "ltalk" }, - /* WTAP_ENCAP_PRISM_HEADER */ - { "IEEE 802.11 plus Prism II monitor mode header", "prism" }, - /* WTAP_ENCAP_OLD_PFLOG */ { "OpenBSD PF Firewall logs, pre-3.4", "pflog-old" }, @@ -158,9 +164,6 @@ static const struct encap_type_info { /* WTAP_ENCAP_COSINE */ { "CoSine L2 debug log", "cosine" }, - /* WTAP_ENCAP_WLAN_HEADER */ - { "IEEE 802.11 plus AVS WLAN monitor header", "wlan" }, - /* WTAP_ENCAP_WFLEET_HDLC */ { "Wellfleet HDLC", "whdlc" }, diff --git a/wiretap/wtap.h b/wiretap/wtap.h index fe39e3a98b..6f5051de31 100644 --- a/wiretap/wtap.h +++ b/wiretap/wtap.h @@ -1,6 +1,6 @@ /* wtap.h * - * $Id: wtap.h,v 1.150 2004/01/28 01:24:30 guy Exp $ + * $Id: wtap.h,v 1.151 2004/01/29 10:58:28 guy Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez @@ -110,48 +110,49 @@ #define WTAP_ENCAP_IP_OVER_FC 18 #define WTAP_ENCAP_PPP_WITH_PHDR 19 #define WTAP_ENCAP_IEEE_802_11 20 -#define WTAP_ENCAP_IEEE_802_11_WITH_RADIO 21 -#define WTAP_ENCAP_SLL 22 -#define WTAP_ENCAP_FRELAY 23 -#define WTAP_ENCAP_FRELAY_WITH_PHDR 24 -#define WTAP_ENCAP_CHDLC 25 -#define WTAP_ENCAP_CISCO_IOS 26 -#define WTAP_ENCAP_LOCALTALK 27 -#define WTAP_ENCAP_PRISM_HEADER 28 -#define WTAP_ENCAP_OLD_PFLOG 29 -#define WTAP_ENCAP_HHDLC 30 -#define WTAP_ENCAP_DOCSIS 31 -#define WTAP_ENCAP_COSINE 32 -#define WTAP_ENCAP_WLAN_HEADER 33 -#define WTAP_ENCAP_WFLEET_HDLC 34 -#define WTAP_ENCAP_SDLC 35 -#define WTAP_ENCAP_TZSP 36 -#define WTAP_ENCAP_ENC 37 -#define WTAP_ENCAP_PFLOG 38 -#define WTAP_ENCAP_CHDLC_WITH_PHDR 39 -#define WTAP_ENCAP_BLUETOOTH_H4 40 -#define WTAP_ENCAP_MTP2 41 -#define WTAP_ENCAP_MTP3 42 -#define WTAP_ENCAP_IRDA 43 -#define WTAP_ENCAP_USER0 44 -#define WTAP_ENCAP_USER1 45 -#define WTAP_ENCAP_USER2 46 -#define WTAP_ENCAP_USER3 47 -#define WTAP_ENCAP_USER4 48 -#define WTAP_ENCAP_USER5 49 -#define WTAP_ENCAP_USER6 50 -#define WTAP_ENCAP_USER7 51 -#define WTAP_ENCAP_USER8 52 -#define WTAP_ENCAP_USER9 53 -#define WTAP_ENCAP_USER10 54 -#define WTAP_ENCAP_USER11 55 -#define WTAP_ENCAP_USER12 56 -#define WTAP_ENCAP_USER13 57 -#define WTAP_ENCAP_USER14 58 -#define WTAP_ENCAP_USER15 59 +#define WTAP_ENCAP_PRISM_HEADER 21 +#define WTAP_ENCAP_IEEE_802_11_WITH_RADIO 22 +#define WTAP_ENCAP_IEEE_802_11_WLAN_BSD 23 +#define WTAP_ENCAP_IEEE_802_11_WLAN_AVS 24 +#define WTAP_ENCAP_SLL 25 +#define WTAP_ENCAP_FRELAY 26 +#define WTAP_ENCAP_FRELAY_WITH_PHDR 27 +#define WTAP_ENCAP_CHDLC 28 +#define WTAP_ENCAP_CISCO_IOS 29 +#define WTAP_ENCAP_LOCALTALK 30 +#define WTAP_ENCAP_OLD_PFLOG 31 +#define WTAP_ENCAP_HHDLC 32 +#define WTAP_ENCAP_DOCSIS 33 +#define WTAP_ENCAP_COSINE 34 +#define WTAP_ENCAP_WFLEET_HDLC 35 +#define WTAP_ENCAP_SDLC 36 +#define WTAP_ENCAP_TZSP 37 +#define WTAP_ENCAP_ENC 38 +#define WTAP_ENCAP_PFLOG 39 +#define WTAP_ENCAP_CHDLC_WITH_PHDR 40 +#define WTAP_ENCAP_BLUETOOTH_H4 41 +#define WTAP_ENCAP_MTP2 42 +#define WTAP_ENCAP_MTP3 43 +#define WTAP_ENCAP_IRDA 44 +#define WTAP_ENCAP_USER0 45 +#define WTAP_ENCAP_USER1 46 +#define WTAP_ENCAP_USER2 47 +#define WTAP_ENCAP_USER3 48 +#define WTAP_ENCAP_USER4 49 +#define WTAP_ENCAP_USER5 50 +#define WTAP_ENCAP_USER6 51 +#define WTAP_ENCAP_USER7 52 +#define WTAP_ENCAP_USER8 53 +#define WTAP_ENCAP_USER9 54 +#define WTAP_ENCAP_USER10 55 +#define WTAP_ENCAP_USER11 56 +#define WTAP_ENCAP_USER12 57 +#define WTAP_ENCAP_USER13 58 +#define WTAP_ENCAP_USER14 59 +#define WTAP_ENCAP_USER15 60 /* last WTAP_ENCAP_ value + 1 */ -#define WTAP_NUM_ENCAP_TYPES 60 +#define WTAP_NUM_ENCAP_TYPES 61 /* File types that can be read by wiretap. We support writing some many of these file types, too, so we