Home
last modified time | relevance | path

Searched hist:"86 fcd9463240c256f00963440fbd084196eeb964" (Results 1 – 3 of 3) sorted by relevance

/openbmc/qemu/linux-user/
H A Dioctls.hdiff 86fcd9463240c256f00963440fbd084196eeb964 Tue Mar 29 18:35:23 CDT 2011 Laurent Vivier <laurent@vivier.eu> linux-user: add ioctl(SIOCGIWNAME, ...) support.

Allow to run properly following program from linux-user:

/* cc -o wifi wifi.c */

#include <stdio.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <linux/wireless.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>

int main(int argc, char **argv)
{
int ret;
struct ifreq req;
struct sockaddr_in *addr;
int s;

if (argc != 2) {
fprintf(stderr, "Need an interface name (like wlan0)\n");
return 1;
}

s = socket( AF_INET, SOCK_DGRAM, 0 );
if (s < 0) {
perror("Cannot open socket");
return 1;
}
strncpy(req.ifr_name, argv[1], sizeof(req.ifr_name));
ret = ioctl( s, SIOCGIWNAME, &req );
if (ret < 0) {
fprintf(stderr, "No wireless extension\n");
return 1;
}

printf("%s\n", req.ifr_name);
printf("%s\n", req.ifr_newname);
return 0;
}

$ ./wifi eth0
No wireless extension

$ ./wifi wlan0
wlan0
IEEE 802.11bg

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
H A Dsyscall_defs.hdiff 86fcd9463240c256f00963440fbd084196eeb964 Tue Mar 29 18:35:23 CDT 2011 Laurent Vivier <laurent@vivier.eu> linux-user: add ioctl(SIOCGIWNAME, ...) support.

Allow to run properly following program from linux-user:

/* cc -o wifi wifi.c */

#include <stdio.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <linux/wireless.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>

int main(int argc, char **argv)
{
int ret;
struct ifreq req;
struct sockaddr_in *addr;
int s;

if (argc != 2) {
fprintf(stderr, "Need an interface name (like wlan0)\n");
return 1;
}

s = socket( AF_INET, SOCK_DGRAM, 0 );
if (s < 0) {
perror("Cannot open socket");
return 1;
}
strncpy(req.ifr_name, argv[1], sizeof(req.ifr_name));
ret = ioctl( s, SIOCGIWNAME, &req );
if (ret < 0) {
fprintf(stderr, "No wireless extension\n");
return 1;
}

printf("%s\n", req.ifr_name);
printf("%s\n", req.ifr_newname);
return 0;
}

$ ./wifi eth0
No wireless extension

$ ./wifi wlan0
wlan0
IEEE 802.11bg

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
H A Dsyscall.cdiff 86fcd9463240c256f00963440fbd084196eeb964 Tue Mar 29 18:35:23 CDT 2011 Laurent Vivier <laurent@vivier.eu> linux-user: add ioctl(SIOCGIWNAME, ...) support.

Allow to run properly following program from linux-user:

/* cc -o wifi wifi.c */

#include <stdio.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <linux/wireless.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>

int main(int argc, char **argv)
{
int ret;
struct ifreq req;
struct sockaddr_in *addr;
int s;

if (argc != 2) {
fprintf(stderr, "Need an interface name (like wlan0)\n");
return 1;
}

s = socket( AF_INET, SOCK_DGRAM, 0 );
if (s < 0) {
perror("Cannot open socket");
return 1;
}
strncpy(req.ifr_name, argv[1], sizeof(req.ifr_name));
ret = ioctl( s, SIOCGIWNAME, &req );
if (ret < 0) {
fprintf(stderr, "No wireless extension\n");
return 1;
}

printf("%s\n", req.ifr_name);
printf("%s\n", req.ifr_newname);
return 0;
}

$ ./wifi eth0
No wireless extension

$ ./wifi wlan0
wlan0
IEEE 802.11bg

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>