From 08468754f7ac91a34f2da925e5de0c2ac631849f Mon Sep 17 00:00:00 2001 From: Anders Broman Date: Thu, 8 Dec 2005 06:43:01 +0000 Subject: Commit the actual diissectors: Log: From Grame Lunt: updated X.500 dissectors to include DOP support. The "dop" dissector is the renamed "x501" dissector consequently the asn/x501 directory should be removed. The patch includes the changes to epan/dissectors/Makefile.common to reflect this. As the DOP dissection is not fully tested, I have disabled it by default for now (like DSP) but it can be enabled by the user. svn path=/trunk/; revision=16727 --- epan/dissectors/Makefile.common | 4 +- epan/dissectors/packet-dap.c | 80 +++++-- epan/dissectors/packet-dap.h | 7 +- epan/dissectors/packet-disp.c | 108 +++++++-- epan/dissectors/packet-disp.h | 3 +- epan/dissectors/packet-dsp.c | 35 +-- epan/dissectors/packet-dsp.h | 8 +- epan/dissectors/packet-x501.c | 470 ---------------------------------------- epan/dissectors/packet-x501.h | 45 ---- 9 files changed, 184 insertions(+), 576 deletions(-) delete mode 100644 epan/dissectors/packet-x501.c delete mode 100644 epan/dissectors/packet-x501.h (limited to 'epan') diff --git a/epan/dissectors/Makefile.common b/epan/dissectors/Makefile.common index aeec387053..c3fe1f7332 100644 --- a/epan/dissectors/Makefile.common +++ b/epan/dissectors/Makefile.common @@ -255,6 +255,7 @@ DISSECTOR_SRC = \ packet-dlsw.c \ packet-dnp.c \ packet-dns.c \ + packet-dop.c \ packet-dsi.c \ packet-dsp.c \ packet-dtp.c \ @@ -634,7 +635,6 @@ DISSECTOR_SRC = \ packet-x29.c \ packet-x411.c \ packet-x420.c \ - packet-x501.c \ packet-x509af.c \ packet-x509ce.c \ packet-x509if.c \ @@ -724,6 +724,7 @@ DISSECTOR_INCLUDES = \ packet-dis-fields.h \ packet-dis-pdus.h \ packet-dns.h \ + packet-dop.h \ packet-dsp.h \ packet-dvmrp.h \ packet-e164.h \ @@ -899,7 +900,6 @@ DISSECTOR_INCLUDES = \ packet-x11-keysymdef.h \ packet-x411.h \ packet-x420.h \ - packet-x501.h \ packet-x509af.h \ packet-x509ce.h \ packet-x509if.h \ diff --git a/epan/dissectors/packet-dap.c b/epan/dissectors/packet-dap.c index 10319c50ef..f08af813c1 100644 --- a/epan/dissectors/packet-dap.c +++ b/epan/dissectors/packet-dap.c @@ -1,10 +1,11 @@ /* Do not modify this file. */ /* It is created automatically by the ASN.1 to Ethereal dissector compiler */ -/* ./packet-dap.c */ +/* .\packet-dap.c */ /* ../../tools/asn2eth.py -X -b -e -p dap -c dap.cnf -s packet-dap-template dap.asn */ /* Input file: packet-dap-template.c */ +#line 1 "packet-dap-template.c" /* packet-dap.c * Routines for X.511 (X.500 Directory Asbtract Service) and X.519 DAP packet dissection * Graeme Lunt 2005 @@ -55,7 +56,6 @@ #include "packet-dap.h" #include - /* we don't have a separate dissector for X519 - most of DAP is defined in X511 */ #define PNAME "X.519 Directory Access Protocol" @@ -75,7 +75,7 @@ static struct SESSION_DATA_STRUCTURE* session = NULL; /*--- Included file: packet-dap-hf.c ---*/ - +#line 1 "packet-dap-hf.c" static int hf_dap_securityParameters = -1; /* SecurityParameters */ static int hf_dap_performer = -1; /* DistinguishedName */ static int hf_dap_aliasDereferenced = -1; /* BOOLEAN */ @@ -439,13 +439,13 @@ static int hf_dap_SearchControlOptions_separateFamilyMembers = -1; static int hf_dap_SearchControlOptions_searchFamily = -1; /*--- End of included file: packet-dap-hf.c ---*/ - +#line 69 "packet-dap-template.c" /* Initialize the subtree pointers */ static gint ett_dap = -1; /*--- Included file: packet-dap-ett.c ---*/ - +#line 1 "packet-dap-ett.c" static gint ett_dap_CommonResults = -1; static gint ett_dap_SEQUENCE_OF_Attribute = -1; static gint ett_dap_ServiceControls = -1; @@ -616,11 +616,11 @@ static gint ett_dap_OperationalBindingID = -1; static gint ett_dap_DirectoryString = -1; /*--- End of included file: packet-dap-ett.c ---*/ - +#line 73 "packet-dap-template.c" /*--- Included file: packet-dap-fn.c ---*/ - +#line 1 "packet-dap-fn.c" /*--- Cyclic dependencies ---*/ /* FamilyEntries -> FamilyEntries/familyEntries -> FamilyEntry -> FamilyEntry/family-info -> FamilyEntries */ @@ -1159,6 +1159,7 @@ static int dissect_priority(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, static int dissect_dap_INTEGER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +#line 168 "dap.cnf" guint32 value; offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, @@ -1174,6 +1175,7 @@ dissect_dap_INTEGER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet } + return offset; } static int dissect_timeLimit(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { @@ -1242,6 +1244,7 @@ static const ber_choice_t Name_choice[] = { static int dissect_dap_Name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +#line 269 "dap.cnf" const char *dn; offset = dissect_ber_choice(pinfo, tree, tvb, offset, @@ -1255,6 +1258,7 @@ dissect_dap_Name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_in } + return offset; } static int dissect_dsaName(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { @@ -1860,11 +1864,13 @@ dissect_dap_FamilyEntries(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, static int dissect_dap_T_initial(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +#line 113 "dap.cnf" proto_item *it; it = proto_tree_add_item(tree, hf_index, tvb, offset, -1, FALSE); proto_item_append_text(it," XXX: Not yet implemented!"); + return offset; } static int dissect_initial(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { @@ -1875,9 +1881,11 @@ static int dissect_initial(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, static int dissect_dap_T_any(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +#line 118 "dap.cnf" /* XXX: not yet implemented */ + return offset; } static int dissect_any(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { @@ -1888,9 +1896,11 @@ static int dissect_any(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int static int dissect_dap_T_final(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +#line 121 "dap.cnf" /* XXX: not yet implemented */ + return offset; } static int dissect_final(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { @@ -1980,9 +1990,11 @@ static int dissect_matchingRule(packet_info *pinfo, proto_tree *tree, tvbuff_t * static int dissect_dap_T_matchValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +#line 124 "dap.cnf" /* XXX: not yet implemented */ + return offset; } static int dissect_matchValue(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { @@ -2149,6 +2161,7 @@ static int dissect_newRequest(packet_info *pinfo, proto_tree *tree, tvbuff_t *tv static int dissect_dap_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +#line 184 "dap.cnf" tvbuff_t *out_tvb; int i; int len; @@ -2175,6 +2188,7 @@ dissect_dap_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, p } + return offset; } static int dissect_queryReference(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { @@ -2336,6 +2350,7 @@ static const ber_sequence_t SimpleCredentials_sequence[] = { static int dissect_dap_SimpleCredentials(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +#line 158 "dap.cnf" offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, SimpleCredentials_sequence, hf_index, ett_dap_SimpleCredentials); @@ -2345,6 +2360,7 @@ dissect_dap_SimpleCredentials(gboolean implicit_tag _U_, tvbuff_t *tvb, int offs col_append_fstr(pinfo->cinfo, COL_INFO, " %s", x509if_get_last_dn()); + return offset; } static int dissect_simple(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { @@ -2355,9 +2371,11 @@ static int dissect_simple(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, i static int dissect_dap_T_bind_token(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +#line 127 "dap.cnf" /* XXX: not yet implemented */ + return offset; } static int dissect_bind_token(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { @@ -2388,9 +2406,11 @@ static int dissect_strong(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, i static int dissect_dap_T_req(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +#line 130 "dap.cnf" /* XXX: not yet implemented */ + return offset; } static int dissect_req(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { @@ -2401,9 +2421,11 @@ static int dissect_req(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int static int dissect_dap_T_rep(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +#line 133 "dap.cnf" /* XXX: not yet implemented */ + return offset; } static int dissect_rep(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { @@ -2492,6 +2514,7 @@ static const ber_sequence_t DirectoryBindArgument_set[] = { int dissect_dap_DirectoryBindArgument(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +#line 139 "dap.cnf" guint32 len; @@ -2513,6 +2536,7 @@ dissect_dap_DirectoryBindArgument(gboolean implicit_tag _U_, tvbuff_t *tvb, int + return offset; } @@ -2549,6 +2573,7 @@ static const value_string dap_ServiceProblem_vals[] = { static int dissect_dap_ServiceProblem(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +#line 223 "dap.cnf" guint32 problem; offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, @@ -2560,6 +2585,7 @@ dissect_dap_ServiceProblem(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, } + return offset; } static int dissect_serviceProblem(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { @@ -2586,6 +2612,7 @@ static const value_string dap_SecurityProblem_vals[] = { static int dissect_dap_SecurityProblem(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +#line 211 "dap.cnf" guint32 problem; offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, @@ -2597,6 +2624,7 @@ dissect_dap_SecurityProblem(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset } + return offset; } static int dissect_securityProblem(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { @@ -3327,6 +3355,7 @@ static const value_string dap_LimitProblem_vals[] = { static int dissect_dap_LimitProblem(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +#line 247 "dap.cnf" guint32 problem; offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, @@ -3338,6 +3367,7 @@ dissect_dap_LimitProblem(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, p } + return offset; } static int dissect_limitProblem(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { @@ -3541,6 +3571,7 @@ static const value_string dap_T_subset_vals[] = { static int dissect_dap_T_subset(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +#line 259 "dap.cnf" guint32 subset; offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, @@ -3553,6 +3584,7 @@ dissect_dap_T_subset(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packe + return offset; } static int dissect_subset(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { @@ -5177,9 +5209,11 @@ dissect_dap_Referral(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packe static int dissect_dap_T_spkmInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +#line 136 "dap.cnf" /* XXX: not yet implemented */ + return offset; } static int dissect_spkmInfo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { @@ -5337,6 +5371,7 @@ static const value_string dap_UpdateProblem_vals[] = { static int dissect_dap_UpdateProblem(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +#line 235 "dap.cnf" guint32 problem; offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, @@ -5348,6 +5383,7 @@ dissect_dap_UpdateProblem(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, } + return offset; } static int dissect_update_error_problem(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { @@ -5463,7 +5499,7 @@ dissect_dap_UpdateError(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, pa /*--- End of included file: packet-dap-fn.c ---*/ - +#line 75 "packet-dap-template.c" /* * Dissect DAP PDUs inside a ROS PDUs @@ -5667,7 +5703,7 @@ void proto_register_dap(void) { { /*--- Included file: packet-dap-hfarr.c ---*/ - +#line 1 "packet-dap-hfarr.c" { &hf_dap_securityParameters, { "securityParameters", "dap.securityParameters", FT_NONE, BASE_NONE, NULL, 0, @@ -5726,7 +5762,7 @@ void proto_register_dap(void) { "ServiceControls/manageDSAITPlaneRef/agreementID", HFILL }}, { &hf_dap_serviceType, { "serviceType", "dap.serviceType", - FT_STRING, BASE_NONE, NULL, 0, + FT_OID, BASE_NONE, NULL, 0, "ServiceControls/serviceType", HFILL }}, { &hf_dap_userClass, { "userClass", "dap.userClass", @@ -5818,7 +5854,7 @@ void proto_register_dap(void) { "FamilyReturn/familySelect", HFILL }}, { &hf_dap_familySelect_item, { "Item", "dap.familySelect_item", - FT_STRING, BASE_NONE, NULL, 0, + FT_OID, BASE_NONE, NULL, 0, "FamilyReturn/familySelect/_item", HFILL }}, { &hf_dap_name, { "name", "dap.name", @@ -5858,7 +5894,7 @@ void proto_register_dap(void) { "EntryInformation/derivedEntry", HFILL }}, { &hf_dap_family_class, { "family-class", "dap.family_class", - FT_STRING, BASE_NONE, NULL, 0, + FT_OID, BASE_NONE, NULL, 0, "FamilyEntries/family-class", HFILL }}, { &hf_dap_familyEntries, { "familyEntries", "dap.familyEntries", @@ -5918,7 +5954,7 @@ void proto_register_dap(void) { "FilterItem/substrings", HFILL }}, { &hf_dap_sunstringType, { "type", "dap.type", - FT_STRING, BASE_NONE, NULL, 0, + FT_OID, BASE_NONE, NULL, 0, "FilterItem/substrings/type", HFILL }}, { &hf_dap_strings, { "strings", "dap.strings", @@ -5974,7 +6010,7 @@ void proto_register_dap(void) { "MatchingRuleAssertion/matchingRule", HFILL }}, { &hf_dap_matchingRule_item, { "Item", "dap.matchingRule_item", - FT_STRING, BASE_NONE, NULL, 0, + FT_OID, BASE_NONE, NULL, 0, "MatchingRuleAssertion/matchingRule/_item", HFILL }}, { &hf_dap_matchValue, { "matchValue", "dap.matchValue", @@ -6014,7 +6050,7 @@ void proto_register_dap(void) { "", HFILL }}, { &hf_dap_orderingRule, { "orderingRule", "dap.orderingRule", - FT_STRING, BASE_NONE, NULL, 0, + FT_OID, BASE_NONE, NULL, 0, "SortKey/orderingRule", HFILL }}, { &hf_dap_certification_path, { "certification-path", "dap.certification_path", @@ -6442,7 +6478,7 @@ void proto_register_dap(void) { "PartialOutcomeQualifier/unknownErrors", HFILL }}, { &hf_dap_unknownErrors_item, { "Item", "dap.unknownErrors_item", - FT_STRING, BASE_NONE, NULL, 0, + FT_OID, BASE_NONE, NULL, 0, "PartialOutcomeQualifier/unknownErrors/_item", HFILL }}, { &hf_dap_overspecFilter, { "overspecFilter", "dap.overspecFilter", @@ -6570,7 +6606,7 @@ void proto_register_dap(void) { "JoinAttPair/joinContext", HFILL }}, { &hf_dap_joinContext_item, { "Item", "dap.joinContext_item", - FT_STRING, BASE_NONE, NULL, 0, + FT_OID, BASE_NONE, NULL, 0, "JoinAttPair/joinContext/_item", HFILL }}, { &hf_dap_searchInfo, { "searchInfo", "dap.searchInfo", @@ -7110,7 +7146,7 @@ void proto_register_dap(void) { "", HFILL }}, /*--- End of included file: packet-dap-hfarr.c ---*/ - +#line 277 "packet-dap-template.c" }; /* List of subtrees */ @@ -7118,7 +7154,7 @@ void proto_register_dap(void) { &ett_dap, /*--- Included file: packet-dap-ettarr.c ---*/ - +#line 1 "packet-dap-ettarr.c" &ett_dap_CommonResults, &ett_dap_SEQUENCE_OF_Attribute, &ett_dap_ServiceControls, @@ -7289,7 +7325,7 @@ void proto_register_dap(void) { &ett_dap_DirectoryString, /*--- End of included file: packet-dap-ettarr.c ---*/ - +#line 283 "packet-dap-template.c" }; module_t *dap_module; @@ -7303,7 +7339,11 @@ void proto_register_dap(void) { /* Register our configuration options for DAP, particularly our port */ +#ifdef PREFERENCE_GROUPING + dap_module = prefs_register_protocol_subtree("OSI/X.500", proto_dap, prefs_register_dap); +#else dap_module = prefs_register_protocol(proto_dap, prefs_register_dap); +#endif prefs_register_uint_preference(dap_module, "tcp.port", "DAP TCP Port", "Set the port for DAP operations (if other" diff --git a/epan/dissectors/packet-dap.h b/epan/dissectors/packet-dap.h index 1a311f276a..d9d5b59dad 100644 --- a/epan/dissectors/packet-dap.h +++ b/epan/dissectors/packet-dap.h @@ -1,10 +1,11 @@ /* Do not modify this file. */ /* It is created automatically by the ASN.1 to Ethereal dissector compiler */ -/* ./packet-dap.h */ +/* .\packet-dap.h */ /* ../../tools/asn2eth.py -X -b -e -p dap -c dap.cnf -s packet-dap-template dap.asn */ /* Input file: packet-dap-template.h */ +#line 1 "packet-dap-template.h" /* packet-dap.h * Routines for X.511 (X.500 Directory Access Protocol) packet dissection * Graeme Lunt 2005 @@ -35,7 +36,7 @@ /*--- Included file: packet-dap-exp.h ---*/ - +#line 1 "packet-dap-exp.h" extern const value_string dap_ContextSelection_vals[]; extern const value_string dap_DirectoryBindError_vals[]; extern const value_string dap_ReadArgument_vals[]; @@ -99,6 +100,6 @@ int dissect_dap_UpdateError(gboolean implicit_tag, tvbuff_t *tvb, int offset, pa int dissect_dap_OperationalBindingID(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); /*--- End of included file: packet-dap-exp.h ---*/ - +#line 30 "packet-dap-template.h" #endif /* PACKET_DAP_H */ diff --git a/epan/dissectors/packet-disp.c b/epan/dissectors/packet-disp.c index d0f1649413..4f55192ceb 100644 --- a/epan/dissectors/packet-disp.c +++ b/epan/dissectors/packet-disp.c @@ -1,10 +1,11 @@ /* Do not modify this file. */ /* It is created automatically by the ASN.1 to Ethereal dissector compiler */ -/* ./packet-disp.c */ +/* .\packet-disp.c */ /* ../../tools/asn2eth.py -X -b -e -p disp -c disp.cnf -s packet-disp-template disp.asn */ /* Input file: packet-disp-template.c */ +#line 1 "packet-disp-template.c" /* packet-disp.c * Routines for X.525 (X.500 Directory Shadow Asbtract Service) and X.519 DISP packet dissection * Graeme Lunt 2005 @@ -52,7 +53,7 @@ #include "packet-x509sat.h" #include "packet-crmf.h" -#include "packet-x501.h" +#include "packet-dop.h" #include "packet-dap.h" #include "packet-dsp.h" #include "packet-disp.h" @@ -78,7 +79,10 @@ static struct SESSION_DATA_STRUCTURE* session = NULL; /*--- Included file: packet-disp-hf.c ---*/ - +#line 1 "packet-disp-hf.c" +static int hf_disp_EstablishParameter_PDU = -1; /* EstablishParameter */ +static int hf_disp_ModificationParameter_PDU = -1; /* ModificationParameter */ +static int hf_disp_ShadowingAgreementInfo_PDU = -1; /* ShadowingAgreementInfo */ static int hf_disp_modifiedSecondaryShadows = -1; /* SET_OF_SupplierAndConsumers */ static int hf_disp_secondaryShadows_item = -1; /* SupplierAndConsumers */ static int hf_disp_shadowSubject = -1; /* UnitOfReplication */ @@ -185,13 +189,13 @@ static int hf_disp_signedShadowError = -1; /* T_signedShadowError */ static int hf_disp_shadowError = -1; /* ShadowErrorData */ /*--- End of included file: packet-disp-hf.c ---*/ - +#line 73 "packet-disp-template.c" /* Initialize the subtree pointers */ static gint ett_disp = -1; /*--- Included file: packet-disp-ett.c ---*/ - +#line 1 "packet-disp-ett.c" static gint ett_disp_ModificationParameter = -1; static gint ett_disp_SET_OF_SupplierAndConsumers = -1; static gint ett_disp_ShadowingAgreementInfo = -1; @@ -248,11 +252,11 @@ static gint ett_disp_ShadowError = -1; static gint ett_disp_T_signedShadowError = -1; /*--- End of included file: packet-disp-ett.c ---*/ - +#line 77 "packet-disp-template.c" /*--- Included file: packet-disp-fn.c ---*/ - +#line 1 "packet-disp-fn.c" /*--- Cyclic dependencies ---*/ /* Subtree -> Subtree/subtree -> Subtree */ @@ -276,7 +280,7 @@ static int dissect_subordinate_changes(packet_info *pinfo, proto_tree *tree, tvb /*--- Fields for imported types ---*/ static int dissect_secondaryShadows_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { - return dissect_x501_SupplierAndConsumers(FALSE, tvb, offset, pinfo, tree, hf_disp_secondaryShadows_item); + return dissect_dop_SupplierAndConsumers(FALSE, tvb, offset, pinfo, tree, hf_disp_secondaryShadows_item); } static int dissect_master(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { return dissect_dsp_AccessPoint(FALSE, tvb, offset, pinfo, tree, hf_disp_master); @@ -367,6 +371,15 @@ dissect_disp_DSAShadowBindError(gboolean implicit_tag _U_, tvbuff_t *tvb, int of } + +static int +dissect_disp_EstablishParameter(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_null(implicit_tag, pinfo, tree, tvb, offset, hf_index); + + return offset; +} + + static const ber_sequence_t SET_OF_SupplierAndConsumers_set_of[1] = { { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_secondaryShadows_item }, }; @@ -846,6 +859,7 @@ static const value_string disp_StandardUpdate_vals[] = { static int dissect_disp_StandardUpdate(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +#line 73 "disp.cnf" guint32 update; offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, @@ -857,6 +871,7 @@ dissect_disp_StandardUpdate(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset } + return offset; } static int dissect_standardUpdate(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { @@ -1066,6 +1081,7 @@ static const ber_choice_t CoordinateShadowUpdateResult_choice[] = { static int dissect_disp_CoordinateShadowUpdateResult(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +#line 85 "disp.cnf" guint32 update; offset = dissect_ber_choice(pinfo, tree, tvb, offset, @@ -1078,6 +1094,7 @@ dissect_disp_CoordinateShadowUpdateResult(gboolean implicit_tag _U_, tvbuff_t *t } + return offset; } @@ -1091,6 +1108,7 @@ static const value_string disp_T_standard_vals[] = { static int dissect_disp_T_standard(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +#line 49 "disp.cnf" guint32 update; offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, @@ -1102,6 +1120,7 @@ dissect_disp_T_standard(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, pa } + return offset; } static int dissect_standard(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { @@ -1212,6 +1231,7 @@ static const ber_choice_t RequestShadowUpdateResult_choice[] = { static int dissect_disp_RequestShadowUpdateResult(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +#line 97 "disp.cnf" guint32 update; offset = dissect_ber_choice(pinfo, tree, tvb, offset, @@ -1224,6 +1244,7 @@ dissect_disp_RequestShadowUpdateResult(gboolean implicit_tag _U_, tvbuff_t *tvb, } + return offset; } @@ -1249,7 +1270,7 @@ static int dissect_updateWindow(packet_info *pinfo, proto_tree *tree, tvbuff_t * static int dissect_disp_SDSEType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { - offset = dissect_x501_DSEType(implicit_tag, tvb, offset, pinfo, tree, hf_index); + offset = dissect_dop_DSEType(implicit_tag, tvb, offset, pinfo, tree, hf_index); return offset; } @@ -1565,6 +1586,7 @@ static const ber_choice_t RefreshInformation_choice[] = { static int dissect_disp_RefreshInformation(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +#line 61 "disp.cnf" guint32 update; offset = dissect_ber_choice(pinfo, tree, tvb, offset, @@ -1577,6 +1599,7 @@ dissect_disp_RefreshInformation(gboolean implicit_tag _U_, tvbuff_t *tvb, int of } + return offset; } static int dissect_updatedInfo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { @@ -1663,6 +1686,7 @@ static const ber_choice_t UpdateShadowResult_choice[] = { static int dissect_disp_UpdateShadowResult(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +#line 109 "disp.cnf" guint32 update; offset = dissect_ber_choice(pinfo, tree, tvb, offset, @@ -1675,6 +1699,7 @@ dissect_disp_UpdateShadowResult(gboolean implicit_tag _U_, tvbuff_t *tvb, int of } + return offset; } @@ -1697,6 +1722,7 @@ static const value_string disp_ShadowProblem_vals[] = { static int dissect_disp_ShadowProblem(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +#line 121 "disp.cnf" guint32 problem; offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, @@ -1708,6 +1734,7 @@ dissect_disp_ShadowProblem(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, } + return offset; } static int dissect_problem(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { @@ -1781,9 +1808,21 @@ dissect_disp_ShadowError(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, p return offset; } +/*--- PDUs ---*/ + +static void dissect_EstablishParameter_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { + dissect_disp_EstablishParameter(FALSE, tvb, 0, pinfo, tree, hf_disp_EstablishParameter_PDU); +} +static void dissect_ModificationParameter_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { + dissect_disp_ModificationParameter(FALSE, tvb, 0, pinfo, tree, hf_disp_ModificationParameter_PDU); +} +static void dissect_ShadowingAgreementInfo_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { + dissect_disp_ShadowingAgreementInfo(FALSE, tvb, 0, pinfo, tree, hf_disp_ShadowingAgreementInfo_PDU); +} -/*--- End of included file: packet-disp-fn.c ---*/ +/*--- End of included file: packet-disp-fn.c ---*/ +#line 79 "packet-disp-template.c" /* * Dissect DISP PDUs inside a ROS PDUs @@ -1911,7 +1950,19 @@ void proto_register_disp(void) { { /*--- Included file: packet-disp-hfarr.c ---*/ - +#line 1 "packet-disp-hfarr.c" + { &hf_disp_EstablishParameter_PDU, + { "EstablishParameter", "disp.EstablishParameter", + FT_NONE, BASE_NONE, NULL, 0, + "EstablishParameter", HFILL }}, + { &hf_disp_ModificationParameter_PDU, + { "ModificationParameter", "disp.ModificationParameter", + FT_NONE, BASE_NONE, NULL, 0, + "ModificationParameter", HFILL }}, + { &hf_disp_ShadowingAgreementInfo_PDU, + { "ShadowingAgreementInfo", "disp.ShadowingAgreementInfo", + FT_NONE, BASE_NONE, NULL, 0, + "ShadowingAgreementInfo", HFILL }}, { &hf_disp_modifiedSecondaryShadows, { "secondaryShadows", "disp.secondaryShadows", FT_UINT32, BASE_DEC, NULL, 0, @@ -1970,7 +2021,7 @@ void proto_register_disp(void) { "UnitOfReplication/supplyContexts/selectedContexts", HFILL }}, { &hf_disp_selectedContexts_item, { "Item", "disp.selectedContexts_item", - FT_STRING, BASE_NONE, NULL, 0, + FT_OID, BASE_NONE, NULL, 0, "UnitOfReplication/supplyContexts/selectedContexts/_item", HFILL }}, { &hf_disp_contextPrefix, { "contextPrefix", "disp.contextPrefix", @@ -1994,7 +2045,7 @@ void proto_register_disp(void) { "AttributeSelection/_item", HFILL }}, { &hf_disp_class, { "class", "disp.class", - FT_STRING, BASE_NONE, NULL, 0, + FT_OID, BASE_NONE, NULL, 0, "ClassAttributeSelection/class", HFILL }}, { &hf_disp_classAttributes, { "classAttributes", "disp.classAttributes", @@ -2330,7 +2381,7 @@ void proto_register_disp(void) { "ShadowError/signedShadowError/shadowError", HFILL }}, /*--- End of included file: packet-disp-hfarr.c ---*/ - +#line 205 "packet-disp-template.c" }; /* List of subtrees */ @@ -2338,7 +2389,7 @@ void proto_register_disp(void) { &ett_disp, /*--- Included file: packet-disp-ettarr.c ---*/ - +#line 1 "packet-disp-ettarr.c" &ett_disp_ModificationParameter, &ett_disp_SET_OF_SupplierAndConsumers, &ett_disp_ShadowingAgreementInfo, @@ -2395,7 +2446,7 @@ void proto_register_disp(void) { &ett_disp_T_signedShadowError, /*--- End of included file: packet-disp-ettarr.c ---*/ - +#line 211 "packet-disp-template.c" }; module_t *disp_module; @@ -2409,7 +2460,11 @@ void proto_register_disp(void) { /* Register our configuration options for DISP, particularly our port */ +#ifdef PREFERENCE_GROUPING + disp_module = prefs_register_protocol_subtree("OSI/X.500", proto_disp, prefs_register_disp); +#else disp_module = prefs_register_protocol(proto_disp, prefs_register_disp); +#endif prefs_register_uint_preference(disp_module, "tcp.port", "DISP TCP Port", "Set the port for DISP operations (if other" @@ -2423,7 +2478,23 @@ void proto_register_disp(void) { void proto_reg_handoff_disp(void) { dissector_handle_t handle = NULL; - /* #include "packet-disp-dis-tab.c" */ + +/*--- Included file: packet-disp-dis-tab.c ---*/ +#line 1 "packet-disp-dis-tab.c" + register_ber_oid_dissector("dop.agreement.2.5.19.1", dissect_ShadowingAgreementInfo_PDU, proto_disp, "shadow-agreement"); + register_ber_oid_dissector("dop.establish.rolea.2.5.19.1", dissect_EstablishParameter_PDU, proto_disp, "shadow-establish-rolea"); + register_ber_oid_dissector("dop.establish.roleb.2.5.19.1", dissect_EstablishParameter_PDU, proto_disp, "shadow-establish-roleb"); + register_ber_oid_dissector("dop.modify.rolea.2.5.19.1", dissect_ModificationParameter_PDU, proto_disp, "shadow-modify-rolea"); + register_ber_oid_dissector("dop.modify.roleb.2.5.19.1", dissect_ModificationParameter_PDU, proto_disp, "shadow-modify-roleb"); + register_ber_oid_dissector("dop.agreement.2.5.1.0.2.1", dissect_ShadowingAgreementInfo_PDU, proto_disp, "shadow-agreement"); + register_ber_oid_dissector("dop.establish.rolea.2.5.1.0.2.1", dissect_EstablishParameter_PDU, proto_disp, "shadow-establish-rolea"); + register_ber_oid_dissector("dop.establish.roleb.2.5.1.0.2.1", dissect_EstablishParameter_PDU, proto_disp, "shadow-establish-roleb"); + register_ber_oid_dissector("dop.modify.rolea.2.5.1.0.2.1", dissect_ModificationParameter_PDU, proto_disp, "shadow-modify-rolea"); + register_ber_oid_dissector("dop.modify.roleb.2.5.1.0.2.1", dissect_ModificationParameter_PDU, proto_disp, "shadow-modify-roleb"); + + +/*--- End of included file: packet-disp-dis-tab.c ---*/ +#line 243 "packet-disp-template.c" /* APPLICATION CONTEXT */ @@ -2442,6 +2513,9 @@ void proto_reg_handoff_disp(void) { register_rtse_oid_dissector_handle("2.5.9.6", handle, 0, "id-as-directory-reliable-binding", FALSE); } + /* OPERATIONAL BINDING */ + register_ber_oid_name("2.5.1.0.5.1", "id-op-binding-shadow"); + tpkt_handle = find_dissector("tpkt"); } diff --git a/epan/dissectors/packet-disp.h b/epan/dissectors/packet-disp.h index 9973f73ee0..29a0d65476 100644 --- a/epan/dissectors/packet-disp.h +++ b/epan/dissectors/packet-disp.h @@ -1,10 +1,11 @@ /* Do not modify this file. */ /* It is created automatically by the ASN.1 to Ethereal dissector compiler */ -/* ./packet-disp.h */ +/* .\packet-disp.h */ /* ../../tools/asn2eth.py -X -b -e -p disp -c disp.cnf -s packet-disp-template disp.asn */ /* Input file: packet-disp-template.h */ +#line 1 "packet-disp-template.h" /* packet-disp.h * Routines for X.525 (X.400 Message Transfer) packet dissection * Graeme Lunt 2005 diff --git a/epan/dissectors/packet-dsp.c b/epan/dissectors/packet-dsp.c index 33de3ea12a..e33422c331 100644 --- a/epan/dissectors/packet-dsp.c +++ b/epan/dissectors/packet-dsp.c @@ -1,10 +1,11 @@ /* Do not modify this file. */ /* It is created automatically by the ASN.1 to Ethereal dissector compiler */ -/* ./packet-dsp.c */ +/* .\packet-dsp.c */ /* ../../tools/asn2eth.py -X -b -e -p dsp -c dsp.cnf -s packet-dsp-template dsp.asn */ /* Input file: packet-dsp-template.c */ +#line 1 "packet-dsp-template.c" /* packet-dsp.c * Routines for X.518 (X.500 Distributed Operations) packet dissection * Graeme Lunt 2005 @@ -71,7 +72,7 @@ static struct SESSION_DATA_STRUCTURE* session = NULL; /*--- Included file: packet-dsp-hf.c ---*/ - +#line 1 "packet-dsp-hf.c" static int hf_dsp_AccessPoint_PDU = -1; /* AccessPoint */ static int hf_dsp_MasterAndShadowAccessPoints_PDU = -1; /* MasterAndShadowAccessPoints */ static int hf_dsp_chainedArgument = -1; /* ChainingArguments */ @@ -203,13 +204,13 @@ static int hf_dsp_signed = -1; /* BOOLEAN */ static int hf_dsp_other = -1; /* EXTERNAL */ /*--- End of included file: packet-dsp-hf.c ---*/ - +#line 66 "packet-dsp-template.c" /* Initialize the subtree pointers */ static gint ett_dsp = -1; /*--- Included file: packet-dsp-ett.c ---*/ - +#line 1 "packet-dsp-ett.c" static gint ett_dsp_ChainedReadArgumentData = -1; static gint ett_dsp_ChainedReadArgument = -1; static gint ett_dsp_T_signedChainedReadArgument = -1; @@ -282,11 +283,11 @@ static gint ett_dsp_AuthenticationLevel = -1; static gint ett_dsp_T_basicLevels = -1; /*--- End of included file: packet-dsp-ett.c ---*/ - +#line 70 "packet-dsp-template.c" /*--- Included file: packet-dsp-fn.c ---*/ - +#line 1 "packet-dsp-fn.c" /*--- Fields for imported types ---*/ static int dissect_readArgument(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { @@ -914,7 +915,7 @@ static const ber_sequence_t MasterAndShadowAccessPoints_set_of[1] = { { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_MasterAndShadowAccessPoints_item }, }; -static int +int dissect_dsp_MasterAndShadowAccessPoints(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset, MasterAndShadowAccessPoints_set_of, hf_index, ett_dsp_MasterAndShadowAccessPoints); @@ -2103,7 +2104,7 @@ static void dissect_MasterAndShadowAccessPoints_PDU(tvbuff_t *tvb, packet_info * /*--- End of included file: packet-dsp-fn.c ---*/ - +#line 72 "packet-dsp-template.c" /* * Dissect X518 PDUs inside a ROS PDUs @@ -2311,7 +2312,7 @@ void proto_register_dsp(void) { { /*--- Included file: packet-dsp-hfarr.c ---*/ - +#line 1 "packet-dsp-hfarr.c" { &hf_dsp_AccessPoint_PDU, { "AccessPoint", "dsp.AccessPoint", FT_NONE, BASE_NONE, NULL, 0, @@ -2662,7 +2663,7 @@ void proto_register_dsp(void) { "", HFILL }}, { &hf_dsp_info, { "info", "dsp.info", - FT_STRING, BASE_NONE, NULL, 0, + FT_OID, BASE_NONE, NULL, 0, "", HFILL }}, { &hf_dsp_timeLimit, { "timeLimit", "dsp.timeLimit", @@ -2830,7 +2831,7 @@ void proto_register_dsp(void) { "AuthenticationLevel/other", HFILL }}, /*--- End of included file: packet-dsp-hfarr.c ---*/ - +#line 278 "packet-dsp-template.c" }; /* List of subtrees */ @@ -2838,7 +2839,7 @@ void proto_register_dsp(void) { &ett_dsp, /*--- Included file: packet-dsp-ettarr.c ---*/ - +#line 1 "packet-dsp-ettarr.c" &ett_dsp_ChainedReadArgumentData, &ett_dsp_ChainedReadArgument, &ett_dsp_T_signedChainedReadArgument, @@ -2911,7 +2912,7 @@ void proto_register_dsp(void) { &ett_dsp_T_basicLevels, /*--- End of included file: packet-dsp-ettarr.c ---*/ - +#line 284 "packet-dsp-template.c" }; module_t *dsp_module; @@ -2929,7 +2930,11 @@ void proto_register_dsp(void) { /* Register our configuration options for DSP, particularly our port */ +#ifdef PREFERENCE_GROUPING + dsp_module = prefs_register_protocol_subtree("OSI/X.500", proto_dsp, prefs_register_dsp); +#else dsp_module = prefs_register_protocol(proto_dsp, prefs_register_dsp); +#endif prefs_register_uint_preference(dsp_module, "tcp.port", "DSP TCP Port", "Set the port for DSP operations (if other" @@ -2946,7 +2951,7 @@ void proto_reg_handoff_dsp(void) { /*--- Included file: packet-dsp-dis-tab.c ---*/ - +#line 1 "packet-dsp-dis-tab.c" register_ber_oid_dissector("2.5.12.1", dissect_AccessPoint_PDU, proto_dsp, "id-doa-myAccessPoint"); register_ber_oid_dissector("2.5.12.2", dissect_AccessPoint_PDU, proto_dsp, "id-doa-superiorKnowledge"); register_ber_oid_dissector("2.5.12.3", dissect_MasterAndShadowAccessPoints_PDU, proto_dsp, "id-doa-specificKnowledge"); @@ -2954,7 +2959,7 @@ void proto_reg_handoff_dsp(void) { /*--- End of included file: packet-dsp-dis-tab.c ---*/ - +#line 321 "packet-dsp-template.c" /* APPLICATION CONTEXT */ diff --git a/epan/dissectors/packet-dsp.h b/epan/dissectors/packet-dsp.h index 6f6affee17..1db0e03a65 100644 --- a/epan/dissectors/packet-dsp.h +++ b/epan/dissectors/packet-dsp.h @@ -1,10 +1,11 @@ /* Do not modify this file. */ /* It is created automatically by the ASN.1 to Ethereal dissector compiler */ -/* ./packet-dsp.h */ +/* .\packet-dsp.h */ /* ../../tools/asn2eth.py -X -b -e -p dsp -c dsp.cnf -s packet-dsp-template dsp.asn */ /* Input file: packet-dsp-template.h */ +#line 1 "packet-dsp-template.h" /* packet-dsp.h * Routines for X.511 (X.500 Directory Access Protocol) packet dissection * Graeme Lunt 2005 @@ -35,14 +36,15 @@ /*--- Included file: packet-dsp-exp.h ---*/ - +#line 1 "packet-dsp-exp.h" extern const value_string dsp_ReferenceType_vals[]; int dissect_dsp_OperationProgress(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); int dissect_dsp_ReferenceType(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); int dissect_dsp_AccessPoint(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); +int dissect_dsp_MasterAndShadowAccessPoints(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); int dissect_dsp_ContinuationReference(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); /*--- End of included file: packet-dsp-exp.h ---*/ - +#line 30 "packet-dsp-template.h" #endif /* PACKET_DSP_H */ diff --git a/epan/dissectors/packet-x501.c b/epan/dissectors/packet-x501.c deleted file mode 100644 index 7465dd2e7e..0000000000 --- a/epan/dissectors/packet-x501.c +++ /dev/null @@ -1,470 +0,0 @@ -/* Do not modify this file. */ -/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ -/* ./packet-x501.c */ -/* ../../tools/asn2eth.py -X -b -e -p x501 -c x501.cnf -s packet-x501-template x501.asn */ - -/* Input file: packet-x501-template.c */ - -/* packet-x501.c - * Routines for X.501 (DSA Operational Attributes) packet dissection - * Graeme Lunt 2005 - * - * $Id$ - * - * Ethereal - Network traffic analyzer - * By Gerald Combs - * Copyright 1998 Gerald Combs - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include -#include -#include - -#include -#include - -#include "packet-ber.h" - -#include "packet-x509sat.h" -#include "packet-x509if.h" -#include "packet-dap.h" -#include "packet-dsp.h" - - -#include "packet-x501.h" - -#define PNAME "X.501 Operational Attributes" -#define PSNAME "X501" -#define PFNAME "x501" - -/* Initialize the protocol and registered fields */ -int proto_x501 = -1; - - -/*--- Included file: packet-x501-hf.c ---*/ - -static int hf_x501_DSEType_PDU = -1; /* DSEType */ -static int hf_x501_SupplierInformation_PDU = -1; /* SupplierInformation */ -static int hf_x501_ConsumerInformation_PDU = -1; /* ConsumerInformation */ -static int hf_x501_SupplierAndConsumers_PDU = -1; /* SupplierAndConsumers */ -static int hf_x501_ae_title = -1; /* Name */ -static int hf_x501_address = -1; /* PresentationAddress */ -static int hf_x501_protocolInformation = -1; /* SET_OF_ProtocolInformation */ -static int hf_x501_protocolInformation_item = -1; /* ProtocolInformation */ -static int hf_x501_agreementID = -1; /* OperationalBindingID */ -static int hf_x501_supplier_is_master = -1; /* BOOLEAN */ -static int hf_x501_non_supplying_master = -1; /* AccessPoint */ -static int hf_x501_consumers = -1; /* SET_OF_AccessPoint */ -static int hf_x501_consumers_item = -1; /* AccessPoint */ -/* named bits */ -static int hf_x501_DSEType_root = -1; -static int hf_x501_DSEType_glue = -1; -static int hf_x501_DSEType_cp = -1; -static int hf_x501_DSEType_entry = -1; -static int hf_x501_DSEType_alias = -1; -static int hf_x501_DSEType_subr = -1; -static int hf_x501_DSEType_nssr = -1; -static int hf_x501_DSEType_supr = -1; -static int hf_x501_DSEType_xr = -1; -static int hf_x501_DSEType_admPoint = -1; -static int hf_x501_DSEType_subentry = -1; -static int hf_x501_DSEType_shadow = -1; -static int hf_x501_DSEType_immSupr = -1; -static int hf_x501_DSEType_rhob = -1; -static int hf_x501_DSEType_sa = -1; -static int hf_x501_DSEType_dsSubentry = -1; -static int hf_x501_DSEType_familyMember = -1; - -/*--- End of included file: packet-x501-hf.c ---*/ - - -/* Initialize the subtree pointers */ -static gint ett_x501 = -1; - -/*--- Included file: packet-x501-ett.c ---*/ - -static gint ett_x501_DSEType = -1; -static gint ett_x501_SupplierOrConsumer = -1; -static gint ett_x501_SET_OF_ProtocolInformation = -1; -static gint ett_x501_SupplierInformation = -1; -static gint ett_x501_SupplierAndConsumers = -1; -static gint ett_x501_SET_OF_AccessPoint = -1; - -/*--- End of included file: packet-x501-ett.c ---*/ - - - -/*--- Included file: packet-x501-fn.c ---*/ - -/*--- Fields for imported types ---*/ - -static int dissect_ae_title(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { - return dissect_x509if_Name(FALSE, tvb, offset, pinfo, tree, hf_x501_ae_title); -} -static int dissect_address(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { - return dissect_x509sat_PresentationAddress(FALSE, tvb, offset, pinfo, tree, hf_x501_address); -} -static int dissect_protocolInformation_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { - return dissect_x509sat_ProtocolInformation(FALSE, tvb, offset, pinfo, tree, hf_x501_protocolInformation_item); -} -static int dissect_agreementID(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { - return dissect_dap_OperationalBindingID(FALSE, tvb, offset, pinfo, tree, hf_x501_agreementID); -} -static int dissect_non_supplying_master(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { - return dissect_dsp_AccessPoint(FALSE, tvb, offset, pinfo, tree, hf_x501_non_supplying_master); -} -static int dissect_consumers_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { - return dissect_dsp_AccessPoint(FALSE, tvb, offset, pinfo, tree, hf_x501_consumers_item); -} - - -static const asn_namedbit DSEType_bits[] = { - { 0, &hf_x501_DSEType_root, -1, -1, "root", NULL }, - { 1, &hf_x501_DSEType_glue, -1, -1, "glue", NULL }, - { 2, &hf_x501_DSEType_cp, -1, -1, "cp", NULL }, - { 3, &hf_x501_DSEType_entry, -1, -1, "entry", NULL }, - { 4, &hf_x501_DSEType_alias, -1, -1, "alias", NULL }, - { 5, &hf_x501_DSEType_subr, -1, -1, "subr", NULL }, - { 6, &hf_x501_DSEType_nssr, -1, -1, "nssr", NULL }, - { 7, &hf_x501_DSEType_supr, -1, -1, "supr", NULL }, - { 8, &hf_x501_DSEType_xr, -1, -1, "xr", NULL }, - { 9, &hf_x501_DSEType_admPoint, -1, -1, "admPoint", NULL }, - { 10, &hf_x501_DSEType_subentry, -1, -1, "subentry", NULL }, - { 11, &hf_x501_DSEType_shadow, -1, -1, "shadow", NULL }, - { 13, &hf_x501_DSEType_immSupr, -1, -1, "immSupr", NULL }, - { 14, &hf_x501_DSEType_rhob, -1, -1, "rhob", NULL }, - { 15, &hf_x501_DSEType_sa, -1, -1, "sa", NULL }, - { 16, &hf_x501_DSEType_dsSubentry, -1, -1, "dsSubentry", NULL }, - { 17, &hf_x501_DSEType_familyMember, -1, -1, "familyMember", NULL }, - { 0, NULL, 0, 0, NULL, NULL } -}; - -int -dissect_x501_DSEType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { - offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset, - DSEType_bits, hf_index, ett_x501_DSEType, - NULL); - - return offset; -} - - -static const ber_sequence_t SET_OF_ProtocolInformation_set_of[1] = { - { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_protocolInformation_item }, -}; - -static int -dissect_x501_SET_OF_ProtocolInformation(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { - offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset, - SET_OF_ProtocolInformation_set_of, hf_index, ett_x501_SET_OF_ProtocolInformation); - - return offset; -} -static int dissect_protocolInformation(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { - return dissect_x501_SET_OF_ProtocolInformation(FALSE, tvb, offset, pinfo, tree, hf_x501_protocolInformation); -} - - -static const ber_sequence_t SupplierOrConsumer_set[] = { - { BER_CLASS_CON, 0, 0, dissect_ae_title }, - { BER_CLASS_CON, 1, 0, dissect_address }, - { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL, dissect_protocolInformation }, - { BER_CLASS_CON, 3, 0, dissect_agreementID }, - { 0, 0, 0, NULL } -}; - -static int -dissect_x501_SupplierOrConsumer(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { - offset = dissect_ber_set(implicit_tag, pinfo, tree, tvb, offset, - SupplierOrConsumer_set, hf_index, ett_x501_SupplierOrConsumer); - - return offset; -} - - - -static int -dissect_x501_BOOLEAN(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { - offset = dissect_ber_boolean(implicit_tag, pinfo, tree, tvb, offset, hf_index); - - return offset; -} -static int dissect_supplier_is_master(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { - return dissect_x501_BOOLEAN(FALSE, tvb, offset, pinfo, tree, hf_x501_supplier_is_master); -} - - -static const ber_sequence_t SupplierInformation_set[] = { - { BER_CLASS_CON, 0, 0, dissect_ae_title }, - { BER_CLASS_CON, 1, 0, dissect_address }, - { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL, dissect_protocolInformation }, - { BER_CLASS_CON, 3, 0, dissect_agreementID }, - { BER_CLASS_CON, 4, BER_FLAGS_OPTIONAL, dissect_supplier_is_master }, - { BER_CLASS_CON, 5, BER_FLAGS_OPTIONAL, dissect_non_supplying_master }, - { 0, 0, 0, NULL } -}; - -static int -dissect_x501_SupplierInformation(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { - offset = dissect_ber_set(implicit_tag, pinfo, tree, tvb, offset, - SupplierInformation_set, hf_index, ett_x501_SupplierInformation); - - return offset; -} - - - -static int -dissect_x501_ConsumerInformation(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { - offset = dissect_x501_SupplierOrConsumer(implicit_tag, tvb, offset, pinfo, tree, hf_index); - - return offset; -} - - -static const ber_sequence_t SET_OF_AccessPoint_set_of[1] = { - { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_consumers_item }, -}; - -static int -dissect_x501_SET_OF_AccessPoint(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { - offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset, - SET_OF_AccessPoint_set_of, hf_index, ett_x501_SET_OF_AccessPoint); - - return offset; -} -static int dissect_consumers(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { - return dissect_x501_SET_OF_AccessPoint(FALSE, tvb, offset, pinfo, tree, hf_x501_consumers); -} - - -static const ber_sequence_t SupplierAndConsumers_set[] = { - { BER_CLASS_CON, 0, 0, dissect_ae_title }, - { BER_CLASS_CON, 1, 0, dissect_address }, - { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL, dissect_protocolInformation }, - { BER_CLASS_CON, 3, 0, dissect_consumers }, - { 0, 0, 0, NULL } -}; - -int -dissect_x501_SupplierAndConsumers(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { - offset = dissect_ber_set(implicit_tag, pinfo, tree, tvb, offset, - SupplierAndConsumers_set, hf_index, ett_x501_SupplierAndConsumers); - - return offset; -} - -/*--- PDUs ---*/ - -static void dissect_DSEType_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - dissect_x501_DSEType(FALSE, tvb, 0, pinfo, tree, hf_x501_DSEType_PDU); -} -static void dissect_SupplierInformation_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - dissect_x501_SupplierInformation(FALSE, tvb, 0, pinfo, tree, hf_x501_SupplierInformation_PDU); -} -static void dissect_ConsumerInformation_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - dissect_x501_ConsumerInformation(FALSE, tvb, 0, pinfo, tree, hf_x501_ConsumerInformation_PDU); -} -static void dissect_SupplierAndConsumers_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - dissect_x501_SupplierAndConsumers(FALSE, tvb, 0, pinfo, tree, hf_x501_SupplierAndConsumers_PDU); -} - - -/*--- End of included file: packet-x501-fn.c ---*/ - - -/*--- proto_register_x501 -------------------------------------------*/ -void proto_register_x501(void) { - - /* List of fields */ - static hf_register_info hf[] = - { - -/*--- Included file: packet-x501-hfarr.c ---*/ - - { &hf_x501_DSEType_PDU, - { "DSEType", "x501.DSEType", - FT_BYTES, BASE_HEX, NULL, 0, - "DSEType", HFILL }}, - { &hf_x501_SupplierInformation_PDU, - { "SupplierInformation", "x501.SupplierInformation", - FT_NONE, BASE_NONE, NULL, 0, - "SupplierInformation", HFILL }}, - { &hf_x501_ConsumerInformation_PDU, - { "ConsumerInformation", "x501.ConsumerInformation", - FT_NONE, BASE_NONE, NULL, 0, - "ConsumerInformation", HFILL }}, - { &hf_x501_SupplierAndConsumers_PDU, - { "SupplierAndConsumers", "x501.SupplierAndConsumers", - FT_NONE, BASE_NONE, NULL, 0, - "SupplierAndConsumers", HFILL }}, - { &hf_x501_ae_title, - { "ae-title", "x501.ae_title", - FT_NONE, BASE_NONE, NULL, 0, - "", HFILL }}, - { &hf_x501_address, - { "address", "x501.address", - FT_NONE, BASE_NONE, NULL, 0, - "", HFILL }}, - { &hf_x501_protocolInformation, - { "protocolInformation", "x501.protocolInformation", - FT_UINT32, BASE_DEC, NULL, 0, - "", HFILL }}, - { &hf_x501_protocolInformation_item, - { "Item", "x501.protocolInformation_item", - FT_NONE, BASE_NONE, NULL, 0, - "", HFILL }}, - { &hf_x501_agreementID, - { "agreementID", "x501.agreementID", - FT_NONE, BASE_NONE, NULL, 0, - "", HFILL }}, - { &hf_x501_supplier_is_master, - { "supplier-is-master", "x501.supplier_is_master", - FT_BOOLEAN, 8, NULL, 0, - "SupplierInformation/supplier-is-master", HFILL }}, - { &hf_x501_non_supplying_master, - { "non-supplying-master", "x501.non_supplying_master", - FT_NONE, BASE_NONE, NULL, 0, - "SupplierInformation/non-supplying-master", HFILL }}, - { &hf_x501_consumers, - { "consumers", "x501.consumers", - FT_UINT32, BASE_DEC, NULL, 0, - "SupplierAndConsumers/consumers", HFILL }}, - { &hf_x501_consumers_item, - { "Item", "x501.consumers_item", - FT_NONE, BASE_NONE, NULL, 0, - "SupplierAndConsumers/consumers/_item", HFILL }}, - { &hf_x501_DSEType_root, - { "root", "x501.root", - FT_BOOLEAN, 8, NULL, 0x80, - "", HFILL }}, - { &hf_x501_DSEType_glue, - { "glue", "x501.glue", - FT_BOOLEAN, 8, NULL, 0x40, - "", HFILL }}, - { &hf_x501_DSEType_cp, - { "cp", "x501.cp", - FT_BOOLEAN, 8, NULL, 0x20, - "", HFILL }}, - { &hf_x501_DSEType_entry, - { "entry", "x501.entry", - FT_BOOLEAN, 8, NULL, 0x10, - "", HFILL }}, - { &hf_x501_DSEType_alias, - { "alias", "x501.alias", - FT_BOOLEAN, 8, NULL, 0x08, - "", HFILL }}, - { &hf_x501_DSEType_subr, - { "subr", "x501.subr", - FT_BOOLEAN, 8, NULL, 0x04, - "", HFILL }}, - { &hf_x501_DSEType_nssr, - { "nssr", "x501.nssr", - FT_BOOLEAN, 8, NULL, 0x02, - "", HFILL }}, - { &hf_x501_DSEType_supr, - { "supr", "x501.supr", - FT_BOOLEAN, 8, NULL, 0x01, - "", HFILL }}, - { &hf_x501_DSEType_xr, - { "xr", "x501.xr", - FT_BOOLEAN, 8, NULL, 0x80, - "", HFILL }}, - { &hf_x501_DSEType_admPoint, - { "admPoint", "x501.admPoint", - FT_BOOLEAN, 8, NULL, 0x40, - "", HFILL }}, - { &hf_x501_DSEType_subentry, - { "subentry", "x501.subentry", - FT_BOOLEAN, 8, NULL, 0x20, - "", HFILL }}, - { &hf_x501_DSEType_shadow, - { "shadow", "x501.shadow", - FT_BOOLEAN, 8, NULL, 0x10, - "", HFILL }}, - { &hf_x501_DSEType_immSupr, - { "immSupr", "x501.immSupr", - FT_BOOLEAN, 8, NULL, 0x04, - "", HFILL }}, - { &hf_x501_DSEType_rhob, - { "rhob", "x501.rhob", - FT_BOOLEAN, 8, NULL, 0x02, - "", HFILL }}, - { &hf_x501_DSEType_sa, - { "sa", "x501.sa", - FT_BOOLEAN, 8, NULL, 0x01, - "", HFILL }}, - { &hf_x501_DSEType_dsSubentry, - { "dsSubentry", "x501.dsSubentry", - FT_BOOLEAN, 8, NULL, 0x80, - "", HFILL }}, - { &hf_x501_DSEType_familyMember, - { "familyMember", "x501.familyMember", - FT_BOOLEAN, 8, NULL, 0x40, - "", HFILL }}, - -/*--- End of included file: packet-x501-hfarr.c ---*/ - - }; - - /* List of subtrees */ - static gint *ett[] = { - &ett_x501, - -/*--- Included file: packet-x501-ettarr.c ---*/ - - &ett_x501_DSEType, - &ett_x501_SupplierOrConsumer, - &ett_x501_SET_OF_ProtocolInformation, - &ett_x501_SupplierInformation, - &ett_x501_SupplierAndConsumers, - &ett_x501_SET_OF_AccessPoint, - -/*--- End of included file: packet-x501-ettarr.c ---*/ - - }; - - /* Register protocol */ - proto_x501 = proto_register_protocol(PNAME, PSNAME, PFNAME); - - /* Register fields and subtrees */ - proto_register_field_array(proto_x501, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); - -} - - -/*--- proto_reg_handoff_x501 --- */ -void proto_reg_handoff_x501(void) { - - -/*--- Included file: packet-x501-dis-tab.c ---*/ - - register_ber_oid_dissector("2.5.12.0", dissect_DSEType_PDU, proto_x501, "id-doa-dseType"); - register_ber_oid_dissector("2.5.12.5", dissect_SupplierInformation_PDU, proto_x501, "id-doa-supplierKnowledge"); - register_ber_oid_dissector("2.5.12.6", dissect_ConsumerInformation_PDU, proto_x501, "id-doa-consumerKnowledge"); - register_ber_oid_dissector("2.5.12.7", dissect_SupplierAndConsumers_PDU, proto_x501, "id-doa-secondaryShadows"); - - -/*--- End of included file: packet-x501-dis-tab.c ---*/ - - -} diff --git a/epan/dissectors/packet-x501.h b/epan/dissectors/packet-x501.h deleted file mode 100644 index 2b57083d2a..0000000000 --- a/epan/dissectors/packet-x501.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Do not modify this file. */ -/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ -/* ./packet-x501.h */ -/* ../../tools/asn2eth.py -X -b -e -p x501 -c x501.cnf -s packet-x501-template x501.asn */ - -/* Input file: packet-x501-template.h */ - -/* packet-x501.h - * Routines for X.501 (DSA Operational Attributes) packet dissection - * Graeme Lunt 2005 - * - * $Id$ - * - * Ethereal - Network traffic analyzer - * By Gerald Combs - * Copyright 1998 Gerald Combs - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef PACKET_X501_H -#define PACKET_X501_H - - -/*--- Included file: packet-x501-exp.h ---*/ - -int dissect_x501_DSEType(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); -int dissect_x501_SupplierAndConsumers(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); - -/*--- End of included file: packet-x501-exp.h ---*/ - - -#endif /* PACKET_X501_H */ -- cgit v1.2.3