1. 19 7月, 2016 2 次提交
  2. 07 10月, 2014 1 次提交
  3. 15 7月, 2014 1 次提交
  4. 29 6月, 2014 2 次提交
  5. 19 2月, 2014 1 次提交
  6. 24 9月, 2013 1 次提交
  7. 05 7月, 2013 1 次提交
    • L
      linux-user: add SIOCADDRT/SIOCDELRT support · 7ff7b666
      Laurent Vivier 提交于
      This allows to pass the device name.
      
      You can test this with the "route" command.
      
      WITHOUT this patch:
      
      $ sudo route add -net default gw 10.0.3.1 eth0
      SIOCADDRT: Bad address
      $ netstat -nr
      Kernel IP routing table
      Destination     Gateway         Genmask         Flags   MSS Window  irtt Ifa
      10.0.3.0        0.0.0.0         255.255.255.0   U         0 0          0 eth
      
      WITH this patch:
      
      $ sudo route add -net default gw 10.0.3.1 eth0
      $ netstat -nr
      Kernel IP routing table
      Destination     Gateway         Genmask         Flags   MSS Window  irtt Ifa
      0.0.0.0         10.0.3.1        0.0.0.0         UG        0 0          0 eth
      10.0.3.0        0.0.0.0         255.255.255.0   U         0 0          0 eth
      Signed-off-by: NLaurent Vivier <laurent@vivier.eu>
      Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
      7ff7b666
  8. 13 8月, 2012 1 次提交
  9. 06 4月, 2012 3 次提交
  10. 11 7月, 2011 3 次提交
  11. 26 4月, 2011 2 次提交
    • L
      linux-user: add ioctl(SIOCGIWNAME, ...) support. · 86fcd946
      Laurent Vivier 提交于
      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: NLaurent Vivier <laurent@vivier.eu>
      Signed-off-by: NRiku Voipio <riku.voipio@iki.fi>
      86fcd946
    • L
      linux-user: convert ioctl(SIOCGIFCONF, ...) result. · 059c2f2c
      Laurent Vivier 提交于
      The result needs to be converted as it is stored in an array of struct
      ifreq and sizeof(struct ifreq) differs according to target and host
      alignment rules.
      
      This patch allows to execute correctly the following program on arm
      and m68k:
      
       #include <stdio.h>
       #include <sys/ioctl.h>
       #include <net/if.h>
       #include <alloca.h>
       #include <string.h>
       #include <sys/socket.h>
       #include <netinet/in.h>
       #include <arpa/inet.h>
      
      int main(void)
      {
          int s, ret;
          struct ifconf ifc;
          int i;
      
          memset( &ifc, 0, sizeof( struct ifconf ) );
          ifc.ifc_len = 8 * sizeof(struct ifreq);
          ifc.ifc_buf = alloca(ifc.ifc_len);
      
          s = socket( AF_INET, SOCK_DGRAM, 0 );
          if (s < 0) {
              perror("Cannot open socket");
              return 1;
          }
          ret = ioctl( s, SIOCGIFCONF, &ifc );
          if (s < 0) {
              perror("ioctl() failed");
              return 1;
          }
      
          for (i = 0; i < ifc.ifc_len / sizeof(struct ifreq) ; i ++) {
              struct sockaddr_in *s;
              s = (struct sockaddr_in*)&ifc.ifc_req[i].ifr_addr;
              printf("%s\n", ifc.ifc_req[i].ifr_name);
              printf("%s\n", inet_ntoa(s->sin_addr));
          }
      }
      Signed-off-by: NLaurent Vivier <laurent@vivier.eu>
      Signed-off-by: NRiku Voipio <riku.voipio@iki.fi>
      059c2f2c
  12. 09 2月, 2011 1 次提交
  13. 12 1月, 2011 1 次提交
  14. 07 1月, 2011 1 次提交
  15. 17 10月, 2009 1 次提交
  16. 20 9月, 2008 1 次提交
  17. 26 4月, 2008 1 次提交
  18. 26 3月, 2006 1 次提交
  19. 16 6月, 2003 1 次提交
  20. 10 5月, 2003 1 次提交
  21. 08 5月, 2003 1 次提交
  22. 10 4月, 2003 1 次提交
  23. 31 3月, 2003 1 次提交
  24. 24 3月, 2003 1 次提交
  25. 17 3月, 2003 1 次提交
  26. 19 2月, 2003 1 次提交