- dissect_ber_object_identifier() returns value as tvb
authorkukosa <kukosa@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 14 Nov 2005 10:02:31 +0000 (10:02 +0000)
committerkukosa <kukosa@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 14 Nov 2005 10:02:31 +0000 (10:02 +0000)
 - new dissect_ber_object_identifier_str() function
 - BER dissectors adapted and regenerated

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16501 f5534014-38df-0310-8fa8-9805f1628bb7

57 files changed:
asn1/acse/acse.cnf
asn1/acse/packet-acse-template.c
asn1/cmip/cmip.cnf
asn1/cmip/packet-cmip-template.c
asn1/cms/cms.cnf
asn1/cms/packet-cms-template.c
asn1/ess/ess.cnf
asn1/ess/packet-ess-template.c
asn1/ftam/ftam.cnf
asn1/ftam/packet-ftam-template.c
asn1/ocsp/ocsp.cnf
asn1/ocsp/packet-ocsp-template.c
asn1/pkix1explicit/packet-pkix1explicit-template.c
asn1/pkix1explicit/pkix1explicit.cnf
asn1/pkixcmp/cmp.cnf
asn1/pkixcmp/packet-cmp-template.c
asn1/pkixcrmf/crmf.cnf
asn1/pkixcrmf/packet-crmf-template.c
asn1/pkixqualified/packet-pkixqualified-template.c
asn1/pkixqualified/pkixqualified.cnf
asn1/pres/packet-pres-template.c
asn1/pres/pres.cnf
asn1/spnego/packet-spnego-template.c
asn1/spnego/spnego.cnf
asn1/tcap/packet-tcap-template.c
asn1/tcap/tcap.cnf
asn1/x411/packet-x411-template.c
asn1/x411/x411.cnf
asn1/x420/packet-x420-template.c
asn1/x420/x420.cnf
asn1/x509af/packet-x509af-template.c
asn1/x509af/x509af.cnf
asn1/x509ce/packet-x509ce-template.c
asn1/x509ce/x509ce.cnf
asn1/x509if/packet-x509if-template.c
asn1/x509if/x509if.cnf
epan/dissectors/packet-acse.c
epan/dissectors/packet-ber.c
epan/dissectors/packet-ber.h
epan/dissectors/packet-cmip.c
epan/dissectors/packet-cmp.c
epan/dissectors/packet-cms.c
epan/dissectors/packet-crmf.c
epan/dissectors/packet-ess.c
epan/dissectors/packet-ftam.c
epan/dissectors/packet-gssapi.c
epan/dissectors/packet-ocsp.c
epan/dissectors/packet-pkix1explicit.c
epan/dissectors/packet-pkixqualified.c
epan/dissectors/packet-pres.c
epan/dissectors/packet-spnego.c
epan/dissectors/packet-tcap.c
epan/dissectors/packet-x411.c
epan/dissectors/packet-x420.c
epan/dissectors/packet-x509af.c
epan/dissectors/packet-x509ce.c
epan/dissectors/packet-x509if.c

index c80e625366b56db69a590ed5e4f47298dc8f642a..5a72fa3690df64c0a6f5fdfdaf5d7a96d9d44b42 100644 (file)
@@ -1,3 +1,8 @@
+# asce.cnf
+# ACSE conformation file
+
+# $Id$
+
 #.MODULE_IMPORT
 InformationFramework x509if
 
@@ -52,9 +57,8 @@ ACRQ-apdu/aSO-context-name    aCRQ_aSO_context_name
    offset = dissect_ber_sequence(TRUE, pinfo, tree, tvb, offset,
                                 EXTERNAL_sequence, hf_index, ett_acse_EXTERNAL);
 
-#.FN_BODY Authentication-value-other/other-mechanism-name
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_index, object_identifier_id);
+#.FN_PARS Authentication-value-other/other-mechanism-name  
+  FN_VARIANT = _str VAL_PTR = &object_identifier_id
 
 #.FN_BODY Authentication-value-other/other-mechanism-value
   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, top_tree);
@@ -63,20 +67,20 @@ ACRQ-apdu/aSO-context-name  aCRQ_aSO_context_name
 /*XXX not implemented yet */
 
 #.FN_BODY AARQ-apdu/aSO-context-name
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_index, object_identifier_id);
+  offset = dissect_ber_object_identifier_str(FALSE, pinfo, tree, tvb, offset,
+                                         hf_index, &object_identifier_id);
 
 #.FN_BODY AARE-apdu/aSO-context-name
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_index, object_identifier_id);
+  offset = dissect_ber_object_identifier_str(FALSE, pinfo, tree, tvb, offset,
+                                         hf_index, &object_identifier_id);
 
 #.FN_BODY ACRQ-apdu/aSO-context-name
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_index, object_identifier_id);
+  offset = dissect_ber_object_identifier_str(FALSE, pinfo, tree, tvb, offset,
+                                         hf_index, &object_identifier_id);
 
 #.FN_BODY ACRP-apdu/aSO-context-name
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_index, object_identifier_id);
+  offset = dissect_ber_object_identifier_str(FALSE, pinfo, tree, tvb, offset,
+                                         hf_index, &object_identifier_id);
 
 #.FN_BODY EXTERNAL/indirect-reference
   char *oid;
@@ -86,16 +90,14 @@ ACRQ-apdu/aSO-context-name  aCRQ_aSO_context_name
 
   /* look up the indirect reference */
   if((oid = find_oid_by_pres_ctx_id(pinfo, indir_ref)) != NULL) {
-    g_snprintf(object_identifier_id, MAX_OID_STR_LEN, "%%s", oid);
+    object_identifier_id = ep_strdup(oid);
   }
 
   if(session)
        session->pres_ctx_id = indir_ref;
 
-#.FN_BODY EXTERNAL/direct-reference
-
-  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, object_identifier_id);
-
+#.FN_PARS EXTERNAL/direct-reference
+  FN_VARIANT = _str VAL_PTR = &object_identifier_id
 
 #.FN_BODY EXTERNAL/encoding/single-ASN1-type
   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, top_tree ? top_tree : tree);
index 67d86ed5f34829736160205c8209acf38d31f0ce..0e32bcaa5762ac86796fa70424093233cc537ad4 100644 (file)
@@ -68,7 +68,7 @@ static gint ett_acse = -1;
 
 static struct SESSION_DATA_STRUCTURE* session = NULL;
 
-static char object_identifier_id[MAX_OID_STR_LEN];
+static const char *object_identifier_id;
 /* indirect_reference, used to pick up the signalling so we know what
    kind of data is transferred in SES_DATA_TRANSFER_PDUs */
 static guint32 indir_ref=0;
index f601cd77b877ba7542d9b47fd4141f1dc1e7a562..c1c0a6a00035b0e06de0e0f7d85fe4845901145d 100644 (file)
@@ -38,11 +38,7 @@ RDNSequence
   }
 #.END
 
-#.FN_PARS CMIPAbortSource
-
-VAL_PTR = &value
-
-#.FN_BODY CMIPAbortSource
+#.FN_BODY CMIPAbortSource  VAL_PTR = &value
   guint32 value;
 
   %(DEFAULT_BODY)s
@@ -50,10 +46,8 @@ VAL_PTR = &value
     col_append_fstr(pinfo->cinfo, COL_INFO, " AbortSource:%%s", val_to_str(value, cmip_CMIPAbortSource_vals, " Unknown AbortSource:%%d"));
   }
 #.END
-#.FN_PARS Opcode
-       VAL_PTR = &opcode
 
-#.FN_BODY Opcode
+#.FN_BODY Opcode  VAL_PTR = &opcode
   %(DEFAULT_BODY)s
   if(check_col(pinfo->cinfo, COL_INFO)){
     col_prepend_fstr(pinfo->cinfo, COL_INFO, "%%s", val_to_str(opcode, cmip_Opcode_vals, " Unknown Opcode:%%d"));
@@ -88,10 +82,7 @@ VAL_PTR = &value
   }
 #.END
 
-#.FN_PARS AttributeId/globalForm
-       VAL_PTR = attribute_identifier_id
-
-#.FN_BODY AttributeId/globalForm
+#.FN_BODY AttributeId/globalForm  FN_VARIANT = _str  VAL_PTR = &attribute_identifier_id
   attributeform = ATTRIBUTE_GLOBAL_FORM;
   %(DEFAULT_BODY)s
 
@@ -105,7 +96,7 @@ VAL_PTR = &value
     offset=call_ber_oid_callback(attribute_identifier_id, tvb, offset, pinfo, tree);
   }
 #.FN_PARS AttributeValueAssertion/id
-       VAL_PTR = attributevalueassertion_id
+       FN_VARIANT = _str  VAL_PTR = &attributevalueassertion_id
 
 #.FN_BODY AttributeValueAssertion/value
     offset=call_ber_oid_callback(attributevalueassertion_id, tvb, offset, pinfo, tree);
@@ -184,87 +175,71 @@ VAL_PTR = &value
   /*XXX add more types here */
   }
 
-#.FN_BODY ObjectClass/ocglobalForm
+#.FN_HDR ObjectClass/ocglobalForm
   objectclassform = OBJECTCLASS_GLOBAL_FORM;
-  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset,
-                                         hf_cmip_ocglobalForm, objectclass_identifier_id);
+#.FN_PARS ObjectClass/ocglobalForm
+  FN_VARIANT = _str  VAL_PTR = &objectclass_identifier_id
 
-#.FN_BODY ObjectClass/oclocalForm
+#.FN_HDR ObjectClass/oclocalForm
   objectclassform = OBJECTCLASS_LOCAL_FORM;
-  offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_cmip_oclocalForm, NULL);
 
-#.FN_BODY ActionInfo/actionType
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_cmip_actionType_OID, object_identifier_id);
+#.FN_PARS ActionInfo/actionType
+  FN_VARIANT = _str  HF_INDEX = hf_cmip_actionType_OID  VAL_PTR = &object_identifier_id
 
 #.FN_BODY ActionInfo/actionInfoArg
   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
 
-#.FN_BODY ActionReply/actionType
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_cmip_actionType_OID, object_identifier_id);
+#.FN_PARS ActionReply/actionType
+  FN_VARIANT = _str  HF_INDEX = hf_cmip_actionType_OID  VAL_PTR = &object_identifier_id
 
 #.FN_BODY ActionReply/actionReplyInfo
   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
 
-#.FN_BODY EventReportArgument/eventType
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_cmip_eventType_OID, object_identifier_id);
+#.FN_PARS EventReportArgument/eventType
+  FN_VARIANT = _str  HF_INDEX = hf_cmip_eventType_OID  VAL_PTR = &object_identifier_id
 
 #.FN_BODY EventReportArgument/eventInfo
   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
 
