57 buf1.skip<
short int>();
Buffer whose starting can be moved back and forth, useful to decapsulate stacked network packets.
Definition netbuffer.h:36
size_t size() const
Return the buffer size.
Definition netbuffer.h:77
const NetBuffer after(size_t ofs) const
Return another NetBuffer starting ofs bytes from the beginning of this one.
Definition netbuffer.h:111
bool fits(size_t ofs=0) const
Check if the buffer is long enough to contain a structure T at the given offset.
Definition netbuffer.h:84
const void * data(size_t ofs=0) const
Return a pointer to the buffer.
Definition netbuffer.h:71
const T * cast(size_t ofs=0) const
Access the buffer contents as a structure T at the given offset.
Definition netbuffer.h:93
Definition netbuffer.test.h:12
Test startAtBeginning()
Definition netbuffer.test.h:15
Test skipBytes()
Definition netbuffer.test.h:27
#define assert_eq(x, y)
Definition test.h:33
#define assert(x)
Definition test.h:30