Hi,
there are a problem with the AddressInfo element if click is used as a
linuxmodule. If i use the madwifi-driver with other device types than 802.11,
it doesn't work. The madwifi driver supports additional device types (prism,
ath,...). The packet gets an additional header with extra information (rates,
powerlevel,...). The reason that it doesn't work is that the AddressInfo
element only supports Ethernet- and 802.11 header:
Line 431:
if (dev && (dev->type == ARPHRD_ETHER || dev->type == ARPHRD_80211))
So scripts like:
AddressInfo(my_wlan ath0:eth);
RatedSource(\<0800>, 10, 1000)
-> EtherEncap(0x8088, my_wlan, FF:FF:FF:FF:FF:FF)
-> Print()
-> Discard;
doesn't work, if the device type is not 801 (see /proc/sys/net/ath0/dev_type).
The patch (see attachment) add additional device types, which are supported by
madwifi (802-805). But the solution is not the best. Is a possible to add an
additional parameter to specify the device type ? E.g.:
AddressInfo(my_wlan ath0:eth, DEVICETYPE 802); //set device type to 802
Best regards,
Robert
diff --git a/elements/standard/addressinfo.cc b/elements/standard/addressinfo.cc
index ba82816..fbe6d8d 100644
--- a/elements/standard/addressinfo.cc
+++ b/elements/standard/addressinfo.cc
@@ -428,7 +428,12 @@ AddressInfo::query_ethernet(String s, unsigned char *store, const Element *e)
# else
net_device *dev = dev_get_by_name(s.c_str());
# endif
- if (dev && (dev->type == ARPHRD_ETHER || dev->type == ARPHRD_80211)) {
+ if (dev && (dev->type == ARPHRD_ETHER ||
+ dev->type == ARPHRD_80211 ||
+ dev->type == ARPHRD_80211_PRISM ||
+ dev->type == ARPHRD_80211_RADIOTAP ||
+ dev->type == ARPHRD_80211_ATHDESC ||
+ dev->type == ARPHRD_80211_ATHDESCEXT )) {
memcpy(store, dev->dev_addr, 6);
dev_put(dev);
return true;
diff --git a/include/click/standard/addressinfo.hh b/include/click/standard/addressinfo.hh
index cbfd35c..82de0a1 100644
--- a/include/click/standard/addressinfo.hh
+++ b/include/click/standard/addressinfo.hh
@@ -89,6 +89,12 @@ These defaults are not available on all platforms.
PortInfo */
+/* Several additional device types for madwifi driver (see madwifi/net80211/ieee80211_monitor.h) */
+#define ARPHRD_80211_PRISM 802 /* wifi + Prism2 header */
+#define ARPHRD_80211_RADIOTAP 803 /* wifi + Radiotap header */
+#define ARPHRD_80211_ATHDESC 804 /* wifi + Atheros header */
+#define ARPHRD_80211_ATHDESCEXT 805 /* wifi + Atheros header + X */
+
class AddressInfo : public Element { public:
AddressInfo();
_______________________________________________
click mailing list
[email protected]
https://amsterdam.lcs.mit.edu/mailman/listinfo/click