aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorJakub Zawadzki <darkjames-ws@darkjames.pl>2012-09-03 12:00:40 +0000
committerJakub Zawadzki <darkjames-ws@darkjames.pl>2012-09-03 12:00:40 +0000
commit5ad3e5331e929920fcca0657622f557f2e2358f2 (patch)
treecef16aa8c778151e33e48b3018eef977094fe252 /epan
parent1db996e051c6ffab1e5d7a61ccf44aff0b28ac29 (diff)
MT: move global frame_end_routines to packet_info.
svn path=/trunk/; revision=44748
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-frame.c14
-rw-r--r--epan/dissectors/packet-frame.h2
-rw-r--r--epan/dissectors/packet-ldap.c2
-rw-r--r--epan/dissectors/packet-mtp3.c2
-rw-r--r--epan/dissectors/packet-opensafety.c4
-rw-r--r--epan/dissectors/packet-ositp.c2
-rw-r--r--epan/dissectors/packet-rpcap.c2
-rw-r--r--epan/dissectors/packet-sccp.c2
-rw-r--r--epan/dissectors/packet-x509if.c10
-rw-r--r--epan/packet_info.h2
-rw-r--r--epan/wslua/init_wslua.c2
11 files changed, 22 insertions, 22 deletions
diff --git a/epan/dissectors/packet-frame.c b/epan/dissectors/packet-frame.c
index 6258521a76..5fbb4e88be 100644
--- a/epan/dissectors/packet-frame.c
+++ b/epan/dissectors/packet-frame.c
@@ -98,17 +98,15 @@ static const value_string p2p_dirs[] = {
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 registered when the dissector is used in the frame, not in the
* proto_register_XXX function.
*/
void
-register_frame_end_routine(void (*func)(void))
+register_frame_end_routine(packet_info *pinfo, void (*func)(void))
{
- frame_end_routines = g_slist_append(frame_end_routines, (gpointer)func);
+ pinfo->frame_end_routines = g_slist_append(pinfo->frame_end_routines, (gpointer)func);
}
typedef void (*void_func_t)(void);
@@ -477,10 +475,10 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
tap_queue_packet(frame_tap, pinfo, NULL);
- 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;
+ if (pinfo->frame_end_routines) {
+ g_slist_foreach(pinfo->frame_end_routines, &call_frame_end_routine, NULL);
+ g_slist_free(pinfo->frame_end_routines);
+ pinfo->frame_end_routines = NULL;
}
}
diff --git a/epan/dissectors/packet-frame.h b/epan/dissectors/packet-frame.h
index bed147a363..1bebceed83 100644
--- a/epan/dissectors/packet-frame.h
+++ b/epan/dissectors/packet-frame.h
@@ -42,7 +42,7 @@ show_reported_bounds_error(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
* proto_register_XXX function.
*/
void
-register_frame_end_routine(void (*func)(void));
+register_frame_end_routine(packet_info *pinfo, void (*func)(void));
/*
* "Protocol" used for "malformed frame" errors (other than
diff --git a/epan/dissectors/packet-ldap.c b/epan/dissectors/packet-ldap.c
index 07c5860c3a..0085215367 100644
--- a/epan/dissectors/packet-ldap.c
+++ b/epan/dissectors/packet-ldap.c
@@ -4042,7 +4042,7 @@ static void
col_set_fence(pinfo->cinfo, COL_INFO);
} else {
col_clear(pinfo->cinfo, COL_INFO);
- register_frame_end_routine (ldap_frame_end);
+ register_frame_end_routine (pinfo, ldap_frame_end);
ldap_found_in_frame = TRUE;
}
diff --git a/epan/dissectors/packet-mtp3.c b/epan/dissectors/packet-mtp3.c
index 2b47c74cac..ccc9776154 100644
--- a/epan/dissectors/packet-mtp3.c
+++ b/epan/dissectors/packet-mtp3.c
@@ -729,7 +729,7 @@ dissect_mtp3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Register a frame-end routine to ensure mtp3_standard is set
* back, even if an exception is thrown.
*/
- register_frame_end_routine(reset_mtp3_standard);
+ register_frame_end_routine(pinfo, reset_mtp3_standard);
}
PROTO_ITEM_SET_GENERATED(gen_item);
}
diff --git a/epan/dissectors/packet-opensafety.c b/epan/dissectors/packet-opensafety.c
index a4dcc019f1..a26c79c2db 100644
--- a/epan/dissectors/packet-opensafety.c
+++ b/epan/dissectors/packet-opensafety.c
@@ -1323,7 +1323,7 @@ opensafety_package_dissector(const gchar *protocolName, const gchar *sub_diss_ha
/* registering frame end routine, to prevent a malformed dissection preventing
* further dissector calls (see bug #6950) */
- register_frame_end_routine(reset_dissector);
+ register_frame_end_routine(pinfo, reset_dissector);
length = tvb_length(message_tvb);
/* Minimum package length is 11 */
@@ -1946,7 +1946,7 @@ proto_reg_handoff_opensafety(void)
/* registering frame end routine, to prevent a malformed dissection preventing
* further dissector calls (see bug #6950) */
- register_frame_end_routine(reset_dissector);
+ /* register_frame_end_routine(reset_dissector); */
}
}
diff --git a/epan/dissectors/packet-ositp.c b/epan/dissectors/packet-ositp.c
index 225509d948..0109aa75f9 100644
--- a/epan/dissectors/packet-ositp.c
+++ b/epan/dissectors/packet-ositp.c
@@ -850,7 +850,7 @@ static int ositp_decode_DT(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
}
if (!fragment) {
cotp_dst_ref++;
- register_frame_end_routine(cotp_frame_end);
+ register_frame_end_routine(pinfo, cotp_frame_end);
}
break;
diff --git a/epan/dissectors/packet-rpcap.c b/epan/dissectors/packet-rpcap.c
index ef58fbabaf..6712bda944 100644
--- a/epan/dissectors/packet-rpcap.c
+++ b/epan/dissectors/packet-rpcap.c
@@ -897,7 +897,7 @@ dissect_rpcap_packet (tvbuff_t *tvb, packet_info *pinfo, proto_tree *top_tree,
/* Indicate RPCAP in the info column */
col_prepend_fence_fstr (pinfo->cinfo, COL_INFO, "Remote | ");
info_added = TRUE;
- register_frame_end_routine(rpcap_frame_end);
+ register_frame_end_routine(pinfo, rpcap_frame_end);
}
} else {
if (linktype == WTAP_ENCAP_UNKNOWN) {
diff --git a/epan/dissectors/packet-sccp.c b/epan/dissectors/packet-sccp.c
index 8bb9ec4aa3..90692bd763 100644
--- a/epan/dissectors/packet-sccp.c
+++ b/epan/dissectors/packet-sccp.c
@@ -2667,7 +2667,7 @@ new_ud_msg(packet_info *pinfo, guint32 msg_type _U_)
m->data.ud.calling_gt = NULL;
m->data.ud.called_gt = NULL;
- register_frame_end_routine(reset_sccp_assoc);
+ register_frame_end_routine(pinfo, reset_sccp_assoc);
return m;
}
diff --git a/epan/dissectors/packet-x509if.c b/epan/dissectors/packet-x509if.c
index f4a8f761ea..3609782ca1 100644
--- a/epan/dissectors/packet-x509if.c
+++ b/epan/dissectors/packet-x509if.c
@@ -510,7 +510,7 @@ int
dissect_x509if_Attribute(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 418 "../../asn1/x509if/x509if.cnf"
doing_attr = TRUE;
- register_frame_end_routine (x509if_frame_end);
+ register_frame_end_routine (actx->pinfo, x509if_frame_end);
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
Attribute_sequence, hf_index, ett_x509if_Attribute);
@@ -669,7 +669,7 @@ dissect_x509if_AttributeValueAssertion(gboolean implicit_tag _U_, tvbuff_t *tvb
ava_hf_index = hf_index;
last_ava = ep_alloc(MAX_AVA_STR_LEN); *last_ava = '\0';
- register_frame_end_routine (x509if_frame_end);
+ register_frame_end_routine (actx->pinfo, x509if_frame_end);
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
AttributeValueAssertion_sequence, hf_index, ett_x509if_AttributeValueAssertion);
@@ -751,7 +751,7 @@ dissect_x509if_T_type_02(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offse
if((fmt = val_to_str(hf_index, fmt_vals, "")) && *fmt) {
/* we have a format */
last_ava = ep_alloc(MAX_AVA_STR_LEN); *last_ava = '\0';
- register_frame_end_routine (x509if_frame_end);
+ register_frame_end_routine (actx->pinfo, x509if_frame_end);
g_snprintf(last_ava, MAX_AVA_STR_LEN, "%s %s", name, fmt);
@@ -916,7 +916,7 @@ dissect_x509if_RelativeDistinguishedName(gboolean implicit_tag _U_, tvbuff_t *tv
rdn_one_value = FALSE;
top_of_rdn = tree;
last_rdn = ep_alloc(MAX_DN_STR_LEN); *last_rdn = '\0';
- register_frame_end_routine (x509if_frame_end);
+ register_frame_end_routine (actx->pinfo, x509if_frame_end);
offset = dissect_ber_set_of(implicit_tag, actx, tree, tvb, offset,
RelativeDistinguishedName_set_of, hf_index, ett_x509if_RelativeDistinguishedName);
@@ -978,7 +978,7 @@ dissect_x509if_RDNSequence(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off
dn_one_rdn = FALSE; /* reset */
last_dn = ep_alloc(MAX_DN_STR_LEN); *last_dn = '\0';
top_of_dn = NULL;
- register_frame_end_routine (x509if_frame_end);
+ register_frame_end_routine (actx->pinfo, x509if_frame_end);
offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
diff --git a/epan/packet_info.h b/epan/packet_info.h
index 0f151219cf..7086254cad 100644
--- a/epan/packet_info.h
+++ b/epan/packet_info.h
@@ -204,6 +204,8 @@ typedef struct _packet_info {
*/
int link_dir; /* 3GPP messages are sometime different UP link(UL) or Downlink(DL) */
GSList* dependent_frames; /* A list of frames which this one depends on */
+
+ GSList *frame_end_routines;
} packet_info;
/* For old code that hasn't yet been changed. */
diff --git a/epan/wslua/init_wslua.c b/epan/wslua/init_wslua.c
index 53d6e07847..53d2370076 100644
--- a/epan/wslua/init_wslua.c
+++ b/epan/wslua/init_wslua.c
@@ -120,7 +120,7 @@ int dissect_lua(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree) {
expert_add_info_format(pinfo, pi, PI_UNDECODED, PI_ERROR ,"Lua Error");
}
- register_frame_end_routine(lua_frame_end);
+ register_frame_end_routine(pinfo, lua_frame_end);
lua_pinfo = NULL;
lua_tree = NULL;