Networking Forums

Networking Forums > Wireless Networking > Wireless Internet > programming a hostap app.

Reply
Thread Tools Display Modes

programming a hostap app.

 
 
Tom.Long
Guest
Posts: n/a

 
      11-20-2006, 06:11 PM
Hi,
First of all, I am not to sure if this is where i am suppose to post
this kind of question. I am currently trying to convert a wireless
application, that runs a wireless card using the linux-wlan-ng drivers.
My goal is to make this application run with the newest hostAP drivers,
but I am having trouble accomplishing this task. Here is the code that
currently runs with the linux-wlan-ng drivers..

//Original code //
//--------------------------------------------------------------------

#define LINUX_WLAN_NG 0x89f1 /*used by linux-wlan */
#define LENGTH 16 /* Max length of a device name */
request_t req; /* The formal request to the ioctl

//Fill in the request
req.len = MSGSIZE;
req.data = msg;
req.result = 0;
req.magic = MAGIC;
strncpy(req.name, name, LENGTH);

//Open the socket to the prism2 card
s = socket(AF_INET, SOCK_STREAM, 0);

if(-1 == s)
{
perror("Could not open socket");
ret = ERR;
}

//Perform the ioctl call
if(0 == ret)
{
if(ioctl(s, LINUX_WLAN_NG , &req) == -1)
{
perror("Bad ioctl request");
ret = ERR;
}
}
return ret;
}

Now my problem is I am really not to sure how I would go about
modifying this code so that it does the same (communicate), using the
hostAP drivers. Here is what I have so far..

/*----------------------------------------------------------------------------------------------*/

struct iwreq iwr;

memset(&iwr, 0, sizeof(iwr));
strncpy(iwr.ifr_name, name, LENGTH);
iwr.u.data.pointer = msg;
iwr.u.data.length = MSGSIZE;

s = socket(AF_INET, SOCK_STREAM, 0);
if(-1 == s)
{
perror("Could not open socket");
ret = ERR;
}

if(0 == ret)
{
if (ioctl(s, /*NOT SURE WHAT HEX GOES HERE*/, &iwr) ==
-1)
{
perror("Bad ioctl request");
ret = ERR;
}
}

return ret;
}

This code compiles correctly, when I actually place a hex value in for
the second aurgument of my ioctl call, but doesn't seem to communicate
with the hostAP drivers correctly. I think my second aurgument in the
ioctl call is incorrect.

Any help will be appreciated, I have been working on this problem for
some time now, and I am looking for some ideas/help.

Thank You,
Tom

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
netBSD and hostap? grus Wireless Internet 0 07-03-2006 09:49 PM
Debian hostap USB prism2 : HELP Ou Phrontis Linux Networking 3 10-26-2005 03:02 PM
hostAP analysis? Choonho Son Linux Networking 1 04-19-2004 04:17 AM
PCMCIA Vs HostAP NeCrOS Linux Networking 0 11-17-2003 07:08 PM
Cisco350 HostAP Matthew Fowle Wireless Internet 0 08-17-2003 09:07 PM



1 2 3 4 5 6 7 8 9 10 11