… | |
… | |
40 | #else |
40 | #else |
41 | #include <linux/if_tun.h> |
41 | #include <linux/if_tun.h> |
42 | #endif |
42 | #endif |
43 | #define DEFAULT_DEVICE "/dev/net/tun" |
43 | #define DEFAULT_DEVICE "/dev/net/tun" |
44 | |
44 | |
|
|
45 | #include "gettext.h" |
|
|
46 | |
45 | #include "conf.h" |
47 | #include "conf.h" |
46 | |
48 | |
47 | #if TEST_ETHEREMU |
49 | #if TEST_ETHEREMU |
48 | # define IF_istun |
50 | # define IF_istun |
49 | # include "ether_emu.C" |
51 | # include "ether_emu.C" |
… | |
… | |
51 | |
53 | |
52 | const char * |
54 | const char * |
53 | tap_device::info () |
55 | tap_device::info () |
54 | { |
56 | { |
55 | return _("Linux tun/tap device"); |
57 | return _("Linux tun/tap device"); |
|
|
58 | } |
|
|
59 | |
|
|
60 | const char * |
|
|
61 | tap_device::if_up () |
|
|
62 | { |
|
|
63 | return "/sbin/ifconfig $IFNAME hw ether $MAC mtu $MTU"; |
56 | } |
64 | } |
57 | |
65 | |
58 | tap_device::tap_device () |
66 | tap_device::tap_device () |
59 | { |
67 | { |
60 | struct ifreq ifr; |
68 | struct ifreq ifr; |