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' |
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)), |