[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r25018 - gnunet/src/transport
From: |
gnunet |
Subject: |
[GNUnet-SVN] r25018 - gnunet/src/transport |
Date: |
Fri, 16 Nov 2012 17:59:44 +0100 |
Author: grothoff
Date: 2012-11-16 17:59:44 +0100 (Fri, 16 Nov 2012)
New Revision: 25018
Modified:
gnunet/src/transport/gnunet-helper-transport-wlan.c
gnunet/src/transport/plugin_transport_wlan.h
Log:
-trying to add 802.3-encoding support
Modified: gnunet/src/transport/gnunet-helper-transport-wlan.c
===================================================================
--- gnunet/src/transport/gnunet-helper-transport-wlan.c 2012-11-16 16:43:27 UTC
(rev 25017)
+++ gnunet/src/transport/gnunet-helper-transport-wlan.c 2012-11-16 16:59:44 UTC
(rev 25018)
@@ -139,11 +139,20 @@
/**
* Packet format type for the messages we receive from
+ * the kernel. This is for Ethernet 10Mbps format (no
+ * performance information included).
+ */
+#define ARPHRD_ETHER 1
+
+
+/**
+ * Packet format type for the messages we receive from
* the kernel. This is for plain messages (with no
* performance information included).
*/
#define ARPHRD_IEEE80211 801
+
/**
* Packet format type for the messages we receive from
* the kernel. This is for the PRISM format.
@@ -1588,6 +1597,17 @@
case ARPHRD_IEEE80211:
n = 0; /* no header */
break;
+ case ARPHRD_ETHER:
+ {
+ ;
+
+ if (sizeof (struct GNUNET_TRANSPORT_WLAN_Ieee8023Frame) > caplen)
+ return 0; /* invalid */
+ memcpy (&buf[sizeof (struct GNUNET_TRANSPORT_WLAN_Ieee80211Frame)],
+ tmpbuf + sizeof (struct GNUNET_TRANSPORT_WLAN_Ieee8023Frame),
+ caplen - sizeof (struct GNUNET_TRANSPORT_WLAN_Ieee8023Frame) - 4
/* 4 byte FCS */);
+ return caplen - sizeof (struct GNUNET_TRANSPORT_WLAN_Ieee8023Frame) - 4;
+ }
default:
errno = ENOTSUP; /* unsupported format */
return -1;
@@ -1652,6 +1672,7 @@
return 1;
}
if (((ifr.ifr_hwaddr.sa_family != ARPHRD_IEEE80211) &&
+ (ifr.ifr_hwaddr.sa_family != ARPHRD_ETHER) &&
(ifr.ifr_hwaddr.sa_family != ARPHRD_IEEE80211_PRISM) &&
(ifr.ifr_hwaddr.sa_family != ARPHRD_IEEE80211_FULL)) )
{
Modified: gnunet/src/transport/plugin_transport_wlan.h
===================================================================
--- gnunet/src/transport/plugin_transport_wlan.h 2012-11-16 16:43:27 UTC
(rev 25017)
+++ gnunet/src/transport/plugin_transport_wlan.h 2012-11-16 16:59:44 UTC
(rev 25018)
@@ -80,7 +80,30 @@
struct GNUNET_TRANSPORT_WLAN_MacAddress mac;
};
+/**
+ * generic definitions for IEEE 802.3 frames
+ */
+struct GNUNET_TRANSPORT_WLAN_Ieee8023Frame
+{
+ /**
+ * Address 1: destination address in ad-hoc mode or AP, BSSID if station,
+ */
+ struct GNUNET_TRANSPORT_WLAN_MacAddress dst;
+
+ /**
+ * Address 2: source address if in ad-hoc-mode or station, BSSID if AP
+ */
+ struct GNUNET_TRANSPORT_WLAN_MacAddress src;
+
+ /**
+ * Packet type ID.
+ */
+ uint16_t type;
+
+};
+
+
/**
* generic definitions for IEEE 802.11 frames
*/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r25018 - gnunet/src/transport,
gnunet <=