Ethereal-dev: [Ethereal-dev] Some TVB rountines I want to add ...
Hi,
I am working on getting the routines into tvbuff.c that I need for
generating dissectors ...
Should be able to post the perl script next week.
I need the following. Comments please.
1. tvb_skip_bytes
int
tvb_skip_bytes(tvbuff_t *tvb, guint offset, guint8 bytes[],
guint len, guint min, guint max)
Returns -1 if the specified (len of bytes)*min does not occur at
the currentoffset, or there is not enough characters in the buffer.
Returns number of bytes skipped if (len bytes)*min found in buffer, up to
(len bytes)*max. Only complete occurrences of (len bytes) skipped. Any
partial initial match does not count!
This does not currently seem to exist as a routine.
2. ptvcursor_get_item_[guint8, guint16, guint32, gint8, gint16, gint32 etc]
int
ptvcursor_get_item_guint8(tvbuff_t *tvb, guint offset,
guint min, guint max, void *item)
Look for a string of characters that is convertable to an item of the
specified type and convert to the specified item.
Respect min and max length of items.
Return item in item, and return chars consumed in return value or -1
if specified item not found.
If not enough characters in buffer for min, return -1.
Regards
-------
Richard Sharpe, sharpe@xxxxxxxxxx
Samba (Team member, www.samba.org), Ethereal (Team member, www.zing.org)
Contributing author, SAMS Teach Yourself Samba in 24 Hours
Author, Special Edition, Using Samba