RadioTap Archive on lore.kernel.org
 help / color / Atom feed
* Help needed with Constructing radiotap header and ieee80211 header structures
@ 2012-06-09  5:37 Anand Madhusoodanan
  0 siblings, 0 replies; only message in thread
From: Anand Madhusoodanan @ 2012-06-09  5:37 UTC (permalink / raw)
  To: radiotap-sUITvd46vNxg9hUCZPvPmw

[-- Attachment #1: Type: text/plain, Size: 2515 bytes --]

Hi ,
I need some help with a Wifi experiment i am trying to set up.
I am trying to communicate between two laptop machines using Wifi. 

The structure of the radiotap header 
and ieee80211 header i am using are

 struct ieee80211_radiotap_header {
unsigned char it_version;
uint16_t it_len;        
uint32_t it_present;
 };

 /* Structure for 80211 header */

 struct ieee80211_hdr_3addr {
    uint16_t frame_ctl[2];
    uint16_t duration_id;
    unsigned char addr1[ETH_ALEN];
    unsigned char addr2[ETH_ALEN];
    unsigned char addr3[ETH_ALEN];
    uint16_t seq_ctl;
  };

struct packet {
   struct ieee80211_radiotap_header rtap_header;
   struct ieee80211_hdr_3addr iee802_header;
   unsigned char payload[30];

  };

  /* In main program */

   struct packet mypacket;
   struct ieee80211_radiotap_header ratap_header;
   struct ieee80211_hdr_3addr iee802_header;

   unsigned char addr1[ETH_ALEN] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};  /* broadcast address */
   unsigned char addr2[ETH_ALEN] = {0x28,0xcf,0xda,0xde,0xd3,0xcc};  /* mac address of   
                                                                      network card */
   unsigned char addr3[ETH_ALEN] = {0xd8,0xc7,0xc8,0xd7,0x9f,0x21};   /* mac address of   
                                                  access point i am trying to connect to */

  /* Radio tap header data */
   ratap_header.it_version = 0x00;
   ratap_header.it_len = 0x07;      
   ratap_header.it_present =  (1 << IEEE80211_RADIOTAP_RATE);

   mypacket.rtap_header = ratap_header;

   /* ieee80211 header data */

    iee802_header.frame_ctl[0] = IEEE80211_FC0_VERSION_0  |
                                                   IEEE80211_FC0_TYPE_MGT | 
                                                    IEEE80211_FC0_SUBTYPE_BEACON;

   iee802_header.frame_ctl[1] =IEEE80211_FC1_DIR_NODS;
    strcpy(iee802_header.addr1,addr1);
    strcpy(iee802_header.addr2,addr2);
    strcpy(iee802_header.addr3,addr3);
    iee802_header.seq_ctl = 0x1086;

    mypacket.iee802_header=iee802_header;

   /* Payload */

   unsigned char payload[PACKET_LENGTH]="temp";

   strcpy(mypacket.payload , payload);

I am able to receive the packets when i test the transmission 
and reception on the same laptop. However i 
am not able to receive the packet transmitted on a 
different laptop. Wireshark does not show the packet 
as well. Can you point out the mistake i am making?

Thanks and Regards,
Anand.


[-- Attachment #2: Type: text/html, Size: 5585 bytes --]

<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); ">Hi ,</div><pre style="white-space: pre-wrap; color: rgb(34, 34, 34); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); ">I need some help with a Wifi experiment i am trying to set up.</pre><pre style="white-space: pre-wrap; color: rgb(34, 34, 34); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); position: static; z-index: auto; ">I am trying to communicate between two laptop machines using Wifi.&nbsp;</pre><pre style="white-space: pre-wrap; color: rgb(34, 34, 34); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); position: static; z-index: auto; ">
The structure of the radiotap header 
and ieee80211 header i am using are

 struct ieee80211_radiotap_header {
unsigned char it_version;
uint16_t it_len;        
uint32_t it_present;
 };

 /* Structure for 80211 header */

 struct ieee80211_hdr_3addr {
    uint16_t frame_ctl[2];
    uint16_t duration_id;
    unsigned char addr1[ETH_ALEN];
    unsigned char addr2[ETH_ALEN];
    unsigned char addr3[ETH_ALEN];
    uint16_t seq_ctl;
  };

struct packet {
   struct ieee80211_radiotap_header rtap_header;
   struct ieee80211_hdr_3addr iee802_header;
   unsigned char payload[30];

  };

  /* In main program */

   struct packet mypacket;
   struct ieee80211_radiotap_header ratap_header;
   struct ieee80211_hdr_3addr iee802_header;

   unsigned char addr1[ETH_ALEN] = {0xFF,0xFF,0xFF,0xFF,0xFF,<wbr>0xFF};  /* broadcast address */
   unsigned char addr2[ETH_ALEN] = {0x28,0xcf,0xda,0xde,0xd3,<wbr>0xcc};  /* mac address of   
                                                                      network card */
   unsigned char addr3[ETH_ALEN] = {0xd8,0xc7,0xc8,0xd7,0x9f,<wbr>0x21};   /* mac address of   
                                                  access point i am trying to connect to */

  /* Radio tap header data */
   ratap_header.it_version = 0x00;
   ratap_header.it_len = 0x07;      
   ratap_header.it_present =  (1 &lt;&lt; IEEE80211_RADIOTAP_RATE);

   mypacket.rtap_header = ratap_header;

   /* ieee80211 header data */

    iee802_header.frame_ctl[0] = IEEE80211_FC0_VERSION_0  |
                                                   IEEE80211_FC0_TYPE_MGT | 
                                                    IEEE80211_FC0_SUBTYPE_BEACON;

   iee802_header.frame_ctl[1] =IEEE80211_FC1_DIR_NODS;
    strcpy(iee802_header.addr1,<wbr>addr1);
    strcpy(iee802_header.addr2,<wbr>addr2);
    strcpy(iee802_header.addr3,<wbr>addr3);
    iee802_header.seq_ctl = 0x1086;

    mypacket.iee802_header=iee802_<wbr>header;

   /* Payload */

   unsigned char payload[PACKET_LENGTH]="temp";

   strcpy(mypacket.payload , payload);

I am able to receive the packets when i test the transmission 
and reception on the same laptop. However i 
am not able to receive the packet transmitted on a 
different laptop. Wireshark does not show the packet 
as well. Can you point out the mistake i am making?</pre><pre style="white-space: pre-wrap; color: rgb(34, 34, 34); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); "><br></pre><pre style="white-space: pre-wrap; color: rgb(34, 34, 34); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); ">Thanks and Regards,</pre><pre style="white-space: pre-wrap; color: rgb(34, 34, 34); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgba(255, 255, 255, 0.917969); ">Anand.</pre><div><br></div></body></html>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-09  5:37 Help needed with Constructing radiotap header and ieee80211 header structures Anand Madhusoodanan

RadioTap Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/radiotap/0 radiotap/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 radiotap radiotap/ https://lore.kernel.org/radiotap \
		radiotap@radiotap.org
	public-inbox-index radiotap

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.netbsd.radiotap


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git