aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/dop
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2007-09-04 21:46:41 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2007-09-04 21:46:41 +0000
commit6e948358486a265c3ce7f5438159e5a622305543 (patch)
tree48b15e5b32d1e9042c61f105d0aae93d36a057c4 /asn1/dop
parentb3521c5975cd4fe04b3be3b354e8769daf3f5d7c (diff)
Rewrote handling of parameters to get rid of "funky" oid strings.
Added expert info for unknown binding-parameters. svn path=/trunk/; revision=22786
Diffstat (limited to 'asn1/dop')
-rw-r--r--asn1/dop/dop.cnf54
-rw-r--r--asn1/dop/packet-dop-template.c29
2 files changed, 52 insertions, 31 deletions
diff --git a/asn1/dop/dop.cnf b/asn1/dop/dop.cnf
index 77a84c3474..be115c3165 100644
--- a/asn1/dop/dop.cnf
+++ b/asn1/dop/dop.cnf
@@ -71,17 +71,17 @@ SupplierInformation B "2.5.12.5" "id-doa-supplierKnowledge"
ConsumerInformation B "2.5.12.6" "id-doa-consumerKnowledge"
SupplierAndConsumers B "2.5.12.7" "id-doa-secondaryShadows"
-HierarchicalAgreement B "dop.agreement.2.5.19.2" "hierarchical-agreement"
-SuperiorToSubordinate B "dop.establish.rolea.2.5.19.2" "hierarchical-establish-rolea"
-SuperiorToSubordinateModification B "dop.modify.rolea.2.5.19.2" "hierarchical-modify-rolea"
-SubordinateToSuperior B "dop.establish.roleb.2.5.19.2" "hierarchical-establish-roleb"
-SubordinateToSuperior B "dop.modify.roleb.2.5.19.2" "hierarchical-modify-roleb"
-
-NonSpecificHierarchicalAgreement B "dop.agreement.2.5.19.3" "non-specific-hierarchical-agreement"
-NHOBSuperiorToSubordinate B "dop.establish.rolea.2.5.19.3" "non-specific-hierarchical-establish-rolea"
-NHOBSuperiorToSubordinate B "dop.modify.rolea.2.5.19.3" "non-specific-hierarchical-modify-rolea"
-NHOBSubordinateToSuperior B "dop.establish.roleb.2.5.19.3" "non-specific-hierarchical-establish-roleb"
-NHOBSubordinateToSuperior B "dop.modify.roleb.2.5.19.3" "non-specific-hierarchical-modify-roleb"
+HierarchicalAgreement S dop.oid "agreement.2.5.19.2"
+SuperiorToSubordinate S dop.oid "establish.rolea.2.5.19.2"
+SuperiorToSubordinateModification S dop.oid "modify.rolea.2.5.19.2"
+SubordinateToSuperior S dop.oid "establish.roleb.2.5.19.2"
+SubordinateToSuperior S dop.oid "modify.roleb.2.5.19.2"
+
+NonSpecificHierarchicalAgreement S dop.oid "agreement.2.5.19.3"
+NHOBSuperiorToSubordinate S dop.oid "establish.rolea.2.5.19.3"
+NHOBSuperiorToSubordinate S dop.oid "modify.rolea.2.5.19.3"
+NHOBSubordinateToSuperior S dop.oid "establish.roleb.2.5.19.3"
+NHOBSubordinateToSuperior S dop.oid "modify.roleb.2.5.19.3"
ACIItem B "2.5.24.4" "id-aca-prescriptiveACI"
ACIItem B "2.5.24.5" "id-aca-entryACI"
@@ -106,67 +106,67 @@ OpBindingErrorParam/bindingType BindingType
#.FN_BODY EstablishOperationalBindingArgumentData/initiator/symmetric
- offset = call_dop_oid_callback("dop.establish.symmetric", tvb, offset, actx->pinfo, tree, "symmetric");
+ offset = call_dop_oid_callback("establish.symmetric", tvb, offset, actx->pinfo, tree, "symmetric");
#.FN_BODY EstablishOperationalBindingArgumentData/initiator/roleA-initiates
- offset = call_dop_oid_callback("dop.establish.rolea", tvb, offset, actx->pinfo, tree, "roleA");
+ offset = call_dop_oid_callback("establish.rolea", tvb, offset, actx->pinfo, tree, "roleA");
#.FN_BODY EstablishOperationalBindingArgumentData/initiator/roleB-initiates
- offset = call_dop_oid_callback("dop.establish.roleb", tvb, offset, actx->pinfo, tree, "roleB");
+ offset = call_dop_oid_callback("establish.roleb", tvb, offset, actx->pinfo, tree, "roleB");
#.FN_BODY ModifyOperationalBindingArgumentData/initiator/symmetric
- offset = call_dop_oid_callback("dop.modify.symmetric", tvb, offset, actx->pinfo, tree, "symmetric");
+ offset = call_dop_oid_callback("modify.symmetric", tvb, offset, actx->pinfo, tree, "symmetric");
#.FN_BODY ModifyOperationalBindingArgumentData/initiator/roleA-initiates
- offset = call_dop_oid_callback("dop.modify.rolea", tvb, offset, actx->pinfo, tree, "roleA");
+ offset = call_dop_oid_callback("modify.rolea", tvb, offset, actx->pinfo, tree, "roleA");
#.FN_BODY ModifyOperationalBindingArgumentData/initiator/roleB-initiates
- offset = call_dop_oid_callback("dop.modify.roleb", tvb, offset, actx->pinfo, tree, "roleB");
+ offset = call_dop_oid_callback("modify.roleb", tvb, offset, actx->pinfo, tree, "roleB");
#.FN_BODY TerminateOperationalBindingArgumentData/initiator/symmetric
- offset = call_dop_oid_callback("dop.terminate.symmetric", tvb, offset, actx->pinfo, tree, "symmetric");
+ offset = call_dop_oid_callback("terminate.symmetric", tvb, offset, actx->pinfo, tree, "symmetric");
#.FN_BODY TerminateOperationalBindingArgumentData/initiator/roleA-initiates
- offset = call_dop_oid_callback("dop.terminate.rolea", tvb, offset, actx->pinfo, tree, "roleA");
+ offset = call_dop_oid_callback("terminate.rolea", tvb, offset, actx->pinfo, tree, "roleA");
#.FN_BODY TerminateOperationalBindingArgumentData/initiator/roleB-initiates
- offset = call_dop_oid_callback("dop.terminate.roleb", tvb, offset, actx->pinfo, tree, "roleB");
+ offset = call_dop_oid_callback("terminate.roleb", tvb, offset, actx->pinfo, tree, "roleB");
#.FN_BODY EstablishOperationalBindingArgumentData/agreement
- offset = call_dop_oid_callback("dop.agreement", tvb, offset, actx->pinfo, tree, NULL);
+ offset = call_dop_oid_callback("agreement", tvb, offset, actx->pinfo, tree, NULL);
#.FN_BODY EstablishOperationalBindingResult/initiator/symmetric
- offset = call_dop_oid_callback("dop.establish.symmetric", tvb, offset, actx->pinfo, tree, "symmetric");
+ offset = call_dop_oid_callback("establish.symmetric", tvb, offset, actx->pinfo, tree, "symmetric");
#.FN_BODY EstablishOperationalBindingResult/initiator/roleA-replies
- offset = call_dop_oid_callback("dop.establish.rolea", tvb, offset, actx->pinfo, tree, "roleA");
+ offset = call_dop_oid_callback("establish.rolea", tvb, offset, actx->pinfo, tree, "roleA");
#.FN_BODY EstablishOperationalBindingResult/initiator/roleB-replies
- offset = call_dop_oid_callback("dop.establish.roleb", tvb, offset, actx->pinfo, tree, "roleB");
+ offset = call_dop_oid_callback("establish.roleb", tvb, offset, actx->pinfo, tree, "roleB");
#.FN_BODY OpBindingErrorParam/agreementProposal
- offset = call_dop_oid_callback("dop.agreement", tvb, offset, actx->pinfo, tree, NULL);
+ offset = call_dop_oid_callback("agreement", tvb, offset, actx->pinfo, tree, NULL);
#.FN_BODY ModifyOperationalBindingResultData/newAgreement
- offset = call_dop_oid_callback("dop.agreement", tvb, offset, actx->pinfo, tree, NULL);
+ offset = call_dop_oid_callback("agreement", tvb, offset, actx->pinfo, tree, NULL);
#.FN_BODY ModifyOperationalBindingArgumentData/newAgreement
- offset = call_dop_oid_callback("dop.agreement", tvb, offset, actx->pinfo, tree, NULL);
+ offset = call_dop_oid_callback("agreement", tvb, offset, actx->pinfo, tree, NULL);
#.FN_BODY OperationalBindingID/identifier VAL_PTR = &value
diff --git a/asn1/dop/packet-dop-template.c b/asn1/dop/packet-dop-template.c
index a22094539d..c5dcf9cf08 100644
--- a/asn1/dop/packet-dop-template.c
+++ b/asn1/dop/packet-dop-template.c
@@ -66,14 +66,18 @@ int proto_dop = -1;
static struct SESSION_DATA_STRUCTURE* session = NULL;
static const char *binding_type = NULL; /* binding_type */
-static int call_dop_oid_callback(char *base_oid, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, char *col_info);
+static int call_dop_oid_callback(char *base_string, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, char *col_info);
#include "packet-dop-hf.c"
/* Initialize the subtree pointers */
static gint ett_dop = -1;
+static gint ett_dop_unknown = -1;
#include "packet-dop-ett.c"
+/* Dissector table */
+static dissector_table_t dop_dissector_table;
+
static void append_oid(packet_info *pinfo, const char *oid)
{
const char *name = NULL;
@@ -87,16 +91,30 @@ static void append_oid(packet_info *pinfo, const char *oid)
#include "packet-dop-fn.c"
static int
-call_dop_oid_callback(char *base_oid, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, char *col_info)
+call_dop_oid_callback(char *base_string, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, char *col_info)
{
char* binding_param;
- binding_param = ep_strdup_printf("%s.%s", base_oid, binding_type ? binding_type : "");
+ binding_param = ep_strdup_printf("%s.%s", base_string, binding_type ? binding_type : "");
if (col_info && (check_col(pinfo->cinfo, COL_INFO)))
col_append_fstr(pinfo->cinfo, COL_INFO, " %s", col_info);
- return call_ber_oid_callback(binding_param, tvb, offset, pinfo, tree);
+ if (dissector_try_string(dop_dissector_table, binding_param, tvb, pinfo, tree)) {
+ offset += tvb_length_remaining (tvb, offset);
+ } else {
+ proto_item *item=NULL;
+ proto_tree *next_tree=NULL;
+
+ item = proto_tree_add_text(tree, tvb, 0, tvb_length_remaining(tvb, offset), "Dissector for parameter %s OID:%s not implemented. Contact Wireshark developers if you want this supported", base_string, binding_type ? binding_type : "<empty>");
+ if (item) {
+ next_tree = proto_item_add_subtree(item, ett_dop_unknown);
+ }
+ offset = dissect_unknown_ber(pinfo, tvb, offset, next_tree);
+ expert_add_info_format(pinfo, item, PI_UNDECODED, PI_WARN, "Unknown binding-parameter");
+ }
+
+ return offset;
}
@@ -236,6 +254,7 @@ void proto_register_dop(void) {
/* List of subtrees */
static gint *ett[] = {
&ett_dop,
+ &ett_dop_unknown,
#include "packet-dop-ettarr.c"
};
@@ -246,6 +265,8 @@ void proto_register_dop(void) {
register_dissector("dop", dissect_dop, proto_dop);
+ dop_dissector_table = register_dissector_table("dop.oid", "DOP OID Dissectors", FT_STRING, BASE_NONE);
+
/* Register fields and subtrees */
proto_register_field_array(proto_dop, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));