summaryrefslogtreecommitdiffstats
path: root/epan/stream.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:33 +0000
commit9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9 (patch)
tree2784370cda9bbf2da9114d70f05399c0b229d28c /epan/stream.c
parentAdding debian version 4.2.6-1. (diff)
downloadwireshark-9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9.tar.xz
wireshark-9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9.zip
Merging upstream version 4.4.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'epan/stream.c')
-rw-r--r--epan/stream.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/epan/stream.c b/epan/stream.c
index 5bad6037..097babc1 100644
--- a/epan/stream.c
+++ b/epan/stream.c
@@ -24,18 +24,18 @@
typedef struct {
fragment_head *fd_head; /* the reassembled data, NULL
* until we add the last fragment */
- guint32 pdu_number; /* Number of this PDU within the stream */
+ uint32_t pdu_number; /* Number of this PDU within the stream */
/* id of this pdu (globally unique) */
- guint32 id;
+ uint32_t id;
} stream_pdu_t;
struct stream_pdu_fragment
{
- guint32 len; /* the length of this fragment */
+ uint32_t len; /* the length of this fragment */
stream_pdu_t *pdu;
- gboolean final_fragment;
+ bool final_fragment;
};
struct stream {
@@ -48,12 +48,12 @@ struct stream {
stream_pdu_t *current_pdu;
/* number of PDUs added to this stream so far */
- guint32 pdu_counter;
+ uint32_t pdu_counter;
/* the framenumber and offset of the last fragment added;
used for sanity-checking */
- guint32 lastfrag_framenum;
- guint32 lastfrag_offset;
+ uint32_t lastfrag_framenum;
+ uint32_t lastfrag_offset;
};
@@ -71,7 +71,7 @@ typedef struct stream_key {
/* hash func */
-static guint stream_hash_func(gconstpointer k)
+static unsigned stream_hash_func(const void *k)
{
const stream_key_t *key = (const stream_key_t *)k;
@@ -79,8 +79,8 @@ static guint stream_hash_func(gconstpointer k)
}
/* compare func */
-static gboolean stream_compare_func(gconstpointer a,
- gconstpointer b)
+static gboolean stream_compare_func(const void *a,
+ const void *b)
{
const stream_key_t *key1 = (const stream_key_t *)a;
const stream_key_t *key2 = (const stream_key_t *)b;
@@ -154,7 +154,7 @@ static stream_t *stream_hash_insert( const struct conversation *conv, int p2p_di
*/
/* pdu counter, for generating unique pdu ids */
-static guint32 pdu_counter;
+static uint32_t pdu_counter;
static void stream_cleanup_pdu_data(void)
{
@@ -185,21 +185,21 @@ static stream_pdu_t *stream_new_pdu(stream_t *stream)
/* key */
typedef struct fragment_key {
const stream_t *stream;
- guint32 framenum;
- guint32 offset;
+ uint32_t framenum;
+ uint32_t offset;
} fragment_key_t;
/* hash func */
-static guint fragment_hash_func(gconstpointer k)
+static unsigned fragment_hash_func(const void *k)
{
const fragment_key_t *key = (const fragment_key_t *)k;
- return (GPOINTER_TO_UINT(key->stream)) + ((guint)key -> framenum) + ((guint)key->offset);
+ return (GPOINTER_TO_UINT(key->stream)) + ((unsigned)key -> framenum) + ((unsigned)key->offset);
}
/* compare func */
-static gboolean fragment_compare_func(gconstpointer a,
- gconstpointer b)
+static gboolean fragment_compare_func(const void *a,
+ const void *b)
{
const fragment_key_t *key1 = (const fragment_key_t *)a;
const fragment_key_t *key2 = (const fragment_key_t *)b;
@@ -229,7 +229,7 @@ static void init_fragment_hash( void ) {
/* lookup function, returns null if not found */
-static stream_pdu_fragment_t *fragment_hash_lookup( const stream_t *stream, guint32 framenum, guint32 offset )
+static stream_pdu_fragment_t *fragment_hash_lookup( const stream_t *stream, uint32_t framenum, uint32_t offset )
{
fragment_key_t key;
stream_pdu_fragment_t *val;
@@ -244,8 +244,8 @@ static stream_pdu_fragment_t *fragment_hash_lookup( const stream_t *stream, guin
/* insert function */
-static stream_pdu_fragment_t *fragment_hash_insert( const stream_t *stream, guint32 framenum, guint32 offset,
- guint32 length)
+static stream_pdu_fragment_t *fragment_hash_insert( const stream_t *stream, uint32_t framenum, uint32_t offset,
+ uint32_t length)
{
fragment_key_t *key;
stream_pdu_fragment_t *val;
@@ -258,7 +258,7 @@ static stream_pdu_fragment_t *fragment_hash_insert( const stream_t *stream, guin
val = wmem_new(wmem_file_scope(), stream_pdu_fragment_t);
val->len = length;
val->pdu = NULL;
- val->final_fragment = FALSE;
+ val->final_fragment = false;
g_hash_table_insert(fragment_hash, key, val);
return val;
@@ -320,13 +320,13 @@ void stream_init( void )
/*****************************************************************************/
-stream_pdu_fragment_t *stream_find_frag( stream_t *stream, guint32 framenum, guint32 offset )
+stream_pdu_fragment_t *stream_find_frag( stream_t *stream, uint32_t framenum, uint32_t offset )
{
return fragment_hash_lookup( stream, framenum, offset );
}
-stream_pdu_fragment_t *stream_add_frag( stream_t *stream, guint32 framenum, guint32 offset,
- tvbuff_t *tvb, packet_info *pinfo, gboolean more_frags )
+stream_pdu_fragment_t *stream_add_frag( stream_t *stream, uint32_t framenum, uint32_t offset,
+ tvbuff_t *tvb, packet_info *pinfo, bool more_frags )
{
fragment_head *fd_head;
stream_pdu_t *pdu;
@@ -361,7 +361,7 @@ stream_pdu_fragment_t *stream_add_frag( stream_t *stream, guint32 framenum, guin
/* start a new pdu next time */
stream->current_pdu = NULL;
- frag_data -> final_fragment = TRUE;
+ frag_data -> final_fragment = true;
}
/* stashing the framenum and offset permit future sanity checks */
@@ -376,7 +376,7 @@ tvbuff_t *stream_process_reassembled(
tvbuff_t *tvb, int offset, packet_info *pinfo,
const char *name, const stream_pdu_fragment_t *frag,
const struct _fragment_items *fit,
- gboolean *update_col_infop, proto_tree *tree)
+ bool *update_col_infop, proto_tree *tree)
{
stream_pdu_t *pdu;
DISSECTOR_ASSERT(frag);
@@ -397,7 +397,7 @@ tvbuff_t *stream_process_reassembled(
fit, update_col_infop, tree);
}
-guint32 stream_get_frag_length( const stream_pdu_fragment_t *frag)
+uint32_t stream_get_frag_length( const stream_pdu_fragment_t *frag)
{
DISSECTOR_ASSERT( frag );
return frag->len;
@@ -409,7 +409,7 @@ fragment_head *stream_get_frag_data( const stream_pdu_fragment_t *frag)
return frag->pdu->fd_head;
}
-guint32 stream_get_pdu_no( const stream_pdu_fragment_t *frag)
+uint32_t stream_get_pdu_no( const stream_pdu_fragment_t *frag)
{
DISSECTOR_ASSERT( frag );
return frag->pdu->pdu_number;