NonStandardData and TunnelledProtocol reimplemented and tested
authorkukosa <kukosa@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 20 Jan 2005 12:02:08 +0000 (12:02 +0000)
committerkukosa <kukosa@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 20 Jan 2005 12:02:08 +0000 (12:02 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13138 f5534014-38df-0310-8fa8-9805f1628bb7

asn1/h225/h225.cnf
asn1/h225/packet-h225-template.c

index 611dc055185f7822aab2b75498dcc7f306e4b5cd..0f4d281df6ea040b83739f9fc4009c90aa09c054 100644 (file)
@@ -43,7 +43,6 @@ RasUsageSpecification/callStartingPoint RasUsageSpecificationcallStartingPoint
 CapacityReportingSpecification/when CapacityReportingSpecification_when
 RasUsageSpecification/when RasUsageSpecification_when
 TransportAddress/ipAddress/ip IpV4
-NonStandardIdentifier NonStandardIdentifier
 #----------------------------------------------------------------------------------------
 #.FIELD_RENAME
 RasUsageSpecification/callStartingPoint/alerting alerting_flg 
@@ -54,7 +53,8 @@ UUIEsRequested/callProceeding callProceeding_flg
 
 CicInfo/cic cic_2_4
 UUIEsRequested/connect connect_bool
-NonStandardParameter/data data_oct_str
+NonStandardIdentifier/object nsiOID
+NonStandardParameter/data nsp_data
 H323-UU-PDU/h323-message-body/empty empty_flg
 RasUsageInfoTypes/endTime endTime_flg
 UUIEsRequested/facility facility_bool
@@ -132,6 +132,7 @@ GatekeeperRejectReason/securityError gkRej_securityError
 RegistrationRejectReason/securityError reg_securityError
 
 CallIdentifier/guid guid
+
 #----------------------------------------------------------------------------------------
 #.FN_BODY H323-UU-PDU/h323-message-body
        guint32 message_body_val;
@@ -206,32 +207,6 @@ CallIdentifier/guid guid
        offset=dissect_per_restricted_character_string(tvb, offset, pinfo, tree, hf_index, 1, 128, "#,*0123456789", 13);
 #.END
 #----------------------------------------------------------------------------------------
-#.FN_BODY H221NonStandard/t35CountryCode
-  guint32 value;
-
-  offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index,
-                                           0U, 255U, &value, NULL, FALSE);
-  T38_manufacturer_code = value << 24;
-#.END
-#----------------------------------------------------------------------------------------
-#.FN_BODY H221NonStandard/t35Extension
-  guint32 value;
-
-  offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index,
-                                           0U, 255U, &value, NULL, FALSE);
-  T38_manufacturer_code = T38_manufacturer_code ^ (value << 16);
-#.END
-#----------------------------------------------------------------------------------------
-#.FN_BODY H221NonStandard/manufacturerCode
-  guint32 value;
-
-  offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index,
-                                           0U, 65535U, &value, NULL, FALSE);
-  T38_manufacturer_code = T38_manufacturer_code ^ value;
-  proto_tree_add_uint(tree, hf_h221Manufacturer, tvb, (offset)-4,4,T38_manufacturer_code);
-
-#.END
-#----------------------------------------------------------------------------------------
 #.FN_BODY H245TransportAddress/h245ipAddress/h245ipv4
 
 guint32 value_offset;
@@ -454,49 +429,96 @@ guint32 value_len;
        }
 #.END
 #----------------------------------------------------------------------------------------
-#.FN_BODY NonStandardIdentifier/object
 
-  offset = dissect_per_object_identifier(tvb, offset, pinfo, tree, hf_index,
-                                         object);
+#--- TunnelledProtocol ------------------------------------------------------------------
+#.FN_HDR TunnelledProtocol
+  tpOID[0] = '\0';
+#.FN_FTR TunnelledProtocol
+  tp_handle = dissector_get_string_handle(tp_dissector_table, tpOID);
+#.FN_BODY TunnelledProtocol/id/tunnelledProtocolObjectID
+  offset=dissect_per_object_identifier(tvb, offset, pinfo, tree, hf_h225_tunnelledProtocolObjectID, tpOID);
+#.END
 
