Go Back   Wireless and Wifi Forums > News > Newsgroups > alt.internet.wireless
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-20-2006, 07:11 PM
Tom.Long
Guest
 
Posts: n/a
Default programming a hostap app.

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Programming a Router Thru a Wireless Connection? Tom alt.internet.wireless 3 12-15-2006 08:46 PM
Programming handsfree button (Nokia) dron alt.cellular.nokia 0 11-30-2006 07:52 PM
Programming fo E61 Ilkka alt.cellular.nokia 1 11-06-2006 12:10 PM
Programming Language and how cell phone scripts work? bookert1973 alt.cellular.verizon 12 09-29-2006 12:51 AM
Wireless Programming Ionian NZ Wireless 0 11-02-2004 03:06 PM


All times are GMT. The time now is 12:59 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45