programming a hostap app.

T

tomlong76

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
 
C

CBFalconer

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..

Not here, unless you can show us where the ISO C standard deals
with 'wireless', 'linuis-wlan-ng drivers', 'hostAP drivers', etc.
This newsgroup deals with the standard C language. For system
specific things go to newsgroups dealing with such a system.
 
S

santosh

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..
<snip>

This newsgroup only deals with the standard C langauge. Your question
appears to be intimately connected to the Linux kernel. Please try
asking in one of the many Linux groups on Usenet as well as other
mailing lists.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top