… | |
… | |
17 | */ |
17 | */ |
18 | |
18 | |
19 | #ifndef VPE_DEVICE_H__ |
19 | #ifndef VPE_DEVICE_H__ |
20 | #define VPE_DEVICE_H__ |
20 | #define VPE_DEVICE_H__ |
21 | |
21 | |
22 | #include <net/if.h> |
22 | #define IFNAMESIZE 256 |
23 | |
23 | |
24 | #include "gettext.h" |
24 | #include "gettext.h" |
25 | |
25 | |
26 | #include "global.h" |
26 | #include "global.h" |
27 | |
27 | |
… | |
… | |
80 | |
80 | |
81 | struct tap_device { |
81 | struct tap_device { |
82 | int fd; |
82 | int fd; |
83 | |
83 | |
84 | // linux tuntap |
84 | // linux tuntap |
85 | char ifrname[IFNAMSIZ + 1]; |
85 | char ifrname[IFNAMESIZE + 1]; |
86 | |
86 | |
87 | char *device; |
87 | char *device; |
88 | |
88 | |
89 | tap_device (); |
89 | tap_device (); |
90 | ~tap_device (); |
90 | ~tap_device (); |
91 | |
91 | |
92 | const char *interface () { return ifrname; } |
92 | const char *interface () { return ifrname; } |
93 | const char *info () { return _("Linux tun/tap device"); } |
93 | const char *info (); |
94 | |
94 | |
95 | tap_packet *recv (); |
95 | tap_packet *recv (); |
96 | void send (tap_packet *pkt); |
96 | void send (tap_packet *pkt); |
97 | }; |
97 | }; |
98 | |
98 | |