18#include "ws_symbol_export.h"
21#define FD_DEFRAGMENTED 0x0001
24#define FD_OVERLAP 0x0002
27#define FD_OVERLAPCONFLICT 0x0004
30#define FD_MULTIPLETAILS 0x0008
34#define FD_TOOLONGFRAGMENT 0x0010
37#define FD_SUBSET_TVB 0x0020
40#define FD_PARTIAL_REASSEMBLY 0x0040
44#define FD_BLOCKSEQUENCE 0x0100
50#define FD_DATALEN_SET 0x0400
106#define REASSEMBLE_FLAGS_NO_FRAG_NUMBER 0x0001
109#define REASSEMBLE_FLAGS_802_11_HACK 0x0002
116#define REASSEMBLE_FLAGS_AGING 0x0001
125typedef void * (*fragment_temporary_key)(
const packet_info *pinfo,
126 const uint32_t id,
const void *data);
132typedef void * (*fragment_persistent_key)(
const packet_info *pinfo,
133 const uint32_t id,
const void *data);
139 GHashTable *fragment_table;
140 GHashTable *reassembled_table;
141 fragment_temporary_key temporary_key_func;
142 fragment_persistent_key persistent_key_func;
143 GDestroyNotify free_temporary_key_func;
152 GEqualFunc equal_func;
153 fragment_temporary_key temporary_key_func;
154 fragment_persistent_key persistent_key_func;
155 GDestroyNotify free_temporary_key_func;
156 GDestroyNotify free_persistent_key_func;
164 addresses_reassembly_table_functions;
166 addresses_ports_reassembly_table_functions;
215 const packet_info *pinfo,
const uint32_t
id,
const void *data,
216 const uint32_t frag_offset,
const uint32_t frag_data_len,
217 const bool more_frags);
226 const uint32_t
id,
const void *data,
227 const uint32_t frag_offset,
228 const uint32_t frag_data_len,
229 const bool more_frags);
248 const uint32_t
id,
const void *data,
249 const uint32_t frag_offset,
250 const uint32_t frag_data_len,
251 const bool more_frags,
const uint32_t frag_frame);
277 const void *data,
const uint32_t frag_offset,
278 const uint32_t frag_data_len,
const bool more_frags);
292 const void *data,
const uint32_t frag_offset,
293 const uint32_t frag_data_len,
const bool more_frags,
294 const uint32_t fallback_frame);
328 const packet_info *pinfo,
const uint32_t
id,
const void *data,
329 const uint32_t frag_number,
const uint32_t frag_data_len,
330 const bool more_frags,
const uint32_t flags);
348 const uint32_t frag_number,
const uint32_t frag_data_len,
349 const bool more_frags);
359 const uint32_t
id,
const void *data,
360 const uint32_t frag_number,
const uint32_t frag_data_len,
361 const bool more_frags);
376 const void *data,
const uint32_t frag_data_len,
377 const bool more_frags);
391 const int offset,
const packet_info *pinfo,
const uint32_t
id,
392 const void* data,
const uint32_t frag_data_len,
393 const bool first,
const bool last,
394 const uint32_t max_frags);
403 const int offset,
const packet_info *pinfo,
const uint32_t
id,
404 const void* data,
const uint32_t frag_data_len,
405 const bool first,
const bool last,
406 const uint32_t max_frags,
const uint32_t max_age);
414 const uint32_t
id,
const void *data,
415 const uint32_t tot_len);
426 const uint32_t
id,
const void *data);
433 const void *data,
const uint32_t fragment_offset);
446 const uint32_t
id,
const void *data,
const uint32_t tot_len);
458 const uint32_t
id,
const void *data,
const uint32_t tot_len);
472 const uint32_t
id,
const void *data,
const uint32_t tot_len);
478WS_DLL_PUBLIC uint32_t
480 const uint32_t
id,
const void *data);
500 const uint32_t
id,
const void *data);
516 const uint32_t
id,
const void *data);
530 int *hf_fragment_overlap;
531 int *hf_fragment_overlap_conflict;
532 int *hf_fragment_multiple_tails;
533 int *hf_fragment_too_long_fragment;
534 int *hf_fragment_error;
535 int *hf_fragment_count;
536 int *hf_reassembled_in;
537 int *hf_reassembled_length;
538 int *hf_reassembled_data;
558extern void reassembly_tables_init(
void);
563reassembly_table_cleanup(
void);
592#define REASSEMBLE_ITEMS_DEFINE(var_prefix, name_prefix) \
593 static int ett_##var_prefix##_fragment; \
594 static int ett_##var_prefix##_fragments; \
595 static int hf_##var_prefix##_fragments; \
596 static int hf_##var_prefix##_fragment; \
597 static int hf_##var_prefix##_fragment_overlap; \
598 static int hf_##var_prefix##_fragment_overlap_conflicts; \
599 static int hf_##var_prefix##_fragment_multiple_tails; \
600 static int hf_##var_prefix##_fragment_too_long_fragment; \
601 static int hf_##var_prefix##_fragment_error; \
602 static int hf_##var_prefix##_fragment_count; \
603 static int hf_##var_prefix##_reassembled_in; \
604 static int hf_##var_prefix##_reassembled_length; \
605 static int hf_##var_prefix##_reassembled_data; \
606 static int hf_##var_prefix##_segment; \
607 static const fragment_items var_prefix##_fragment_items = { \
608 &ett_##var_prefix##_fragment, \
609 &ett_##var_prefix##_fragments, \
610 &hf_##var_prefix##_fragments, \
611 &hf_##var_prefix##_fragment, \
612 &hf_##var_prefix##_fragment_overlap, \
613 &hf_##var_prefix##_fragment_overlap_conflicts, \
614 &hf_##var_prefix##_fragment_multiple_tails, \
615 &hf_##var_prefix##_fragment_too_long_fragment, \
616 &hf_##var_prefix##_fragment_error, \
617 &hf_##var_prefix##_fragment_count, \
618 &hf_##var_prefix##_reassembled_in, \
619 &hf_##var_prefix##_reassembled_length, \
620 &hf_##var_prefix##_reassembled_data, \
621 name_prefix " fragments" \
671#define REASSEMBLE_INIT_HF_ITEMS(var_prefix, name_prefix, abbrev_prefix) \
672 { &hf_##var_prefix##_fragments, \
673 { "Reassembled " name_prefix " fragments", abbrev_prefix ".fragments", \
674 FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } \
676 { &hf_##var_prefix##_fragment, \
677 { name_prefix " fragment", abbrev_prefix ".fragment", \
678 FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL } \
680 { &hf_##var_prefix##_fragment_overlap, \
681 { name_prefix " fragment overlap", abbrev_prefix ".fragment.overlap", \
682 FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } \
684 { &hf_##var_prefix##_fragment_overlap_conflicts, \
685 { name_prefix " fragment overlapping with conflicting data", abbrev_prefix ".fragment.overlap.conflicts", \
686 FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } \
688 { &hf_##var_prefix##_fragment_multiple_tails, \
689 { name_prefix " has multiple tail fragments", abbrev_prefix ".fragment.multiple_tails", \
690 FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } \
692 { &hf_##var_prefix##_fragment_too_long_fragment, \
693 { name_prefix " fragment too long", abbrev_prefix ".fragment.too_long_fragment", \
694 FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } \
696 { &hf_##var_prefix##_fragment_error, \
697 { name_prefix " defragment error", abbrev_prefix ".fragment.error", \
698 FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL } \
700 { &hf_##var_prefix##_fragment_count, \
701 { name_prefix " fragment count", abbrev_prefix ".fragment.count", \
702 FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } \
704 { &hf_##var_prefix##_reassembled_in, \
705 { "Reassembled in", abbrev_prefix ".reassembled.in", \
706 FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL } \
708 { &hf_##var_prefix##_reassembled_length, \
709 { "Reassembled length", abbrev_prefix ".reassembled.length", \
710 FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } \
712 { &hf_##var_prefix##_reassembled_data, \
713 { "Reassembled data", abbrev_prefix ".reassembled.data", \
714 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } \
716 { &hf_##var_prefix##_segment, \
717 { name_prefix " segment", abbrev_prefix ".segment", \
718 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} \
752#define REASSEMBLE_INIT_ETT_ITEMS(var_prefix) \
753 &ett_##var_prefix##_fragment, \
754 &ett_##var_prefix##_fragments
1131 const char* label,
const fragment_items* frag_hf_items,
int hf_segment_data
1147static inline uint64_t
1150 return (((uint64_t)pinfo->
num) << 32) + (((uint64_t)pinfo->
curr_layer_num) << 24)
1151 + ((uint64_t)tvb_raw_offset(tvb) + offset);
WS_DLL_PUBLIC streaming_reassembly_info_t * streaming_reassembly_info_new(void)
Definition reassemble.c:3216
WS_DLL_PUBLIC int additional_bytes_expected_to_complete_reassembly(streaming_reassembly_info_t *reassembly_info)
Definition reassemble.c:3540
WS_DLL_PUBLIC int reassemble_streaming_data_and_call_subdissector(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, int length, proto_tree *segment_tree, proto_tree *reassembled_tree, reassembly_table streaming_reassembly_table, streaming_reassembly_info_t *reassembly_info, uint64_t cur_frame_num, dissector_handle_t subdissector_handle, proto_tree *subdissector_tree, void *subdissector_data, const char *label, const fragment_items *frag_hf_items, int hf_segment_data)
Definition reassemble.c:3266
Definition reassemble.h:64
unsigned ref_count
Definition reassemble.h:68
uint32_t flags
Definition reassemble.h:89
const char * error
Definition reassemble.h:97
struct _fragment_item * first_gap
Definition reassemble.h:66
uint32_t len
Definition reassemble.h:71
uint32_t contiguous_len
Definition reassemble.h:69
uint32_t datalen
Definition reassemble.h:77
uint32_t reassembled_in
Definition reassemble.h:83
uint32_t fragment_nr_offset
Definition reassemble.h:74
uint8_t reas_in_layer_num
Definition reassemble.h:85
uint32_t frame
Definition reassemble.h:70
Definition reassemble.h:52
uint32_t frame
Definition reassemble.h:54
uint32_t flags
Definition reassemble.h:58
uint32_t len
Definition reassemble.h:57
uint32_t offset
Definition reassemble.h:55
Definition reassemble.h:524
Definition packet_info.h:43
uint32_t num
Definition packet_info.h:47
uint8_t curr_layer_num
Definition packet_info.h:139
Definition reassemble.h:149
Definition reassemble.h:138
Definition reassemble.c:3193
Definition tvbuff-int.h:35