[Click] Mark a Wifi packet

Javier Sánchez javier.recacha at gmail.com
Thu Apr 17 07:21:02 EDT 2008


Hello,

I want to mark a wifi packet in order to know if that packet has passed
through a determined node. I tried a little modifications that didn´t work.

Using a script like pseudo-ibss.click example (this script only sends data
frames, no ctrl no mgnt)

AddressInfo(safe_addr 6.0.0.3/8 00:11:6B:61:35:0C);
winfo :: WirelessInfo(BSSID 00:00:00:00:00:00);

*//SEND

FromHost(safe, safe_addr, ETHER safe_addr)
-> Queue() -> WifiEncap2(0x0, WIRELESS_INFO winfo)
-> SetTXPower(63) -> SetTXRate(11) -> RadiotapEncap()
-> ToDevice(ath2);

//RECEIVE

from_dev :: FromDevice(ath2)
-> RadiotapDecap() -> FilterPhyErr() -> FilterTX()
-> WifiDupeFilter() -> Classifier(0/08%0c 1/00%03) -> RXStats()
-> WifiDecap2() -> SetPacketType(HOST) -> ToHost(safe);*

I modified elements WifiDecap2 and WifiEncap2 in order to mark my packet:

*WifiEncap2:*

  ....
  // w->i_fc[0] = (uint8_t) (WIFI_FC0_VERSION_0 | WIFI_FC0_TYPE_DATA); //its
always 0x08 standard data subtype
  w->i_fc[0] = (uint8_t) (0xa8);
  ....

Here i forced the use of a reserved data subtype instead of the standard
0x08 data subtype

*WifiDecap2:

*  ...*
*  struct click_wifi *w = (struct click_wifi *) p->data();
  sprintf(buf,"%02X",w->i_fc[0]);
  sa << " type: " << buf ;
  w->i_fc[0] = (uint8_t) (0x08); //its not necesary but i set the original
type.
  ... (original code)

The code works, the packet is detected and i can see the subtype 0xa8 on the
screen, but the packet is no further processed, i imagine that the driver or
click has changed something and the packet is malformed.

Anybody knows what is worng or how to mark a wifi packet? exist a
modificable field on radiotap or wifi headers for this purpose?


More information about the click mailing list