tech-net archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
IEEE80211_IOC_STA_STATS broken?
Hi List
I'm having a spot of bother getting the IEEE80211_IOC_STA_STATS ioctl
to work. For some reason it always returns Invalid Argument EINVAL.
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <net80211/ieee80211.h>
#include <net80211/ieee80211_ioctl.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
int main(void) {
struct ieee80211req ireq;
char buf[24*1024];
int s = socket(AF_INET, SOCK_DGRAM, 0);
memset(&ireq, 0, sizeof(ireq));
strlcpy(ireq.i_name, "iwi0", sizeof(ireq.i_name));
ireq.i_type = IEEE80211_IOC_STA_STATS;
ireq.i_data = buf;
ireq.i_len = sizeof(buf);
if(ioctl(s, SIOCG80211, &ireq) != 0)
perror("SIOCG80211");
else
printf ("ok\n");
return 0;
}
If someone could tell me what I'm doing wrong or it's it's a
NetBSD-4.99.73 bug I'd appreciate it.
Thanks
Roy
Home |
Main Index |
Thread Index |
Old Index