diff options
author | Anders Broman <anders.broman@ericsson.com> | 2007-12-09 17:41:16 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2007-12-09 17:41:16 +0000 |
commit | e5f48395f18dcdfe5a65a0163b750179aad64b33 (patch) | |
tree | d8be6b7a292ac5589d0206d140f5a92fb8fa7776 /epan/dissectors/packet-rtsp.c | |
parent | 006d1c446e03af37c260693076d501b6fb5aa887 (diff) |
Move the routines tvb_skip_wsp() to tvbuff.c
svn path=/trunk/; revision=23818
Diffstat (limited to 'epan/dissectors/packet-rtsp.c')
-rw-r--r-- | epan/dissectors/packet-rtsp.c | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/epan/dissectors/packet-rtsp.c b/epan/dissectors/packet-rtsp.c index bbb90d833d..cc5ea41e87 100644 --- a/epan/dissectors/packet-rtsp.c +++ b/epan/dissectors/packet-rtsp.c @@ -103,59 +103,6 @@ static guint tcp_port = 0; static guint tcp_alternate_port = 0; /* - * Copied from the mgcp dissector. (This function should be moved to /epan ) - * tvb_skip_wsp - Returns the position in tvb of the first non-whitespace - * character following offset or offset + maxlength -1 whichever - * is smaller. - * - * Parameters: - * tvb - The tvbuff in which we are skipping whitespace. - * offset - The offset in tvb from which we begin trying to skip whitespace. - * maxlength - The maximum distance from offset that we may try to skip - * whitespace. - * - * Returns: The position in tvb of the first non-whitespace - * character following offset or offset + maxlength -1 whichever - * is smaller. - */ -static gint tvb_skip_wsp(tvbuff_t* tvb, gint offset, gint maxlength) -{ - gint counter = offset; - gint end = offset + maxlength,tvb_len; - guint8 tempchar; - - /* Get the length remaining */ - tvb_len = tvb_length(tvb); - end = offset + maxlength; - if (end >= tvb_len) - { - end = tvb_len; - } - - /* Skip past spaces, tabs, CRs and LFs until run out or meet something else */ - for (counter = offset; - counter < end && - ((tempchar = tvb_get_guint8(tvb,counter)) == ' ' || - tempchar == '\t' || tempchar == '\r' || tempchar == '\n'); - counter++); - - return (counter); -} - -static gint tvb_skip_wsp_return(tvbuff_t* tvb, gint offset){ - gint counter = offset; - gint end; - guint8 tempchar; - end = 0; - - for(counter = offset; counter > end && - ((tempchar = tvb_get_guint8(tvb,counter)) == ' ' || - tempchar == '\t' || tempchar == '\n' || tempchar == '\r'); counter--); - counter++; - return (counter); -} - -/* * Takes an array of bytes, assumed to contain a null-terminated * string, as an argument, and returns the length of the string - * i.e., the size of the array, minus 1 for the null terminator. |