-
-#.FN_BODY EventReply/eventType
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_cmip_eventType_OID, object_identifier_id);
+#.FN_PARS EventReply/eventType
+  FN_VARIANT = _str  HF_INDEX = hf_cmip_eventType_OID  VAL_PTR = &object_identifier_id
 
 #.FN_BODY EventReply/eventReplyInfo
   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
 
-#.FN_BODY ModificationItem/attributeId
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_cmip_attributeId_OID, object_identifier_id);
+#.FN_PARS ModificationItem/attributeId
+  FN_VARIANT = _str  HF_INDEX = hf_cmip_attributeId_OID  VAL_PTR = &object_identifier_id
 
 #.FN_BODY ModificationItem/attributeValue
   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
 
-
-#.FN_BODY SpecificErrorInfo/errorId
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_cmip_errorId_OID, object_identifier_id);
+#.FN_PARS SpecificErrorInfo/errorId
+  FN_VARIANT = _str  HF_INDEX = hf_cmip_errorId_OID  VAL_PTR = &object_identifier_id
 
 #.FN_BODY SpecificErrorInfo/errorInfo
   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
 
-#.FN_BODY AttributeError/attributeId
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_cmip_attributeId_OID, object_identifier_id);
+#.FN_PARS AttributeError/attributeId
+  FN_VARIANT = _str  HF_INDEX = hf_cmip_attributeId_OID  VAL_PTR = &object_identifier_id
 
 #.FN_BODY AttributeError/attributeValue
   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
 
+#.FN_PARS ErrorInfo/actionType
+  FN_VARIANT = _str  HF_INDEX = hf_cmip_actionType_OID  VAL_PTR = &object_identifier_id
 
-#.FN_BODY ErrorInfo/actionType
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_cmip_actionType_OID, object_identifier_id);
-
-#.FN_BODY NoSuchArgumentAction/actionType
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_cmip_actionType_OID, object_identifier_id);
+#.FN_PARS NoSuchArgumentAction/actionType
+  FN_VARIANT = _str  HF_INDEX = hf_cmip_actionType_OID  VAL_PTR = &object_identifier_id
 
-#.FN_BODY NoSuchArgumentEvent/eventType
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_cmip_eventType_OID, object_identifier_id);
+#.FN_PARS NoSuchArgumentEvent/eventType
+  FN_VARIANT = _str  HF_INDEX = hf_cmip_eventType_OID  VAL_PTR = &object_identifier_id
 
-#.FN_BODY InvalidArgumentValueEventValue/eventType
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_cmip_eventType_OID, object_identifier_id);
+#.FN_PARS InvalidArgumentValueEventValue/eventType
+  FN_VARIANT = _str  HF_INDEX = hf_cmip_eventType_OID  VAL_PTR = &object_identifier_id
 
 #.FN_BODY InvalidArgumentValueEventValue/eventInfo
   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
 
-
 #.END
 
 
index 20453fb28b39e0ec427262a9cd8cffc785a86368..4799c559806694bd614dea2c56806b0cfa7642ea 100644 (file)
@@ -75,16 +75,16 @@ static int opcode_type;
 static int attributeform;
 #define ATTRIBUTE_LOCAL_FORM  0
 #define ATTRIBUTE_GLOBAL_FORM 1
-static char attribute_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *attribute_identifier_id;
 
-static char attributevalueassertion_id[BER_MAX_OID_STR_LEN];
+static const char *attributevalueassertion_id;
 
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
 
 static int objectclassform;
 #define OBJECTCLASS_LOCAL_FORM  0
 #define OBJECTCLASS_GLOBAL_FORM 1
-static char objectclass_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *objectclass_identifier_id;
 
 #include "packet-cmip-fn.c"
 
index b2c82528502a568bb8b795b0ef470760357a45dd..2c09a38d5808e320553810370770ad221fba9d7f 100644 (file)
@@ -48,15 +48,15 @@ SignerInfo/signature        signatureValue
 RecipientEncryptedKey/rid      rekRid
 
 #.FN_BODY ContentInfo/contentType
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_cms_ci_contentType, object_identifier_id);
+  offset = dissect_ber_object_identifier_str(FALSE, pinfo, tree, tvb, offset,
+                                         hf_cms_ci_contentType, &object_identifier_id);
 
 #.FN_BODY ContentInfo/content
   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
 
 #.FN_BODY EncapsulatedContentInfo/eContentType
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_cms_ci_contentType, object_identifier_id);
+  offset = dissect_ber_object_identifier_str(FALSE, pinfo, tree, tvb, offset,
+                                         hf_cms_ci_contentType, &object_identifier_id);
 
 #.FN_BODY EncapsulatedContentInfo/eContent
   gint8 class;
@@ -72,17 +72,14 @@ RecipientEncryptedKey/rid   rekRid
   pdu_offset = get_ber_length(tree, tvb, pdu_offset, &len, &ind);
   pdu_offset = call_ber_oid_callback(object_identifier_id, tvb, pdu_offset, pinfo, tree);
 
-#.FN_BODY OtherKeyAttribute/keyAttrId
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_cms_ci_contentType, object_identifier_id);
+#.FN_PARS OtherKeyAttribute/keyAttrId
+  FN_VARIANT = _str  HF_INDEX = hf_cms_ci_contentType  VAL_PTR = &object_identifier_id
 
 #.FN_BODY OtherKeyAttribute/keyAttr
   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
 
-#.FN_BODY Attribute/attrType
-
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_cms_attrType, object_identifier_id);
+#.FN_PARS Attribute/attrType
+  FN_VARIANT = _str  HF_INDEX = hf_cms_attrType  VAL_PTR = &object_identifier_id
 
 #.FN_BODY AttributeValue
 
index 644ea2b82d01183d495042ce24ce9fd2e49e064d..c52c79da72eb7004a869ecc8029f4b64df235122 100644 (file)
@@ -54,7 +54,7 @@ static int hf_cms_ci_contentType = -1;
 static int dissect_cms_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) ; /* XXX kill a compiler warning until asn2eth stops generating these silly wrappers */
 
 
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
 
 #include "packet-cms-fn.c"
 
index d4fe6fb510758c49f75133ee42b9265a75693a6c..10c2caa3ae9fbcfd81a7cfe14fdc7d9e4bd86067 100644 (file)
@@ -35,9 +35,8 @@ SigningCertificate B "1.2.840.113549.1.9.16.2.12" "id-aa-signingCertificate"
 
 #.FIELD_RENAME
 
-#.FN_BODY SecurityCategory/type
-  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset,
-                                         hf_ess_SecurityCategory_type_OID, object_identifier_id);
+#.FN_PARS SecurityCategory/type
+  FN_VARIANT = _str  HF_INDEX = hf_ess_SecurityCategory_type_OID  VAL_PTR = &object_identifier_id
 
 #.FN_BODY SecurityCategory/value
   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
index 3d97f218e76ee15fd19d125298ce1b434d2b6721..477522e0fd9fd1655ceeabeeecc010e8250f680f 100644 (file)
@@ -51,7 +51,7 @@ static int hf_ess_SecurityCategory_type_OID = -1;
 /* Initialize the subtree pointers */
 #include "packet-ess-ett.c"
 
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
 
 #include "packet-ess-fn.c"
 
index d4f6af9448ef08ca21ec14448acc57723e60995b..22ab59d5065e746b632f9135c2b3f2188f64c579 100644 (file)
@@ -68,9 +68,7 @@ Object-Availability-Attribute/actual-values   actual_values8
 Legal-Qualification-Attribute/actual-values    actual_values9
 
 #.FN_PARS Extension-Attribute/extension-attribute-identifier
-       VAL_PTR = object_identifier_id
-
-
+       FN_VARIANT = _str  VAL_PTR = &object_identifier_id
 
 #.FN_BODY Contents-Type-Attribute/document-type/parameter
   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
@@ -79,7 +77,7 @@ Legal-Qualification-Attribute/actual-values   actual_values9
   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
 
 #.FN_PARS Attribute-Extensions-Pattern/_item/extension-set-attribute-Patterns/_item/extension-attribute-identifier
-       VAL_PTR = object_identifier_id
+       FN_VARIANT = _str  VAL_PTR = &object_identifier_id
 
 #.FN_BODY Attribute-Extensions-Pattern/_item/extension-set-attribute-Patterns/_item/extension-attribute-Pattern
   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
@@ -455,7 +453,7 @@ Legal-Qualification-Attribute/actual-values actual_values9
                                    Diagnostic_sequence_of, hf_index, ett_ftam_Diagnostic);
 
 
-#.FN_BODY Document-Type-Name
+#.FN_BODY Document-Type-Name  FN_VARIANT = _str  VAL_PTR = &object_identifier_id
  gint8 class;
  gboolean pc, ind_field;
  gint32 tag;
@@ -468,8 +466,7 @@ Legal-Qualification-Attribute/actual-values actual_values9
     offset = get_ber_identifier(tvb, offset, &class, &pc, &tag);
     offset = get_ber_length(tree, tvb, offset, &len1, &ind_field);
  }
-  offset = dissect_ber_object_identifier(TRUE, pinfo, tree, tvb, offset,
-                                         hf_index, object_identifier_id);
+%(DEFAULT_BODY)s
 
 #.FN_BODY FADU-Lock
  gint8 class;
index ceffa589b81c855b6d16e3478a069aba7be2027f..e0b01ebfc9b844a42129b3af37e42ab3d1106521 100644 (file)
@@ -50,7 +50,7 @@
 /* Initialize the protocol and registered fields */
 int proto_ftam = -1;
 
-static char object_identifier_id[MAX_OID_STR_LEN];
+static const char *object_identifier_id;
 /* Declare the function to avoid a compiler warning */
 static int dissect_ftam_OR_Set(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_);
 
index 567ef511bd1e0f9f55e8880ce6f1dd53e47d5b7c..1f61c4372d48d0d7db97cd5310cc3ff13f7317ef 100644 (file)
@@ -31,9 +31,8 @@ ServiceLocator                B       "1.3.6.1.5.5.7.48.1.7"  "id-pkix-ocsp-service-locator"
 
 #.FIELD_RENAME
 
-#.FN_BODY ResponseBytes/responseType
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                 hf_ocsp_responseType_id, responseType_id);
+#.FN_PARS ResponseBytes/responseType
+  FN_VARIANT = _str  HF_INDEX = hf_ocsp_responseType_id  VAL_PTR = &responseType_id
 
 #.FN_BODY ResponseBytes/response
   gint8 class;
index 888a52943b90f8df050d09a6cc6863fdba5defd9..45b513c329b32f94cf8fc0832f65534bc0a148b8 100644 (file)
@@ -53,7 +53,7 @@ static int hf_ocsp_responseType_id = -1;
 static gint ett_ocsp = -1;
 #include "packet-ocsp-ett.c"
 
-static char responseType_id[BER_MAX_OID_STR_LEN];
+static const char *responseType_id;
 
 
 #include "packet-ocsp-fn.c"
index 5864278ea7d2bb924be057de4612e05dbe440cdc..5074eb184660fca9bd24d17a173a4c5f797aa768 100644 (file)
@@ -54,7 +54,7 @@ static int hf_pkix1explicit_object_identifier_id = -1;
 #include "packet-pkix1explicit-ett.c"
 
 
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
 
 int
 dissect_pkix1explicit_Certificate(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
index 5e9ec6adb0a2de225f148488cac1a06463e75b95..2ee8302b4045f1b3e38b99b7141df38851d2b6ec 100644 (file)
@@ -31,16 +31,14 @@ DomainParameters B "1.2.840.10046.2.1" "dhpublicnumber"
 #.FN_BODY DirectoryString
        offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
 
-#.FN_BODY AttributeTypeAndValue/value
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_pkix1explicit_object_identifier_id, object_identifier_id);
+#.FN_PARS AttributeTypeAndValue/value
+  FN_VARIANT = _str  HF_INDEX = hf_pkix1explicit_object_identifier_id  VAL_PTR = &object_identifier_id
 
 #.FN_BODY AttributeTypeAndValue/value
   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
 
-#.FN_BODY Extension/extnId
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                 hf_pkix1explicit_object_identifier_id, object_identifier_id);
+#.FN_PARS Extension/extnId
+  FN_VARIANT = _str  HF_INDEX = hf_pkix1explicit_object_identifier_id  VAL_PTR = &object_identifier_id
 
 #.FN_BODY Extension/extnValue
   gint8 class;
index b6360cea6a0bc1f51d08b5568a65722f6a4c40d3..66798b85bf0e51d75ab7505ff035b602dd46f7e4 100644 (file)
@@ -59,9 +59,8 @@ RevReqContent
 #.FIELD_RENAME
 
 
-#.FN_BODY InfoTypeAndValue/infoType
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_cmp_type_oid, object_identifier_id);
+#.FN_PARS InfoTypeAndValue/infoType
+  FN_VARIANT = _str  HF_INDEX = hf_cmp_type_oid  VAL_PTR = &object_identifier_id
 
 #.FN_BODY InfoTypeAndValue/infoValue
   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
index 4ee367dbc7b5e66b4acff61231c482787a4b1137..3e763841022b6f378c06c376fa3352e6b1688ef2 100644 (file)
@@ -66,7 +66,7 @@ static int hf_cmp_ttcb = -1;
 static gint ett_cmp = -1;
 #include "packet-cmp-ett.c"
 
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
 
 
 #include "packet-cmp-fn.c"
index 3ceb9cadae2006f06d283f5c6760384640d5e2c7..e7b77cef0a35b77f6dbe8286847d679b79d0d366 100644 (file)
@@ -53,9 +53,8 @@ CertTemplate/issuer           template_issuer
 POPOSigningKey/signature       sk_signature
 PKMACValue/value               pkmac_value
 
-#.FN_BODY AttributeTypeAndValue/type
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_crmf_type_oid, object_identifier_id);
+#.FN_PARS AttributeTypeAndValue/type
+  FN_VARIANT = _str  HF_INDEX = hf_crmf_type_oid  VAL_PTR = &object_identifier_id
 
 #.FN_BODY AttributeTypeAndValue/value
   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
index 5f5b8679b38e7200710f13bf519c8b8093c1d8bb..29b60fbc4b0b5b89c1077105eac67c5418dc5aec 100644 (file)
@@ -52,7 +52,7 @@ static int hf_crmf_type_oid = -1;
 /* Initialize the subtree pointers */
 #include "packet-crmf-ett.c"
 
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
 
 #include "packet-crmf-fn.c"
 
index 865868e2038973ffc27b3110e15552b42b3ed60b..b7d0f75244056ab6509b152c1a9bdeb7f793476a 100644 (file)
@@ -51,7 +51,7 @@ int proto_pkixqualified = -1;
 /* Initialize the subtree pointers */
 #include "packet-pkixqualified-ett.c"
 
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
 
 #include "packet-pkixqualified-fn.c"
 
index 29b2050fff288ab8f61d7e26d738de1297fa615f..3307a6fc67b8dd19a4f381525bd44eeb3ac468a8 100644 (file)
@@ -31,9 +31,8 @@ Printablestring         B "1.3.6.1.5.5.7.9.5" "id-pda-countryOfResidence"
 
 #.FIELD_RENAME
 
-#.FN_BODY QCStatement/statementId
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_pkixqualified_statementId, object_identifier_id);
+#.FN_PARS QCStatement/statementId
+  FN_VARIANT = _str  HF_INDEX = hf_pkixqualified_statementId  VAL_PTR = &object_identifier_id
 
 #.FN_BODY QCStatement/statementInfo
   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
index f4b79ac433c47741335f1d75032c957f18d19991..7e7513b6ffd45e1a1968fc5e65cdedcba1e189f3 100644 (file)
@@ -58,7 +58,7 @@ packet_info *global_pinfo = NULL;
 /* dissector for data */
 static dissector_handle_t data_handle;
 
-static char abstract_syntax_name_oid[BER_MAX_OID_STR_LEN];
+static const char *abstract_syntax_name_oid;
 static guint32 presentation_context_identifier;
 
 /* to keep track of presentation context identifiers and protocol-oids */
@@ -111,7 +111,7 @@ pres_init(void)
 }
 
 static void
-register_ctx_id_and_oid(packet_info *pinfo _U_, guint32 idx, char *oid)
+register_ctx_id_and_oid(packet_info *pinfo _U_, guint32 idx, const char *oid)
 {
        pres_ctx_oid_t *pco, *tmppco;
        pco=se_alloc(sizeof(pres_ctx_oid_t));
index fd5c4df37e48e5b773dcefb10f6b7675fc0e0f7f..ba2d332ac9e02ee66731d37c60e7508ef4ffd879 100644 (file)
@@ -63,7 +63,7 @@ CPR-PPDU/normal-mode-parameters/provider-reason cPR_PPDU__provider-reason
 
 
 #.FN_PARS Abstract_syntax_name
VAL_PTR = abstract_syntax_name_oid
 FN_VARIANT = _str  VAL_PTR = &abstract_syntax_name_oid
 
 #.FN_PARS Presentation_context_identifier
  VAL_PTR = &presentation_context_identifier
index 151eb43a127e817877faaf2f005cda0e841757ce..59f7851668ee5b27b86746ffee45bd150aa9944e 100644 (file)
@@ -73,7 +73,7 @@ static int hf_spnego_krb5_confounder = -1;
 #include "packet-spnego-hf.c"
 
 /* Global variables */
-gchar MechType_oid[MAX_OID_STR_LEN];
+static const char *MechType_oid;
 gssapi_oid_value *next_level_value;
 gboolean saw_mechanism = FALSE;
 
@@ -163,7 +163,7 @@ dissect_spnego_krb5(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        proto_tree *subtree;
        int offset = 0;
        guint16 token_id;
-       gchar oid[MAX_OID_STR_LEN];
+       const char *oid;
        gssapi_oid_value *value;
        tvbuff_t *krb5_tvb;
        gint8 class;
@@ -222,7 +222,7 @@ dissect_spnego_krb5(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                 */
 
                /* Next, the OID */
-               offset=dissect_ber_object_identifier(FALSE, pinfo, subtree, tvb, offset, hf_spnego_krb5_oid, oid);
+               offset=dissect_ber_object_identifier_str(FALSE, pinfo, subtree, tvb, offset, hf_spnego_krb5_oid, &oid);
 
                value = gssapi_lookup_oid_str(oid);
 
index 1ebd727d5e4c913a83d1dad044e5e26900ace901..d39d09238aebd88f5676323361eec3ad31601b9f 100644 (file)
@@ -17,7 +17,7 @@ NegTokenInit/mechListMIC negTokenInit_mechListMIC
 
 #.FN_PARS MechType
 
-  VAL_PTR = MechType_oid
+  FN_VARIANT = _str  VAL_PTR = &MechType_oid
 
 #.FN_BODY MechType
 
index 0bf0d6334e356345d50c8f91f21d813a29c8ba64..175593497924f22ac0d32a0adca4fa916b37edd6 100644 (file)
@@ -74,8 +74,8 @@ static gboolean g_tcap_ends_def_len = FALSE;
 
 dissector_handle_t     tcap_handle;
 static dissector_table_t ber_oid_dissector_table=NULL;
-static char * cur_oid;
-static char * tcapext_oid;
+static const char * cur_oid;
+static const char * tcapext_oid;
 static proto_tree      *tcap_top_tree=NULL;
 static dissector_handle_t data_handle;
 static dissector_table_t tcap_itu_ssn_dissector_table; /* map use ssn in sccp */
index 2e3068f0eed5a4cc58a31eaf6ab0e000603d67ac..687f5601ce5192700ad32991127af9b20a9179cf 100644 (file)
@@ -124,19 +124,13 @@ else
         dissector_try_port(tcap_itu_ssn_dissector_table, pinfo->match_port, next_tvb, pinfo, tcap_top_tree);
 return offset+len;
 
-#.FN_BODY Applicationcontext
-       static char buffer[128];
-       cur_oid = buffer;
-       pinfo->private_data = buffer;
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_index, cur_oid);
-
-#.FN_BODY UserInfoOID
-       static char buffer[128];
-       tcapext_oid = buffer;
-       pinfo->private_data = buffer;
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_index, tcapext_oid);
+#.FN_BODY Applicationcontext  FN_VARIANT = _str  VAL_PTR = &cur_oid
+%(DEFAULT_BODY)s
+       pinfo->private_data = cur_oid;
+
+#.FN_BODY UserInfoOID  FN_VARIANT = _str  VAL_PTR = &tcapext_oid
+%(DEFAULT_BODY)s
+       pinfo->private_data = tcapext_oid;
 
 #.FN_BODY ExternUserInfo
 tvbuff_t       *next_tvb;
index a02ed78ec0d5081d2834486af80bbb5a5fd6ae78..f21ef4ebb18ffd6c78821d1b0725212aa2e41d80 100644 (file)
@@ -28,6 +28,7 @@
 #endif
 
 #include <glib.h>
+#include <epan/emem.h>
 #include <epan/packet.h>
 #include <epan/conversation.h>
 
@@ -55,7 +56,7 @@ int proto_x411 = -1;
 
 static struct SESSION_DATA_STRUCTURE* session = NULL;
 static int extension_id = 0; /* integer extension id */
-static char object_identifier_id[BER_MAX_OID_STR_LEN]; /* content type identifier */
+static const char *object_identifier_id; /* content type identifier */
 
 static proto_tree *top_tree=NULL;
 
index 2260d5fd739bfe1b95a1eb531cf65f9b7a6563eb..72cdef65c7ab3f105a7cb7081ccdaa04e8bd7d6d 100644 (file)
@@ -263,7 +263,7 @@ UniversalOrganizationalUnitNames B "x411.extension-attribute.27" "universal-orga
        VAL_PTR = &extension_id
 
 #.FN_PARS ExtendedContentType
-       VAL_PTR = object_identifier_id
+       FN_VARIANT = _str  VAL_PTR = &object_identifier_id
 
 #.FN_PARS BuiltInContentType
        VAL_PTR = &ict
@@ -276,10 +276,10 @@ UniversalOrganizationalUnitNames B "x411.extension-attribute.27" "universal-orga
   /* convert integer content type to oid for dispatch when the content is found */
   switch(ict) {
        case 2:
-       g_snprintf(object_identifier_id, BER_MAX_OID_STR_LEN, "2.6.1.10.0");
+       object_identifier_id = ep_strdup("2.6.1.10.0");
        break;
        case 22:
-       g_snprintf(object_identifier_id, BER_MAX_OID_STR_LEN, "2.6.1.10.1");
+       object_identifier_id = ep_strdup("2.6.1.10.1");
        break;
        default:
        break;
index e17d6af99fef6b373d5394d166a6dbfb12a51823..f0be929410aff05a3d9a807223607dc59a393703 100644 (file)
@@ -50,7 +50,7 @@
 /* Initialize the protocol and registered fields */
 int proto_x420 = -1;
 
-static char object_identifier_id[BER_MAX_OID_STR_LEN]; /* content type identifier */
+static const char *object_identifier_id; /* content type identifier */
 
 #include "packet-x420-hf.c"
 
index 71e714852759b29b75c43821af847dadf6c9849c..564089c8a3d336410a9ba0ecaa514b7d40c69234 100644 (file)
@@ -46,7 +46,7 @@ ChangeOfAddressAdvice B "2.6.1.19.1"  "id-on-change-of-address-advice"
 IPMAssemblyInstructions        B "2.6.1.17.2"  "id-mst-assembly-instructions"
 
 #.FN_PARS IPMSExtension/type
-       VAL_PTR = object_identifier_id
+       FN_VARIANT = _str  VAL_PTR = &object_identifier_id
 
 #.FN_BODY IPMSExtension/type
   char *name = NULL;
index 1f8a2993b90a06444aecf49af6adb723564a8963..393a052eeae47afbb48afd61854664d51d41ffe1 100644 (file)
@@ -54,10 +54,10 @@ static int hf_x509af_extension_id = -1;
 static gint ett_pkix_crl = -1;
 #include "packet-x509af-ett.c"
 
-static char algorithm_id[BER_MAX_OID_STR_LEN];
+static const char *algorithm_id;
 
 
-static char extension_id[BER_MAX_OID_STR_LEN];
+static const char *extension_id;
 
 
 #include "packet-x509af-fn.c"
index 942155eddf1c069c926dd739554d693de024cdf2..4bde694356cf4bf194500ec2efec861460638871 100644 (file)
@@ -66,16 +66,15 @@ IssuerSerial/issuer                 issuerName
 CertificateList/signedCertificateList/revokedCertificates/_item/userCertificate                revokedUserCertificate
 #.END
 
-#.FN_BODY AlgorithmIdentifier/algorithmId
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                 hf_x509af_algorithm_id, algorithm_id);
+#.FN_PARS AlgorithmIdentifier/algorithmId
+  FN_VARIANT = _str  HF_INDEX = hf_x509af_algorithm_id  VAL_PTR = &algorithm_id
+
 
 #.FN_BODY AlgorithmIdentifier/parameters
   offset=call_ber_oid_callback(algorithm_id, tvb, offset, pinfo, tree);
 
-#.FN_BODY Extension/extnId
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                 hf_x509af_extension_id, extension_id);
+#.FN_PARS Extension/extnId
+  FN_VARIANT = _str  HF_INDEX = hf_x509af_extension_id  VAL_PTR = &extension_id
 
 #.FN_BODY Extension/extnValue
   gint8 class;
index 05945be10f63d3a30012fb7974b6885519b54318..d5928ceba98ca62756613e3ccd00c5f8bcbab4f7 100644 (file)
@@ -55,7 +55,7 @@ static int hf_x509ce_IPAddress = -1;
 /* Initialize the subtree pointers */
 #include "packet-x509ce-ett.c"
 
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
 
 #include "packet-x509ce-fn.c"
 
index a547e1876cd7612ba58592cf934c357279885d8b..edce713b94a97b57720eeb3acd16890b76cc70e4 100644 (file)
@@ -104,9 +104,8 @@ CRLReferral/issuer  crlr_issuer
 CertificatePairExactAssertion/issuedToThisCAAssertion  cpea_issuedToThisCAAssertion
 CertificatePairExactAssertion/issuedByThisCAAssertion  cpea_issuedByThisCAAssertion
        
-#.FN_BODY PolicyQualifierId
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_x509ce_object_identifier_id, object_identifier_id);
+#.FN_PARS PolicyQualifierId
+  FN_VARIANT = _str  HF_INDEX = hf_x509ce_object_identifier_id  VAL_PTR = &object_identifier_id
 
 #.FN_BODY PolicyQualifierValue
   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
index 097e4e15514c287ee3ff9944a60ec41f4bd22cf7..a53ddcc364ebab5aeebf0a8ae6d82b4ee30d5508 100644 (file)
@@ -50,7 +50,7 @@ static int hf_x509if_object_identifier_id = -1;
 /* Initialize the subtree pointers */
 #include "packet-x509if-ett.c"
 
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
 
 #include "packet-x509if-fn.c"
 
index 09303e7eab3c197a9921dcd5bc1f417f5a967c01..d59a97022a482fb08062c2fb6634e82c85295648 100644 (file)
@@ -84,16 +84,14 @@ RequestAttribute/defaultValues/_item/values/_item   ra_values_item
 RequestAttribute/selectedValues                                ra_selectedValues
 RequestAttribute/selectedValues/_item                  ra_selectedValues_item
 
-#.FN_BODY ContextId
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_x509if_object_identifier_id, object_identifier_id);
+#.FN_PARS ContextId
+  FN_VARIANT = _str  HF_INDEX = hf_x509if_object_identifier_id  VAL_PTR = &object_identifier_id
 
 #.FN_BODY ContextValue
   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
 
-#.FN_BODY AttributeId
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_x509if_object_identifier_id, object_identifier_id);
+#.FN_PARS AttributeId
+  FN_VARIANT = _str  HF_INDEX = hf_x509if_object_identifier_id  VAL_PTR = &object_identifier_id
 
 #.FN_BODY AttributeValue
   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
@@ -101,9 +99,8 @@ RequestAttribute/selectedValues/_item                        ra_selectedValues_item
 #.FN_BODY SelectedValues
   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
 
-#.FN_BODY DefaultValueType
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_x509if_object_identifier_id, object_identifier_id);
+#.FN_PARS DefaultValueType
+  FN_VARIANT = _str  HF_INDEX = hf_x509if_object_identifier_id  VAL_PTR = &object_identifier_id
 
 #.FN_BODY DefaultValueValues
   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
index 2fb969ef56e318b55f90ed6450337ec7a55b2c51..6cedf275dca44981fff052e54ec3e22f01311cba 100644 (file)
@@ -226,7 +226,7 @@ static gint ett_acse_Authentication_value = -1;
 
 static struct SESSION_DATA_STRUCTURE* session = NULL;
 
-static char object_identifier_id[MAX_OID_STR_LEN];
+static const char *object_identifier_id;
 /* indirect_reference, used to pick up the signalling so we know what
    kind of data is transferred in SES_DATA_TRANSFER_PDUs */
 static guint32 indir_ref=0;
@@ -308,10 +308,7 @@ find_oid_by_ctx_id(packet_info *pinfo _U_, guint32 idx)
 
 static int
 dissect_acse_T_direct_reference(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-
-  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, object_identifier_id);
-
-
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_index, &object_identifier_id);
 
   return offset;
 }
@@ -330,7 +327,7 @@ dissect_acse_T_indirect_reference(gboolean implicit_tag _U_, tvbuff_t *tvb, int
 
   /* look up the indirect reference */
   if((oid = find_oid_by_pres_ctx_id(pinfo, indir_ref)) != NULL) {
-    g_snprintf(object_identifier_id, MAX_OID_STR_LEN, "%s", oid);
+    object_identifier_id = ep_strdup(oid);
   }
 
   if(session)
@@ -498,8 +495,8 @@ static int dissect_ASO_context_name_list_item(packet_info *pinfo, proto_tree *tr
 
 static int
 dissect_acse_T_AARQ_aSO_context_name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_index, object_identifier_id);
+  offset = dissect_ber_object_identifier_str(FALSE, pinfo, tree, tvb, offset,
+                                         hf_index, &object_identifier_id);
 
 
   return offset;
@@ -764,9 +761,7 @@ static int dissect_charstring_impl(packet_info *pinfo, proto_tree *tree, tvbuff_
 
 static int
 dissect_acse_T_other_mechanism_name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_index, object_identifier_id);
-
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_index, &object_identifier_id);
 
   return offset;
 }
@@ -1164,8 +1159,8 @@ static int dissect_aARE_protocol_version_impl(packet_info *pinfo, proto_tree *tr
 
 static int
 dissect_acse_T_AARE_aSO_context_name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_index, object_identifier_id);
+  offset = dissect_ber_object_identifier_str(FALSE, pinfo, tree, tvb, offset,
+                                         hf_index, &object_identifier_id);
 
 
   return offset;
@@ -1672,8 +1667,8 @@ static int dissect_adt_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb,
 
 static int
 dissect_acse_T_ACRQ_aSO_context_name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_index, object_identifier_id);
+  offset = dissect_ber_object_identifier_str(FALSE, pinfo, tree, tvb, offset,
+                                         hf_index, &object_identifier_id);
 
 
   return offset;
