diff options
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/asn1/h245/h245.cnf | 6 | ||||
-rw-r--r-- | epan/dissectors/asn1/h245/packet-h245-template.h | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-dvbci.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-fr.c | 5 | ||||
-rw-r--r-- | epan/dissectors/packet-gsmtap.c | 3 | ||||
-rw-r--r-- | epan/dissectors/packet-h223.c | 131 | ||||
-rw-r--r-- | epan/dissectors/packet-h245.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-h245.h | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-iax2.c | 42 | ||||
-rw-r--r-- | epan/dissectors/packet-iax2.h | 3 | ||||
-rw-r--r-- | epan/dissectors/packet-isdn.c | 10 | ||||
-rw-r--r-- | epan/dissectors/packet-iso14443.c | 8 | ||||
-rw-r--r-- | epan/dissectors/packet-isup.c | 7 | ||||
-rw-r--r-- | epan/dissectors/packet-iuup.c | 9 | ||||
-rw-r--r-- | epan/dissectors/packet-k12.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-lapdm.c | 5 | ||||
-rw-r--r-- | epan/dissectors/packet-lapsat.c | 3 | ||||
-rw-r--r-- | epan/dissectors/packet-wcp.c | 34 | ||||
-rw-r--r-- | epan/dissectors/packet-x25.c | 27 |
19 files changed, 141 insertions, 174 deletions
diff --git a/epan/dissectors/asn1/h245/h245.cnf b/epan/dissectors/asn1/h245/h245.cnf index 2fd5aef742..2dabaaf9ff 100644 --- a/epan/dissectors/asn1/h245/h245.cnf +++ b/epan/dissectors/asn1/h245/h245.cnf @@ -55,7 +55,7 @@ Rfc2733Format FECCapability/rfc2733Format FECMode/rfc2733Format h223_mc = 0; %(DEFAULT_BODY)s if(h223_set_mc_handle) - (*h223_set_mc_handle)(%(ACTX)s->pinfo, h223_mc, h223_me, %(ACTX)s->pinfo->ctype, %(ACTX)s->pinfo->circuit_id); + (*h223_set_mc_handle)(%(ACTX)s->pinfo, h223_mc, h223_me); /* stuff */ #.END #---------------------------------------------------------------------------------------- @@ -240,9 +240,9 @@ Rfc2733Format FECCapability/rfc2733Format FECMode/rfc2733Format DISSECTOR_ASSERT( ( h223_rev_lc_num && pend->rev_channel_params) || (!h223_rev_lc_num && !pend->rev_channel_params) ); if(h223_add_lc_handle) { - (*h223_add_lc_handle)( %(ACTX)s->pinfo, h223_fw_lc_num, pend->fw_channel_params, %(ACTX)s->pinfo->ctype, %(ACTX)s->pinfo->circuit_id ); + (*h223_add_lc_handle)( %(ACTX)s->pinfo, h223_fw_lc_num, pend->fw_channel_params); if(h223_rev_lc_num) - (*h223_add_lc_handle)( %(ACTX)s->pinfo, h223_rev_lc_num, pend->rev_channel_params, %(ACTX)s->pinfo->ctype, %(ACTX)s->pinfo->circuit_id ); + (*h223_add_lc_handle)( %(ACTX)s->pinfo, h223_rev_lc_num, pend->rev_channel_params); } } else { /* we missed the OpenLogicalChannel packet */ diff --git a/epan/dissectors/asn1/h245/packet-h245-template.h b/epan/dissectors/asn1/h245/packet-h245-template.h index e83ee44505..d07408eea6 100644 --- a/epan/dissectors/asn1/h245/packet-h245-template.h +++ b/epan/dissectors/asn1/h245/packet-h245-template.h @@ -116,10 +116,10 @@ struct _h223_mux_element { #include <epan/packet_info.h> #include <epan/dissectors/packet-per.h> -typedef void (*h223_set_mc_handle_t) ( packet_info* pinfo, guint8 mc, h223_mux_element* me, circuit_type ctype, guint32 circuit_id ); +typedef void (*h223_set_mc_handle_t) ( packet_info* pinfo, guint8 mc, h223_mux_element* me); WS_DLL_PUBLIC void h245_set_h223_set_mc_handle( h223_set_mc_handle_t handle ); -typedef void (*h223_add_lc_handle_t) ( packet_info* pinfo, guint16 lc, h223_lc_params* params, circuit_type ctype, guint32 circuit_id ); +typedef void (*h223_add_lc_handle_t) ( packet_info* pinfo, guint16 lc, h223_lc_params* params); WS_DLL_PUBLIC void h245_set_h223_add_lc_handle( h223_add_lc_handle_t handle ); #include "packet-h245-exp.h" diff --git a/epan/dissectors/packet-dvbci.c b/epan/dissectors/packet-dvbci.c index b18f049516..8b65967fce 100644 --- a/epan/dissectors/packet-dvbci.c +++ b/epan/dissectors/packet-dvbci.c @@ -4322,7 +4322,7 @@ dissect_dvbci_spdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, break; } col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Session opened"); - conv = conversation_new_simple(pinfo->num, ENDPOINT_DVBCI, CT_ID(ssnb, tcid), 0); + conv = conversation_new_by_id(pinfo->num, ENDPOINT_DVBCI, CT_ID(ssnb, tcid), 0); /* we always add the resource id immediately after the circuit was created */ conversation_add_proto_data(conv, proto_dvbci, GUINT_TO_POINTER(res_id)); @@ -4343,7 +4343,7 @@ dissect_dvbci_spdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, ssnb = tvb_get_ntohs(tvb, offset+1); proto_tree_add_item(sess_tree, hf_dvbci_sess_nb, tvb, offset+1, 2, ENC_BIG_ENDIAN); - conv = find_conversation_simple(pinfo->num, ENDPOINT_DVBCI, CT_ID(ssnb, tcid), 0); + conv = find_conversation_by_id(pinfo->num, ENDPOINT_DVBCI, CT_ID(ssnb, tcid), 0); if (conv) conv->last_frame = pinfo->num; break; @@ -4360,7 +4360,7 @@ dissect_dvbci_spdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } if (ssnb && !conv) - conv = find_conversation_simple(pinfo->num, ENDPOINT_DVBCI, CT_ID(ssnb, tcid), 0); + conv = find_conversation_by_id(pinfo->num, ENDPOINT_DVBCI, CT_ID(ssnb, tcid), 0); /* if the packet contains no resource id, we add the cached id from the circuit so that each packet has a resource id that can be diff --git a/epan/dissectors/packet-fr.c b/epan/dissectors/packet-fr.c index d35d0827b7..58cd2625bd 100644 --- a/epan/dissectors/packet-fr.c +++ b/epan/dissectors/packet-fr.c @@ -38,6 +38,7 @@ #include <epan/capture_dissectors.h> #include <epan/prefs.h> #include <epan/expert.h> +#include <epan/conversation.h> #include <wiretap/wtap.h> #include "packet-llc.h" @@ -507,9 +508,7 @@ dissect_fr_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree_add_uint(fr_tree, hf_fr_dlci, tvb, 0, offset, addr); } - pinfo->ctype = CT_DLCI; - pinfo->circuit_id = addr; - + conversation_create_endpoint_by_id(pinfo, ENDPOINT_DLCI, addr, 0); col_add_fstr(pinfo->cinfo, COL_INFO, "DLCI %u", addr); } diff --git a/epan/dissectors/packet-gsmtap.c b/epan/dissectors/packet-gsmtap.c index 1a44e8954e..c8a1c718fb 100644 --- a/epan/dissectors/packet-gsmtap.c +++ b/epan/dissectors/packet-gsmtap.c @@ -45,6 +45,7 @@ #include "config.h" #include <epan/packet.h> +#include <epan/conversation.h> #include "packet-gsmtap.h" #include "packet-lapdm.h" @@ -501,7 +502,7 @@ dissect_gsmtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _ /* Try to build an identifier of different 'streams' */ /* (AFCN _cant_ be used because of hopping */ - pinfo->circuit_id = (timeslot << 3) | subslot; + conversation_create_endpoint_by_id(pinfo, ENDPOINT_GSMTAP, (timeslot << 3) | subslot, 0); if (tree) { guint8 channel; diff --git a/epan/dissectors/packet-h223.c b/epan/dissectors/packet-h223.c index e6805c201b..60c3eecb6c 100644 --- a/epan/dissectors/packet-h223.c +++ b/epan/dissectors/packet-h223.c @@ -25,7 +25,6 @@ #include <epan/packet.h> -#include <epan/circuit.h> #include <epan/conversation.h> #include <epan/exceptions.h> #include <epan/expert.h> @@ -405,19 +404,19 @@ static void init_logical_channel( guint32 start_frame, h223_call_info* call_info, int vc, int direction, h223_lc_params* params ) { guint32 circuit_id = circuit_chain_lookup(call_info, vc); - circuit_t *subcircuit; + conversation_t *subcircuit; h223_vc_info *vc_info; - subcircuit = find_circuit( CT_H223, circuit_id, start_frame ); + subcircuit = find_conversation_by_id( start_frame, ENDPOINT_H223, circuit_id, 0); if( subcircuit == NULL ) { - subcircuit = circuit_new( CT_H223, circuit_id, start_frame ); + subcircuit = conversation_new_by_id( start_frame, ENDPOINT_H223, circuit_id, 0 ); #ifdef DEBUG_H223 g_debug("%d: Created new circuit %d for call %p VC %d", start_frame, circuit_id, call_info, vc); #endif vc_info = h223_vc_info_new( call_info ); - circuit_add_proto_data( subcircuit, proto_h223, vc_info ); + conversation_add_proto_data( subcircuit, proto_h223, vc_info ); } else { - vc_info = (h223_vc_info *)circuit_get_proto_data( subcircuit, proto_h223 ); + vc_info = (h223_vc_info *)conversation_get_proto_data( subcircuit, proto_h223 ); } add_h223_lc_params( vc_info, direction, params, start_frame ); } @@ -450,17 +449,17 @@ create_call_info( guint32 start_frame ) /* find or create call_info struct for calls over circuits (eg, IAX) */ static h223_call_info * -find_or_create_call_info_circ(packet_info * pinfo, circuit_type ctype, guint32 circuit_id) +find_or_create_call_info_circ(packet_info * pinfo, endpoint_type etype, guint32 circuit_id) { h223_call_info *datax; - circuit_t *circ = NULL; + conversation_t *circ = NULL; - if(ctype != CT_NONE) - circ = find_circuit( ctype, circuit_id, pinfo->num ); + if(etype != ENDPOINT_NONE) + circ = find_conversation_by_id( pinfo->num, etype, circuit_id, 0); if(circ == NULL) return NULL; - datax = (h223_call_info *)circuit_get_proto_data(circ, proto_h223); + datax = (h223_call_info *)conversation_get_proto_data(circ, proto_h223); if( datax == NULL ) { datax = create_call_info(pinfo->num); @@ -469,7 +468,7 @@ find_or_create_call_info_circ(packet_info * pinfo, circuit_type ctype, guint32 c g_debug("%u: Created new call %p for circuit %p ctype %d, id %u", pinfo->num, datax, circ, type, circuit_id); #endif - circuit_add_proto_data(circ, proto_h223, datax); + conversation_add_proto_data(circ, proto_h223, datax); } /* work out what direction we're really going in */ @@ -555,11 +554,11 @@ find_or_create_call_info_conv(packet_info * pinfo) } static h223_call_info * -find_or_create_call_info ( packet_info * pinfo, circuit_type ctype, guint32 circuit_id ) +find_or_create_call_info ( packet_info * pinfo, endpoint_type etype, guint32 circuit_id ) { h223_call_info *datax; - datax = find_or_create_call_info_circ(pinfo, ctype, circuit_id); + datax = find_or_create_call_info_circ(pinfo, etype, circuit_id); if(datax == NULL) datax = find_or_create_call_info_conv(pinfo); return datax; @@ -567,30 +566,30 @@ find_or_create_call_info ( packet_info * pinfo, circuit_type ctype, guint32 circ /* called from the h245 dissector to handle a MultiplexEntrySend message */ static void -h223_set_mc( packet_info* pinfo, guint8 mc, h223_mux_element* me, circuit_type ctype, guint32 circuit_id ) +h223_set_mc( packet_info* pinfo, guint8 mc, h223_mux_element* me) { - circuit_t *circ = find_circuit( ctype, circuit_id, pinfo->num ); + conversation_t *circ = find_conversation_pinfo( pinfo, 0 ); h223_vc_info* vc_info; /* if this h245 pdu packet came from an h223 circuit, add the details on * the new mux entry */ if(circ) { - vc_info = (h223_vc_info *)circuit_get_proto_data(circ, proto_h223); + vc_info = (h223_vc_info *)conversation_get_proto_data(circ, proto_h223); add_h223_mux_element( &(vc_info->call_info->direction_data[pinfo->p2p_dir ? 0 : 1]), mc, me, pinfo->num ); } } /* called from the h245 dissector to handle an OpenLogicalChannelAck message */ static void -h223_add_lc( packet_info* pinfo, guint16 lc, h223_lc_params* params, circuit_type ctype, guint32 circuit_id ) +h223_add_lc( packet_info* pinfo, guint16 lc, h223_lc_params* params ) { - circuit_t *circ = find_circuit( ctype, circuit_id, pinfo->num ); + conversation_t *circ = find_conversation_pinfo( pinfo, 0 ); h223_vc_info* vc_info; /* if this h245 pdu packet came from an h223 circuit, add the details on * the new channel */ if(circ) { - vc_info = (h223_vc_info *)circuit_get_proto_data(circ, proto_h223); + vc_info = (h223_vc_info *)conversation_get_proto_data(circ, proto_h223); init_logical_channel( pinfo->num, vc_info->call_info, lc, pinfo->p2p_dir, params ); } } @@ -732,32 +731,27 @@ static void dissect_mux_sdu_fragment(tvbuff_t *volatile next_tvb, packet_info *pinfo, guint32 pkt_offset, proto_tree *pdu_tree, h223_call_info* call_info, guint16 vc, - gboolean end_of_mux_sdu, circuit_type orig_ctype, guint32 orig_circuit) + gboolean end_of_mux_sdu, endpoint_type orig_etype, guint32 orig_circuit) { /* update the circuit details before passing to a subdissector */ - circuit_type ctype = CT_H223; - /* XXX - Not sure if these need to be saved */ - pinfo->circuit_id = circuit_chain_lookup(call_info, vc); - pinfo->ctype = ctype; + guint32 circuit_id = circuit_chain_lookup(call_info, vc); + conversation_create_endpoint_by_id(pinfo, ENDPOINT_H223, circuit_id, 0); TRY { - guint32 circuit_id = pinfo->circuit_id; - circuit_t *subcircuit=find_circuit(ctype,circuit_id,pinfo->num); - proto_tree *vc_tree = NULL; + conversation_t *subcircuit = find_conversation_by_id(pinfo->num, ENDPOINT_H223, circuit_id, 0); + proto_tree *vc_tree; proto_item *vc_item; h223_vc_info *vc_info = NULL; h223_lc_params *lc_params = NULL; - if(pdu_tree) { - vc_item = proto_tree_add_uint(pdu_tree, hf_h223_mux_vc, next_tvb, 0, tvb_reported_length(next_tvb), vc); - vc_tree = proto_item_add_subtree (vc_item, ett_h223_mux_vc); - } + vc_item = proto_tree_add_uint(pdu_tree, hf_h223_mux_vc, next_tvb, 0, tvb_reported_length(next_tvb), vc); + vc_tree = proto_item_add_subtree (vc_item, ett_h223_mux_vc); if( subcircuit == NULL ) { g_message( "Frame %d: Subcircuit id %d not found for call %p VC %d", pinfo->num, circuit_id, (void *)call_info, vc ); } else { - vc_info = (h223_vc_info *)circuit_get_proto_data(subcircuit, proto_h223); + vc_info = (h223_vc_info *)conversation_get_proto_data(subcircuit, proto_h223); if( vc_info != NULL ) { lc_params = find_h223_lc_params( vc_info, pinfo->p2p_dir, pinfo->num ); } @@ -769,9 +763,9 @@ dissect_mux_sdu_fragment(tvbuff_t *volatile next_tvb, packet_info *pinfo, stream_t *substream; stream_pdu_fragment_t *frag; - substream = find_stream_circ(subcircuit,pinfo->p2p_dir); + substream = find_stream_conv(subcircuit,pinfo->p2p_dir); if(substream == NULL ) - substream = stream_new_circ(subcircuit,pinfo->p2p_dir); + substream = stream_new_conv(subcircuit,pinfo->p2p_dir); frag = stream_find_frag(substream,pinfo->num,pkt_offset); if(frag == NULL ) { @@ -808,8 +802,7 @@ dissect_mux_sdu_fragment(tvbuff_t *volatile next_tvb, packet_info *pinfo, /* restore the original circuit details for future PDUs */ FINALLY { - pinfo->ctype=orig_ctype; - pinfo->circuit_id=orig_circuit; + conversation_create_endpoint_by_id(pinfo, orig_etype, orig_circuit, 0); } ENDTRY; } @@ -851,7 +844,7 @@ dissect_mux_payload_by_me_list( tvbuff_t *tvb, packet_info *pinfo, guint32 pkt_offset, proto_tree *pdu_tree, h223_call_info* call_info, h223_mux_element *me, guint32 offset, - gboolean endOfMuxSdu, circuit_type ctype, guint32 circuit_id) + gboolean endOfMuxSdu, endpoint_type etype, guint32 circuit_id) { guint32 len = tvb_reported_length(tvb); guint32 frag_len; @@ -864,12 +857,12 @@ dissect_mux_payload_by_me_list( tvbuff_t *tvb, packet_info *pinfo, offset + sublist_len <= len; offset = dissect_mux_payload_by_me_list( tvb, pinfo, pkt_offset, pdu_tree, call_info, me->sublist, offset, endOfMuxSdu, - ctype, circuit_id) ); + etype, circuit_id) ); } else { for(i = 0; i < me->repeat_count; ++i) offset = dissect_mux_payload_by_me_list( tvb, pinfo, pkt_offset, pdu_tree, call_info, me->sublist, offset, endOfMuxSdu, - ctype, circuit_id); + etype, circuit_id); } } else { if ( me->repeat_count == 0 ) @@ -881,7 +874,7 @@ dissect_mux_payload_by_me_list( tvbuff_t *tvb, packet_info *pinfo, next_tvb = tvb_new_subset_length(tvb, offset, frag_len); dissect_mux_sdu_fragment( next_tvb, pinfo, pkt_offset + offset, pdu_tree, call_info, me->vc, (offset+frag_len==len) && endOfMuxSdu, - ctype, circuit_id); + etype, circuit_id); offset += frag_len; } } @@ -905,14 +898,14 @@ dissect_mux_payload_by_me_list( tvbuff_t *tvb, packet_info *pinfo, static void dissect_mux_payload( tvbuff_t *tvb, packet_info *pinfo, guint32 pkt_offset, proto_tree *pdu_tree, h223_call_info *call_info, - guint8 mc, gboolean endOfMuxSdu, circuit_type ctype, guint32 circuit_id ) + guint8 mc, gboolean endOfMuxSdu, endpoint_type etype, guint32 circuit_id ) { guint32 len = tvb_reported_length(tvb); h223_mux_element* me = find_h223_mux_element( &(call_info->direction_data[pinfo->p2p_dir ? 0 : 1]), mc, pinfo->num, pkt_offset ); if( me ) { - dissect_mux_payload_by_me_list( tvb, pinfo, pkt_offset, pdu_tree, call_info, me, 0, endOfMuxSdu, ctype, circuit_id ); + dissect_mux_payload_by_me_list( tvb, pinfo, pkt_offset, pdu_tree, call_info, me, 0, endOfMuxSdu, etype, circuit_id ); } else { /* no entry found in mux-table. ignore packet and dissect as data */ proto_tree *vc_tree = NULL; @@ -939,7 +932,7 @@ dissect_mux_payload( tvbuff_t *tvb, packet_info *pinfo, guint32 pkt_offset, */ static void dissect_mux_pdu( tvbuff_t *tvb, packet_info *pinfo, guint32 pkt_offset, - proto_tree *h223_tree, h223_call_info *call_info, circuit_type ctype, guint32 circuit_id) + proto_tree *h223_tree, h223_call_info *call_info, endpoint_type etype, guint32 circuit_id) { guint32 offset = 0; /* actual (as opposed to reported) payload len */ @@ -1055,7 +1048,7 @@ dissect_mux_pdu( tvbuff_t *tvb, packet_info *pinfo, guint32 pkt_offset, if(mpl > 0) { pdu_tvb = tvb_new_subset_length_caplen(tvb, offset, len, mpl); if(errors != -1) { - dissect_mux_payload(pdu_tvb,pinfo,pkt_offset+offset,pdu_tree,call_info,mc,end_of_mux_sdu, ctype, circuit_id); + dissect_mux_payload(pdu_tvb,pinfo,pkt_offset+offset,pdu_tree,call_info,mc,end_of_mux_sdu, etype, circuit_id); } else { call_dissector(data_handle,pdu_tvb,pinfo,pdu_tree); } @@ -1182,7 +1175,7 @@ h223_mux_check_hdlc(int h223_level, guint32 nbytes, guint32 tail_buf) static gint dissect_mux_pdu_fragment( tvbuff_t *tvb, guint32 start_offset, packet_info *pinfo, proto_tree *h223_tree, - h223_call_info *call_info, circuit_type ctype, guint32 circuit_id) + h223_call_info *call_info, endpoint_type etype, guint32 circuit_id) { tvbuff_t *volatile next_tvb; volatile guint32 offset = start_offset; @@ -1258,7 +1251,7 @@ dissect_mux_pdu_fragment( tvbuff_t *tvb, guint32 start_offset, * data. */ TRY { - dissect_mux_pdu( next_tvb, pinfo, start_offset, h223_tree, call_info, ctype, circuit_id); + dissect_mux_pdu( next_tvb, pinfo, start_offset, h223_tree, call_info, etype, circuit_id); } CATCH_NONFATAL_ERRORS { show_exception(tvb, pinfo, h223_tree, EXCEPT_CODE, GET_MESSAGE); @@ -1280,7 +1273,7 @@ dissect_mux_pdu_fragment( tvbuff_t *tvb, guint32 start_offset, * line up with the end of a pdu. */ static void -dissect_h223_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, circuit_type ctype, guint32 circuit_id) +dissect_h223_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, endpoint_type etype, guint32 circuit_id) { proto_tree *h223_tree = NULL; proto_item *h223_item = NULL; @@ -1293,7 +1286,7 @@ dissect_h223_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, circuit col_clear(pinfo->cinfo, COL_INFO); /* find or create the call_info for this call */ - call_info = find_or_create_call_info(pinfo, ctype, circuit_id); + call_info = find_or_create_call_info(pinfo, etype, circuit_id); /* add the 'h223' tree to the main tree */ if (tree) { @@ -1303,7 +1296,7 @@ dissect_h223_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, circuit while( offset < tvb_reported_length( tvb )) { int res = dissect_mux_pdu_fragment( tvb, offset, pinfo, - h223_tree, call_info, ctype, circuit_id); + h223_tree, call_info, etype, circuit_id); if(res <= 0) { /* the end of the tvb held the start of a PDU */ pinfo->desegment_offset = offset; @@ -1341,26 +1334,17 @@ dissect_h223_circuit_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v { iax2_dissector_info_t circuit_info; - if (data != NULL) - { - circuit_info = *((iax2_dissector_info_t*)data); - } - else - { - /* Just in case dissectors are still using the "old" method */ - /* XXX - This should eventually be removed */ - circuit_info.ctype = (circuit_type)pinfo->ctype; - circuit_info.circuit_id = pinfo->circuit_id; - } + DISSECTOR_ASSERT(data); + circuit_info = *((iax2_dissector_info_t*)data); - dissect_h223_common(tvb, pinfo, tree, circuit_info.ctype, circuit_info.circuit_id); + dissect_h223_common(tvb, pinfo, tree, circuit_info.etype, circuit_info.circuit_id); return tvb_captured_length(tvb); } static int dissect_h223(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { - dissect_h223_common(tvb, pinfo, tree, CT_NONE, 0); + dissect_h223_common(tvb, pinfo, tree, ENDPOINT_NONE, 0); return tvb_captured_length(tvb); } @@ -1372,7 +1356,7 @@ dissect_h223(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ * normal entry point. */ static void -dissect_h223_bitswapped_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, circuit_type ctype, guint32 circuit_id) +dissect_h223_bitswapped_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, endpoint_type etype, guint32 circuit_id) { tvbuff_t *reversed_tvb; guint8 *datax; @@ -1392,7 +1376,7 @@ dissect_h223_bitswapped_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr /* Add the reversed data to the data source list. */ add_new_data_source(pinfo, reversed_tvb, "Bit-swapped H.223 frame" ); - dissect_h223_common(reversed_tvb,pinfo,tree,ctype,circuit_id); + dissect_h223_common(reversed_tvb,pinfo,tree,etype,circuit_id); } static int @@ -1400,26 +1384,17 @@ dissect_h223_bitswapped_circuit_data(tvbuff_t *tvb, packet_info *pinfo, proto_tr { iax2_dissector_info_t circuit_info; - if (data != NULL) - { - circuit_info = *((iax2_dissector_info_t*)data); - } - else - { - /* Just in case dissectors are still using the "old" method */ - /* XXX - This should eventually be removed */ - circuit_info.ctype = (circuit_type)pinfo->ctype; - circuit_info.circuit_id = pinfo->circuit_id; - } + DISSECTOR_ASSERT(data); + circuit_info = *((iax2_dissector_info_t*)data); - dissect_h223_bitswapped_common(tvb, pinfo, tree, circuit_info.ctype, circuit_info.circuit_id); + dissect_h223_bitswapped_common(tvb, pinfo, tree, circuit_info.etype, circuit_info.circuit_id); return tvb_captured_length(tvb); } static int dissect_h223_bitswapped(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { - dissect_h223_bitswapped_common(tvb, pinfo, tree, CT_NONE, 0); + dissect_h223_bitswapped_common(tvb, pinfo, tree, ENDPOINT_NONE, 0); return tvb_captured_length(tvb); } diff --git a/epan/dissectors/packet-h245.c b/epan/dissectors/packet-h245.c index cd39bdc171..a489278dcb 100644 --- a/epan/dissectors/packet-h245.c +++ b/epan/dissectors/packet-h245.c @@ -9084,7 +9084,7 @@ dissect_h245_MultiplexEntryDescriptor(tvbuff_t *tvb _U_, int offset _U_, asn1_ct ett_h245_MultiplexEntryDescriptor, MultiplexEntryDescriptor_sequence); if(h223_set_mc_handle) - (*h223_set_mc_handle)(actx->pinfo, h223_mc, h223_me, actx->pinfo->ctype, actx->pinfo->circuit_id); + (*h223_set_mc_handle)(actx->pinfo, h223_mc, h223_me); /* stuff */ @@ -11114,9 +11114,9 @@ dissect_h245_OpenLogicalChannelAck(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t DISSECTOR_ASSERT( ( h223_rev_lc_num && pend->rev_channel_params) || (!h223_rev_lc_num && !pend->rev_channel_params) ); if(h223_add_lc_handle) { - (*h223_add_lc_handle)( actx->pinfo, h223_fw_lc_num, pend->fw_channel_params, actx->pinfo->ctype, actx->pinfo->circuit_id ); + (*h223_add_lc_handle)( actx->pinfo, h223_fw_lc_num, pend->fw_channel_params); if(h223_rev_lc_num) - (*h223_add_lc_handle)( actx->pinfo, h223_rev_lc_num, pend->rev_channel_params, actx->pinfo->ctype, actx->pinfo->circuit_id ); + (*h223_add_lc_handle)( actx->pinfo, h223_rev_lc_num, pend->rev_channel_params); } } else { /* we missed the OpenLogicalChannel packet */ diff --git a/epan/dissectors/packet-h245.h b/epan/dissectors/packet-h245.h index 38ceb2660a..ee6d62be9c 100644 --- a/epan/dissectors/packet-h245.h +++ b/epan/dissectors/packet-h245.h @@ -124,10 +124,10 @@ struct _h223_mux_element { #include <epan/packet_info.h> #include <epan/dissectors/packet-per.h> -typedef void (*h223_set_mc_handle_t) ( packet_info* pinfo, guint8 mc, h223_mux_element* me, circuit_type ctype, guint32 circuit_id ); +typedef void (*h223_set_mc_handle_t) ( packet_info* pinfo, guint8 mc, h223_mux_element* me); WS_DLL_PUBLIC void h245_set_h223_set_mc_handle( h223_set_mc_handle_t handle ); -typedef void (*h223_add_lc_handle_t) ( packet_info* pinfo, guint16 lc, h223_lc_params* params, circuit_type ctype, guint32 circuit_id ); +typedef void (*h223_add_lc_handle_t) ( packet_info* pinfo, guint16 lc, h223_lc_params* params); WS_DLL_PUBLIC void h245_set_h223_add_lc_handle( h223_add_lc_handle_t handle ); diff --git a/epan/dissectors/packet-iax2.c b/epan/dissectors/packet-iax2.c index 6d99aa6d34..81d47618da 100644 --- a/epan/dissectors/packet-iax2.c +++ b/epan/dissectors/packet-iax2.c @@ -32,7 +32,7 @@ #include <epan/packet.h> -#include <epan/circuit.h> +#include <epan/conversation.h> #include <epan/exceptions.h> #include <epan/reassemble.h> #include <epan/expert.h> @@ -743,12 +743,12 @@ typedef struct iax_call_data { -/* creates a new CT_IAX2 circuit with a specified circuit id for a call +/* creates a new ENDPOINT_IAX2 circuit with a specified circuit id for a call * * typically a call has up to three associated circuits: an original source, an * original destination, and the result of a transfer. * - * For each endpoint, a CT_IAX2 circuit is created and added to the call_data + * For each endpoint, a ENDPOINT_IAX2 circuit is created and added to the call_data * by this function * * 'reversed' should be true if this end is the one which would have _received_ @@ -756,11 +756,11 @@ typedef struct iax_call_data { * transferred. * */ -static circuit_t *iax2_new_circuit_for_call(packet_info *pinfo, proto_item * item, +static conversation_t *iax2_new_circuit_for_call(packet_info *pinfo, proto_item * item, guint circuit_id, guint framenum, iax_call_data *iax_call, gboolean reversed) { - circuit_t *res; + conversation_t *conv; if(!iax_call){ return NULL; @@ -771,18 +771,18 @@ static circuit_t *iax2_new_circuit_for_call(packet_info *pinfo, proto_item * ite return NULL; } - res = circuit_new(CT_IAX2, + conv = conversation_new_by_id(framenum, ENDPOINT_IAX2, circuit_id, framenum); - circuit_add_proto_data(res, proto_iax2, iax_call); + conversation_add_proto_data(conv, proto_iax2, iax_call); if (reversed) iax_call -> reverse_circuit_ids[iax_call->n_reverse_circuit_ids++] = circuit_id; else iax_call -> forward_circuit_ids[iax_call->n_forward_circuit_ids++] = circuit_id; - return res; + return conv; } @@ -821,15 +821,13 @@ static iax_call_data *iax_lookup_call_from_dest(packet_info *pinfo, proto_item * guint framenum, gboolean *reversed_p) { - circuit_t *dst_circuit; + conversation_t *dst_conv; iax_call_data *iax_call; gboolean reversed = FALSE; - dst_circuit = find_circuit(CT_IAX2, - dst_circuit_id, - framenum); + dst_conv = find_conversation_by_id(framenum, ENDPOINT_IAX2, dst_circuit_id, 0); - if (!dst_circuit) { + if (!dst_conv) { #ifdef DEBUG_HASHING g_debug("++ destination circuit not found, must have missed NEW packet"); #endif @@ -842,9 +840,9 @@ static iax_call_data *iax_lookup_call_from_dest(packet_info *pinfo, proto_item * g_debug("++ found destination circuit"); #endif - iax_call = (iax_call_data *)circuit_get_proto_data(dst_circuit, proto_iax2); + iax_call = (iax_call_data *)conversation_get_proto_data(dst_conv, proto_iax2); - /* there's no way we can create a CT_IAX2 circuit without adding + /* there's no way we can create a ENDPOINT_IAX2 circuit without adding iax call data to it; assert this */ DISSECTOR_ASSERT(iax_call); @@ -950,21 +948,19 @@ static iax_call_data *iax_lookup_call( packet_info *pinfo, iax_call = iax_lookup_call_from_dest(pinfo, NULL, src_circuit_id, dst_circuit_id, pinfo->num, &reversed); } else { - circuit_t *src_circuit; + conversation_t *src_conv; /* in all other circumstances, the source circuit should already * exist: its absence indicates that we missed the all-important NEW * packet. */ - src_circuit = find_circuit(CT_IAX2, - src_circuit_id, - pinfo->num); + src_conv = find_conversation_by_id(pinfo->num, ENDPOINT_IAX2, src_circuit_id, 0); - if (src_circuit) { - iax_call = (iax_call_data *)circuit_get_proto_data(src_circuit, proto_iax2); + if (src_conv) { + iax_call = (iax_call_data *)conversation_get_proto_data(src_conv, proto_iax2); - /* there's no way we can create a CT_IAX2 circuit without adding + /* there's no way we can create a ENDPOINT_IAX2 circuit without adding iax call data to it; assert this */ DISSECTOR_ASSERT(iax_call); @@ -2175,7 +2171,7 @@ static void process_iax_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * tbd what the best thing to do here is. */ memset(&dissector_info, 0, sizeof(dissector_info)); } else { - dissector_info.ctype = CT_IAX2; + dissector_info.etype = ENDPOINT_IAX2; dissector_info.circuit_id = (guint32)iax_packet->call_data->forward_circuit_ids[0]; } diff --git a/epan/dissectors/packet-iax2.h b/epan/dissectors/packet-iax2.h index fd926a8a80..a1c0f293f9 100644 --- a/epan/dissectors/packet-iax2.h +++ b/epan/dissectors/packet-iax2.h @@ -26,6 +26,7 @@ #define __PACKET_IAX2_H__ #include <epan/tap-voip.h> +#include <epan/conversation.h> /* Max version of IAX protocol we support */ #define IAX_PROTO_VERSION 2 @@ -255,7 +256,7 @@ typedef struct _iax2_info_t /* Container for passing data between dissectors */ typedef struct _iax2_dissector_info_t { - circuit_type ctype; + endpoint_type etype; guint32 circuit_id; } iax2_dissector_info_t; diff --git a/epan/dissectors/packet-isdn.c b/epan/dissectors/packet-isdn.c index 7e5bfe585c..cef118c179 100644 --- a/epan/dissectors/packet-isdn.c +++ b/epan/dissectors/packet-isdn.c @@ -108,9 +108,7 @@ dissect_isdn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ col_set_str(pinfo->cinfo, COL_RES_DL_SRC, "Network"); } - /* XXX - Are these still needed? We've used other values where necessary */ - pinfo->ctype = CT_ISDN; - pinfo->circuit_id = pinfo->pseudo_header->isdn.channel; + conversation_create_endpoint_by_id(pinfo, ENDPOINT_ISDN, pinfo->pseudo_header->isdn.channel, 0); if (tree) { ti = proto_tree_add_item(tree, proto_isdn, tvb, 0, 0, ENC_NA); @@ -123,9 +121,7 @@ dissect_isdn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ /* * Set up a circuit for this channel, and assign it a dissector. */ - conv = find_conversation_simple(pinfo->num, ENDPOINT_ISDN, pinfo->pseudo_header->isdn.channel, 0); - if (conv == NULL) - conv = conversation_new_simple(pinfo->num, ENDPOINT_ISDN, pinfo->pseudo_header->isdn.channel, 0); + conv = find_or_create_conversation(pinfo); if (conversation_get_dissector(conv, 0) == NULL) { /* @@ -196,7 +192,7 @@ dissect_isdn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ } } - if (!try_conversation_dissector_simple(ENDPOINT_ISDN, pinfo->pseudo_header->isdn.channel, + if (!try_conversation_dissector_by_id(ENDPOINT_ISDN, pinfo->pseudo_header->isdn.channel, tvb, pinfo, tree, NULL)) call_data_dissector(tvb, pinfo, tree); diff --git a/epan/dissectors/packet-iso14443.c b/epan/dissectors/packet-iso14443.c index cef146b192..db550569cd 100644 --- a/epan/dissectors/packet-iso14443.c +++ b/epan/dissectors/packet-iso14443.c @@ -693,7 +693,7 @@ static int dissect_iso14443_ats(tvbuff_t *tvb, gint offset, col_set_str(pinfo->cinfo, COL_INFO, "ATS"); proto_item_append_text(ti, ": ATS"); - conv = conversation_new_simple(pinfo->num, ENDPOINT_ISO14443, ISO14443_CIRCUIT_ID, 0); + conv = conversation_new_by_id(pinfo->num, ENDPOINT_ISO14443, ISO14443_CIRCUIT_ID, 0); conversation_add_proto_data(conv, proto_iso14443, GUINT_TO_POINTER((guint)ISO14443_A)); offset_tl = offset; @@ -919,7 +919,7 @@ dissect_iso14443_cmd_type_attrib(tvbuff_t *tvb, packet_info *pinfo, col_set_str(pinfo->cinfo, COL_INFO, "Response to Attrib"); proto_item_append_text(ti, ": Response to Attrib"); - conv = conversation_new_simple(pinfo->num, ENDPOINT_ISO14443, ISO14443_CIRCUIT_ID, 0); + conv = conversation_new_by_id(pinfo->num, ENDPOINT_ISO14443, ISO14443_CIRCUIT_ID, 0); conversation_add_proto_data(conv, proto_iso14443, GUINT_TO_POINTER((guint)ISO14443_B)); mbli = tvb_get_guint8(tvb, offset) >> 4; @@ -1091,7 +1091,7 @@ dissect_iso14443_cmd_type_block(tvbuff_t *tvb, packet_info *pinfo, iso14443_type_t t; conversation_t *conv; - conv = find_conversation_simple(pinfo->num, ENDPOINT_ISO14443, ISO14443_CIRCUIT_ID, 0); + conv = find_conversation_by_id(pinfo->num, ENDPOINT_ISO14443, ISO14443_CIRCUIT_ID, 0); if (conv) { t = (iso14443_type_t)GPOINTER_TO_UINT(conversation_get_proto_data(conv, proto_iso14443)); @@ -1374,7 +1374,7 @@ static int dissect_iso14443(tvbuff_t *tvb, /* all events that are not data transfers close the connection to the card (e.g. the field is switched on or off) */ - conv = find_conversation_simple(pinfo->num, ENDPOINT_ISO14443, ISO14443_CIRCUIT_ID, 0); + conv = find_conversation_by_id(pinfo->num, ENDPOINT_ISO14443, ISO14443_CIRCUIT_ID, 0); if (conv) conv->last_frame = pinfo->num; } diff --git a/epan/dissectors/packet-isup.c b/epan/dissectors/packet-isup.c index 71f5718332..79ec8449f9 100644 --- a/epan/dissectors/packet-isup.c +++ b/epan/dissectors/packet-isup.c @@ -49,6 +49,7 @@ #include <epan/packet.h> #include <epan/expert.h> #include <epan/exceptions.h> +#include <epan/conversation.h> #include <epan/stats_tree.h> #include <epan/asn1.h> #include <epan/prefs.h> @@ -10148,8 +10149,6 @@ dissect_isup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ /* Extract message type field */ message_type = tvb_get_guint8(tvb, CIC_OFFSET + CIC_LENGTH); - pinfo->ctype = CT_ISUP; - switch (mtp3_standard) { case ANSI_STANDARD: isup_standard = ANSI_STANDARD; @@ -10169,6 +10168,7 @@ dissect_isup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ isup_tree = proto_item_add_subtree(ti, ett_isup); proto_tree_add_uint(isup_tree, hf_isup_cic, tvb, CIC_OFFSET, CIC_LENGTH, cic); } + conversation_create_endpoint_by_id(pinfo, ENDPOINT_ISUP, cic, 0); message_tvb = tvb_new_subset_remaining(tvb, CIC_LENGTH); dissect_ansi_isup_message(message_tvb, pinfo, isup_tree, ISUP_ITU_STANDARD_VARIANT, cic); break; @@ -10217,6 +10217,7 @@ dissect_isup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ isup_tree = proto_item_add_subtree(ti, ett_isup); proto_tree_add_uint(isup_tree, hf_isup_cic, tvb, CIC_OFFSET, CIC_LENGTH, cic); } + conversation_create_endpoint_by_id(pinfo, ENDPOINT_ISUP, cic, 0); message_tvb = tvb_new_subset_remaining(tvb, CIC_LENGTH); dissect_isup_message(message_tvb, pinfo, isup_tree, itu_isup_variant, cic); } @@ -10270,7 +10271,7 @@ dissect_bicc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ bicc_cic = tvb_get_letohl(tvb, BICC_CIC_OFFSET); - pinfo->ctype = CT_BICC; + conversation_create_endpoint_by_id(pinfo, ENDPOINT_BICC, bicc_cic, 0); col_clear(pinfo->cinfo, COL_INFO); if (isup_show_cic_in_info) { diff --git a/epan/dissectors/packet-iuup.c b/epan/dissectors/packet-iuup.c index 348f2b8f4a..60b63bd7c8 100644 --- a/epan/dissectors/packet-iuup.c +++ b/epan/dissectors/packet-iuup.c @@ -34,6 +34,7 @@ #include <epan/packet.h> #include <epan/prefs.h> #include <epan/expert.h> +#include <epan/conversation.h> #include <epan/crc10-tvb.h> #include <wsutil/crc10.h> #include <wsutil/crc6.h> @@ -633,7 +634,7 @@ static int dissect_iuup(tvbuff_t* tvb_in, packet_info* pinfo, proto_tree* tree, phdr &= 0x7fff; - pinfo->circuit_id = phdr; + conversation_create_endpoint_by_id(pinfo, ENDPOINT_IUUP, phdr, 0); tvb = tvb_new_subset_length(tvb_in,2,len); } @@ -668,7 +669,7 @@ static int dissect_iuup(tvbuff_t* tvb_in, packet_info* pinfo, proto_tree* tree, proto_tree_add_item(iuup_tree,hf_iuup_rfci,tvb,1,1,ENC_BIG_ENDIAN); add_hdr_crc(tvb, pinfo, iuup_tree, crccheck); add_payload_crc(tvb, pinfo, iuup_tree); - dissect_iuup_payload(tvb,pinfo,iuup_tree,second_octet & 0x3f,4,pinfo->circuit_id); + dissect_iuup_payload(tvb,pinfo,iuup_tree,second_octet & 0x3f,4, conversation_get_endpoint_by_id(pinfo, ENDPOINT_IUUP, USE_LAST_ENDPOINT)); return tvb_captured_length(tvb); case PDUTYPE_DATA_NO_CRC: col_append_fstr(pinfo->cinfo, COL_INFO," RFCI %u", (guint)(second_octet & 0x3f)); @@ -682,7 +683,7 @@ static int dissect_iuup(tvbuff_t* tvb_in, packet_info* pinfo, proto_tree* tree, proto_tree_add_item(iuup_tree,hf_iuup_rfci,tvb,1,1,ENC_BIG_ENDIAN); add_hdr_crc(tvb, pinfo, iuup_tree, crccheck); - dissect_iuup_payload(tvb,pinfo,iuup_tree,second_octet & 0x3f,3,pinfo->circuit_id); + dissect_iuup_payload(tvb,pinfo,iuup_tree,second_octet & 0x3f,3, conversation_get_endpoint_by_id(pinfo, ENDPOINT_IUUP, USE_LAST_ENDPOINT)); return tvb_captured_length(tvb); case PDUTYPE_DATA_CONTROL_PROC: if (tree) { @@ -733,7 +734,7 @@ static int dissect_iuup(tvbuff_t* tvb_in, packet_info* pinfo, proto_tree* tree, switch( second_octet & PROCEDURE_MASK ) { case PROC_INIT: add_payload_crc(tvb, pinfo, iuup_tree); - dissect_iuup_init(tvb,pinfo,iuup_tree,pinfo->circuit_id); + dissect_iuup_init(tvb,pinfo,iuup_tree, conversation_get_endpoint_by_id(pinfo, ENDPOINT_IUUP, USE_LAST_ENDPOINT)); return tvb_captured_length(tvb); case PROC_RATE: add_payload_crc(tvb, pinfo, iuup_tree); diff --git a/epan/dissectors/packet-k12.c b/epan/dissectors/packet-k12.c index dce370c0fa..9757999357 100644 --- a/epan/dissectors/packet-k12.c +++ b/epan/dissectors/packet-k12.c @@ -223,7 +223,7 @@ dissect_k12(tvbuff_t* tvb,packet_info* pinfo,proto_tree* tree, void* data _U_) * XXX: this is prone to collisions! * we need an uniform way to manage circuits between dissectors */ - pinfo->circuit_id = g_str_hash(circuit_str); + conversation_create_endpoint_by_id(pinfo, ENDPOINT_NONE, g_str_hash(circuit_str), 0); proto_tree_add_uint(k12_tree, hf_k12_atm_vp, tvb, 0, 0, pinfo->pseudo_header->k12.input_info.atm.vp); diff --git a/epan/dissectors/packet-lapdm.c b/epan/dissectors/packet-lapdm.c index d351edd76e..de7cc1fced 100644 --- a/epan/dissectors/packet-lapdm.c +++ b/epan/dissectors/packet-lapdm.c @@ -56,6 +56,7 @@ #include <epan/prefs.h> #include <epan/xdlc.h> #include <epan/reassemble.h> +#include <epan/conversation.h> void proto_register_lapdm(void); @@ -326,7 +327,7 @@ dissect_lapdm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) pinfo->fragmented = m; /* Rely on caller to provide a way to group fragments */ - fragment_id = (pinfo->circuit_id << 4) | (sapi << 1) | pinfo->p2p_dir; + fragment_id = (conversation_get_endpoint_by_id(pinfo, ENDPOINT_GSMTAP, USE_LAST_ENDPOINT) << 4) | (sapi << 1) | pinfo->p2p_dir; if (!PINFO_FD_VISITED(pinfo)) { /* Check if new N(S) is equal to previous N(S) (to avoid adding retransmissions in reassembly table) @@ -380,7 +381,7 @@ dissect_lapdm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { if (!PINFO_FD_VISITED(pinfo) && ((control & XDLC_S_U_MASK) == XDLC_U) && ((control & XDLC_U_MODIFIER_MASK) == XDLC_SABM)) { /* SABM frame; reset the last N(S) to an invalid value */ - guint32 fragment_id = (pinfo->circuit_id << 4) | (sapi << 1) | pinfo->p2p_dir; + guint32 fragment_id = (conversation_get_endpoint_by_id(pinfo, ENDPOINT_GSMTAP, USE_LAST_ENDPOINT) << 4) | (sapi << 1) | pinfo->p2p_dir; wmem_map_insert(lapdm_last_n_s_map, GUINT_TO_POINTER(fragment_id), GUINT_TO_POINTER(0)); } diff --git a/epan/dissectors/packet-lapsat.c b/epan/dissectors/packet-lapsat.c index 10672749eb..73af54f2aa 100644 --- a/epan/dissectors/packet-lapsat.c +++ b/epan/dissectors/packet-lapsat.c @@ -35,6 +35,7 @@ #include <epan/packet.h> #include <epan/reassemble.h> +#include <epan/conversation.h> void proto_register_lapsat(void); @@ -516,7 +517,7 @@ dissect_lapsat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dissec pinfo->fragmented = !!(addr & LAPSAT_SI); /* Rely on caller to provide a way to group fragments */ - fragment_id = (pinfo->circuit_id << 3) | (sapi << 1) | pinfo->p2p_dir; + fragment_id = (conversation_get_endpoint_by_id(pinfo, ENDPOINT_GSMTAP, USE_LAST_ENDPOINT) << 3) | (sapi << 1) | pinfo->p2p_dir; /* Fragment reconstruction helpers */ fd_m = fragment_add_seq_next( diff --git a/epan/dissectors/packet-wcp.c b/epan/dissectors/packet-wcp.c index 1548cde061..9094c48900 100644 --- a/epan/dissectors/packet-wcp.c +++ b/epan/dissectors/packet-wcp.c @@ -102,7 +102,7 @@ #include <wiretap/wtap.h> #include <wsutil/pint.h> -#include <epan/circuit.h> +#include <epan/conversation.h> #include <epan/etypes.h> #include <epan/nlpid.h> #include <epan/expert.h> @@ -222,8 +222,8 @@ static const value_string ext_cmd_string[] = { -static tvbuff_t *wcp_uncompress( tvbuff_t *src_tvb, int offset, packet_info *pinfo, proto_tree *tree, circuit_type ctype, guint32 circuit_id); -static wcp_window_t *get_wcp_window_ptr(packet_info *pinfo, circuit_type ctype, guint32 circuit_id); +static tvbuff_t *wcp_uncompress( tvbuff_t *src_tvb, int offset, packet_info *pinfo, proto_tree *tree); +static wcp_window_t *get_wcp_window_ptr(packet_info *pinfo); static void dissect_wcp_con_req(tvbuff_t *tvb, int offset, proto_tree *tree) { @@ -278,14 +278,14 @@ dissect_wcp_reset( tvbuff_t *tvb, int offset, proto_tree *tree){ } -static void wcp_save_data( tvbuff_t *tvb, packet_info *pinfo, circuit_type ctype, guint32 circuit_id){ +static void wcp_save_data( tvbuff_t *tvb, packet_info *pinfo) { wcp_window_t *buf_ptr = 0; size_t len; /* discard first 2 bytes, header and last byte (check byte) */ len = tvb_reported_length( tvb)-3; - buf_ptr = get_wcp_window_ptr(pinfo, ctype, circuit_id); + buf_ptr = get_wcp_window_ptr(pinfo); if (( buf_ptr->buf_cur + len) <= (buf_ptr->buffer + MAX_WIN_BUF_LEN)){ tvb_memcpy( tvb, buf_ptr->buf_cur, 2, len); @@ -368,13 +368,13 @@ static int dissect_wcp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi if ( cmd == 1) { /* uncompressed data */ if ( !pinfo->fd->flags.visited){ /* if first pass */ - wcp_save_data( tvb, pinfo, pinfo->ctype, pinfo->circuit_id); + wcp_save_data( tvb, pinfo); } next_tvb = tvb_new_subset_remaining(tvb, wcp_header_len); } else { /* cmd == 0 || (cmd == 0xf && ext_cmd == 0) */ - next_tvb = wcp_uncompress( tvb, wcp_header_len, pinfo, wcp_tree, pinfo->ctype, pinfo->circuit_id); + next_tvb = wcp_uncompress( tvb, wcp_header_len, pinfo, wcp_tree); if ( !next_tvb){ return tvb_captured_length(tvb); @@ -427,29 +427,25 @@ decompressed_entry(guint8 *dst, guint16 data_offset, static -wcp_window_t *get_wcp_window_ptr(packet_info *pinfo, circuit_type ctype, guint32 circuit_id){ +wcp_window_t *get_wcp_window_ptr(packet_info *pinfo){ /* find the circuit for this DLCI, create one if needed */ /* and return the wcp_window data structure pointer */ /* for the direction of this packet */ - circuit_t *circuit; + conversation_t *conv; wcp_circuit_data_t *wcp_circuit_data; - circuit = find_circuit( ctype, circuit_id, - pinfo->num); - if ( !circuit){ - circuit = circuit_new( ctype, circuit_id, - pinfo->num); - } - wcp_circuit_data = (wcp_circuit_data_t *)circuit_get_proto_data(circuit, proto_wcp); + conv = find_or_create_conversation(pinfo); + + wcp_circuit_data = (wcp_circuit_data_t *)conversation_get_proto_data(conv, proto_wcp); if ( !wcp_circuit_data){ wcp_circuit_data = wmem_new(wmem_file_scope(), wcp_circuit_data_t); wcp_circuit_data->recv.buf_cur = wcp_circuit_data->recv.buffer; wcp_circuit_data->recv.initialized = 0; wcp_circuit_data->send.buf_cur = wcp_circuit_data->send.buffer; wcp_circuit_data->send.initialized = 0; - circuit_add_proto_data(circuit, proto_wcp, wcp_circuit_data); + conversation_add_proto_data(conv, proto_wcp, wcp_circuit_data); } if (pinfo->pseudo_header->x25.flags & FROM_DCE) return &wcp_circuit_data->recv; @@ -458,7 +454,7 @@ wcp_window_t *get_wcp_window_ptr(packet_info *pinfo, circuit_type ctype, guint32 } -static tvbuff_t *wcp_uncompress( tvbuff_t *src_tvb, int offset, packet_info *pinfo, proto_tree *tree, circuit_type ctype, guint32 circuit_id) { +static tvbuff_t *wcp_uncompress( tvbuff_t *src_tvb, int offset, packet_info *pinfo, proto_tree *tree) { /* do the packet data uncompression and load it into the dst buffer */ @@ -475,7 +471,7 @@ static tvbuff_t *wcp_uncompress( tvbuff_t *src_tvb, int offset, packet_info *pin wcp_window_t *buf_ptr = 0; wcp_pdata_t *pdata_ptr; - buf_ptr = get_wcp_window_ptr(pinfo, ctype, circuit_id); + buf_ptr = get_wcp_window_ptr(pinfo); buf_start = buf_ptr->buffer; buf_end = buf_start + MAX_WIN_BUF_LEN; diff --git a/epan/dissectors/packet-x25.c b/epan/dissectors/packet-x25.c index b30ac71670..54db217d8e 100644 --- a/epan/dissectors/packet-x25.c +++ b/epan/dissectors/packet-x25.c @@ -27,7 +27,7 @@ #include <epan/packet.h> #include <epan/ax25_pids.h> #include <epan/llcsaps.h> -#include <epan/circuit.h> +#include <epan/conversation.h> #include <epan/reassemble.h> #include <epan/prefs.h> #include <epan/expert.h> @@ -542,45 +542,45 @@ static heur_dissector_list_t x25_heur_subdissector_list; static void x25_hash_add_proto_start(guint16 vc, guint32 frame, dissector_handle_t dissect) { - circuit_t *circuit; + conversation_t *conv; /* * Is there already a circuit with this VC number? */ - circuit = find_circuit(CT_X25, vc, frame); - if (circuit != NULL) { + conv = find_conversation_by_id(frame, ENDPOINT_X25, vc, 0); + if (conv != NULL) { /* * Yes - close it, as we're creating a new one. */ - close_circuit(circuit, frame - 1); + conv->last_frame = frame - 1; } /* * Set up a new circuit. */ - circuit = circuit_new(CT_X25, vc, frame); + conv = conversation_new_by_id(frame, ENDPOINT_X25, vc, 0); /* * Set its dissector. */ - circuit_set_dissector(circuit, dissect); + conversation_set_dissector(conv, dissect); } static void x25_hash_add_proto_end(guint16 vc, guint32 frame) { - circuit_t *circuit; + conversation_t *conv; /* * Try to find the circuit. */ - circuit = find_circuit(CT_X25, vc, frame); + conv = find_conversation_by_id(frame, ENDPOINT_X25, vc, 0); /* * If we succeeded, close it. */ - if (circuit != NULL) - close_circuit(circuit, frame); + if (conv != NULL) + conv->last_frame = frame; } static const range_string clear_code_rvals[] = { @@ -1241,8 +1241,7 @@ dissect_x25_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, modulo = ((bytes0_1 & 0x2000) ? 128 : 8); vc = (int)(bytes0_1 & 0x0FFF); - pinfo->ctype = CT_X25; - pinfo->circuit_id = vc; + conversation_create_endpoint_by_id(pinfo, ENDPOINT_X25, vc, 0); if (bytes0_1 & X25_ABIT) toa = TRUE; else toa = FALSE; @@ -1936,7 +1935,7 @@ dissect_x25_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, next_tvb = tvb_new_subset_remaining(tvb, localoffset); /* See if there's already a dissector for this circuit. */ - if (try_circuit_dissector(CT_X25, vc, pinfo->num, next_tvb, pinfo, + if (try_conversation_dissector_by_id(ENDPOINT_X25, vc, next_tvb, pinfo, tree, &q_bit_set)) { return; /* found it and dissected it */ } |