diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2011-02-10 10:11:38 +0000 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2011-02-10 10:11:38 +0000 |
commit | 1ba57f4c04b4731b6a6d36f8e7a86ac6d73599a6 (patch) | |
tree | 3ec4ee3084f18eb25c7bbe3c9a2608252c25b7c2 | |
parent | 60297df554b03c4156cdcddc447b2b76591fc362 (diff) | |
download | wireshark-1ba57f4c04b4731b6a6d36f8e7a86ac6d73599a6.tar.gz |
Added a dissector table for AttributeId localForm.
Use correct object identifier in ModificationList.
svn path=/trunk/; revision=35894
-rw-r--r-- | asn1/cmip/cmip.cnf | 22 | ||||
-rw-r--r-- | asn1/cmip/packet-cmip-template.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-cmip.c | 78 |
3 files changed, 70 insertions, 36 deletions
diff --git a/asn1/cmip/cmip.cnf b/asn1/cmip/cmip.cnf index 8807f6f43a..9b76fab270 100644 --- a/asn1/cmip/cmip.cnf +++ b/asn1/cmip/cmip.cnf @@ -266,15 +266,19 @@ RejectProblem attributeform = ATTRIBUTE_GLOBAL_FORM; %(DEFAULT_BODY)s -#.FN_BODY AttributeId/localForm +#.FN_BODY AttributeId/localForm VAL_PTR = &attribute_local_id attributeform = ATTRIBUTE_LOCAL_FORM; - offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_cmip_localForm, NULL); + %(DEFAULT_BODY)s #.FN_BODY Attribute/value - /*XXX handle local form here */ if(attributeform==ATTRIBUTE_GLOBAL_FORM){ offset=call_ber_oid_callback(attribute_identifier_id, tvb, offset, actx->pinfo, tree); + } else if (dissector_try_uint(attribute_id_dissector_table, attribute_local_id, tvb, actx->pinfo, tree)) { + offset=tvb_length (tvb); + } else { + offset=dissect_unknown_ber(actx->pinfo, tvb, offset, tree); } + #.FN_PARS AttributeValueAssertion/id FN_VARIANT = _str VAL_PTR = &attributevalueassertion_id @@ -446,8 +450,14 @@ RejectProblem offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.FN_BODY SetArgument/modificationList/_item/attributeValue - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); - + if(attributeform==ATTRIBUTE_GLOBAL_FORM){ + offset=call_ber_oid_callback(attribute_identifier_id, tvb, offset, actx->pinfo, tree); + } else if (dissector_try_uint(attribute_id_dissector_table, attribute_local_id, tvb, actx->pinfo, tree)) { + offset=tvb_length (tvb); + } else { + offset=dissect_unknown_ber(actx->pinfo, tvb, offset, tree); + } + #.FN_PARS SpecificErrorInfo/errorId FN_VARIANT = _str HF_INDEX = hf_cmip_errorId_OID VAL_PTR = &object_identifier_id @@ -458,8 +468,8 @@ RejectProblem offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); #.FN_BODY InvalidArgumentValue/eventValue/eventInfo - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + #.FN_BODY ActionReply/actionReplyInfo offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); diff --git a/asn1/cmip/packet-cmip-template.c b/asn1/cmip/packet-cmip-template.c index ace3b1c9fd..7fcde6ef61 100644 --- a/asn1/cmip/packet-cmip-template.c +++ b/asn1/cmip/packet-cmip-template.c @@ -63,6 +63,9 @@ static gint ett_cmip = -1; static guint32 opcode; +/* Dissector table */ +static dissector_table_t attribute_id_dissector_table; + #include "packet-cmip-table.c" static int opcode_type; @@ -74,6 +77,7 @@ static int opcode_type; static int attributeform; #define ATTRIBUTE_LOCAL_FORM 0 #define ATTRIBUTE_GLOBAL_FORM 1 +static int attribute_local_id; static const char *attribute_identifier_id; static const char *attributevalueassertion_id; @@ -198,6 +202,8 @@ void proto_register_cmip(void) { #include "packet-cmip-dis-tab.c" oid_add_from_string("discriminatorId(1)","2.9.3.2.7.1"); + attribute_id_dissector_table = register_dissector_table("cmip.attribute_id", "CMIP Attribute Id", FT_UINT32, BASE_DEC); + } diff --git a/epan/dissectors/packet-cmip.c b/epan/dissectors/packet-cmip.c index 5c147eabd8..527522b258 100644 --- a/epan/dissectors/packet-cmip.c +++ b/epan/dissectors/packet-cmip.c @@ -478,6 +478,9 @@ static gint ett_cmip_T_modificationList_item = -1; static guint32 opcode; +/* Dissector table */ +static dissector_table_t attribute_id_dissector_table; + /*--- Included file: packet-cmip-table.c ---*/ #line 1 "packet-cmip-table.c" @@ -530,7 +533,7 @@ static const value_string cmip_error_code_vals[] = { /*--- End of included file: packet-cmip-table.c ---*/ -#line 67 "packet-cmip-template.c" +#line 70 "packet-cmip-template.c" static int opcode_type; #define OPCODE_INVOKE 1 @@ -541,6 +544,7 @@ static int opcode_type; static int attributeform; #define ATTRIBUTE_LOCAL_FORM 0 #define ATTRIBUTE_GLOBAL_FORM 1 +static int attribute_local_id; static const char *attribute_identifier_id; static const char *attributevalueassertion_id; @@ -641,7 +645,7 @@ static const char *objectclass_identifier_id; #define noInvokeId NULL /*--- End of included file: packet-cmip-val.h ---*/ -#line 89 "packet-cmip-template.c" +#line 93 "packet-cmip-template.c" /*--- Included file: packet-cmip-fn.c ---*/ #line 1 "packet-cmip-fn.c" @@ -672,7 +676,9 @@ static int dissect_cmip_T_attributeIdlocalForm(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 270 "cmip.cnf" attributeform = ATTRIBUTE_LOCAL_FORM; - offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_cmip_localForm, NULL); + offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index, + &attribute_local_id); + @@ -727,7 +733,7 @@ dissect_cmip_AccessControl(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off static int dissect_cmip_T_objectClass_globalForm(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 426 "cmip.cnf" +#line 430 "cmip.cnf" objectclassform = OBJECTCLASS_GLOBAL_FORM; offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &objectclass_identifier_id); @@ -739,7 +745,7 @@ dissect_cmip_T_objectClass_globalForm(gboolean implicit_tag _U_, tvbuff_t *tvb _ static int dissect_cmip_T_objectClasslocalForm(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 431 "cmip.cnf" +#line 435 "cmip.cnf" objectclassform = OBJECTCLASS_LOCAL_FORM; @@ -784,7 +790,7 @@ dissect_cmip_T_id(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, static int dissect_cmip_T_attributeValueAssertionvalue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 282 "cmip.cnf" +#line 286 "cmip.cnf" offset=call_ber_oid_callback(attributevalueassertion_id, tvb, offset, actx->pinfo, tree); @@ -948,12 +954,16 @@ dissect_cmip_Scope(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, static int dissect_cmip_AttributeValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 274 "cmip.cnf" - /*XXX handle local form here */ if(attributeform==ATTRIBUTE_GLOBAL_FORM){ offset=call_ber_oid_callback(attribute_identifier_id, tvb, offset, actx->pinfo, tree); + } else if (dissector_try_uint(attribute_id_dissector_table, attribute_local_id, tvb, actx->pinfo, tree)) { + offset=tvb_length (tvb); + } else { + offset=dissect_unknown_ber(actx->pinfo, tvb, offset, tree); } + return offset; } @@ -1117,7 +1127,7 @@ dissect_cmip_ActionTypeId(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offs static int dissect_cmip_T_actionInfoArg(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 437 "cmip.cnf" +#line 441 "cmip.cnf" offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); @@ -1274,11 +1284,11 @@ dissect_cmip_NoSuchArgument(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of static int dissect_cmip_T_eventInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 461 "cmip.cnf" - +#line 471 "cmip.cnf" offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); + return offset; } @@ -1379,7 +1389,7 @@ dissect_cmip_ActionError(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offse static int dissect_cmip_T_actionReplyInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 464 "cmip.cnf" +#line 474 "cmip.cnf" offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); @@ -1461,7 +1471,7 @@ dissect_cmip_ModifyOperator(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of static int dissect_cmip_T_attributeValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 458 "cmip.cnf" +#line 468 "cmip.cnf" offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); @@ -1689,7 +1699,7 @@ dissect_cmip_DeleteResult(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offs static int dissect_cmip_T_eventReplyInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 446 "cmip.cnf" +#line 450 "cmip.cnf" offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); @@ -1716,7 +1726,7 @@ dissect_cmip_EventReply(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset static int dissect_cmip_EventReportArgumentEventInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 443 "cmip.cnf" +#line 447 "cmip.cnf" offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); @@ -1983,7 +1993,7 @@ dissect_cmip_T_errorId(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset static int dissect_cmip_T_errorInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 455 "cmip.cnf" +#line 465 "cmip.cnf" offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); @@ -2092,9 +2102,15 @@ dissect_cmip_NoSuchEventType(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o static int dissect_cmip_T_attributevalue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 449 "cmip.cnf" - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); - +#line 453 "cmip.cnf" + if(attributeform==ATTRIBUTE_GLOBAL_FORM){ + offset=call_ber_oid_callback(attribute_identifier_id, tvb, offset, actx->pinfo, tree); + } else if (dissector_try_uint(attribute_id_dissector_table, attribute_local_id, tvb, actx->pinfo, tree)) { + offset=tvb_length (tvb); + } else { + offset=dissect_unknown_ber(actx->pinfo, tvb, offset, tree); + } + return offset; @@ -2330,7 +2346,7 @@ dissect_cmip_BOOLEAN(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U static int dissect_cmip_T_information(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 471 "cmip.cnf" +#line 481 "cmip.cnf" offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); @@ -2427,7 +2443,7 @@ dissect_cmip_AttributeList(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off static int dissect_cmip_T_oldAttributeValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 474 "cmip.cnf" +#line 484 "cmip.cnf" offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); @@ -2439,7 +2455,7 @@ dissect_cmip_T_oldAttributeValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, i static int dissect_cmip_T_newAttributeValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 477 "cmip.cnf" +#line 487 "cmip.cnf" offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); @@ -3215,7 +3231,7 @@ dissect_cmip_T_serviceUseridentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U static int dissect_cmip_T_details(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 482 "cmip.cnf" +#line 492 "cmip.cnf" offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); @@ -3338,7 +3354,7 @@ dissect_cmip_T_featureIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, i static int dissect_cmip_T_featureInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 487 "cmip.cnf" +#line 497 "cmip.cnf" offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); @@ -3669,7 +3685,7 @@ dissect_cmip_T_linkedId(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset static int dissect_cmip_InvokeArgument(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 285 "cmip.cnf" +#line 289 "cmip.cnf" switch(opcode){ case 0: /* M-eventreport */ offset = dissect_cmip_EventReportArgument(FALSE, tvb, offset, actx, tree, -1); @@ -3737,7 +3753,7 @@ dissect_cmip_Invoke(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_ static int dissect_cmip_ResultArgument(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 323 "cmip.cnf" +#line 327 "cmip.cnf" switch(opcode){ case 0: /* M-eventreport*/ @@ -3814,7 +3830,7 @@ dissect_cmip_ReturnResult(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offs static int dissect_cmip_T_parameter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 357 "cmip.cnf" +#line 361 "cmip.cnf" switch(opcode){ case 19: /* classInstanceConflict */ @@ -4364,7 +4380,7 @@ static void dissect_WeekMask_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, prot /*--- End of included file: packet-cmip-fn.c ---*/ -#line 90 "packet-cmip-template.c" +#line 94 "packet-cmip-template.c" @@ -5563,7 +5579,7 @@ void proto_register_cmip(void) { NULL, HFILL }}, /*--- End of included file: packet-cmip-hfarr.c ---*/ -#line 184 "packet-cmip-template.c" +#line 188 "packet-cmip-template.c" }; /* List of subtrees */ @@ -5695,7 +5711,7 @@ void proto_register_cmip(void) { &ett_cmip_T_modificationList_item, /*--- End of included file: packet-cmip-ettarr.c ---*/ -#line 190 "packet-cmip-template.c" +#line 194 "packet-cmip-template.c" }; /* Register protocol */ @@ -5780,9 +5796,11 @@ void proto_register_cmip(void) { /*--- End of included file: packet-cmip-dis-tab.c ---*/ -#line 199 "packet-cmip-template.c" +#line 203 "packet-cmip-template.c" oid_add_from_string("discriminatorId(1)","2.9.3.2.7.1"); + attribute_id_dissector_table = register_dissector_table("cmip.attribute_id", "CMIP Attribute Id", FT_UINT32, BASE_DEC); + } |