diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2005-12-16 00:32:12 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2005-12-16 00:32:12 +0000 |
commit | 163252a41c8f6ce7b233de6db317422647757d04 (patch) | |
tree | 437bb45e352ff8604d59051e8cf8163df2842f6d /epan/dissectors/packet-frame.c | |
parent | f84e9e9bdefd6bef765a4ca32350314d2ef54b54 (diff) |
From Stig B
Patch for COTP reassembly.
There does not seem to be any reasonable or cleaner way to fix COTP
reassembly than adding the frame.[ch] patch.
svn path=/trunk/; revision=16813
Diffstat (limited to 'epan/dissectors/packet-frame.c')
-rw-r--r-- | epan/dissectors/packet-frame.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/epan/dissectors/packet-frame.c b/epan/dissectors/packet-frame.c index 74a8769c54..ec63cf7b67 100644 --- a/epan/dissectors/packet-frame.c +++ b/epan/dissectors/packet-frame.c @@ -74,6 +74,28 @@ static const value_string p2p_dirs[] = { static dissector_table_t wtap_encap_dissector_table; +static GSList *frame_end_routines = NULL; + +/* + * Routine used to register frame end routine. The routine should only + * be registred when the dissector is used in the frame, not in the + * proto_register_XXX function. + */ +void +register_frame_end_routine(void (*func)(void)) +{ + frame_end_routines = g_slist_append(frame_end_routines, (gpointer)func); +} + +typedef void (*void_func_t)(void); + +static void +call_frame_end_routine(gpointer routine, gpointer dummy _U_) +{ + void_func_t func = (void_func_t)routine; + (*func)(); +} + static void dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { @@ -257,6 +279,11 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) if (mate_handle) call_dissector(mate_handle,tvb, pinfo, parent_tree); + if (frame_end_routines) { + g_slist_foreach(frame_end_routines, &call_frame_end_routine, NULL); + g_slist_free(frame_end_routines); + frame_end_routines = NULL; + } } void |