@@ -1708,8 +1703,8 @@ static int dissect_acrq_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb
 
 static int
 dissect_acse_T_ACRP_aSO_context_name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_index, object_identifier_id);
+  offset = dissect_ber_object_identifier_str(FALSE, pinfo, tree, tvb, offset,
+                                         hf_index, &object_identifier_id);
 
 
   return offset;
index a5d4de7a9fcce9e34150a950cab9aea6a9389367..b652d2cbe51bcbd47798e1d7d12daa26c7d4b9c0 100644 (file)
@@ -201,7 +201,7 @@ register_ber_oid_name(const char *oid, const char *name)
 
 /* Get oid name from hash table to get translation in proto dissection(packet-per.c) */
 char *
-get_ber_oid_name(char *oid)
+get_ber_oid_name(const char *oid)
 {
        return g_hash_table_lookup(oid_table, oid);
 }
@@ -1716,16 +1716,17 @@ dissect_ber_GeneralString(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, i
  * if value_string is non-NULL it must point to a buffer of at least
  * MAX_OID_STR_LEN bytes.
  */
-int dissect_ber_object_identifier(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, char *value_string) {
+int dissect_ber_object_identifier(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, tvbuff_t **value_tvb) 
+{
        gint8 class;
        gboolean pc;
        gint32 tag;
        guint32 len;
        int eoffset;
        char *str, *name;
-       proto_item *item;
+       proto_item *item = NULL;
+  header_field_info *hfi;
 
-       str=ep_alloc(MAX_OID_STR_LEN);
 #ifdef DEBUG_BER
 {
 char *name;
@@ -1744,10 +1745,6 @@ printf("OBJECT IDENTIFIER dissect_ber_object_identifier(%s) entered\n",name);
 }
 #endif
 
-       if(value_string) {
-               value_string[0] = '\0';
-       }
-
        if(!implicit_tag) {
                /* sanity check */
                offset = dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &tag);
@@ -1764,27 +1761,50 @@ printf("OBJECT IDENTIFIER dissect_ber_object_identifier(%s) entered\n",name);
                eoffset=offset+len;
        }
 
-       oid_to_str_buf(tvb_get_ptr(tvb, offset, len), len, str, MAX_OID_STR_LEN);
-       offset += len;
+  str = oid_to_str(tvb_get_ptr(tvb, offset, len), len);
 
-       if(hf_id >= 0) {
-               item=proto_tree_add_string(tree, hf_id, tvb, offset - len, len, str);
-               /* see if we know the name of this oid */
-               if(item){
-                       name=g_hash_table_lookup(oid_table, str);
-                       if(name){
-                               proto_item_append_text(item, " (%s)", name);
-                       }
-               }
-       }
+  hfi = proto_registrar_get_nth(hf_id);
+  /*if (hfi->type == FT_OID) {
+    item = proto_tree_add_item(tree, hf_index, tvb, offset, len, FALSE);
+  } else*/ if (IS_FT_STRING(hfi->type)) {
+    item = proto_tree_add_string(tree, hf_id, tvb, offset, len, str);
+  } else {
+    DISSECTOR_ASSERT_NOT_REACHED();
+  }
+
+  if (value_tvb)
+    *value_tvb = tvb_new_subset(tvb, offset, len, len);
 
-       if(value_string) {
-               g_snprintf(value_string, MAX_OID_STR_LEN, "%s", str);
+       /* see if we know the name of this oid */
+       if(item){
+               name=g_hash_table_lookup(oid_table, str);
+               if(name){
+                       proto_item_append_text(item, " (%s)", name);
+               }
        }
 
        return eoffset;
 }
 
+int dissect_ber_object_identifier_str(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, const char **value_string)
+{
+  tvbuff_t *value_tvb = NULL;
+  guint length;
+
+  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_id, (value_string) ? &value_tvb : NULL);
+
+  if (value_string) {
+    if (value_tvb && (length = tvb_length(value_tvb))) {
+      *value_string = oid_to_str(tvb_get_ptr(value_tvb, 0, length), length);
+    } else {
+      *value_string = "";
+    }
+  }
+
+  return offset;
+}
+
+
 static int dissect_ber_sq_of(gboolean implicit_tag, gint32 type, packet_info *pinfo, proto_tree *parent_tree, tvbuff_t *tvb, int offset, const ber_sequence_t *seq, gint hf_id, gint ett_id) {
        gint8 class;
        gboolean pc, ind = FALSE, ind_field;
index 7626f0d16781eb86af605f5c203f02c5da81e7ef..015b61fc997b04ef3e13d6118b64d00d5438fb8e 100644 (file)
@@ -135,10 +135,9 @@ extern int dissect_ber_GeneralString(packet_info *pinfo, proto_tree *tree, tvbuf
 
 
 /* this function dissects a BER Object Identifier
- * IF you pass a pointer for value_string to this one, MAKE SURE it is declared
- * as char foo[MAX_OID_STR_LEN]
  */
-extern int dissect_ber_object_identifier(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, char *value_string);
+extern int dissect_ber_object_identifier(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, tvbuff_t **value_tvb);
+extern int dissect_ber_object_identifier_str(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, const char **value_string);
 
 /* this function dissects a BER sequence of
  */
@@ -171,7 +170,7 @@ void register_ber_oid_dissector_handle(const char *oid, dissector_handle_t disse
 void register_ber_oid_dissector(const char *oid, dissector_t dissector, int proto, const char *name);
 void register_ber_oid_name(const char *oid, const char *name);
 void dissect_ber_oid_NULL_callback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
-char * get_ber_oid_name(char *str);
+char * get_ber_oid_name(const char *str);
 
 #endif  /* __PACKET_BER_H__ */
 
index a146f34a078c5356a92af5a207ba5c4ed84cb989..8f993eae59a23e8f77fac8a92d9125f414c65440 100644 (file)
@@ -303,16 +303,16 @@ static int opcode_type;
 static int attributeform;
 #define ATTRIBUTE_LOCAL_FORM  0
 #define ATTRIBUTE_GLOBAL_FORM 1
-static char attribute_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *attribute_identifier_id;
 
-static char attributevalueassertion_id[BER_MAX_OID_STR_LEN];
+static const char *attributevalueassertion_id;
 
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
 
 static int objectclassform;
 #define OBJECTCLASS_LOCAL_FORM  0
 #define OBJECTCLASS_GLOBAL_FORM 1
-static char objectclass_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *objectclass_identifier_id;
 
 
 /*--- Included file: packet-cmip-fn.c ---*/
@@ -371,9 +371,7 @@ static int dissect_modifyOperator_impl(packet_info *pinfo, proto_tree *tree, tvb
 
 static int
 dissect_cmip_T_attributeId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_cmip_attributeId_OID, object_identifier_id);
-
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_cmip_attributeId_OID, &object_identifier_id);
 
   return offset;
 }
@@ -388,7 +386,6 @@ dissect_cmip_T_attributeValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offs
   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
 
 
-
   return offset;
 }
 static int dissect_attributeValue(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
@@ -419,9 +416,7 @@ static int dissect_modificationList_item(packet_info *pinfo, proto_tree *tree, t
 static int
 dissect_cmip_T_ocglobalForm(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
   objectclassform = OBJECTCLASS_GLOBAL_FORM;
-  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset,
-                                         hf_cmip_ocglobalForm, objectclass_identifier_id);
-
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_index, &objectclass_identifier_id);
 
   return offset;
 }
@@ -434,8 +429,9 @@ static int dissect_ocglobalForm_impl(packet_info *pinfo, proto_tree *tree, tvbuf
 static int
 dissect_cmip_T_oclocalForm(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
   objectclassform = OBJECTCLASS_LOCAL_FORM;
-  offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_cmip_oclocalForm, NULL);
 
+  offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
+                                  NULL);
 
   return offset;
 }
@@ -475,8 +471,7 @@ static int dissect_baseManagedObjectClass(packet_info *pinfo, proto_tree *tree,
 
 static int
 dissect_cmip_T_id(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
-                                            attributevalueassertion_id);
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_index, &attributevalueassertion_id);
 
   return offset;
 }
@@ -650,8 +645,7 @@ static int dissect_errorStatus(packet_info *pinfo, proto_tree *tree, tvbuff_t *t
 static int
 dissect_cmip_T_globalForm(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
   attributeform = ATTRIBUTE_GLOBAL_FORM;
-    offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
-                                            attribute_identifier_id);
+    offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_index, &attribute_identifier_id);
 
 
 
@@ -877,9 +871,7 @@ static int dissect_errorStatus2(packet_info *pinfo, proto_tree *tree, tvbuff_t *
 
 static int
 dissect_cmip_T_attributeId1(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_cmip_attributeId_OID, object_identifier_id);
-
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_cmip_attributeId_OID, &object_identifier_id);
 
   return offset;
 }
@@ -894,7 +886,6 @@ dissect_cmip_T_attributeValue1(gboolean implicit_tag _U_, tvbuff_t *tvb, int off
   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
 
 
-
   return offset;
 }
 static int dissect_attributeValue1(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
@@ -1007,9 +998,7 @@ static int dissect_errorStatus1(packet_info *pinfo, proto_tree *tree, tvbuff_t *
 
 static int
 dissect_cmip_T_actionType1(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_cmip_actionType_OID, object_identifier_id);
-
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_cmip_actionType_OID, &object_identifier_id);
 
   return offset;
 }
@@ -1021,9 +1010,7 @@ static int dissect_actionType1(packet_info *pinfo, proto_tree *tree, tvbuff_t *t
 
 static int
 dissect_cmip_T_actionType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_cmip_actionType_OID, object_identifier_id);
-
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_cmip_actionType_OID, &object_identifier_id);
 
   return offset;
 }
@@ -1053,9 +1040,7 @@ static int dissect_actionId_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t
 
 static int
 dissect_cmip_T_eventType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_cmip_eventType_OID, object_identifier_id);
-
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_cmip_eventType_OID, &object_identifier_id);
 
   return offset;
 }
@@ -1110,9 +1095,7 @@ static int dissect_actionArgument(packet_info *pinfo, proto_tree *tree, tvbuff_t
 
 static int
 dissect_cmip_T_actionType3(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_cmip_actionType_OID, object_identifier_id);
-
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_cmip_actionType_OID, &object_identifier_id);
 
   return offset;
 }
@@ -1158,9 +1141,7 @@ static int dissect_actionInfo_impl(packet_info *pinfo, proto_tree *tree, tvbuff_
 
 static int
 dissect_cmip_T_eventType1(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_cmip_eventType_OID, object_identifier_id);
-
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_cmip_eventType_OID, &object_identifier_id);
 
   return offset;
 }
@@ -1175,7 +1156,6 @@ dissect_cmip_T_eventInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, p
   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
 
 
-
   return offset;
 }
 static int dissect_eventInfo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
@@ -1294,9 +1274,7 @@ static int dissect_actionError_impl(packet_info *pinfo, proto_tree *tree, tvbuff
 
 static int
 dissect_cmip_T_errorId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_cmip_errorId_OID, object_identifier_id);
-
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_cmip_errorId_OID, &object_identifier_id);
 
   return offset;
 }
@@ -1707,9 +1685,7 @@ static int dissect_getResult_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t
 
 static int
 dissect_cmip_T_actionType2(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_cmip_actionType_OID, object_identifier_id);
-
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_cmip_actionType_OID, &object_identifier_id);
 
   return offset;
 }
@@ -1827,9 +1803,7 @@ dissect_cmip_LinkedReplyArgument(gboolean implicit_tag _U_, tvbuff_t *tvb, int o
 
 static int
 dissect_cmip_T_eventType2(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_cmip_eventType_OID, object_identifier_id);
-
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_cmip_eventType_OID, &object_identifier_id);
 
   return offset;
 }
@@ -1889,9 +1863,7 @@ dissect_cmip_EventReportResult(gboolean implicit_tag _U_, tvbuff_t *tvb, int off
 
 static int
 dissect_cmip_T_eventType3(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_cmip_eventType_OID, object_identifier_id);
-
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_cmip_eventType_OID, &object_identifier_id);
 
   return offset;
 }
@@ -1906,7 +1878,6 @@ dissect_cmip_T_eventInfo1(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset,
   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
 
 
-
   return offset;
 }
 static int dissect_eventInfo1(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
@@ -2107,8 +2078,7 @@ static int dissect_ae_title_form1(packet_info *pinfo, proto_tree *tree, tvbuff_t
 
 static int
 dissect_cmip_AE_title_form2(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
-                                            NULL);
+  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
 
   return offset;
 }
@@ -2202,8 +2172,7 @@ dissect_cmip_OperationalState(gboolean implicit_tag _U_, tvbuff_t *tvb, int offs
 
 static int
 dissect_cmip_NameBinding(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
-                                            NULL);
+  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
 
   return offset;
 }
index b96e3586d27b453d5ad4b4ada6db699b12c40648..6bafc791f0c577611cb555b5994f830fdab4e843 100644 (file)
@@ -1,6 +1,6 @@
 /* Do not modify this file.                                                   */
 /* It is created automatically by the ASN.1 to Ethereal dissector compiler    */
-/* ./packet-cmp.c                                                             */
+/* .\packet-cmp.c                                                             */
 /* ../../tools/asn2eth.py -X -b -e -p cmp -c cmp.cnf -s packet-cmp-template CMP.asn */
 
 /* Input file: packet-cmp-template.c */
@@ -227,7 +227,7 @@ static gint ett_cmp_ErrorMsgContent = -1;
 /*--- End of included file: packet-cmp-ett.c ---*/
 
 
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
 
 
 
@@ -456,9 +456,7 @@ static int dissect_errorDetails(packet_info *pinfo, proto_tree *tree, tvbuff_t *
 
 static int
 dissect_cmp_T_infoType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_cmp_type_oid, object_identifier_id);
-
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_cmp_type_oid, &object_identifier_id);
 
   return offset;
 }
@@ -1466,7 +1464,7 @@ dissect_cmp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
        return tvb_length(tvb);
 }
 
-static void
+static int
 dissect_cmp_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
 {
        proto_item *item=NULL;
@@ -2028,7 +2026,7 @@ void proto_reg_handoff_cmp(void) {
        dissector_handle_t cmp_http_handle;
        dissector_handle_t cmp_tcp_handle;
 
-       cmp_http_handle = create_dissector_handle(dissect_cmp_http, proto_cmp);
+       cmp_http_handle = new_create_dissector_handle(dissect_cmp_http, proto_cmp);
        dissector_add_string("media_type", "application/pkixcmp", cmp_http_handle);
 
        cmp_tcp_handle = new_create_dissector_handle(dissect_cmp_tcp, proto_cmp);
index 23f5edf89d44cb9f171ceee2c4ac56274d43a89f..6eeef3220f879db6d6a63a9d13229a0c62696c02 100644 (file)
@@ -197,7 +197,7 @@ static gint ett_cms_ExtendedCertificateInfo = -1;
 static int dissect_cms_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) ; /* XXX kill a compiler warning until asn2eth stops generating these silly wrappers */
 
 
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
 
 
 /*--- Included file: packet-cms-fn.c ---*/
@@ -239,8 +239,8 @@ static int dissect_contentType1(packet_info *pinfo, proto_tree *tree, tvbuff_t *
 
 static int
 dissect_cms_T_contentType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_cms_ci_contentType, object_identifier_id);
+  offset = dissect_ber_object_identifier_str(FALSE, pinfo, tree, tvb, offset,
+                                         hf_cms_ci_contentType, &object_identifier_id);
 
 
   return offset;
@@ -337,8 +337,8 @@ static int dissect_digestAlgorithms(packet_info *pinfo, proto_tree *tree, tvbuff
 
 static int
 dissect_cms_T_eContentType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_cms_ci_contentType, object_identifier_id);
+  offset = dissect_ber_object_identifier_str(FALSE, pinfo, tree, tvb, offset,
+                                         hf_cms_ci_contentType, &object_identifier_id);
 
 
   return offset;
@@ -393,10 +393,7 @@ static int dissect_encapContentInfo(packet_info *pinfo, proto_tree *tree, tvbuff
 
 static int
 dissect_cms_T_attrType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_cms_attrType, object_identifier_id);
-
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_cms_attrType, &object_identifier_id);
 
   return offset;
 }
@@ -950,9 +947,7 @@ static int dissect_generalTime(packet_info *pinfo, proto_tree *tree, tvbuff_t *t
 
 static int
 dissect_cms_T_keyAttrId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_cms_ci_contentType, object_identifier_id);
-
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_cms_ci_contentType, &object_identifier_id);
 
   return offset;
 }
index 01d2ba8dcf31278c20c21060857e232067dc85ec..2a87725cbacf62ddf34d48582ff313c611405455 100644 (file)
@@ -1,6 +1,6 @@
 /* Do not modify this file.                                                   */
 /* It is created automatically by the ASN.1 to Ethereal dissector compiler    */
-/* ./packet-crmf.c                                                            */
+/* .\packet-crmf.c                                                            */
 /* ../../tools/asn2eth.py -X -b -e -p crmf -c crmf.cnf -s packet-crmf-template CRMF.asn */
 
 /* Input file: packet-crmf-template.c */
@@ -154,7 +154,7 @@ static gint ett_crmf_CertId = -1;
 /*--- End of included file: packet-crmf-ett.c ---*/
 
 
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
 
 
 /*--- Included file: packet-crmf-fn.c ---*/
@@ -374,9 +374,7 @@ static int dissect_certTemplate(packet_info *pinfo, proto_tree *tree, tvbuff_t *
 
 static int
 dissect_crmf_T_type(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_crmf_type_oid, object_identifier_id);
-
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_crmf_type_oid, &object_identifier_id);
 
   return offset;
 }
index 2719a22d0ab7c3bd0bb00f43c1d50f309694885a..65b0e5d5230cfb4e94a894586f4eff328cc1aaad 100644 (file)
@@ -138,7 +138,7 @@ static gint ett_ess_IssuerSerial = -1;
 /*--- End of included file: packet-ess-ett.c ---*/
 
 
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
 
 
 /*--- Included file: packet-ess-fn.c ---*/
@@ -458,9 +458,7 @@ static int dissect_privacy_mark(packet_info *pinfo, proto_tree *tree, tvbuff_t *
 
 static int
 dissect_ess_T_type(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset,
-                                         hf_ess_SecurityCategory_type_OID, object_identifier_id);
-
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_ess_SecurityCategory_type_OID, &object_identifier_id);
 
   return offset;
 }
index e6364c16d47441ac5ab6f8c7ee43df62e1d31bd1..c9097d8ec6d2ada27033eeb4db800f60892a0160 100644 (file)
@@ -57,7 +57,7 @@
 /* Initialize the protocol and registered fields */
 int proto_ftam = -1;
 
-static char object_identifier_id[MAX_OID_STR_LEN];
+static const char *object_identifier_id;
 /* Declare the function to avoid a compiler warning */
 static int dissect_ftam_OR_Set(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_);
 
@@ -936,8 +936,8 @@ dissect_ftam_Document_Type_Name(gboolean implicit_tag _U_, tvbuff_t *tvb, int of
     offset = get_ber_identifier(tvb, offset, &class, &pc, &tag);
     offset = get_ber_length(tree, tvb, offset, &len1, &ind_field);
  }
-  offset = dissect_ber_object_identifier(TRUE, pinfo, tree, tvb, offset,
-                                         hf_index, object_identifier_id);
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_index, &object_identifier_id);
+
 
 
   return offset;
@@ -2698,7 +2698,7 @@ static int dissect_extension_set_identifier_impl(packet_info *pinfo, proto_tree
 
 static int
 dissect_ftam_T_extension_attribute_identifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, object_identifier_id);
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_index, &object_identifier_id);
 
   return offset;
 }
@@ -4816,7 +4816,7 @@ static int dissect_object_availabiiity_Pattern_impl(packet_info *pinfo, proto_tr
 
 static int
 dissect_ftam_T_extension_attribute_identifier1(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, object_identifier_id);
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_index, &object_identifier_id);
 
   return offset;
 }
index 8321b811cbc8573bb5019204538613a68b1996b8..ff44d3d286e904516f2f0624762f26db3b76e018 100644 (file)
@@ -101,7 +101,7 @@ gssapi_init_oid(const char *oid, int proto, int ett, dissector_handle_t handle,
  * an argument.
  */
 gssapi_oid_value *
-gssapi_lookup_oid_str(gchar *oid_key)
+gssapi_lookup_oid_str(const char *oid_key)
 {
        gssapi_oid_value *value;
        value = g_hash_table_lookup(gssapi_oids, oid_key);
@@ -124,7 +124,7 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
        gboolean pc, ind_field;
        gint32 tag;
        guint32 len1;
-       gchar oid[MAX_OID_STR_LEN];
+       const char *oid;
 
        start_offset=0;
        offset=start_offset;
@@ -234,7 +234,7 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
 
                /* Read oid */
                oid_start_offset=offset;
-               offset=dissect_ber_object_identifier(FALSE, pinfo, subtree, tvb, offset, hf_gssapi_oid, oid);
+               offset=dissect_ber_object_identifier_str(FALSE, pinfo, subtree, tvb, offset, hf_gssapi_oid, &oid);
 
                /*
                 * Hand off to subdissector.
index 6a8dbcd37538a35c46bc3c5b3c4084a6c882a584..27de186e3e77bc5b09355e5f61a6245abcb8ab7a 100644 (file)
@@ -1,6 +1,6 @@
 /* Do not modify this file.                                                   */
 /* It is created automatically by the ASN.1 to Ethereal dissector compiler    */
-/* ./packet-ocsp.c                                                            */
+/* .\packet-ocsp.c                                                            */
 /* ../../tools/asn2eth.py -X -b -e -p ocsp -c ocsp.cnf -s packet-ocsp-template OCSP.asn */
 
 /* Input file: packet-ocsp-template.c */
@@ -139,7 +139,7 @@ static gint ett_ocsp_CrlID = -1;
 /*--- End of included file: packet-ocsp-ett.c ---*/
 
 
-static char responseType_id[BER_MAX_OID_STR_LEN];
+static const char *responseType_id;
 
 
 
@@ -389,9 +389,7 @@ static int dissect_responseStatus(packet_info *pinfo, proto_tree *tree, tvbuff_t
 
 static int
 dissect_ocsp_T_responseType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                 hf_ocsp_responseType_id, responseType_id);
-
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_ocsp_responseType_id, &responseType_id);
 
   return offset;
 }
@@ -671,8 +669,7 @@ dissect_ocsp_ArchiveCutoff(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset,
 
 static int
 dissect_ocsp_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
-                                            NULL);
+  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
 
   return offset;
 }
index db033ba73c9c3676f5efde9f4fd528afa549082f..9486db1fd7b2359ec4478410d20659f2b54ebcf7 100644 (file)
@@ -1,6 +1,6 @@
 /* Do not modify this file.                                                   */
 /* It is created automatically by the ASN.1 to Ethereal dissector compiler    */
-/* ./packet-pkix1explicit.c                                                   */
+/* .\packet-pkix1explicit.c                                                   */
 /* ../../tools/asn2eth.py -e -X -b -p pkix1explicit -c pkix1explicit.cnf -s packet-pkix1explicit-template PKIX1EXPLICIT93.asn */
 
 /* Input file: packet-pkix1explicit-template.c */
@@ -98,7 +98,7 @@ static gint ett_pkix1explicit_TeletexDomainDefinedAttribute = -1;
 
 
 
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
 
 int
 dissect_pkix1explicit_Certificate(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
@@ -159,9 +159,7 @@ dissect_pkix1explicit_CertificateSerialNumber(gboolean implicit_tag _U_, tvbuff_
 
 static int
 dissect_pkix1explicit_T_extnId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                 hf_pkix1explicit_object_identifier_id, object_identifier_id);
-
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_pkix1explicit_object_identifier_id, &object_identifier_id);
 
   return offset;
 }
@@ -313,8 +311,7 @@ dissect_pkix1explicit_DomainParameters(gboolean implicit_tag _U_, tvbuff_t *tvb,
 
 static int
 dissect_pkix1explicit_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
-                                            NULL);
+  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
 
   return offset;
 }
@@ -326,9 +323,6 @@ static int dissect_type(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int
 
 static int
 dissect_pkix1explicit_T_value(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_pkix1explicit_object_identifier_id, object_identifier_id);
-
   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
 
 
index 52e35a70f6a02883bb0234b2cde88f60124454d6..d409ce5e53289bf1f0928092a4a5f65db767eb3d 100644 (file)
@@ -1,6 +1,6 @@
 /* Do not modify this file.                                                   */
 /* It is created automatically by the ASN.1 to Ethereal dissector compiler    */
-/* ./packet-pkixqualified.c                                                   */
+/* .\packet-pkixqualified.c                                                   */
 /* ../../tools/asn2eth.py -X -b -e -p pkixqualified -c pkixqualified.cnf -s packet-pkixqualified-template PKIXqualified.asn */
 
 /* Input file: packet-pkixqualified-template.c */
@@ -94,7 +94,7 @@ static gint ett_pkixqualified_NameRegistrationAuthorities = -1;
 /*--- End of included file: packet-pkixqualified-ett.c ---*/
 
 
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
 
 
 /*--- Included file: packet-pkixqualified-fn.c ---*/
@@ -160,8 +160,7 @@ static int dissect_predefinedBiometricType(packet_info *pinfo, proto_tree *tree,
 
 static int
 dissect_pkixqualified_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
-                                            NULL);
+  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
 
   return offset;
 }
@@ -261,9 +260,7 @@ dissect_pkixqualified_BiometricSyntax(gboolean implicit_tag _U_, tvbuff_t *tvb,
 
 static int
 dissect_pkixqualified_T_statementId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_pkixqualified_statementId, object_identifier_id);
-
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_pkixqualified_statementId, &object_identifier_id);
 
   return offset;
 }
@@ -317,7 +314,7 @@ dissect_pkixqualified_QCStatements(gboolean implicit_tag _U_, tvbuff_t *tvb, int
 
 
 static const ber_sequence_t NameRegistrationAuthorities_sequence_of[1] = {
-  { BER_CLASS_CON, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_NameRegistrationAuthorities_item },
+  { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_NameRegistrationAuthorities_item },
 };
 
 static int
index 882261da2a5d4e442cf03934116243ce2adbf3db..ba0b1c49a6a8b67e292731ba08cd0964c42d924c 100644 (file)
@@ -65,7 +65,7 @@ packet_info *global_pinfo = NULL;
 /* dissector for data */
 static dissector_handle_t data_handle;
 
-static char abstract_syntax_name_oid[BER_MAX_OID_STR_LEN];
+static const char *abstract_syntax_name_oid;
 static guint32 presentation_context_identifier;
 
 /* to keep track of presentation context identifiers and protocol-oids */
@@ -240,7 +240,7 @@ pres_init(void)
 }
 
 static void
-register_ctx_id_and_oid(packet_info *pinfo _U_, guint32 idx, char *oid)
+register_ctx_id_and_oid(packet_info *pinfo _U_, guint32 idx, const char *oid)
 {
        pres_ctx_oid_t *pco, *tmppco;
        pco=se_alloc(sizeof(pres_ctx_oid_t));
@@ -406,7 +406,7 @@ static int dissect_Presentation_context_deletion_list_item(packet_info *pinfo, p
 
 static int
 dissect_pres_Abstract_syntax_name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, abstract_syntax_name_oid);
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_index, &abstract_syntax_name_oid);
 
   return offset;
 }
index 5935b02e19dddcfe28f3eb1732c6b319e8cc9196..0e7961bee4caac225ae6eeb7a28c765b674e8c56 100644 (file)
@@ -1,6 +1,6 @@
 /* Do not modify this file.                                                   */
 /* It is created automatically by the ASN.1 to Ethereal dissector compiler    */
-/* ./packet-spnego.c                                                          */
+/* .\packet-spnego.c                                                          */
 /* ../../tools/asn2eth.py -X -b -e -p spnego -c spnego.cnf -s packet-spnego-template spnego.asn */
 
 /* Input file: packet-spnego-template.c */
@@ -107,7 +107,7 @@ static int hf_spnego_ContextFlags_integFlag = -1;
 
 
 /* Global variables */
-gchar MechType_oid[MAX_OID_STR_LEN];
+static const char *MechType_oid;
 gssapi_oid_value *next_level_value;
 gboolean saw_mechanism = FALSE;
 
@@ -155,7 +155,7 @@ dissect_spnego_MechType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, pa
 
   gssapi_oid_value *value;
 
-  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, MechType_oid);
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_index, &MechType_oid);
 
 
   value = gssapi_lookup_oid_str(MechType_oid);
@@ -646,7 +646,7 @@ dissect_spnego_krb5(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        proto_tree *subtree;
        int offset = 0;
        guint16 token_id;
-       gchar oid[MAX_OID_STR_LEN];
+       const char *oid;
        gssapi_oid_value *value;
        tvbuff_t *krb5_tvb;
        gint8 class;
@@ -705,7 +705,7 @@ dissect_spnego_krb5(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                 */
 
                /* Next, the OID */
-               offset=dissect_ber_object_identifier(FALSE, pinfo, subtree, tvb, offset, hf_spnego_krb5_oid, oid);
+               offset=dissect_ber_object_identifier_str(FALSE, pinfo, subtree, tvb, offset, hf_spnego_krb5_oid, &oid);
 
                value = gssapi_lookup_oid_str(oid);
 
index a45d1a7041a315750d412eb73595548d71838d8e..771adc5724e9e1890b06f8fcfbb0a51b9f5999e1 100644 (file)
@@ -264,8 +264,8 @@ static gboolean g_tcap_ends_def_len = FALSE;
 
 dissector_handle_t     tcap_handle;
 static dissector_table_t ber_oid_dissector_table=NULL;
-static char * cur_oid;
-static char * tcapext_oid;
+static const char * cur_oid;
+static const char * tcapext_oid;
 static proto_tree      *tcap_top_tree=NULL;
 static dissector_handle_t data_handle;
 static dissector_table_t tcap_itu_ssn_dissector_table; /* map use ssn in sccp */
@@ -303,11 +303,9 @@ static int dissect_protocol_versionrq_impl(packet_info *pinfo, proto_tree *tree,
 
 static int
 dissect_tcap_Applicationcontext(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-       static char buffer[128];
-       cur_oid = buffer;
-       pinfo->private_data = buffer;
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_index, cur_oid);
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_index, &cur_oid);
+
+       pinfo->private_data = cur_oid;
 
 
   return offset;
@@ -551,8 +549,7 @@ dissect_tcap_DialoguePDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, p
 
 static int
 dissect_tcap_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
-                                            NULL);
+  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
 
   return offset;
 }
@@ -612,11 +609,9 @@ dissect_tcap_ExternalPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, p
 
 static int
 dissect_tcap_UserInfoOID(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-       static char buffer[128];
-       tcapext_oid = buffer;
-       pinfo->private_data = buffer;
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_index, tcapext_oid);
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_index, &tcapext_oid);
+
+       pinfo->private_data = tcapext_oid;
 
 
   return offset;
@@ -1569,8 +1564,7 @@ static int dissect_integerApplicationId(packet_info *pinfo, proto_tree *tree, tv
 
 static int
 dissect_tcap_ObjectIDApplicationContext(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
-                                            NULL);
+  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
 
   return offset;
 }
