[Avila] radio header and raw sockets.. Help

project2 sivakumar at deccantechnosoft.com
Fri Apr 18 03:07:33 EDT 2008


-------- Forwarded Message --------
From: project2 <sivakumar at deccantechnosoft.com>
Reply-To: sivakumar at deccantechnosoft.com
To: madwifi <madwifi-devel at lists.sourceforge.net>
Subject: radio header and raw sockets.. Help
Date: Fri, 18 Apr 2008 12:33:11 +0530

Hi ! 

            Am a beginner in madwifi based socket program.I wanted to
know If i Were right. I learned something while I was working with raw
sockets. The frame created by the socket should have a radio header +
management frame/ control / data header + my data for receving it on the
other side ,running a raw socket and setting the interfaces to
promiscous mode....... What I belive is that the header of type data
would only seen by the recieving raw socket with interface in promicoius
mode! 

    Would the big brothers help me to know where I can find a structure
that is data header ( put into the packet ) so that I can see packets
over the reciving side with my payload.  I have include a code as
attachment which says would create a beacon .. but when I ran it on one
side and using athdebug +recv, I could get something showing the mac
what I had put. ( please forgive if you dont get the attached )

Thanks in advance...
regards Siva



struct ieee80211_mgmt
struct ieee80211_mgmt {
	__le16 frame_control;
	__le16 duration;
	u8 da[6];
	u8 sa[6];
	u8 bssid[6];
	__le16 seq_ctrl;
	union {
		struct {
			__le16 auth_alg;
			__le16 auth_transaction;
			__le16 status_code;
			/* possibly followed by Challenge text */
			u8 variable[0];
		} __attribute__ ((packed)) auth;
		struct {
			__le16 reason_code;
		} __attribute__ ((packed)) deauth;
		struct {
			__le16 capab_info;
			__le16 listen_interval;
			/* followed by SSID and Supported rates */
			u8 variable[0];
		} __attribute__ ((packed)) assoc_req;
		struct {
			__le16 capab_info;
			__le16 status_code;
			__le16 aid;
			/* followed by Supported rates */
			u8 variable[0];
		} __attribute__ ((packed)) assoc_resp, reassoc_resp;
		struct {
			__le16 capab_info;
			__le16 listen_interval;
			u8 current_ap[6];
			/* followed by SSID and Supported rates */
			u8 variable[0];
		} __attribute__ ((packed)) reassoc_req;
		struct {
			__le16 reason_code;
		} __attribute__ ((packed)) disassoc;
		struct {
			__le64 timestamp;
			__le16 beacon_int;
			__le16 capab_info;
			/* followed by some of SSID, Supported rates,
			 * FH Params, DS Params, CF Params, IBSS Params, TIM */
			u8 variable[0];
		} __attribute__ ((packed)) beacon;
		struct {
			/* only variable items: SSID, Supported rates */
			u8 variable[0];
		} __attribute__ ((packed)) probe_req;
		struct {
			__le64 timestamp;
			__le16 beacon_int;
			__le16 capab_info;
			/* followed by some of SSID, Supported rates,
			 * FH Params, DS Params, CF Params, IBSS Params */
			u8 variable[0];
		} __attribute__ ((packed)) probe_resp;
		struct {
			u8 category;
			union {
				struct {
					u8 action_code;
					u8 dialog_token;
					u8 status_code;
					u8 variable[0];
				} __attribute__ ((packed)) wme_action;
				struct{
					u8 action_code;
					u8 element_id;
					u8 length;
					u8 switch_mode;
					u8 new_chan;
					u8 switch_count;
				} __attribute__((packed)) chan_switch;
			} u;
		} __attribute__ ((packed)) action;
	} u;
} __attribute__ ((packed));


&


     I. struct tx80211_radiotap_header {

uint8_t it_version; /* Version 0. Only increases
* for drastic changes,
* introduction of compatible
* new fields does not count.
*/
uint8_t it_pad;
uint16_t it_len; /* length of the whole
* header in bytes, including
* it_version, it_pad,
* it_len, and data fields.
*/
uint32_t it_present; /* A bitmap telling which
* fields are present. Set bit 31
* (0x80000000) to extend the
* bitmap by another 32 bits.
* Additional extensions are made
* by setting bit 31.
*/
uint8_t wr_flags; /* Flags, not used by LORCON, but
* included for word boundary padding.
*/
uint8_t wr_rate; /* Data rate in 500 Kbps increments */
uint16_t wr_chan_freq; /* Frequency flags */
uint16_t wr_chan_flags; /* Modulation flags */
uint8_t wr_retry; /* number of retries */
}
__attribute__((__packed__));

Warm regards



Sivakumar Mohan
Associate Developer
Deccan Technosoft ( India ) PRIVATE LIMITED
Kochi, Kerala State
India.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.gateworks.com/pipermail/avila/attachments/20080418/211793f6/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: deccan-home_01.gif
Type: image/gif
Size: 7800 bytes
Desc: not available
Url : http://lists.gateworks.com/pipermail/avila/attachments/20080418/211793f6/attachment.gif 


More information about the Avila mailing list