--- gvpe/src/device.h 2003/10/16 14:12:00 1.12 +++ gvpe/src/device.h 2005/03/03 07:24:57 1.16 @@ -1,6 +1,6 @@ /* device.h -- generic header for device.c - Copyright (C) 2003 Marc Lehmann + Copyright (C) 2003-2004 Marc Lehmann This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,6 +31,7 @@ u32 len; // actually u16, but padding... u8 &operator[] (u16 offset) const; + u8 *at (u16 offset) const; void unshift_hdr (u16 hdrsize) { @@ -88,6 +89,12 @@ return ((data_packet *)this)->data_[offset]; } +inline +u8 *net_packet::at (u16 offset) const +{ + return &((*this)[offset]); +} + struct tap_packet : net_packet { mac dst; mac src;