diff toys/pending/ifconfig.c @ 883:aca8323e2690

Add posix headers to toynet.h, move xioctl() to lib.c, introduce lib/net.c and move xsocket() to it.
author Rob Landley <rob@landley.net>
date Fri, 26 Apr 2013 02:41:05 -0500
parents bc7aa2d123b9
children f6db08574875
line wrap: on
line diff
--- a/toys/pending/ifconfig.c	Fri Apr 26 01:59:13 2013 -0500
+++ b/toys/pending/ifconfig.c	Fri Apr 26 02:41:05 2013 -0500
@@ -32,7 +32,6 @@
 #include "toys.h"
 #include "toynet.h"
 
-#include <net/if.h>
 #include <net/if_arp.h>
 #include <net/ethernet.h>
 
@@ -61,9 +60,6 @@
   unsigned long long val[16];
 };
 
-#define HW_NAME_LEN 20
-#define HW_TITLE_LEN 30
-
 #define IO_MAP_INDEX 0x100
 
 //from kernel header ipv6.h
@@ -96,19 +92,6 @@
 # define INFINIBAND_ALEN 20
 #endif
 
-void xioctl(int fd, int request, void *data)
-{
-  if (ioctl(fd, request, data) < 0) perror_exit("ioctl %d", request);
-}
-
-int xsocket(int domain, int type, int protocol)
-{
-  int fd = socket(domain, type, protocol);
-
-  if (fd < 0) perror_exit("socket %x %x", type, protocol);
-  return fd;
-}
-
 /*
  * verify the host is local unix path.
  * if so, set the swl input param accordingly.