aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/h245
diff options
context:
space:
mode:
authorTomas Kukosa <tomas.kukosa@siemens.com>2005-07-04 09:35:25 +0000
committerTomas Kukosa <tomas.kukosa@siemens.com>2005-07-04 09:35:25 +0000
commit5f2fd433abc60c0e5f97613fbb18a00090dddc26 (patch)
treef94d06201f1f3524613eee828b38eeeb7e0223f5 /asn1/h245
parentf88d8d41b5c4faa3884d97905d916f5f8a80eade (diff)
- use tvb instead of offset and length in dissect_per_octet_string() for value returning
- asn2eth: #.FN_PARS support for OCTET STRING - usage of #.FN_PARS in h225 and h245 - h225: ParallelH245Control support - h245: better support of NonStandardParameter - usage of MAX_OID_STR_LEN constant - all PER dissectors regenerated svn path=/trunk/; revision=14844
Diffstat (limited to 'asn1/h245')
-rw-r--r--asn1/h245/h245.cnf76
-rw-r--r--asn1/h245/packet-h245-template.c7
2 files changed, 53 insertions, 30 deletions
diff --git a/asn1/h245/h245.cnf b/asn1/h245/h245.cnf
index 170ed9bc72..c6ff8928f5 100644
--- a/asn1/h245/h245.cnf
+++ b/asn1/h245/h245.cnf
@@ -281,17 +281,15 @@ guint32 subMessageIdentifer;
#----------------------------------------------------------------------------------------
#.FN_BODY UnicastAddress/iPAddress/network
-guint32 value_offset;
-guint32 value_len;
+ tvbuff_t *value_tvb;
offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index,
- 4, 4,
- &value_offset, &value_len);
+ 4, 4, &value_tvb);
if ( media_channel )
- tvb_memcpy(tvb, (char *)&ipv4_address, value_offset, 4);
+ tvb_memcpy(value_tvb, (char *)&ipv4_address, 0, 4);
if ( media_control_channel )
- tvb_memcpy(tvb, (char *)&rtcp_ipv4_address, value_offset, 4);
+ tvb_memcpy(value_tvb, (char *)&rtcp_ipv4_address, 0, 4);
#.END
#----------------------------------------------------------------------------------------
@@ -418,6 +416,34 @@ guint32 tsapIdentifier;
}
#.END
+
+#--- NonStandardParameter ---------------------------------------------------------------
+
+#.FN_BODY NonStandardIdentifier
+ guint32 value;
+
+ nsiOID[0] = '\0';
+ h221NonStandard = 0;
+
+ offset = dissect_per_choice(tvb, offset, pinfo, tree,
+ hf_h245_nonStandardIdentifier,
+ ett_h245_NonStandardIdentifier, NonStandardIdentifier_choice, "NonStandardIdentifier",
+ &value);
+
+ switch (value) {
+ case 0 : /* 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, h221NonStandard);
+ break;
+ default :
+ nsp_handle = NULL;
+ }
+#.FN_PARS NonStandardIdentifier/object
+ VAL_PTR = nsiOID
+#.END
+
#.FN_HDR NonStandardIdentifier/h221NonStandard
t35CountryCode = 0;
t35Extension = 0;
@@ -425,30 +451,24 @@ guint32 tsapIdentifier;
#.FN_FTR NonStandardIdentifier/h221NonStandard
h221NonStandard = ((t35CountryCode * 256) + t35Extension) * 65536 + manufacturerCode;
proto_tree_add_uint(tree, hf_h245Manufacturer, tvb, (offset>>3)-4, 4, h221NonStandard);
- nsp_handle = dissector_get_port_handle(nsp_h221_dissector_table, h221NonStandard);
-#.FN_BODY NonStandardIdentifier/h221NonStandard/t35CountryCode
- offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index,
- 0U, 255U, &t35CountryCode, NULL, FALSE);
-#.FN_BODY NonStandardIdentifier/h221NonStandard/t35Extension
- offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index,
- 0U, 255U, &t35Extension, NULL, FALSE);
-#.FN_BODY NonStandardIdentifier/h221NonStandard/manufacturerCode
- offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index,
- 0U, 65535U, &manufacturerCode, NULL, FALSE);
-#.FN_BODY NonStandardParameter/data
- guint32 value_offset, value_len;
- tvbuff_t *next_tvb;
-
- offset = dissect_per_octet_string(tvb, offset, pinfo, tree,
- hf_index, -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);
- }
+#.FN_PARS
+NonStandardIdentifier/h221NonStandard/t35CountryCode VAL_PTR = &t35CountryCode
+NonStandardIdentifier/h221NonStandard/t35Extension VAL_PTR = &t35Extension
+NonStandardIdentifier/h221NonStandard/manufacturerCode VAL_PTR = &manufacturerCode
+#.END
+#.FN_HDR NonStandardParameter
+ nsp_handle = NULL;
+#.FN_HDR NonStandardParameter/data
+ tvbuff_t *next_tvb = NULL;
+#.FN_PARS NonStandardParameter/data
+ VAL_PTR = &next_tvb
+#.FN_FTR NonStandardParameter/data
+ if (next_tvb && tvb_length(next_tvb)) {
+ call_dissector((nsp_handle)?nsp_handle:data_handle, next_tvb, pinfo, tree);
+ }
#.END
+
#----------------------------------------------------------------------------------------
#.TYPE_RENAME
diff --git a/asn1/h245/packet-h245-template.c b/asn1/h245/packet-h245-template.c
index ddb6b77ea7..de6dfd5d8e 100644
--- a/asn1/h245/packet-h245-template.c
+++ b/asn1/h245/packet-h245-template.c
@@ -201,17 +201,20 @@ static const value_string h245_AudioCapability_short_vals[] = {
an OLC is read */
const char* codec_type = NULL;
-static char standard_oid_str[256];
+static char standard_oid_str[MAX_OID_STR_LEN];
static guint32 ipv4_address;
static guint32 ipv4_port;
static guint32 rtcp_ipv4_address;
static guint32 rtcp_ipv4_port;
static gboolean media_channel;
static gboolean media_control_channel;
+
+/* NonStandardParameter */
+static char nsiOID[MAX_OID_STR_LEN];
+static guint32 h221NonStandard;
static guint32 t35CountryCode;
static guint32 t35Extension;
static guint32 manufacturerCode;
-static guint32 h221NonStandard;
static const value_string h245_RFC_number_vals[] = {
{ 2190, "RFC 2190 - H.263 Video Streams" },