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.22 by pcg, Thu Aug 7 17:54:27 2008 UTC vs.
Revision 1.25 by root, Fri Sep 16 18:01:26 2011 UTC

56 { 56 {
57 len -= hdrsize; 57 len -= hdrsize;
58 memmove ((void *)&(*this)[0], (void *)&(*this)[hdrsize], len); 58 memmove ((void *)&(*this)[0], (void *)&(*this)[hdrsize], len);
59 } 59 }
60 60
61 u16 ipv4_hdr_len () const
62 {
63 return ((*this)[0] & 15) << 2;
64 }
65
61 void set (const net_packet &pkt) 66 void set (const net_packet &pkt)
62 { 67 {
63 len = pkt.len; 68 len = pkt.len;
64 memcpy (&((*this)[0]), &(pkt[0]), len); 69 memcpy (&((*this)[0]), &(pkt[0]), len);
65 } 70 }
95struct data_packet : net_packet 100struct data_packet : net_packet
96{ 101{
97 u8 data_[MAXSIZE]; 102 u8 data_[MAXSIZE];
98}; 103};
99 104
100inline 105inline
101u8 &net_packet::operator[] (u16 offset) const 106u8 &net_packet::operator[] (u16 offset) const
102{ 107{
103 return ((data_packet *)this)->data_[offset]; 108 return ((data_packet *)this)->data_[offset];
104} 109}
105 110
106inline 111inline
107u8 *net_packet::at (u16 offset) const 112u8 *net_packet::at (u16 offset) const
108{ 113{
109 return &((*this)[offset]); 114 return &((*this)[offset]);
110} 115}
111 116

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines