diff options
author | Michael Mann <mmann78@netscape.net> | 2017-11-11 17:16:13 -0500 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2017-11-13 05:21:36 +0000 |
commit | 800b26edbe34e135cc9be1d4395db2c13ae1213f (patch) | |
tree | fae0a8da631334bde17966a4e7a6a5c0f4491f71 /epan/dissectors/packet-x25.c | |
parent | 7c40580584eac67a23633e58810028dddc58781c (diff) |
Remove circuit API
Replace with conversation API that limits the "endpoint" to a single
uint32 value.
The intention is to eventually have "layered" endpoints, because circuit_id
was used in cases where src/dest port have already been populated (and
are used for layers above). Those src/dest ports should just be treated
as just another endpoint, but we currently only have support for one.
Change-Id: Ic6aa7ef0241275aa4dfde9459194369b48c72960
Reviewed-on: https://code.wireshark.org/review/24369
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-x25.c')
-rw-r--r-- | epan/dissectors/packet-x25.c | 27 |
1 files changed, 13 insertions, 14 deletions
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 */ } |