Roy Marples
2008-10-28 16:10:57 UTC
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
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
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
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de