ean up SAT a bit remove the unneccesary implementation of DirectoryStr4ing in...
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 20 Nov 2004 05:58:13 +0000 (05:58 +0000)
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 20 Nov 2004 05:58:13 +0000 (05:58 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12545 f5534014-38df-0310-8fa8-9805f1628bb7

asn1/x509sat/SelectedAttributeTypes.asn
asn1/x509sat/packet-x509sat-template.c
asn1/x509sat/packet-x509sat-template.h
asn1/x509sat/x509sat.cnf
asn1/x509sat/x509sat_exp.cnf
epan/dissectors/packet-x509sat.c
epan/dissectors/packet-x509sat.h

index 86d66d3b1d794329cbc0b9198787cdeaf5b86f6b..29b3306dad7e042af6918dfc068b2c6ed3223871 100644 (file)
@@ -37,15 +37,18 @@ IMPORTS
     FROM DirectoryAbstractService directoryAbstractService;
 
 -- Directory string type 
--- XXX DirectoryString is handimplemented inside the template
--- DirectoryString ::= CHOICE {
---  teletexString    TeletexString(SIZE (1..maxSize)),
---  printableString  PrintableString(SIZE (1..maxSize)),
---  universalString  UniversalString(SIZE (1..maxSize)),
---  bmpString        BMPString(SIZE (1..maxSize)),
---  uTF8String       UTF8String(SIZE (1..maxSize))
--- }
---
+--This one is much better declared as this,  it is prettier at least
+--the octet string dissector can handle all of them
+DirectoryString ::= OCTET STRING
+--DirectoryString ::= CHOICE {
+--  teletexString    TeletexString,
+--  printableString  PrintableString,
+--  universalString  UniversalString,
+--  bmpString        BMPString,
+--  uTF8String       UTF8String
+--}
+
+
 -- Attribute types 
 -- knowledgeInformation ATTRIBUTE ::= {
 --   WITH SYNTAX             DirectoryString {ub-knowledge-information}
index 1f983b5abaf246ec596e20b5289a7853ba5845f7..b30979715175ad54a193de4645ca18e848f65a33 100644 (file)
@@ -1,3 +1,4 @@
+#define BER_UNI_TAG_TeletexString          20  /* until we fix the bug in asn2eth */
 /* packet-x509sat.c
  * Routines for X.509 Selected Attribute Types packet dissection
  *
@@ -81,72 +82,10 @@ int hf_x509sat_id_at_collectiveTelephoneNumber = -1;
 #include "packet-x509sat-hf.c"
 
 /* Initialize the subtree pointers */
-static gint ett_x509sat_DirectoryString = -1;
 #include "packet-x509sat-ett.c"
 
 #include "packet-x509sat-fn.c"
 
-
-
-
-static int DirectoryString_hf_index;
-
-static int
-dissect_teletextString(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
-  return dissect_ber_restricted_string(FALSE, BER_UNI_TAG_TeletextString, 
-              pinfo, tree, tvb, offset, DirectoryString_hf_index, NULL);
-}
-static int
-dissect_printableString(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
-  return dissect_ber_restricted_string(FALSE, BER_UNI_TAG_PrintableString, 
-              pinfo, tree, tvb, offset, DirectoryString_hf_index, NULL);
-}
-static int
-dissect_universalString(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
-  return dissect_ber_restricted_string(FALSE, BER_UNI_TAG_UniversalString,
-              pinfo, tree, tvb, offset, DirectoryString_hf_index, NULL);
-}
-static int
-dissect_bmpString(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
-  return dissect_ber_restricted_string(FALSE, BER_UNI_TAG_BMPString,
-              pinfo, tree, tvb, offset, DirectoryString_hf_index, NULL);
-}
-static int
-dissect_uTF8String(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
-  return dissect_ber_restricted_string(FALSE, BER_UNI_TAG_UTF8String,
-              pinfo, tree, tvb, offset, DirectoryString_hf_index, NULL);
-}
-
-static const value_string DirectoryString_vals[] = {
-  {   0, "teletextString" },
-  {   1, "printableString" },
-  {   2, "universalString" },
-  {   3, "bmpString" },
-  {   4, "uTF8String" },
-  { 0, NULL }
-};
-
-static ber_choice DirectoryString_choice[] = {
-  {   0, BER_CLASS_UNI, BER_UNI_TAG_TeletextString, BER_FLAGS_NOOWNTAG, dissect_teletextString },
-  {   1, BER_CLASS_UNI, BER_UNI_TAG_PrintableString, BER_FLAGS_NOOWNTAG, dissect_printableString },
-  {   2, BER_CLASS_UNI, BER_UNI_TAG_UniversalString, BER_FLAGS_NOOWNTAG, dissect_universalString },
-  {   3, BER_CLASS_UNI, BER_UNI_TAG_BMPString, BER_FLAGS_NOOWNTAG, dissect_bmpString },
-  {   4, BER_CLASS_UNI, BER_UNI_TAG_UTF8String, BER_FLAGS_NOOWNTAG, dissect_uTF8String },
-  { 0, 0, 0, 0, NULL }
-};
-
-int
-dissect_x509sat_DirectoryString(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index) {
-  DirectoryString_hf_index = hf_index;
-  offset = dissect_ber_choice(pinfo, tree, tvb, offset,
-                              DirectoryString_choice, -1, ett_x509sat_DirectoryString);
-
-  return offset;
-}
-
-
-
-
 static void
 dissect_x509sat_countryName_callback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
@@ -500,7 +439,6 @@ void proto_register_x509sat(void) {
 
   /* List of subtrees */
   static gint *ett[] = {
-    &ett_x509sat_DirectoryString,
 #include "packet-x509sat-ettarr.c"
   };
 
index ecde979f63a3d07153e238c7683a42dbd8494a0b..4e936a0a5980cbf197cf5582e8efd2056f9aad47 100644 (file)
@@ -27,7 +27,5 @@
 
 #include "packet-x509sat-exp.h"
 
-int dissect_x509sat_DirectoryString(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
-
 #endif  /* PACKET_X509SAT_H */
 
index d611ce1adaeb3b682e99e1537e0c9a1d92a19c82..ce15ffa67b3e2d415991409330fa5f5af7ff33d0 100644 (file)
@@ -7,7 +7,7 @@
 InformationFramework x509if
 
 #.EXPORTS
-
+DirectoryString
 UniqueIdentifier
 
 #.NO_EMIT
index 426e88f57f4309132299f830d167da34a15aa3b0..c4047786170f08cf72bb1ce491202c118f9c7e80 100644 (file)
@@ -1,4 +1,4 @@
 
 #.IMPORT_TAG
 UniqueIdentifier BER_CLASS_UNI BER_UNI_TAG_BITSTRING
-DirectoryString  BER_CLASS_UNI BER_UNI_TAG_CHOICE
+DirectoryString  BER_CLASS_UNI BER_UNI_TAG_PrintableString
index 852278382c7720d590801d5873506928a2db37b5..1269050b256e4f401799c09fd8ad46365ef00839 100644 (file)
@@ -5,6 +5,7 @@
 
 /* Input file: packet-x509sat-template.c */
 
+#define BER_UNI_TAG_TeletexString          20  /* until we fix the bug in asn2eth */
 /* packet-x509sat.c
  * Routines for X.509 Selected Attribute Types packet dissection
  *
@@ -101,7 +102,6 @@ static int hf_x509sat_answerback = -1;            /* PrintableString */
 
 
 /* Initialize the subtree pointers */
-static gint ett_x509sat_DirectoryString = -1;
 
 /*--- Included file: packet-x509sat-ett.c ---*/
 
@@ -133,6 +133,15 @@ static int dissect_approximateMatch(packet_info *pinfo, proto_tree *tree, tvbuff
 }
 
 
+int
+dissect_x509sat_DirectoryString(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
+  offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
+                                    NULL);
+
+  return offset;
+}
+
+
 int
 dissect_x509sat_UniqueIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
   offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
@@ -227,67 +236,6 @@ dissect_x509sat_TelexNumber(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset
 /*--- End of included file: packet-x509sat-fn.c ---*/
 
 
-
-
-
-static int DirectoryString_hf_index;
-
-static int
-dissect_teletextString(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
-  return dissect_ber_restricted_string(FALSE, BER_UNI_TAG_TeletextString, 
-              pinfo, tree, tvb, offset, DirectoryString_hf_index, NULL);
-}
-static int
-dissect_printableString(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
-  return dissect_ber_restricted_string(FALSE, BER_UNI_TAG_PrintableString, 
-              pinfo, tree, tvb, offset, DirectoryString_hf_index, NULL);
-}
-static int
-dissect_universalString(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
-  return dissect_ber_restricted_string(FALSE, BER_UNI_TAG_UniversalString,
-              pinfo, tree, tvb, offset, DirectoryString_hf_index, NULL);
-}
-static int
-dissect_bmpString(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
-  return dissect_ber_restricted_string(FALSE, BER_UNI_TAG_BMPString,
-              pinfo, tree, tvb, offset, DirectoryString_hf_index, NULL);
-}
-static int
-dissect_uTF8String(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
-  return dissect_ber_restricted_string(FALSE, BER_UNI_TAG_UTF8String,
-              pinfo, tree, tvb, offset, DirectoryString_hf_index, NULL);
-}
-
-static const value_string DirectoryString_vals[] = {
-  {   0, "teletextString" },
-  {   1, "printableString" },
-  {   2, "universalString" },
-  {   3, "bmpString" },
-  {   4, "uTF8String" },
-  { 0, NULL }
-};
-
-static ber_choice DirectoryString_choice[] = {
-  {   0, BER_CLASS_UNI, BER_UNI_TAG_TeletextString, BER_FLAGS_NOOWNTAG, dissect_teletextString },
-  {   1, BER_CLASS_UNI, BER_UNI_TAG_PrintableString, BER_FLAGS_NOOWNTAG, dissect_printableString },
-  {   2, BER_CLASS_UNI, BER_UNI_TAG_UniversalString, BER_FLAGS_NOOWNTAG, dissect_universalString },
-  {   3, BER_CLASS_UNI, BER_UNI_TAG_BMPString, BER_FLAGS_NOOWNTAG, dissect_bmpString },
-  {   4, BER_CLASS_UNI, BER_UNI_TAG_UTF8String, BER_FLAGS_NOOWNTAG, dissect_uTF8String },
-  { 0, 0, 0, 0, NULL }
-};
-
-int
-dissect_x509sat_DirectoryString(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index) {
-  DirectoryString_hf_index = hf_index;
-  offset = dissect_ber_choice(pinfo, tree, tvb, offset,
-                              DirectoryString_choice, -1, ett_x509sat_DirectoryString);
-
-  return offset;
-}
-
-
-
-
 static void
 dissect_x509sat_countryName_callback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
@@ -678,7 +626,6 @@ void proto_register_x509sat(void) {
 
   /* List of subtrees */
   static gint *ett[] = {
-    &ett_x509sat_DirectoryString,
 
 /*--- Included file: packet-x509sat-ettarr.c ---*/
 
index fcea0d8112aa4b08a518d7411a5343bf69ff280b..670a28b777f8a1dab939ba845e4284adf8d67cf9 100644 (file)
 
 /*--- Included file: packet-x509sat-exp.h ---*/
 
+int dissect_x509sat_DirectoryString(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
 int dissect_x509sat_UniqueIdentifier(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
 
 /*--- End of included file: packet-x509sat-exp.h ---*/
 
 
-int dissect_x509sat_DirectoryString(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
-
 #endif  /* PACKET_X509SAT_H */