/[lwip]/contrib/ports/unix/netif/tapif.c
ViewVC logotype

Diff of /contrib/ports/unix/netif/tapif.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by likewise, Wed May 5 18:47:21 2004 UTC revision 1.9 by christiaans, Tue Nov 8 12:00:45 2005 UTC
# Line 55  Line 55 
55  #include "netif/tcpdump.h"  #include "netif/tcpdump.h"
56  #endif /* LWIP_DEBUG && LWIP_TCPDUMP */  #endif /* LWIP_DEBUG && LWIP_TCPDUMP */
57    
58  #ifdef linux  #if defined(linux)
59  #include <sys/ioctl.h>  #include <sys/ioctl.h>
60  #include <linux/if.h>  #include <linux/if.h>
61  #include <linux/if_tun.h>  #include <linux/if_tun.h>
62  #define DEVTAP "/dev/net/tun"  #define DEVTAP "/dev/net/tun"
63  #else  /* linux */  #define IFCONFIG_ARGS "tap0 inet %d.%d.%d.%d"
64    #elif defined(openbsd)
65    #define DEVTAP "/dev/tun0"
66    #define IFCONFIG_ARGS "tun0 inet %d.%d.%d.%d link0"
67    #else /* others */
68  #define DEVTAP "/dev/tap0"  #define DEVTAP "/dev/tap0"
69  #endif /* linux */  #define IFCONFIG_ARGS "tap0 inet %d.%d.%d.%d"
70    #endif
71    
72  #define IFNAME0 't'  #define IFNAME0 't'
73  #define IFNAME1 'p'  #define IFNAME1 'p'
# Line 126  low_level_init(struct netif *netif) Line 131  low_level_init(struct netif *netif)
131    }    }
132  #endif /* Linux */  #endif /* Linux */
133    
134    snprintf(buf, sizeof(buf), "ifconfig tap0 inet %d.%d.%d.%d",    snprintf(buf, sizeof(buf), "/sbin/ifconfig " IFCONFIG_ARGS,
135             ip4_addr1(&(netif->gw)),             ip4_addr1(&(netif->gw)),
136             ip4_addr2(&(netif->gw)),             ip4_addr2(&(netif->gw)),
137             ip4_addr3(&(netif->gw)),             ip4_addr3(&(netif->gw)),

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26