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.15 by pcg, Sat Jan 17 01:18:36 2004 UTC vs.
Revision 1.16 by pcg, Thu Mar 3 07:24:57 2005 UTC

29 29
30struct net_packet { 30struct net_packet {
31 u32 len; // actually u16, but padding... 31 u32 len; // actually u16, but padding...
32 32
33 u8 &operator[] (u16 offset) const; 33 u8 &operator[] (u16 offset) const;
34 u8 *at (u16 offset) const;
34 35
35 void unshift_hdr (u16 hdrsize) 36 void unshift_hdr (u16 hdrsize)
36 { 37 {
37 memmove ((void *)&(*this)[hdrsize], (void *)&(*this)[0], len); 38 memmove ((void *)&(*this)[hdrsize], (void *)&(*this)[0], len);
38 len += hdrsize; 39 len += hdrsize;
86u8 &net_packet::operator[] (u16 offset) const 87u8 &net_packet::operator[] (u16 offset) const
87{ 88{
88 return ((data_packet *)this)->data_[offset]; 89 return ((data_packet *)this)->data_[offset];
89} 90}
90 91
92inline
93u8 *net_packet::at (u16 offset) const
94{
95 return &((*this)[offset]);
96}
97
91struct tap_packet : net_packet { 98struct tap_packet : net_packet {
92 mac dst; 99 mac dst;
93 mac src; 100 mac src;
94 u8 data[MAXSIZE - 12]; 101 u8 data[MAXSIZE - 12];
95}; 102};

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines