Thread: [Madwifi-devel] sending a MGMT packet - problem with subtype flags
Status: Beta
Brought to you by:
otaku
From: Nicolas B. <nic...@gm...> - 2010-07-08 17:01:47
|
Hello all, I want to send a management packet which can be distinguished from other types that already exist. So, in ./net80211/ieee80211.h at line 137, on both AP and STA sides I wrote : #define IEEE80211_FC0_SUBTYPE_RND_RESP 0x60 My plan was this: each time the STA receives a sertain amount of beacons(say 35) IEEE80211_SEND_MGMT(ni, IEEE80211_FC0_SUBTYPE_RND_RESP, 0); is called. And I would see the arrival of my packet at the AP. On the AP side in ./net80211/ ieee80211_input.c function recv_mgmt I wrote: ..... switch (subtype) { case IEEE80211_FC0_SUBTYPE_RND_RESP: printk("recv_mgmt line 2984: Got a round response!\n "); I thought that I could see if I received my mgmt packet in dmesg, but I didn't see anything. I tried in STA instead of IEEE80211_SEND_MGMT(ni, IEEE80211_FC0_SUBTYPE_RND_RESP, 0), another flag: IEEE80211_SEND_MGMT(ni, IEEE80211_FC0_SUBTYPE_AUTH, 0). This time, on each receive (at case IEEE80211_FC0_SUBTYPE_AUTH in recv_mgmt) the printk was displayed! Can anyone tell me why is this happening? Is it impossible to use a new SUBTYPE flag? I want to be notified on AP side whenever I get my mgmt packet. Should I try a combination of already existing ones? What would you suggest? Thank you! |
From: Jin Y. <yun...@gm...> - 2010-07-09 08:37:16
|
On Fri, Jul 9, 2010 at 1:01 AM, Nicolas Barati <nic...@gm...> wrote: > Hello all, > I want to send a management packet which can be distinguished from other > types that already exist. So, in ./net80211/ieee80211.h at line 137, on both > AP and STA sides I wrote : > #define IEEE80211_FC0_SUBTYPE_RND_RESP 0x60 > My plan was this: each time the STA receives a sertain amount of beacons(say > 35) IEEE80211_SEND_MGMT(ni, IEEE80211_FC0_SUBTYPE_RND_RESP, 0); is called. > And I would see the arrival of my packet at the AP. > On the AP side in ./net80211/ ieee80211_input.c function recv_mgmt I wrote: > ..... > switch (subtype) { > > case IEEE80211_FC0_SUBTYPE_RND_RESP: > printk("recv_mgmt line 2984: Got a round response!\n "); > > I thought that I could see if I received my mgmt packet in dmesg, but I > didn't see anything. > I tried in STA instead of IEEE80211_SEND_MGMT(ni, > IEEE80211_FC0_SUBTYPE_RND_RESP, 0), another flag: IEEE80211_SEND_MGMT(ni, > IEEE80211_FC0_SUBTYPE_AUTH, 0). This time, on each receive (at case > IEEE80211_FC0_SUBTYPE_AUTH in recv_mgmt) the printk was displayed! > Can anyone tell me why is this happening? Is it impossible to use a new > SUBTYPE flag? I want to be notified on AP side whenever I get my mgmt > packet. Should I try a combination of already existing ones? What would you > suggest? > > Thank you! > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Madwifi-devel mailing list > Mad...@li... > https://lists.sourceforge.net/lists/listinfo/madwifi-devel > Hi, I guess you can try modify the ath5k_configure_filter() in "base.c" such that your custom packet type would not be filtered at the receiver end. Thanks YY |
From: Nicolas B. <nic...@gm...> - 2010-07-15 19:17:26
|
Hello, I don't know if anyone shares the same question with me, but I think I found the solution. The problem is, when IEEE80211_SEND_MGMT() is called, through this ieee80211_send_mgmt () (in ieee80211_output.c) is called. There, every candidate mgmt packet is checked if it belongs to one of the standard mgmt types: PROBE_REQ, BEACON, ASSOCIATION_REQ, PROB_RESP etc. So in the "switch (type)" block (line 1924) I added the line: case IEEE80211_FC0_SUBTYPE_RND_RESP: //... And everything went fine! The packet was sent and I saw it on the AP side. 2010/7/8 Nicolas Barati <nic...@gm...> > Hello all, > I want to send a management packet which can be distinguished from other > types that already exist. So, in ./net80211/ieee80211.h at line 137, on both > AP and STA sides I wrote : > #define IEEE80211_FC0_SUBTYPE_RND_RESP 0x60 > My plan was this: each time the STA receives a sertain amount of > beacons(say 35) IEEE80211_SEND_MGMT(ni, IEEE80211_FC0_SUBTYPE_RND_RESP, 0); > is called. And I would see the arrival of my packet at the AP. > On the AP side in ./net80211/ ieee80211_input.c function recv_mgmt I wrote: > > ..... > switch (subtype) { > > case IEEE80211_FC0_SUBTYPE_RND_RESP: > printk("recv_mgmt line 2984: Got a round response!\n "); > > I thought that I could see if I received my mgmt packet in dmesg, but I > didn't see anything. > I tried in STA instead of IEEE80211_SEND_MGMT(ni, > IEEE80211_FC0_SUBTYPE_RND_RESP, 0), another flag: IEEE80211_SEND_MGMT(ni, > IEEE80211_FC0_SUBTYPE_AUTH, 0). This time, on each receive (at case > IEEE80211_FC0_SUBTYPE_AUTH in recv_mgmt) the printk was displayed! > Can anyone tell me why is this happening? Is it impossible to use a new > SUBTYPE flag? I want to be notified on AP side whenever I get my mgmt > packet. Should I try a combination of already existing ones? What would you > suggest? > > Thank you! > |