ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/src/device.h
(Generate patch)

Comparing gvpe/src/device.h (file contents):
Revision 1.6 by pcg, Tue Oct 14 03:22:09 2003 UTC vs.
Revision 1.7 by pcg, Tue Oct 14 16:59:34 2003 UTC

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#define IFNAMESIZE 256 22#define IFNAMESIZE 256 // be conservative
23 23
24#include "gettext.h" 24#include "gettext.h"
25 25
26#include "global.h" 26#include "global.h"
27 27
76 mac dst; 76 mac dst;
77 mac src; 77 mac src;
78 u8 data[MAXSIZE - 12]; 78 u8 data[MAXSIZE - 12];
79}; 79};
80 80
81struct tap_device { 81struct tap_device_base {
82 int fd; 82 int fd;
83 83
84 // linux tuntap 84 // network interface name or identifier
85 char ifrname[IFNAMESIZE + 1]; 85 char ifrname[IFNAMESIZE + 1];
86 86
87 char *device; 87 char *device;
88 88
89 tap_device (); 89 bool open ();
90 ~tap_device (); 90 void close ();
91 91
92 const char *interface () { return ifrname; } 92 const char *interface () { return ifrname; }
93 const char *info (); 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
99struct tap_device;
100
101extern tap_device tap;
102
99#endif 103#endif
100 104

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines