Ethereal-dev: Re: [Ethereal-dev] ASN2ETH for Remote operation Notation, generic functional pro
Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.
From: Tomas Kukosa <tomas.kukosa@xxxxxxxxxxx>
Date: Tue, 10 Jan 2006 08:01:31 +0100
Hi,I am investigating asn2eth changes now. I will implement it in a little bit different way (so as not to use type table for operations) but the output will be the same.
Concerning other code I would recomment to create packet-q932 dissector and put Facility IE dissection in it. The patch does not implement NetworkFacilityExtension, NetworkProtocolProfile and InterpretationComponent in Facility IE or I can not see it. I have a little bit different Facility IE implementation (see attached file) and we could combine those two implementation to have the best one.
Regards, Tomas Anders Broman (AL/EAB) wrote:
Hi, Tomas did you have a chance to look at this ? http://www.ethereal.com/lists/ethereal-dev/200512/msg00009.html Brg Anders ------------------------------------------------------------------------ _______________________________________________ Ethereal-dev mailing list Ethereal-dev@xxxxxxxxxxxx http://www.ethereal.com/mailman/listinfo/ethereal-dev
#include "packet_common.h" #include "packet-ber.h" #include "packet-rose.h" #include "packet-q932.h" #define PNAME "Q.932" #define PSNAME "Q932" #define PFNAME "q932" /* Initialize the protocol and registered fields */ int proto_q932 = -1; static int hf_q932_ie_type = -1; static int hf_q932_ie_len = -1; static int hf_q932_ie_data = -1; static int hf_q932_pp = -1; /*static int hf_q932_NetworkFacilityExtension = -1; static int hf_q932_NetworkProtocolProfile = -1; static int hf_q932_InterpretationComponent = -1;*/ #include "packet-q932ade-hf.c" #include "packet-q932nfe-hf.c" #include "packet-q932npp-hf.c" #include "packet-q932ic-hf.c" /* Initialize the subtree pointers */ static gint ett_q932 = -1; static gint ett_q932_ie = -1; #include "packet-q932ade-ett.c" #include "packet-q932nfe-ett.c" /*#include "packet-q932npp-ett.c"*/ /*#include "packet-q932ic-ett.c"*/ /* Preferences */ /* ROSE context */ static rose_context q932_rose_ctx; /* Subdissectors */ static dissector_handle_t data_handle = NULL; /* Gloabl variables */ #define Q932_IE_EXTENDED_FACILITY 0x0D #define Q932_IE_FACILITY 0x1C #define Q932_IE_INFORMATION_REQUEST 0x32 #define Q932_IE_FEATURE_ACTIVATION 0x38 #define Q932_IE_FEATURE_INDICATION 0x39 #define Q932_IE_SERVICE_PROFILE_ID 0x3A #define Q932_IE_ENDPOINT_IDENTIFIER 0x3B static const value_string q932_str_ie_type[] = { { Q932_IE_EXTENDED_FACILITY , "Extended facility" }, { Q932_IE_FACILITY , "Facility" }, { Q932_IE_INFORMATION_REQUEST, "Information request" }, { Q932_IE_FEATURE_ACTIVATION , "Feature activation" }, { Q932_IE_FEATURE_INDICATION , "Feature indication" }, { Q932_IE_SERVICE_PROFILE_ID , "Service profile identification" }, { Q932_IE_ENDPOINT_IDENTIFIER, "Endpoint identifier" }, { 0, NULL} }; static const value_string str_pp[] = { { 0x11 , "Remote Operations Protocol" }, { 0x12 , "CMIP Protocol" }, { 0x13 , "ACSE Protocol" }, { 0x1F , "Networking extensions" }, { 0, NULL} }; #include "packet-q932ade-exp.h" /*#include "packet-q932nfe-exp.h"*/ /*#include "packet-q932npp-exp.h"*/ /*#include "packet-q932ic-exp.h"*/ #include "packet-q932ade-fn.c" #include "packet-q932nfe-fn.c" #include "packet-q932npp-fn.c" #include "packet-q932ic-fn.c" /*--- dissect_q932_facility_ie -------------------------------------------------------*/ /*static*/ void dissect_q932_facility_ie(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int length) { guint8 class; gboolean pc; guint32 tag; guint32 len; int hoffset, eoffset; int ie_end; tvbuff_t *next_tvb; ie_end = offset + length; proto_tree_add_item(tree, hf_q932_pp, tvb, offset, 1, FALSE); offset++; while (offset < ie_end) { hoffset = offset; offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len, NULL); eoffset = offset + len; switch (class) { case BER_CLASS_CON: switch (tag) { case 10 : /* Network Facility Extension */ offset = dissect_ber_identifier(pinfo, tree, tvb, hoffset, NULL, NULL, NULL); offset = dissect_ber_length(pinfo, tree, tvb, offset, NULL, NULL); next_tvb = tvb_new_subset(tvb, offset, len, len); dissect_NetworkFacilityExtension_PDU(next_tvb, pinfo, tree); /*dissect_q932_NetworkFacilityExtension(TRUE, tvb, hoffset, pinfo, tree, hf_q932_NetworkFacilityExtension);*/ break; case 18 : /* Network Protocol Profile */ offset = dissect_ber_identifier(pinfo, tree, tvb, hoffset, NULL, NULL, NULL); offset = dissect_ber_length(pinfo, tree, tvb, offset, NULL, NULL); next_tvb = tvb_new_subset(tvb, offset, len, len); dissect_NetworkProtocolProfile_PDU(next_tvb, pinfo, tree); /*dissect_q932_NetworkProtocolProfile(TRUE, tvb, hoffset, pinfo, tree, hf_q932_NetworkProtocolProfile);*/ break; case 11 : /* Interpretation Component */ offset = dissect_ber_identifier(pinfo, tree, tvb, hoffset, NULL, NULL, NULL); offset = dissect_ber_length(pinfo, tree, tvb, offset, NULL, NULL); next_tvb = tvb_new_subset(tvb, offset, len, len); dissect_InterpretationComponent_PDU(next_tvb, pinfo, tree); /*dissect_q932_InterpretationComponent(TRUE, tvb, hoffset, pinfo, tree, hf_q932_InterpretationComponent);*/ break; /* ROSE APDU */ case 1 : /* invoke */ case 2 : /* returnResult */ case 3 : /* returnError */ case 4 : /* reject */ q932_rose_ctx.apdu_depth = 1; next_tvb = tvb_new_subset(tvb, hoffset, len + (offset - hoffset), len + (offset - hoffset)); dissect_rose_apdu(next_tvb, hoffset, pinfo, tree, &q932_rose_ctx); break; /* DSE APDU */ case 12 : /* begin */ case 14 : /* end */ case 15 : /* continue */ case 17 : /* abort */ offset = dissect_ber_identifier(pinfo, tree, tvb, hoffset, NULL, NULL, NULL); offset = dissect_ber_length(pinfo, tree, tvb, offset, NULL, NULL); proto_tree_add_text(tree, tvb, offset, len, "DSE APDU (not supported)"); break; default: offset = dissect_ber_identifier(pinfo, tree, tvb, hoffset, NULL, NULL, NULL); offset = dissect_ber_length(pinfo, tree, tvb, offset, NULL, NULL); proto_tree_add_text(tree, tvb, offset, len, "Unknown Component"); } break; case BER_CLASS_APP: switch (tag) { /* ACSE APDU */ case 0 : /* aarq */ case 1 : /* aare */ case 2 : /* rlrq */ case 3 : /* rlre */ case 4 : /* abrt */ offset = dissect_ber_identifier(pinfo, tree, tvb, hoffset, NULL, NULL, NULL); offset = dissect_ber_length(pinfo, tree, tvb, offset, NULL, NULL); proto_tree_add_text(tree, tvb, offset, len, "ACSE APDU (not supported)"); break; default: offset = dissect_ber_identifier(pinfo, tree, tvb, hoffset, NULL, NULL, NULL); offset = dissect_ber_length(pinfo, tree, tvb, offset, NULL, NULL); proto_tree_add_text(tree, tvb, offset, len, "Unknown Component"); } break; default: offset = dissect_ber_identifier(pinfo, tree, tvb, hoffset, NULL, NULL, NULL); offset = dissect_ber_length(pinfo, tree, tvb, offset, NULL, NULL); proto_tree_add_text(tree, tvb, offset, len, "Unknown Component"); } offset = eoffset; } } /*--- dissect_q932_ie -------------------------------------------------------*/ static void dissect_q932_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { gint offset; proto_item *ti, *ti_ie; proto_tree *ie_tree; guint8 ie_type, ie_len; offset = 0; ti = proto_tree_add_item_hidden(tree, proto_q932, tvb, offset, -1, FALSE); ie_type = tvb_get_guint8(tvb, offset); ie_len = tvb_get_guint8(tvb, offset + 1); ti_ie = proto_tree_add_text(tree, tvb, offset, -1, "%s", val_to_str(ie_type, VALS(q932_str_ie_type), "unknown (0x%02X)")); ie_tree = proto_item_add_subtree(ti_ie, ett_q932_ie); proto_tree_add_item(ie_tree, hf_q932_ie_type, tvb, offset, 1, FALSE); proto_tree_add_item(ie_tree, hf_q932_ie_len, tvb, offset + 1, 1, FALSE); offset += 2; if (tvb_length_remaining(tvb, offset) <= 0) return; switch (ie_type) { case Q932_IE_FACILITY : dissect_q932_facility_ie(tvb, offset, pinfo, ie_tree, ie_len); break; default: if (ie_len > 0) { if (tree) proto_tree_add_item(ie_tree, hf_q932_ie_data, tvb, offset, ie_len, FALSE); } } } /*--- dissect_q932_apdu -----------------------------------------------------*/ static void dissect_q932_apdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { dissect_rose_apdu(tvb, 0, pinfo, tree, pinfo->private_data); } /*--- proto_register_q932 ---------------------------------------------------*/ void proto_register_q932(void) { /* List of fields */ static hf_register_info hf[] = { { &hf_q932_ie_type, { "Type", "q932.ie.type", FT_UINT8, BASE_HEX, VALS(q932_str_ie_type), 0x0, "Information Element Type", HFILL }}, { &hf_q932_ie_len, { "Length", "q932.ie.len", FT_UINT8, BASE_DEC, NULL, 0x0, "Information Element Length", HFILL }}, { &hf_q932_ie_data, { "Data", "q932.ie.data", FT_BYTES, BASE_HEX, NULL, 0x0, "Data", HFILL }}, { &hf_q932_pp, { "Protocol profile", "q932.pp", FT_UINT8, BASE_HEX, VALS(str_pp), 0x1F, "Protocol profile", HFILL }}, /* { &hf_q932_NetworkFacilityExtension, { "NetworkFacilityExtension", "q932.NetworkFacilityExtension", FT_NONE, BASE_NONE, NULL, 0, "NetworkFacilityExtension", HFILL }}, { &hf_q932_NetworkProtocolProfile, { "NetworkProtocolProfile", "q932.NetworkProtocolProfile", FT_UINT32, BASE_DEC, VALS(q932_NetworkProtocolProfile_vals), 0, "NetworkProtocolProfile", HFILL }}, { &hf_q932_InterpretationComponent, { "InterpretationComponent", "q932.InterpretationComponent", FT_UINT32, BASE_DEC, VALS(q932_InterpretationComponent_vals), 0, "InterpretationComponent", HFILL }}, */ #include "packet-q932ade-hfarr.c" #include "packet-q932nfe-hfarr.c" #include "packet-q932npp-hfarr.c" #include "packet-q932ic-hfarr.c" }; /* List of subtrees */ static gint *ett[] = { &ett_q932, &ett_q932_ie, #include "packet-q932ade-ettarr.c" #include "packet-q932nfe-ettarr.c" /*#include "packet-q932npp-ettarr.c"*/ /*#include "packet-q932ic-ettarr.c"*/ }; /* Register protocol and dissector */ proto_q932 = proto_register_protocol(PNAME, PSNAME, PFNAME); register_dissector("q932.apdu", dissect_q932_apdu, proto_q932); /* Register fields and subtrees */ proto_register_field_array(proto_q932, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); /* Register dissector tables */ q932_rose_ctx.arg_global_dissector_table = register_dissector_table("q932.ros.global.arg", "Q.932 Operation Argument (global opcode)", FT_STRING, BASE_NONE); q932_rose_ctx.res_global_dissector_table = register_dissector_table("q932.ros.global.res", "Q.932 Operation Result (global opcode)", FT_STRING, BASE_NONE); q932_rose_ctx.arg_local_dissector_table = register_dissector_table("q932.ros.local.arg", "Q.932 Operation Argument (local opcode)", FT_UINT32, BASE_HEX); q932_rose_ctx.res_local_dissector_table = register_dissector_table("q932.ros.local.res", "Q.932 Operation Result (local opcode)", FT_UINT32, BASE_HEX); } /*--- proto_reg_handoff_q932 ------------------------------------------------*/ void proto_reg_handoff_q932(void) { dissector_handle_t q932_ie_handle; q932_ie_handle = create_dissector_handle(dissect_q932_ie, proto_q932); /* Facility */ dissector_add("q931.ie", (0x00 << 8) | Q932_IE_FACILITY, q932_ie_handle); data_handle = find_dissector("data"); } /*---------------------------------------------------------------------------*/
- References:
- [Ethereal-dev] ASN2ETH for Remote operation Notation, generic functional protocol and some ETSI ISDN features
- From: Anders Broman (AL/EAB)
- [Ethereal-dev] ASN2ETH for Remote operation Notation, generic functional protocol and some ETSI ISDN features
- Prev by Date: [Ethereal-dev] buildbot failure in Windows-2003-IA32
- Next by Date: [Ethereal-dev] Deprecated features
- Previous by thread: [Ethereal-dev] ASN2ETH for Remote operation Notation, generic functional protocol and some ETSI ISDN features
- Next by thread: Re: SV: SV: SV: [Ethereal-dev] Ethereal fails to correctlyadddiametervendors from the dictionary xml files [PATCH]
- Index(es):