diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/transport/gnunet-helper-transport-wlan.c | 21 | ||||
-rw-r--r-- | src/transport/plugin_transport_wlan.h | 23 |
2 files changed, 44 insertions, 0 deletions
diff --git a/src/transport/gnunet-helper-transport-wlan.c b/src/transport/gnunet-helper-transport-wlan.c index 515da4334..4b4d5426e 100644 --- a/src/transport/gnunet-helper-transport-wlan.c +++ b/src/transport/gnunet-helper-transport-wlan.c @@ -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 @@ linux_read (struct HardwareInfos *dev, 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 @@ open_device_raw (struct HardwareInfos *dev) 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)) ) { diff --git a/src/transport/plugin_transport_wlan.h b/src/transport/plugin_transport_wlan.h index 2b70fc0f5..b7f22de71 100644 --- a/src/transport/plugin_transport_wlan.h +++ b/src/transport/plugin_transport_wlan.h @@ -80,6 +80,29 @@ struct GNUNET_TRANSPORT_WLAN_HelperControlMessage 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 |