+#.FN_HDR H323-UU-PDU/tunnelledSignallingMessage
+  tp_handle = NULL;
+#.FN_BODY H323-UU-PDU/tunnelledSignallingMessage/messageContent/_item
+       guint32 value_offset, value_len;
+       tvbuff_t *next_tvb;
+
+       offset = dissect_per_octet_string(tvb, offset, pinfo, tree,
+                               hf_h225_messageContent_item, -1, -1,
+                               &value_offset, &value_len);
+
+       if (value_len > 0) {
+               next_tvb = tvb_new_subset(tvb, value_offset, value_len, value_len);
+               call_dissector((tp_handle)?tp_handle:data_handle, next_tvb, pinfo, tree);
+       }
 #.END
-#----------------------------------------------------------------------------------------
+
+#--- NonStandardParameter ---------------------------------------------------------------
+
 #.FN_BODY NonStandardIdentifier
        guint32 value;
 
-       *object = '\0';
-       T38_manufacturer_code = 0;
+       nsiOID[0] = '\0';
+       h221NonStandard = 0;
+
+       offset = dissect_per_choice(tvb, offset, pinfo, tree,
+                               hf_h225_nonStandardIdentifier,
+                               ett_h225_NonStandardIdentifier, NonStandardIdentifier_choice, "NonStandardIdentifier",
+                               &value);
 
-  offset = dissect_per_choice(tvb, offset, pinfo, tree, hf_index,
-                              ett_h225_NonStandardIdentifier, NonStandardIdentifier_choice, "NonStandardIdentifier",
-                              &value);
        switch (value) {
                case 0 :  /* object */
-                       nsp_handle = dissector_get_string_handle(nsp_object_dissector_table, object);
+                       nsp_handle = dissector_get_string_handle(nsp_object_dissector_table, nsiOID);
                        break;
                case 1 :  /* h221NonStandard */
-                       nsp_handle = dissector_get_port_handle(nsp_h221_dissector_table, T38_manufacturer_code);
+                       nsp_handle = dissector_get_port_handle(nsp_h221_dissector_table, h221NonStandard);
                        break;
                default :
                        nsp_handle = NULL;
     }
-
+#.FN_BODY NonStandardIdentifier/object
+       offset = dissect_per_object_identifier(tvb, offset, pinfo, tree,
+                               hf_h225_nsiOID,
+                               nsiOID);
+#.END
+
+#.FN_HDR H221NonStandard
+  t35CountryCode = 0;
+  t35Extension = 0;
+  manufacturerCode = 0;
+#.FN_FTR H221NonStandard
+  h221NonStandard = ((t35CountryCode * 256) + t35Extension) * 65536 + manufacturerCode;
+  proto_tree_add_uint(tree, hf_h221Manufacturer, tvb, (offset>>3)-4, 4, h221NonStandard);
+#.FN_BODY H221NonStandard/t35CountryCode
+  offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index,
+                                           0U, 255U, &t35CountryCode, NULL, FALSE);
+#.FN_BODY H221NonStandard/t35Extension
+  offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index,
+                                           0U, 255U, &t35Extension, NULL, FALSE);
+#.FN_BODY H221NonStandard/manufacturerCode
+  offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index,
+                                           0U, 65535U, &manufacturerCode, NULL, FALSE);
 #.END
-#----------------------------------------------------------------------------------------
-#.FN_BODY TunnelledProtocol/id/tunnelledProtocolObjectID
-  offset = dissect_per_object_identifier(tvb, offset, pinfo, tree, hf_index,
-                                         tpID);
 
+#.FN_HDR NonStandardParameter
+  nsp_handle = NULL;
+
+#.FN_BODY NonStandardParameter/data
+       guint32 value_offset, value_len;
+       tvbuff_t *next_tvb;
+
+       offset = dissect_per_octet_string(tvb, offset, pinfo, tree,
+                               hf_h225_nsp_data, -1, -1,
+                               &value_offset, &value_len);
+
+       if (value_len > 0) {
+               next_tvb = tvb_new_subset(tvb, value_offset, value_len, value_len);
+               call_dissector((nsp_handle)?nsp_handle:data_handle, next_tvb, pinfo, tree);
+       }
 #.END
