--- gvpe/src/device.h 2003/10/16 02:41:21 1.11 +++ 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 @@ -25,11 +25,13 @@ #include "gettext.h" #include "global.h" +#include "util.h" struct net_packet { u32 len; // actually u16, but padding... u8 &operator[] (u16 offset) const; + u8 *at (u16 offset) const; void unshift_hdr (u16 hdrsize) { @@ -87,7 +89,11 @@ return ((data_packet *)this)->data_[offset]; } -typedef u8 mac[6]; +inline +u8 *net_packet::at (u16 offset) const +{ + return &((*this)[offset]); +} struct tap_packet : net_packet { mac dst;