]> The Tcpdump Group git mirrors - libpcap/commitdiff
802.11 support, from Javier Achirica <[email protected]>.
authorguy <guy>
Sun, 10 Jun 2001 01:11:39 +0000 (01:11 +0000)
committerguy <guy>
Sun, 10 Jun 2001 01:11:39 +0000 (01:11 +0000)
CREDITS
gencode.c
pcap-linux.c

diff --git a/CREDITS b/CREDITS
index 40f8a07c56dcd2942ad034954d3e76956bfc4640..6156c7650c8b528f1fccefe1258e55cd9d60a51a 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -23,6 +23,7 @@ Additional people who have contributed patches:
        Greg Troxel                     <[email protected]>
        Igor Khristophorov              <[email protected]>
        Jason R. Thorpe                 <[email protected]>
+       Javier Achirica                 <[email protected]>
        Jefferson Ogata                 <[email protected]>
        Juergen Schoenwaelder           <[email protected]>
        Klaus Klein                     <[email protected]>
index 69392a5021c9f81620cce291fed82ae08e35bae9..e567de14fcada6331a38d4356a94cc3c3ad8283a 100644 (file)
--- a/gencode.c
+++ b/gencode.c
@@ -21,7 +21,7 @@
  */
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.153 2001-05-30 01:27:21 fenner Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.154 2001-06-10 01:11:40 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -654,6 +654,23 @@ init_linktype(type)
                off_nl = 22;
                return;
 
+       case DLT_IEEE802_11:
+               /*
+                * 802.11 doesn't really have a link-level type field.
+                * We set "off_linktype" to the offset of the LLC header.
+                *
+                * To check for Ethernet types, we assume that SSAP = SNAP
+                * is being used and pick out the encapsulated Ethernet type.
+                * XXX - should we generate code to check for SNAP?
+                *
+                * XXX - the header is actually variable-length.  We
+                * assume a 24-byte link-layer header, as appears in
+                * data frames in networks with no bridges.
+                */
+               off_linktype = 24;
+               off_nl = 30;
+               return;
+
        case DLT_ATM_RFC1483:
                /*
                 * assume routed, non-ISO PDUs
@@ -901,6 +918,7 @@ gen_linktype(proto)
                }
                break;
 
+       case DLT_IEEE802_11:
        case DLT_FDDI:
        case DLT_IEEE802:
        case DLT_ATM_RFC1483:
index 5f1c35b50e4bfcfbbe442c2e29ba66956db42942..adabec4e337a904f1b6133312eaf7915a2a7d2ad 100644 (file)
@@ -26,7 +26,7 @@
  */
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/libpcap/pcap-linux.c,v 1.57 2001-04-09 05:55:40 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/pcap-linux.c,v 1.58 2001-06-10 01:11:41 guy Exp $ (LBL)";
 #endif
 
 /*
@@ -656,6 +656,13 @@ static int map_arphrd_to_dlt(pcap_t *handle, int arptype)
                handle->linktype = DLT_ATM_CLIP;
                break;
 
+#ifndef ARPHRD_IEEE80211  /* From Linux 2.4.6 */
+#define ARPHRD_IEEE80211 801
+#endif
+       case ARPHRD_IEEE80211:
+               handle->linktype = DLT_IEEE802_11;
+               break;
+
        case ARPHRD_PPP:
                /*
                 * Some PPP code in the kernel supplies no link-layer