-#----------------------------------------------------------------------------------------
-#.FN_HDR TunnelledProtocol
-       tpID[0] = '\0';
-#.END
-#----------------------------------------------------------------------------------------
-#.FN_FTR TunnelledProtocol
-       tp_handle = dissector_get_string_handle(tp_dissector_table, tpID);
-#.END
-#----------------------------------------------------------------------------------------
+
 #.TYPE_ATTR
 H221NonStandard/t35CountryCode TYPE = FT_UINT32  DISPLAY = BASE_DEC  STRINGS = VALS(T35CountryCode_vals)
 TransportAddress/ipAddress/ip  TYPE = FT_IPv4  DISPLAY = BASE_NONE  STRINGS = NULL
@@ -505,4 +527,6 @@ H245TransportAddress/h245ipAddress/h245ipv4 TYPE = FT_IPv4  DISPLAY = BASE_NONE
 H245TransportAddress/h245ip6Address/h245ipv6 TYPE = FT_IPv6  DISPLAY = BASE_NONE  STRINGS = NULL
 VendorIdentifier/productId TYPE = FT_STRING DISPLAY = BASE_HEX STRINGS = NULL
 VendorIdentifier/versionId TYPE = FT_STRING DISPLAY = BASE_HEX STRINGS = NULL
-H323-UserInformation/user-data/protocol-discriminator TYPE = FT_UINT32 DISPLAY = BASE_DEC STRINGS = VALS(q931_protocol_discriminator_vals)
\ No newline at end of file
+H323-UserInformation/user-data/protocol-discriminator TYPE = FT_UINT32 DISPLAY = BASE_DEC STRINGS = VALS(q931_protocol_discriminator_vals)
+H323-UU-PDU/tunnelledSignallingMessage/messageContent/_item  TYPE = FT_UINT32 DISPLAY = BASE_DEC
+NonStandardParameter/data  TYPE = FT_UINT32 DISPLAY = BASE_DEC
index cc8734ae2da5d5b6edbd9403386874003f0eedee..c774f95b5cf057ce749c47ddd7398478582f579c 100644 (file)
@@ -97,7 +97,6 @@ static int hf_h225_ras_rsp_frame = -1;
 static int hf_h225_ras_dup = -1;
 static int hf_h225_ras_deltatime = -1;
 static int hf_h225_fastStart_item_length = -1; 
-static int hf_h225_nsp_data = -1;
 
 #include "packet-h225-hf.c"
 
@@ -108,12 +107,21 @@ static gint ett_h225 = -1;
 /* Global variables */
 static guint32  ipv4_address;
 static guint32  ipv4_port;
-static char object[256];
 guint32 T38_manufacturer_code;
-static char tpID[256];
 static gboolean h225_reassembly = TRUE;
+guint32 value;
 static gboolean contains_faststart = FALSE;
 
+/* NonStandardParameter */
+static char nsiOID[256];
+static guint32 h221NonStandard;
+static guint32 t35CountryCode;
+static guint32 t35Extension;
+static guint32 manufacturerCode;
+
+/* TunnelledProtocol */
+static char tpOID[256];
+
 #include "packet-h225-fn.c"
 
 
@@ -169,25 +177,6 @@ dissect_h225_h225_RasMessage(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
 
        return offset;
 }
-
-static int
-dissect_h225_nsp_data(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
-{
-       guint32 value_offset, value_len;
-       tvbuff_t *next_tvb;
-
-       offset = dissect_per_octet_string(tvb, offset, pinfo, tree,
-                               hf_h225_nsp_data, -1, -1,
-                               &value_offset, &value_len);
-
-       if (value_len > 0) {
-               next_tvb = tvb_new_subset(tvb, value_offset, value_len, value_len);
-               call_dissector((nsp_handle)?nsp_handle:data_handle, next_tvb, pinfo, tree);
-       }
-
-       return offset;
-}
-
 /*--- proto_register_h225 -------------------------------------------*/
 void proto_register_h225(void) {
 
@@ -217,9 +206,6 @@ void proto_register_h225(void) {
        { &hf_h225_fastStart_item_length,
                { "fastStart item length", "h225.fastStart_item_length", FT_UINT32, BASE_DEC,
                NULL, 0, "fastStart item length", HFILL }},
-       { &hf_h225_nsp_data,
-               { "data", "h225.nsp_data", FT_BYTES, BASE_HEX,
-               NULL, 0, "OCTET STRING", HFILL }},
 
 #include "packet-h225-hfarr.c"
   };