[Click] problem with BPF_FILTER

Vaibhave Agarwal vaibhave at cs.utah.edu
Fri Aug 5 21:22:13 EDT 2005


I have been using gen_config_safe.pl to generate following safe.click
configuration file and i am using userlevel click

------------------------------------------------------------ 
AddressInfo(safe_addr 6.147.11.105/8 00:09:5B:93:0B:69);
winfo :: WirelessInfo(BSSID 00:00:00:00:00:00);

FromHost(safe, safe_addr, ETHER safe_addr)
-> q :: Queue()
-> encap :: WifiEncap(0x0, WIRELESS_INFO winfo)
-> set_power :: SetTXPower(63)
-> set_rate :: SetTXRate(2)
-> radiotap_encap :: RadiotapEncap()
-> to_dev :: ToDevice(ath1raw);

// ether[2:2] == 0x1200 means it has an ath_rx_radiotap header (it is 18 
bytes long)
// ether[18] == 0x08 means NODS   
// ether[34:4] == 0 and ether[38:2] == 0 means a bssid of 
00:00:00:00:00:00
// ether[48] is the ethertype
from_dev :: FromDevice(ath1raw,
                   BPF_FILTER "ether[2:2] == 0x1200 and ether[18] == 0x08
                        and ether[34:4] == 0 and ether[38:2] == 0 and 
ether[48] == 0x08"
)
-> prism2_decap :: Prism2Decap()
-> extra_decap :: ExtraDecap()
-> radiotap_decap :: RadiotapDecap()
-> phyerr_filter :: FilterPhyErr()
-> tx_filter :: FilterTX()
-> dupe :: WifiDupeFilter()
-> wifi_cl :: Classifier(0/08%0c 1/00%03) //nods data
-> WifiDecap()
-> SetPacketType(HOST)
-> ToHost(safe);
----------------------------------------------------------------------------

The problem comes with BPF_FILTER.
This script doesnt capture any packet at all.
But once I remove the BPF_FILTER line, it works fine and captures all
802.11 packets, even all the beacon and management packets(meant for the ath1 interface). 
                        
I tried to print the data packet contents and I did find that the 
ether[2:2] == 0x1200 and ether[18] == 0x08 and bssid =0 and ether[48] = 8, 
but still bpf filter can't capture these packets.

Does that mean, there is some problem with BPF_FILTER??
I have upgraded my libpcap library to libpcap-0.8.3-7, because
previously it used to give me the following warning with libpcap-0.6
"Warning: arptype 803 not supported by libpcap"

Any advice would be highly appreciated,
thanks
vaibhave




More information about the click mailing list