index b0b76b51c286e39e5a9ca98fdb0d6a999df91ba9..f6e6dfa0f343e0d08132788babccf28390b192a9 100644 (file)
@@ -35,6 +35,7 @@
 #endif
 
 #include <glib.h>
+#include <epan/emem.h>
 #include <epan/packet.h>
 #include <epan/conversation.h>
 
@@ -62,7 +63,7 @@ int proto_x411 = -1;
 
 static struct SESSION_DATA_STRUCTURE* session = NULL;
 static int extension_id = 0; /* integer extension id */
-static char object_identifier_id[BER_MAX_OID_STR_LEN]; /* content type identifier */
+static const char *object_identifier_id; /* content type identifier */
 
 static proto_tree *top_tree=NULL;
 
@@ -1920,10 +1921,10 @@ dissect_x411_BuiltInContentType(gboolean implicit_tag _U_, tvbuff_t *tvb, int of
   /* convert integer content type to oid for dispatch when the content is found */
   switch(ict) {
        case 2:
-       g_snprintf(object_identifier_id, BER_MAX_OID_STR_LEN, "2.6.1.10.0");
+       object_identifier_id = ep_strdup("2.6.1.10.0");
        break;
        case 22:
-       g_snprintf(object_identifier_id, BER_MAX_OID_STR_LEN, "2.6.1.10.1");
+       object_identifier_id = ep_strdup("2.6.1.10.1");
        break;
        default:
        break;
@@ -1943,7 +1944,7 @@ static int dissect_built_in_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t
 
 static int
 dissect_x411_ExtendedContentType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, object_identifier_id);
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_index, &object_identifier_id);
 
   return offset;
 }
index f711388dc6c6a058fb50f4c57185499667176ec7..d786dbe90fb14197f681cce9d02e61176cec913a 100644 (file)
@@ -57,7 +57,7 @@
 /* Initialize the protocol and registered fields */
 int proto_x420 = -1;
 
-static char object_identifier_id[BER_MAX_OID_STR_LEN]; /* content type identifier */
+static const char *object_identifier_id; /* content type identifier */
 
 
 /*--- Included file: packet-x420-hf.c ---*/
@@ -487,7 +487,7 @@ static int
 dissect_x420_T_type(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
   char *name = NULL;
 
-    offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, object_identifier_id);
+    offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_index, &object_identifier_id);
 
   
   name = get_ber_oid_name(object_identifier_id);
index 09d1c08bc5e33b0f90099ed1e2f4d6061974d8a0..81a0ced85562772c93db9260b21757ebce0f914e 100644 (file)
@@ -1,6 +1,6 @@
 /* Do not modify this file.                                                   */
 /* It is created automatically by the ASN.1 to Ethereal dissector compiler    */
-/* ./packet-x509af.c                                                          */
+/* .\packet-x509af.c                                                          */
 /* ../../tools/asn2eth.py -X -b -e -p x509af -c x509af.cnf -s packet-x509af-template AuthenticationFramework.asn */
 
 /* Input file: packet-x509af-template.c */
@@ -170,10 +170,10 @@ static gint ett_x509af_SET_OF_AttributeType = -1;
 /*--- End of included file: packet-x509af-ett.c ---*/
 
 
-static char algorithm_id[BER_MAX_OID_STR_LEN];
+static const char *algorithm_id;
 
 
-static char extension_id[BER_MAX_OID_STR_LEN];
+static const char *extension_id;
 
 
 
@@ -261,9 +261,7 @@ static int dissect_serial(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, i
 
 static int
 dissect_x509af_T_algorithmId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                 hf_x509af_algorithm_id, algorithm_id);
-
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_x509af_algorithm_id, &algorithm_id);
 
   return offset;
 }
@@ -437,9 +435,7 @@ static int dissect_subjectPublicKeyInfo(packet_info *pinfo, proto_tree *tree, tv
 
 static int
 dissect_x509af_T_extnId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                 hf_x509af_extension_id, extension_id);
-
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_x509af_extension_id, &extension_id);
 
   return offset;
 }
@@ -525,9 +521,9 @@ static const ber_sequence_t T_signedCertificate_sequence[] = {
   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_version },
   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_serialNumber },
   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_signature },
-  { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_issuer },
+  { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_issuer },
   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_validity },
-  { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_subject },
+  { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_subject },
   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_subjectPublicKeyInfo },
   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_issuerUniqueIdentifier_impl },
   { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_subjectUniqueIdentifier_impl },
@@ -712,7 +708,7 @@ static int dissect_revokedCertificates(packet_info *pinfo, proto_tree *tree, tvb
 static const ber_sequence_t T_signedCertificateList_sequence[] = {
   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_version },
   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_signature },
-  { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_issuer },
+  { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_issuer },
   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_thisUpdate },
   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_nextUpdate },
   { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_revokedCertificates },
index eaa24e544214c8c7961378430220e52e46b726a0..a51af864a05559f48b4c35b402c8f41bdb57081d 100644 (file)
@@ -1,6 +1,6 @@
 /* Do not modify this file.                                                   */
 /* It is created automatically by the ASN.1 to Ethereal dissector compiler    */
-/* ./packet-x509ce.c                                                          */
+/* .\packet-x509ce.c                                                          */
 /* ../../tools/asn2eth.py -X -b -e -p x509ce -c x509ce.cnf -s packet-x509ce-template CertificateExtensions.asn */
 
 /* Input file: packet-x509ce-template.c */
@@ -260,7 +260,7 @@ static gint ett_x509ce_PkiPathMatchSyntax = -1;
 /*--- End of included file: packet-x509ce-ett.c ---*/
 
 
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
 
 
 /*--- Included file: packet-x509ce-fn.c ---*/
@@ -379,8 +379,7 @@ static int dissect_iPAddress_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t
 
 static int
 dissect_x509ce_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
-                                            NULL);
+  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
 
   return offset;
 }
@@ -530,8 +529,7 @@ static int dissect_keyUsage_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t
 
 int
 dissect_x509ce_KeyPurposeId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
-                                            NULL);
+  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
 
   return offset;
 }
@@ -604,8 +602,7 @@ dissect_x509ce_PrivateKeyUsagePeriod(gboolean implicit_tag _U_, tvbuff_t *tvb, i
 
 static int
 dissect_x509ce_CertPolicyId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
-                                            NULL);
+  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
 
   return offset;
 }
@@ -626,9 +623,7 @@ static int dissect_CertPolicySet_item(packet_info *pinfo, proto_tree *tree, tvbu
 
 static int
 dissect_x509ce_PolicyQualifierId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_x509ce_object_identifier_id, object_identifier_id);
-
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_x509ce_object_identifier_id, &object_identifier_id);
 
   return offset;
 }
@@ -975,8 +970,7 @@ dissect_x509ce_CRLReason(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, p
 
 int
 dissect_x509ce_HoldInstruction(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
-                                            NULL);
+  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
 
   return offset;
 }
@@ -1329,7 +1323,7 @@ dissect_x509ce_BaseCRLNumber(gboolean implicit_tag _U_, tvbuff_t *tvb, int offse
 
 static const ber_sequence_t CertificateExactAssertion_sequence[] = {
   { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_serialNumber },
-  { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_issuer },
+  { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_issuer },
   { 0, 0, 0, NULL }
 };
 
@@ -1476,7 +1470,7 @@ dissect_x509ce_CertificatePairAssertion(gboolean implicit_tag _U_, tvbuff_t *tvb
 
 
 static const ber_sequence_t CertificateListExactAssertion_sequence[] = {
-  { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_issuer },
+  { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_issuer },
   { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_distributionPoint },
   { 0, 0, 0, NULL }
 };
@@ -1491,7 +1485,7 @@ dissect_x509ce_CertificateListExactAssertion(gboolean implicit_tag _U_, tvbuff_t
 
 
 static const ber_sequence_t CertificateListAssertion_sequence[] = {
-  { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_issuer },
+  { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_issuer },
   { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_minCRLNumber_impl },
   { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_maxCRLNumber_impl },
   { BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_reasonFlags },
@@ -1510,8 +1504,8 @@ dissect_x509ce_CertificateListAssertion(gboolean implicit_tag _U_, tvbuff_t *tvb
 
 
 static const ber_sequence_t PkiPathMatchSyntax_sequence[] = {
-  { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_firstIssuer },
-  { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_lastSubject },
+  { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_firstIssuer },
+  { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_lastSubject },
   { 0, 0, 0, NULL }
 };
 
index 077515677a191e6f8c190ce6ee9552e92938b3c4..8422135071e2dd0d44b13e43293d9db117a798cf 100644 (file)
@@ -1,6 +1,6 @@
 /* Do not modify this file.                                                   */
 /* It is created automatically by the ASN.1 to Ethereal dissector compiler    */
-/* ./packet-x509if.c                                                          */
+/* .\packet-x509if.c                                                          */
 /* ../../tools/asn2eth.py -X -b -e -p x509if -c x509if.cnf -s packet-x509if-template InformationFramework.asn */
 
 /* Input file: packet-x509if-template.c */
@@ -276,7 +276,7 @@ static gint ett_x509if_MRSubstitution = -1;
 /*--- End of included file: packet-x509if-ett.c ---*/
 
 
-static char object_identifier_id[BER_MAX_OID_STR_LEN];
+static const char *object_identifier_id;
 
 
 /*--- Included file: packet-x509if-fn.c ---*/
@@ -348,9 +348,7 @@ static int dissect_description(packet_info *pinfo, proto_tree *tree, tvbuff_t *t
 
 static int
 dissect_x509if_AttributeId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_x509if_object_identifier_id, object_identifier_id);
-
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_x509if_object_identifier_id, &object_identifier_id);
 
   return offset;
 }
@@ -582,9 +580,7 @@ static int dissect_matchedValuesOnly(packet_info *pinfo, proto_tree *tree, tvbuf
 
 static int
 dissect_x509if_ContextId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_x509if_object_identifier_id, object_identifier_id);
-
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_x509if_object_identifier_id, &object_identifier_id);
 
   return offset;
 }
@@ -924,8 +920,7 @@ static int dissect_maximum(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb,
 
 static int
 dissect_x509if_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index,
-                                            NULL);
+  offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
 
   return offset;
 }
@@ -1337,9 +1332,7 @@ static int dissect_ra_selectedValues(packet_info *pinfo, proto_tree *tree, tvbuf
 
 static int
 dissect_x509if_DefaultValueType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_x509if_object_identifier_id, object_identifier_id);
-
+  offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_x509if_object_identifier_id, &object_identifier_id);
 
   return offset;
 }