diff options
author | Tomas Kukosa <tomas.kukosa@siemens.com> | 2005-07-04 09:35:25 +0000 |
---|---|---|
committer | Tomas Kukosa <tomas.kukosa@siemens.com> | 2005-07-04 09:35:25 +0000 |
commit | 5f2fd433abc60c0e5f97613fbb18a00090dddc26 (patch) | |
tree | f94d06201f1f3524613eee828b38eeeb7e0223f5 | |
parent | f88d8d41b5c4faa3884d97905d916f5f8a80eade (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
-rw-r--r-- | asn1/h225/h225.cnf | 100 | ||||
-rw-r--r-- | asn1/h225/packet-h225-template.c | 4 | ||||
-rw-r--r-- | asn1/h235/Makefile.nmake | 2 | ||||
-rw-r--r-- | asn1/h235/h235-exp.cnf | 4 | ||||
-rw-r--r-- | asn1/h245/h245.cnf | 76 | ||||
-rw-r--r-- | asn1/h245/packet-h245-template.c | 7 | ||||
-rw-r--r-- | asn1/h450/packet-h450-template.c | 25 | ||||
-rw-r--r-- | epan/dissectors/packet-h225.c | 258 | ||||
-rw-r--r-- | epan/dissectors/packet-h225.h | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-h235.c | 51 | ||||
-rw-r--r-- | epan/dissectors/packet-h235.h | 8 | ||||
-rw-r--r-- | epan/dissectors/packet-h245.c | 190 | ||||
-rw-r--r-- | epan/dissectors/packet-h245.h | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-h450.c | 76 | ||||
-rw-r--r-- | epan/dissectors/packet-per.c | 8 | ||||
-rw-r--r-- | epan/dissectors/packet-per.h | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-t38.c | 13 | ||||
-rw-r--r-- | tools/asn2eth.py | 36 |
18 files changed, 441 insertions, 423 deletions
diff --git a/asn1/h225/h225.cnf b/asn1/h225/h225.cnf index 0721f764b8..073a49c76b 100644 --- a/asn1/h225/h225.cnf +++ b/asn1/h225/h225.cnf @@ -179,7 +179,7 @@ CallIdentifier/guid guid offset=dissect_h245_OpenLogicalChannelCodec(tvb,offset, pinfo, tree, hf_index, codec_str); /* Add to packet info */ - g_snprintf(h225_pi->frame_label, 50, "%s %s", h225_pi->frame_label, codec_str); + g_snprintf(h225_pi->frame_label, 50, "%%s %%s", h225_pi->frame_label, codec_str); contains_faststart = TRUE; h225_pi->is_faststart = TRUE; @@ -226,13 +226,12 @@ CallIdentifier/guid guid #---------------------------------------------------------------------------------------- #.FN_BODY H245TransportAddress/h245ipAddress/h245ipv4 -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); - tvb_memcpy(tvb, (char *)&ipv4_address, value_offset, 4); + &value_tvb); + tvb_memcpy(value_tvb, (char *)&ipv4_address, 0, 4); #.END @@ -243,19 +242,24 @@ guint32 value_len; #.END #---------------------------------------------------------------------------------------- -#.FN_BODY H245Control/_item - - tvbuff_t *h245_tvb; - guint32 h245_offset=0; - guint32 h245_len=0; - - offset=dissect_per_octet_string(tvb, offset, pinfo, tree, -1, -1, -1, &h245_offset, &h245_len); - - if(h245_len){ - h245_tvb = tvb_new_subset(tvb, h245_offset, h245_len, h245_len); +#.FN_HDR ParallelH245Control/_item + tvbuff_t *h245_tvb = NULL; +#.FN_PARS ParallelH245Control/_item + VAL_PTR = &h245_tvb +#.FN_FTR ParallelH245Control/_item + if (h245_tvb && tvb_length(h245_tvb)) { + call_dissector(h245dg_handle, h245_tvb, pinfo, tree); + } +#.END +#---------------------------------------------------------------------------------------- +#.FN_HDR H245Control/_item + tvbuff_t *h245_tvb = NULL; +#.FN_PARS H245Control/_item + VAL_PTR = &h245_tvb +#.FN_FTR H245Control/_item + if (h245_tvb && tvb_length(h245_tvb)) { call_dissector(h245dg_handle, h245_tvb, pinfo, tree); } - #.END #---------------------------------------------------------------------------------------- #.FN_FTR H323-UU-PDU/h323-message-body/empty @@ -478,10 +482,10 @@ guint32 value_len; #.END #---------------------------------------------------------------------------------------- #.FN_BODY CallIdentifier/guid - guint32 guid_offset,guid_len; + tvbuff_t *guid_tvb; - offset = dissect_per_octet_string(tvb,offset,pinfo,tree,hf_index,16,16,&guid_offset,&guid_len); - tvb_memcpy(tvb,h225_pi->guid,guid_offset,guid_len); + offset = dissect_per_octet_string(tvb,offset,pinfo,tree,hf_index,16,16,&guid_tvb); + tvb_memcpy(guid_tvb,h225_pi->guid,0,tvb_length(guid_tvb)); #.END #---------------------------------------------------------------------------------------- #.FN_BODY RequestSeqNum @@ -491,42 +495,35 @@ guint32 value_len; #---------------------------------------------------------------------------------------- #.FN_BODY H323-UU-PDU/h4501SupplementaryService/_item - tvbuff_t *h4501_tvb; - guint32 h4501_offset=0; - guint32 h4501_len=0; + tvbuff_t *h4501_tvb = NULL; + offset=dissect_per_octet_string(tvb, offset, pinfo, tree, -1, -1, -1, &h4501_tvb); - offset=dissect_per_octet_string(tvb, offset, pinfo, tree, -1, -1, -1, &h4501_offset, &h4501_len); - - if(h4501_len){ - h4501_tvb = tvb_new_subset(tvb, h4501_offset, h4501_len, h4501_len); + if(tvb_length(h4501_tvb)){ call_dissector(h4501_handle, h4501_tvb, pinfo, tree); } #.END #---------------------------------------------------------------------------------------- #--- TunnelledProtocol ------------------------------------------------------------------ + #.FN_HDR TunnelledProtocol tpOID[0] = '\0'; #.FN_FTR TunnelledProtocol tp_handle = dissector_get_string_handle(tp_dissector_table, tpOID); #.FN_PARS TunnelledProtocol/id/tunnelledProtocolObjectID -VAL_PTR=tpOID + VAL_PTR = 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); - } +#.FN_HDR H323-UU-PDU/tunnelledSignallingMessage/messageContent/_item + tvbuff_t *next_tvb = NULL; +#.FN_PARS H323-UU-PDU/tunnelledSignallingMessage/messageContent/_item + VAL_PTR = &next_tvb +#.FN_FTR H323-UU-PDU/tunnelledSignallingMessage/messageContent/_item + if (next_tvb && tvb_length(next_tvb)) { + call_dissector((tp_handle)?tp_handle:data_handle, next_tvb, pinfo, tree); + } #.END #--- NonStandardParameter --------------------------------------------------------------- @@ -553,7 +550,7 @@ VAL_PTR=tpOID nsp_handle = NULL; } #.FN_PARS NonStandardIdentifier/object -VAL_PTR = nsiOID + VAL_PTR = nsiOID #.END #.FN_HDR H221NonStandard @@ -571,19 +568,14 @@ H221NonStandard/manufacturerCode VAL_PTR = &manufacturerCode #.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); - } +#.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_ATTR @@ -597,3 +589,5 @@ 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) H323-UU-PDU/tunnelledSignallingMessage/messageContent/_item TYPE = FT_UINT32 DISPLAY = BASE_DEC NonStandardParameter/data TYPE = FT_UINT32 DISPLAY = BASE_DEC +ParallelH245Control/_item TYPE = FT_UINT32 DISPLAY = BASE_DEC +H245Control/_item TYPE = FT_UINT32 DISPLAY = BASE_DEC diff --git a/asn1/h225/packet-h225-template.c b/asn1/h225/packet-h225-template.c index 269efea3ad..b519ab5027 100644 --- a/asn1/h225/packet-h225-template.c +++ b/asn1/h225/packet-h225-template.c @@ -115,14 +115,14 @@ guint32 value; static gboolean contains_faststart = FALSE; /* NonStandardParameter */ -static char nsiOID[256]; +static char nsiOID[MAX_OID_STR_LEN]; static guint32 h221NonStandard; static guint32 t35CountryCode; static guint32 t35Extension; static guint32 manufacturerCode; /* TunnelledProtocol */ -static char tpOID[256]; +static char tpOID[MAX_OID_STR_LEN]; #include "packet-h225-fn.c" diff --git a/asn1/h235/Makefile.nmake b/asn1/h235/Makefile.nmake index ffe13fabd9..502d9b59c0 100644 --- a/asn1/h235/Makefile.nmake +++ b/asn1/h235/Makefile.nmake @@ -15,7 +15,7 @@ generate_dissector: $(DISSECTOR_FILES) $(DISSECTOR_FILES): ../../tools/asn2eth.py H235-SECURITY-MESSAGES.asn packet-$(PROTOCOL_NAME)-template.c packet-$(PROTOCOL_NAME)-template.h $(PROTOCOL_NAME).cnf !IFDEF PYTHON - $(PYTHON) ../../tools/asn2eth.py -X -p $(PROTOCOL_NAME) -c $(PROTOCOL_NAME).cnf -s packet-$(PROTOCOL_NAME)-template H235-SECURITY-MESSAGES.asn + $(PYTHON) ../../tools/asn2eth.py -X -e -p $(PROTOCOL_NAME) -c $(PROTOCOL_NAME).cnf -s packet-$(PROTOCOL_NAME)-template H235-SECURITY-MESSAGES.asn !ELSE @echo Error: You need Python to use asn2eth.py @exit 1 diff --git a/asn1/h235/h235-exp.cnf b/asn1/h235/h235-exp.cnf index 7014792629..c5bc2a4aec 100644 --- a/asn1/h235/h235-exp.cnf +++ b/asn1/h235/h235-exp.cnf @@ -1,10 +1,10 @@ #.TYPE_ATTR TimeStamp TYPE = FT_ABSOLUTE_TIME DISPLAY = BASE_NONE STRINGS = NULL BITMASK = 0 -AuthenticationMechanism TYPE = FT_UINT32 DISPLAY = BASE_DEC STRINGS = VALS(AuthenticationMechanism_vals) BITMASK = 0 +AuthenticationMechanism TYPE = FT_UINT32 DISPLAY = BASE_DEC STRINGS = VALS(h235_AuthenticationMechanism_vals) BITMASK = 0 ClearToken TYPE = FT_NONE DISPLAY = BASE_NONE STRINGS = NULL BITMASK = 0 SIGNEDxxx TYPE = FT_NONE DISPLAY = BASE_NONE STRINGS = NULL BITMASK = 0 ENCRYPTEDxxx TYPE = FT_NONE DISPLAY = BASE_NONE STRINGS = NULL BITMASK = 0 HASHEDxxx TYPE = FT_NONE DISPLAY = BASE_NONE STRINGS = NULL BITMASK = 0 -CryptoToken TYPE = FT_UINT32 DISPLAY = BASE_DEC STRINGS = VALS(CryptoToken_vals) BITMASK = 0 +CryptoToken TYPE = FT_UINT32 DISPLAY = BASE_DEC STRINGS = VALS(h235_CryptoToken_vals) BITMASK = 0 #.END 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" }, diff --git a/asn1/h450/packet-h450-template.c b/asn1/h450/packet-h450-template.c index a966504feb..0200d96c96 100644 --- a/asn1/h450/packet-h450-template.c +++ b/asn1/h450/packet-h450-template.c @@ -371,15 +371,11 @@ dissect_h4501_GeneralProblem(tvbuff_t *tvb, int offset, packet_info *pinfo, prot static int dissect_h4501_ReturnResult_result(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { - tvbuff_t *result_tvb; - guint32 result_offset=0; - guint32 result_len=0; + tvbuff_t *result_tvb = NULL; - offset=dissect_per_octet_string(tvb, offset, pinfo, tree, -1, -1, -1, &result_offset, &result_len); - - if(result_len){ - result_tvb = tvb_new_subset(tvb, result_offset, result_len, result_len); + offset=dissect_per_octet_string(tvb, offset, pinfo, tree, -1, -1, -1, &result_tvb); + if(tvb_length(result_tvb)){ switch (localOpcode) { case CallTransferIdentify: dissect_h450_CTIdentifyRes(result_tvb, 0, pinfo, tree, hf_h4502_CTIdentifyRes); @@ -466,7 +462,7 @@ static int dissect_h4501_parameter(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { /* TODO - decode return error parameter based on localErrorCode */ - offset=dissect_per_octet_string(tvb, offset, pinfo, tree, hf_h4501_parameter, -1, -1, NULL, NULL); + offset=dissect_per_octet_string(tvb, offset, pinfo, tree, hf_h4501_parameter, -1, -1, NULL); return offset; } static const value_string localErrorCode_vals[] = { @@ -673,26 +669,21 @@ dissect_h4501_ROS(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tre static int dissect_h4501_argument(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { - tvbuff_t *argument_tvb; - guint32 argument_offset=0; - guint32 argument_len=0; + tvbuff_t *argument_tvb = NULL; if ( is_globalcode ){ /* TODO call oid dissector * call_ber_oid_callback isn't realy apropriate ? */ - offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_h4501_globalargument, -1, -1, NULL, NULL); + offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_h4501_globalargument, -1, -1, NULL); is_globalcode = FALSE; return offset; } - offset=dissect_per_octet_string(tvb, offset, pinfo, tree, -1, -1, -1, &argument_offset, &argument_len); - - if(argument_len){ - argument_tvb = tvb_new_subset(tvb, argument_offset, argument_len, argument_len); - + offset=dissect_per_octet_string(tvb, offset, pinfo, tree, -1, -1, -1, &argument_tvb); + if(tvb_length(argument_tvb)){ switch (localOpcode) { /* h450.2 */ case CallTransferIdentify: /* Localvalue 7 */ diff --git a/epan/dissectors/packet-h225.c b/epan/dissectors/packet-h225.c index 401e99dd28..aaf21e01f8 100644 --- a/epan/dissectors/packet-h225.c +++ b/epan/dissectors/packet-h225.c @@ -1,6 +1,6 @@ /* Do not modify this file. */ /* It is created automatically by the ASN.1 to Ethereal dissector compiler */ -/* ./packet-h225.c */ +/* .\packet-h225.c */ /* ../../tools/asn2eth.py -X -e -p h225 -c h225.cnf -s packet-h225-template h225.asn */ /* Input file: packet-h225-template.c */ @@ -206,7 +206,7 @@ static int hf_h225_rLC_securityError = -1; /* SecurityErrors */ static int hf_h225_hopCountExceeded = -1; /* NULL */ static int hf_h225_sourceAddress = -1; /* SEQUENCE_OF_AliasAddress */ static int hf_h225_sourceAddress_item = -1; /* AliasAddress */ -static int hf_h225_Setup_UUIE_sourceInfo = -1; /* EndpointType */ +static int hf_h225_setup_UUIE_sourceInfo = -1; /* EndpointType */ static int hf_h225_destinationAddress = -1; /* SEQUENCE_OF_AliasAddress */ static int hf_h225_destinationAddress_item = -1; /* AliasAddress */ static int hf_h225_destCallSignalAddress = -1; /* TransportAddress */ @@ -247,7 +247,7 @@ static int hf_h225_parallelH245Control = -1; /* ParallelH245Control */ static int hf_h225_additionalSourceAddresses = -1; /* SEQUENCE_OF_ExtendedAliasAddress */ static int hf_h225_additionalSourceAddresses_item = -1; /* ExtendedAliasAddress */ static int hf_h225_hopCount_1_31 = -1; /* INTEGER_1_31 */ -static int hf_h225_ParallelH245Control_item = -1; /* OCTET_STRING */ +static int hf_h225_ParallelH245Control_item = -1; /* ParallelH245Control_item */ static int hf_h225_unknown = -1; /* NULL */ static int hf_h225_bChannel = -1; /* NULL */ static int hf_h225_hybrid2x64 = -1; /* NULL */ @@ -1109,14 +1109,14 @@ guint32 value; static gboolean contains_faststart = FALSE; /* NonStandardParameter */ -static char nsiOID[256]; +static char nsiOID[MAX_OID_STR_LEN]; static guint32 h221NonStandard; static guint32 t35CountryCode; static guint32 t35Extension; static guint32 manufacturerCode; /* TunnelledProtocol */ -static char tpOID[256]; +static char tpOID[MAX_OID_STR_LEN]; /*--- Included file: packet-h225-fn.c ---*/ @@ -1196,10 +1196,11 @@ static int dissect_authenticationMode(tvbuff_t *tvb, int offset, packet_info *pi } + static int dissect_h225_ProtocolIdentifier(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_object_identifier(tvb, offset, pinfo, tree, hf_index, - NULL); + NULL); return offset; } @@ -1208,16 +1209,16 @@ static int dissect_protocolIdentifier(tvbuff_t *tvb, int offset, packet_info *pi } + static int dissect_h225_T_h245ipv4(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { -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); - tvb_memcpy(tvb, (char *)&ipv4_address, value_offset, 4); + &value_tvb); + tvb_memcpy(value_tvb, (char *)&ipv4_address, 0, 4); @@ -1259,11 +1260,11 @@ static int dissect_h245ipAddress(tvbuff_t *tvb, int offset, packet_info *pinfo, } + static int dissect_h225_OCTET_STRING_SIZE_4(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 4, 4, - NULL, NULL); + 4, 4, NULL); return offset; } @@ -1288,7 +1289,7 @@ static int dissect_h245route_item(tvbuff_t *tvb, int offset, packet_info *pinfo, static int dissect_h225_INTEGER_0_65535(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index, - 0U, 65535U, NULL, NULL, FALSE); + 0U, 65535U, NULL, NULL, FALSE); return offset; } @@ -1336,12 +1337,10 @@ static int dissect_h245route(tvbuff_t *tvb, int offset, packet_info *pinfo, prot } + static int dissect_h225_NULL(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { - { proto_item *ti_tmp; - ti_tmp = proto_tree_add_item(tree, hf_index, tvb, offset>>8, 0, FALSE); - proto_item_append_text(ti_tmp, ": NULL"); - } + offset = dissect_per_null(tvb, offset, pinfo, tree, hf_index); return offset; } @@ -1892,11 +1891,11 @@ static int dissect_h245ipSourceRoute(tvbuff_t *tvb, int offset, packet_info *pin } + static int dissect_h225_OCTET_STRING_SIZE_6(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 6, 6, - NULL, NULL); + 6, 6, NULL); return offset; } @@ -1905,11 +1904,11 @@ static int dissect_node(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre } + static int dissect_h225_OCTET_STRING_SIZE_2(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 2, 2, - NULL, NULL); + 2, 2, NULL); return offset; } @@ -1939,11 +1938,11 @@ static int dissect_h245ipxAddress(tvbuff_t *tvb, int offset, packet_info *pinfo, } + static int dissect_h225_OCTET_STRING_SIZE_16(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 16, 16, - NULL, NULL); + 16, 16, NULL); return offset; } @@ -1978,11 +1977,11 @@ static int dissect_h245ip6Address(tvbuff_t *tvb, int offset, packet_info *pinfo, } + static int dissect_h225_OCTET_STRING_SIZE_1_20(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 1, 20, - NULL, NULL); + 1, 20, NULL); return offset; } @@ -1994,11 +1993,11 @@ static int dissect_h245nsap(tvbuff_t *tvb, int offset, packet_info *pinfo, proto } + static int dissect_h225_T_object(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { - offset = dissect_per_object_identifier(tvb, offset, pinfo, tree, - hf_h225_nsiOID, - nsiOID); + offset = dissect_per_object_identifier(tvb, offset, pinfo, tree, hf_index, + nsiOID); return offset; } @@ -2011,7 +2010,7 @@ static int dissect_nsiOID(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_t static int dissect_h225_T_t35CountryCode(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index, - 0U, 255U, &t35CountryCode, NULL, FALSE); + 0U, 255U, &t35CountryCode, NULL, FALSE); return offset; } @@ -2024,7 +2023,7 @@ static int dissect_t35CountryCode(tvbuff_t *tvb, int offset, packet_info *pinfo, static int dissect_h225_T_t35Extension(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index, - 0U, 255U, &t35Extension, NULL, FALSE); + 0U, 255U, &t35Extension, NULL, FALSE); return offset; } @@ -2037,7 +2036,7 @@ static int dissect_t35Extension(tvbuff_t *tvb, int offset, packet_info *pinfo, p static int dissect_h225_T_manufacturerCode(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index, - 0U, 65535U, &manufacturerCode, NULL, FALSE); + 0U, 65535U, &manufacturerCode, NULL, FALSE); return offset; } @@ -2114,20 +2113,16 @@ static int dissect_nonStandardIdentifier(tvbuff_t *tvb, int offset, packet_info } + static int dissect_h225_T_data(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { - 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); - } + tvbuff_t *next_tvb = NULL; + offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, + -1, -1, &next_tvb); + if (next_tvb && tvb_length(next_tvb)) { + call_dissector((nsp_handle)?nsp_handle:data_handle, next_tvb, pinfo, tree); + } return offset; } static int dissect_nsp_data(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { @@ -2143,7 +2138,6 @@ static const per_sequence_t NonStandardParameter_sequence[] = { int dissect_h225_NonStandardParameter(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { nsp_handle = NULL; - offset = dissect_per_sequence(tvb, offset, pinfo, tree, hf_index, ett_h225_NonStandardParameter, NonStandardParameter_sequence); @@ -2273,11 +2267,11 @@ static int dissect_email_ID(tvbuff_t *tvb, int offset, packet_info *pinfo, proto } + static int dissect_h225_IpV4(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 4, 4, - NULL, NULL); + 4, 4, NULL); return offset; } @@ -2724,11 +2718,11 @@ static int dissect_system_id(tvbuff_t *tvb, int offset, packet_info *pinfo, prot } + static int dissect_h225_OCTET_STRING_SIZE_1(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 1, 1, - NULL, NULL); + 1, 1, NULL); return offset; } @@ -2770,11 +2764,11 @@ static int dissect_ansi_41_uim(tvbuff_t *tvb, int offset, packet_info *pinfo, pr } + static int dissect_h225_OCTET_STRING_SIZE_1_4(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 1, 4, - NULL, NULL); + 1, 4, NULL); return offset; } @@ -2987,11 +2981,11 @@ static int dissect_sourceEndpointInfo(tvbuff_t *tvb, int offset, packet_info *pi } + static int dissect_h225_OCTET_STRING_SIZE_1_256(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 1, 256, - NULL, NULL); + 1, 256, NULL); return offset; } @@ -3003,10 +2997,11 @@ static int dissect_versionId(tvbuff_t *tvb, int offset, packet_info *pinfo, prot } + static int dissect_h225_OBJECT_IDENTIFIER(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_object_identifier(tvb, offset, pinfo, tree, hf_index, - NULL); + NULL); return offset; } @@ -3075,7 +3070,7 @@ static int dissect_gatekeeper(tvbuff_t *tvb, int offset, packet_info *pinfo, pro static int dissect_h225_BandWidth(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index, - 0U, 4294967295U, NULL, NULL, FALSE); + 0U, 4294967295U, NULL, NULL, FALSE); return offset; } @@ -3100,7 +3095,7 @@ static int dissect_allowedBandWidth(tvbuff_t *tvb, int offset, packet_info *pinf static int dissect_h225_INTEGER_1_256(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index, - 1U, 256U, NULL, NULL, FALSE); + 1U, 256U, NULL, NULL, FALSE); return offset; } @@ -3682,9 +3677,11 @@ static int dissect_set(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree } + static int dissect_h225_T_tunnelledProtocolObjectID(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { - offset=dissect_per_object_identifier(tvb, offset, pinfo, tree, hf_h225_tunnelledProtocolObjectID, tpOID); + offset = dissect_per_object_identifier(tvb, offset, pinfo, tree, hf_index, + tpOID); return offset; } @@ -3813,8 +3810,8 @@ dissect_h225_EndpointType(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, pro static int dissect_uUIE_destinationInfo(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { return dissect_h225_EndpointType(tvb, offset, pinfo, tree, hf_h225_uUIE_destinationInfo); } -static int dissect_Setup_UUIE_sourceInfo(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { - return dissect_h225_EndpointType(tvb, offset, pinfo, tree, hf_h225_Setup_UUIE_sourceInfo); +static int dissect_setup_UUIE_sourceInfo(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { + return dissect_h225_EndpointType(tvb, offset, pinfo, tree, hf_h225_setup_UUIE_sourceInfo); } static int dissect_endpointType(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { return dissect_h225_EndpointType(tvb, offset, pinfo, tree, hf_h225_endpointType); @@ -3831,7 +3828,7 @@ static int dissect_destinationType(tvbuff_t *tvb, int offset, packet_info *pinfo static int dissect_h225_CallReferenceValue(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index, - 0U, 65535U, NULL, NULL, FALSE); + 0U, 65535U, NULL, NULL, FALSE); return offset; } @@ -3855,11 +3852,11 @@ static int dissect_destExtraCRV(tvbuff_t *tvb, int offset, packet_info *pinfo, p } + static int dissect_h225_GloballyUniqueID(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 16, 16, - NULL, NULL); + 16, 16, NULL); return offset; } @@ -3993,10 +3990,10 @@ static int dissect_callType(tvbuff_t *tvb, int offset, packet_info *pinfo, proto static int dissect_h225_T_guid(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { - guint32 guid_offset,guid_len; + tvbuff_t *guid_tvb; - offset = dissect_per_octet_string(tvb,offset,pinfo,tree,hf_index,16,16,&guid_offset,&guid_len); - tvb_memcpy(tvb,h225_pi->guid,guid_offset,guid_len); + offset = dissect_per_octet_string(tvb,offset,pinfo,tree,hf_index,16,16,&guid_tvb); + tvb_memcpy(guid_tvb,h225_pi->guid,0,tvb_length(guid_tvb)); return offset; } @@ -4232,6 +4229,7 @@ static int dissect_cryptoTokens(tvbuff_t *tvb, int offset, packet_info *pinfo, p } + static int dissect_h225_FastStart_item(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { guint32 newoffset; @@ -4446,7 +4444,7 @@ static int dissect_screeningIndicator(tvbuff_t *tvb, int offset, packet_info *pi static int dissect_h225_INTEGER_0_255(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index, - 0U, 255U, NULL, NULL, FALSE); + 0U, 255U, NULL, NULL, FALSE); return offset; } @@ -4473,11 +4471,11 @@ static int dissect_url(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree } + static int dissect_h225_H248SignalsDescriptor(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - -1, -1, - NULL, NULL); + -1, -1, NULL); return offset; } @@ -4527,7 +4525,7 @@ static int dissect_billingMode(tvbuff_t *tvb, int offset, packet_info *pinfo, pr static int dissect_h225_INTEGER_1_4294967295(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index, - 1U, 4294967295U, NULL, NULL, FALSE); + 1U, 4294967295U, NULL, NULL, FALSE); return offset; } @@ -4674,7 +4672,7 @@ static int dissect_serviceControl(tvbuff_t *tvb, int offset, packet_info *pinfo, static int dissect_h225_INTEGER_0_4294967295(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index, - 0U, 4294967295U, NULL, NULL, FALSE); + 0U, 4294967295U, NULL, NULL, FALSE); return offset; } @@ -4701,11 +4699,11 @@ static int dissect_carrierName(tvbuff_t *tvb, int offset, packet_info *pinfo, pr } + static int dissect_h225_OCTET_STRING_SIZE_3_4(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 3, 4, - NULL, NULL); + 3, 4, NULL); return offset; } @@ -4874,11 +4872,11 @@ static int dissect_capacity(tvbuff_t *tvb, int offset, packet_info *pinfo, proto } + static int dissect_h225_OCTET_STRING_SIZE_2_4(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 2, 4, - NULL, NULL); + 2, 4, NULL); return offset; } @@ -4899,11 +4897,11 @@ static int dissect_cic_2_4(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_ } + static int dissect_h225_OCTET_STRING_SIZE_2_5(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 2, 5, - NULL, NULL); + 2, 5, NULL); return offset; } @@ -4983,7 +4981,7 @@ static int dissect_destinationCircuitID(tvbuff_t *tvb, int offset, packet_info * static int dissect_h225_INTEGER_0_16383_(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index, - 0U, 16383U, NULL, NULL, TRUE); + 0U, 16383U, NULL, NULL, TRUE); return offset; } @@ -5019,20 +5017,17 @@ static int dissect_id(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree } + static int dissect_h225_OCTET_STRING(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - -1, -1, - NULL, NULL); + -1, -1, NULL); return offset; } static int dissect_h248Message(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { return dissect_h225_OCTET_STRING(tvb, offset, pinfo, tree, hf_h225_h248Message); } -static int dissect_ParallelH245Control_item(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { - return dissect_h225_OCTET_STRING(tvb, offset, pinfo, tree, hf_h225_ParallelH245Control_item); -} static int dissect_raw(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { return dissect_h225_OCTET_STRING(tvb, offset, pinfo, tree, hf_h225_raw); } @@ -5232,6 +5227,23 @@ static int dissect_supportedFeatures(tvbuff_t *tvb, int offset, packet_info *pin } + +static int +dissect_h225_ParallelH245Control_item(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + tvbuff_t *h245_tvb = NULL; + offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, + -1, -1, &h245_tvb); + + if (h245_tvb && tvb_length(h245_tvb)) { + call_dissector(h245dg_handle, h245_tvb, pinfo, tree); + } + return offset; +} +static int dissect_ParallelH245Control_item(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { + return dissect_h225_ParallelH245Control_item(tvb, offset, pinfo, tree, hf_h225_ParallelH245Control_item); +} + + static int dissect_h225_ParallelH245Control(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_sequence_of(tvb, offset, pinfo, tree, hf_index, @@ -5278,7 +5290,7 @@ static int dissect_additionalSourceAddresses(tvbuff_t *tvb, int offset, packet_i static int dissect_h225_INTEGER_1_31(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index, - 1U, 31U, NULL, NULL, FALSE); + 1U, 31U, NULL, NULL, FALSE); return offset; } @@ -5290,7 +5302,7 @@ static const per_sequence_t Setup_UUIE_sequence[] = { { "protocolIdentifier" , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_protocolIdentifier }, { "h245Address" , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_h245Address }, { "sourceAddress" , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_sourceAddress }, - { "sourceInfo" , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_Setup_UUIE_sourceInfo }, + { "sourceInfo" , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_setup_UUIE_sourceInfo }, { "destinationAddress" , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_destinationAddress }, { "destCallSignalAddress" , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_destCallSignalAddress }, { "destExtraCallInfo" , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_destExtraCallInfo }, @@ -5814,12 +5826,10 @@ static int dissect_progress(tvbuff_t *tvb, int offset, packet_info *pinfo, proto } + static int dissect_h225_T_empty(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { - { proto_item *ti_tmp; - ti_tmp = proto_tree_add_item(tree, hf_index, tvb, offset>>8, 0, FALSE); - proto_item_append_text(ti_tmp, ": NULL"); - } + offset = dissect_per_null(tvb, offset, pinfo, tree, hf_index); h225_pi->cs_type = H225_EMPTY; return offset; @@ -5979,17 +5989,14 @@ static int dissect_h323_message_body(tvbuff_t *tvb, int offset, packet_info *pin } + static int dissect_h225_T_h4501SupplementaryService_item(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { - tvbuff_t *h4501_tvb; - guint32 h4501_offset=0; - guint32 h4501_len=0; - - offset=dissect_per_octet_string(tvb, offset, pinfo, tree, -1, -1, -1, &h4501_offset, &h4501_len); + tvbuff_t *h4501_tvb = NULL; + offset=dissect_per_octet_string(tvb, offset, pinfo, tree, -1, -1, -1, &h4501_tvb); - if(h4501_len){ - h4501_tvb = tvb_new_subset(tvb, h4501_offset, h4501_len, h4501_len); + if(tvb_length(h4501_tvb)){ call_dissector(h4501_handle, h4501_tvb, pinfo, tree); } @@ -6023,21 +6030,16 @@ static int dissect_h245Tunneling(tvbuff_t *tvb, int offset, packet_info *pinfo, } + static int dissect_h225_H245Control_item(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + tvbuff_t *h245_tvb = NULL; + offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, + -1, -1, &h245_tvb); - tvbuff_t *h245_tvb; - guint32 h245_offset=0; - guint32 h245_len=0; - - offset=dissect_per_octet_string(tvb, offset, pinfo, tree, -1, -1, -1, &h245_offset, &h245_len); - - if(h245_len){ - h245_tvb = tvb_new_subset(tvb, h245_offset, h245_len, h245_len); + if (h245_tvb && tvb_length(h245_tvb)) { call_dissector(h245dg_handle, h245_tvb, pinfo, tree); } - - return offset; } static int dissect_H245Control_item(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { @@ -6092,20 +6094,16 @@ static int dissect_callLinkage(tvbuff_t *tvb, int offset, packet_info *pinfo, pr } + static int dissect_h225_T_messageContent_item(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { - 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); - } + tvbuff_t *next_tvb = NULL; + offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, + -1, -1, &next_tvb); + if (next_tvb && tvb_length(next_tvb)) { + call_dissector((tp_handle)?tp_handle:data_handle, next_tvb, pinfo, tree); + } return offset; } static int dissect_messageContent_item(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { @@ -6192,11 +6190,11 @@ static int dissect_h323pdu(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_ } + static int dissect_h225_OCTET_STRING_SIZE_1_131(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 1, 131, - NULL, NULL); + 1, 131, NULL); return offset; } @@ -6306,7 +6304,7 @@ static int dissect_sctp(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre static int dissect_h225_INTEGER_0_127(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index, - 0U, 127U, NULL, NULL, FALSE); + 0U, 127U, NULL, NULL, FALSE); return offset; } @@ -6492,7 +6490,7 @@ static int dissect_requestSeqNum(tvbuff_t *tvb, int offset, packet_info *pinfo, static int dissect_h225_TimeToLive(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index, - 1U, 4294967295U, NULL, NULL, FALSE); + 1U, 4294967295U, NULL, NULL, FALSE); return offset; } @@ -6501,11 +6499,11 @@ static int dissect_timeToLive(tvbuff_t *tvb, int offset, packet_info *pinfo, pro } + static int dissect_h225_H248PackagesDescriptor(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - -1, -1, - NULL, NULL); + -1, -1, NULL); return offset; } @@ -6783,11 +6781,11 @@ static int dissect_usageInformation(tvbuff_t *tvb, int offset, packet_info *pinf } + static int dissect_h225_OCTET_STRING_SIZE_2_32(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 2, 32, - NULL, NULL); + 2, 32, NULL); return offset; } @@ -6905,7 +6903,7 @@ static int dissect_cname(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr static int dissect_h225_INTEGER_1_255(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index, - 1U, 255U, NULL, NULL, FALSE); + 1U, 255U, NULL, NULL, FALSE); return offset; } @@ -7220,7 +7218,7 @@ static int dissect_registrationRequest(tvbuff_t *tvb, int offset, packet_info *p static int dissect_h225_INTEGER_1_65535(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index, - 1U, 65535U, NULL, NULL, FALSE); + 1U, 65535U, NULL, NULL, FALSE); return offset; } @@ -9133,7 +9131,7 @@ void proto_register_h225(void) { "", HFILL }}, { &hf_h225_H245Control_item, { "Item", "h225.H245Control_item", - FT_BYTES, BASE_HEX, NULL, 0, + FT_UINT32, BASE_DEC, NULL, 0, "H245Control/_item", HFILL }}, { &hf_h225_nonStandard, { "nonStandard", "h225.nonStandard", @@ -9375,7 +9373,7 @@ void proto_register_h225(void) { { "Item", "h225.sourceAddress_item", FT_UINT32, BASE_DEC, VALS(AliasAddress_vals), 0, "Setup-UUIE/sourceAddress/_item", HFILL }}, - { &hf_h225_Setup_UUIE_sourceInfo, + { &hf_h225_setup_UUIE_sourceInfo, { "sourceInfo", "h225.sourceInfo", FT_NONE, BASE_NONE, NULL, 0, "Setup-UUIE/sourceInfo", HFILL }}, @@ -9541,7 +9539,7 @@ void proto_register_h225(void) { "Setup-UUIE/hopCount", HFILL }}, { &hf_h225_ParallelH245Control_item, { "Item", "h225.ParallelH245Control_item", - FT_BYTES, BASE_HEX, NULL, 0, + FT_UINT32, BASE_DEC, NULL, 0, "ParallelH245Control/_item", HFILL }}, { &hf_h225_unknown, { "unknown", "h225.unknown", @@ -10529,7 +10527,7 @@ void proto_register_h225(void) { "CryptoH323Token/cryptoFastStart", HFILL }}, { &hf_h225_nestedcryptoToken, { "nestedcryptoToken", "h225.nestedcryptoToken", - FT_UINT32, BASE_DEC, VALS(CryptoToken_vals), 0, + FT_UINT32, BASE_DEC, VALS(h235_CryptoToken_vals), 0, "CryptoH323Token/nestedcryptoToken", HFILL }}, { &hf_h225_channelRate, { "channelRate", "h225.channelRate", @@ -11177,7 +11175,7 @@ void proto_register_h225(void) { "GatekeeperRequest/authenticationCapability", HFILL }}, { &hf_h225_authenticationCapability_item, { "Item", "h225.authenticationCapability_item", - FT_UINT32, BASE_DEC, VALS(AuthenticationMechanism_vals), 0, + FT_UINT32, BASE_DEC, VALS(h235_AuthenticationMechanism_vals), 0, "GatekeeperRequest/authenticationCapability/_item", HFILL }}, { &hf_h225_algorithmOIDs, { "algorithmOIDs", "h225.algorithmOIDs", @@ -11209,7 +11207,7 @@ void proto_register_h225(void) { "GatekeeperConfirm/rasAddress", HFILL }}, { &hf_h225_authenticationMode, { "authenticationMode", "h225.authenticationMode", - FT_UINT32, BASE_DEC, VALS(AuthenticationMechanism_vals), 0, + FT_UINT32, BASE_DEC, VALS(h235_AuthenticationMechanism_vals), 0, "GatekeeperConfirm/authenticationMode", HFILL }}, { &hf_h225_gatekeeperRejectReason, { "rejectReason", "h225.rejectReason", diff --git a/epan/dissectors/packet-h225.h b/epan/dissectors/packet-h225.h index 0dc6be9fc4..8c73d39f4b 100644 --- a/epan/dissectors/packet-h225.h +++ b/epan/dissectors/packet-h225.h @@ -1,6 +1,6 @@ /* Do not modify this file. */ /* It is created automatically by the ASN.1 to Ethereal dissector compiler */ -/* ./packet-h225.h */ +/* .\packet-h225.h */ /* ../../tools/asn2eth.py -X -e -p h225 -c h225.cnf -s packet-h225-template h225.asn */ /* Input file: packet-h225-template.h */ diff --git a/epan/dissectors/packet-h235.c b/epan/dissectors/packet-h235.c index 8fae04193d..85f773d312 100644 --- a/epan/dissectors/packet-h235.c +++ b/epan/dissectors/packet-h235.c @@ -1,7 +1,7 @@ /* Do not modify this file. */ /* It is created automatically by the ASN.1 to Ethereal dissector compiler */ -/* ./packet-h235.c */ -/* ../../tools/asn2eth.py -X -p h235 -c h235.cnf -s packet-h235-template H235-SECURITY-MESSAGES.asn */ +/* .\packet-h235.c */ +/* ../../tools/asn2eth.py -X -e -p h235 -c h235.cnf -s packet-h235-template H235-SECURITY-MESSAGES.asn */ /* Input file: packet-h235-template.c */ @@ -167,11 +167,11 @@ static int dissect_toBeSigned(tvbuff_t *tvb, int offset, packet_info *pinfo, pro } + static int dissect_h235_ChallengeString(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 8, 128, - NULL, NULL); + 8, 128, NULL); return offset; } @@ -184,7 +184,7 @@ static int dissect_challenge(tvbuff_t *tvb, int offset, packet_info *pinfo, prot int dissect_h235_TimeStamp(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index, - 1U, 4294967295U, NULL, NULL, FALSE); + 1U, 4294967295U, NULL, NULL, FALSE); return offset; } @@ -197,7 +197,7 @@ static int dissect_timeStamp(tvbuff_t *tvb, int offset, packet_info *pinfo, prot static int dissect_h235_RandomVal(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_integer(tvb, offset, pinfo, tree, hf_index, - NULL, NULL); + NULL, NULL); return offset; } @@ -245,10 +245,11 @@ static int dissect_secureChannel(tvbuff_t *tvb, int offset, packet_info *pinfo, } + static int dissect_h235_OBJECT_IDENTIFIER(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_object_identifier(tvb, offset, pinfo, tree, hf_index, - NULL); + NULL); return offset; } @@ -269,11 +270,11 @@ static int dissect_keyDerivationOID(tvbuff_t *tvb, int offset, packet_info *pinf } + static int dissect_h235_OCTET_STRING(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - -1, -1, - NULL, NULL); + -1, -1, NULL); return offset; } @@ -443,7 +444,7 @@ static int dissect_eckasdh2(tvbuff_t *tvb, int offset, packet_info *pinfo, proto } -static const value_string ECKASDH_vals[] = { +static const value_string h235_ECKASDH_vals[] = { { 0, "eckasdhp" }, { 1, "eckasdh2" }, { 0, NULL } @@ -485,12 +486,10 @@ static int dissect_certificate(tvbuff_t *tvb, int offset, packet_info *pinfo, pr } + static int dissect_h235_NULL(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { - { proto_item *ti_tmp; - ti_tmp = proto_tree_add_item(tree, hf_index, tvb, offset>>8, 0, FALSE); - proto_item_append_text(ti_tmp, ": NULL"); - } + offset = dissect_per_null(tvb, offset, pinfo, tree, hf_index); return offset; } @@ -520,7 +519,7 @@ static int dissect_tls(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree } -static const value_string AuthenticationBES_vals[] = { +static const value_string h235_AuthenticationBES_vals[] = { { 0, "default" }, { 1, "radius" }, { 0, NULL } @@ -545,7 +544,7 @@ static int dissect_authenticationBES(tvbuff_t *tvb, int offset, packet_info *pin } -const value_string AuthenticationMechanism_vals[] = { +const value_string h235_AuthenticationMechanism_vals[] = { { 0, "dhExch" }, { 1, "pwdSymEnc" }, { 2, "pwdHash" }, @@ -583,7 +582,7 @@ dissect_h235_AuthenticationMechanism(tvbuff_t *tvb, int offset, packet_info *pin static int dissect_h235_INTEGER(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_integer(tvb, offset, pinfo, tree, hf_index, - NULL, NULL); + NULL, NULL); return offset; } @@ -592,11 +591,11 @@ static int dissect_ranInt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_t } + static int dissect_h235_IV8(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 8, 8, - NULL, NULL); + 8, 8, NULL); return offset; } @@ -605,11 +604,11 @@ static int dissect_iv8(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree } + static int dissect_h235_IV16(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 16, 16, - NULL, NULL); + 16, 16, NULL); return offset; } @@ -727,7 +726,7 @@ static int dissect_secureSharedSecret(tvbuff_t *tvb, int offset, packet_info *pi } -static const value_string H235Key_vals[] = { +static const value_string h235_H235Key_vals[] = { { 0, "secureChannel" }, { 1, "sharedSecret" }, { 2, "certProtectedKey" }, @@ -855,7 +854,7 @@ static int dissect_cryptoHashedToken(tvbuff_t *tvb, int offset, packet_info *pin } -const value_string CryptoToken_vals[] = { +const value_string h235_CryptoToken_vals[] = { { 0, "cryptoEncryptedToken" }, { 1, "cryptoSignedToken" }, { 2, "cryptoHashedToken" }, @@ -1000,7 +999,7 @@ void proto_register_h235(void) { "", HFILL }}, { &hf_h235_authenticationBES, { "authenticationBES", "h235.authenticationBES", - FT_UINT32, BASE_DEC, VALS(AuthenticationBES_vals), 0, + FT_UINT32, BASE_DEC, VALS(h235_AuthenticationBES_vals), 0, "AuthenticationMechanism/authenticationBES", HFILL }}, { &hf_h235_tokenOID, { "tokenOID", "h235.tokenOID", @@ -1036,7 +1035,7 @@ void proto_register_h235(void) { "", HFILL }}, { &hf_h235_eckasdhkey, { "eckasdhkey", "h235.eckasdhkey", - FT_UINT32, BASE_DEC, VALS(ECKASDH_vals), 0, + FT_UINT32, BASE_DEC, VALS(h235_ECKASDH_vals), 0, "ClearToken/eckasdhkey", HFILL }}, { &hf_h235_sendersID, { "sendersID", "h235.sendersID", @@ -1044,7 +1043,7 @@ void proto_register_h235(void) { "ClearToken/sendersID", HFILL }}, { &hf_h235_h235Key, { "h235Key", "h235.h235Key", - FT_UINT32, BASE_DEC, VALS(H235Key_vals), 0, + FT_UINT32, BASE_DEC, VALS(h235_H235Key_vals), 0, "ClearToken/h235Key", HFILL }}, { &hf_h235_toBeSigned, { "toBeSigned", "h235.toBeSigned", diff --git a/epan/dissectors/packet-h235.h b/epan/dissectors/packet-h235.h index 83893ca605..af912f6b1d 100644 --- a/epan/dissectors/packet-h235.h +++ b/epan/dissectors/packet-h235.h @@ -1,7 +1,7 @@ /* Do not modify this file. */ /* It is created automatically by the ASN.1 to Ethereal dissector compiler */ -/* ./packet-h235.h */ -/* ../../tools/asn2eth.py -X -p h235 -c h235.cnf -s packet-h235-template H235-SECURITY-MESSAGES.asn */ +/* .\packet-h235.h */ +/* ../../tools/asn2eth.py -X -e -p h235 -c h235.cnf -s packet-h235-template H235-SECURITY-MESSAGES.asn */ /* Input file: packet-h235-template.h */ @@ -36,8 +36,8 @@ /*--- Included file: packet-h235-exp.h ---*/ -extern const value_string AuthenticationMechanism_vals[]; -extern const value_string CryptoToken_vals[]; +extern const value_string h235_AuthenticationMechanism_vals[]; +extern const value_string h235_CryptoToken_vals[]; int dissect_h235_TimeStamp(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); int dissect_h235_AuthenticationMechanism(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); int dissect_h235_ClearToken(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); diff --git a/epan/dissectors/packet-h245.c b/epan/dissectors/packet-h245.c index b304a334c7..b43a65e03e 100644 --- a/epan/dissectors/packet-h245.c +++ b/epan/dissectors/packet-h245.c @@ -1,6 +1,6 @@ /* Do not modify this file. */ /* It is created automatically by the ASN.1 to Ethereal dissector compiler */ -/* ./packet-h245.c */ +/* .\packet-h245.c */ /* ../../tools/asn2eth.py -X -e -p h245 -c h245.cnf -s packet-h245-template h245.asn */ /* Input file: packet-h245-template.c */ @@ -208,17 +208,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" }, @@ -317,7 +320,7 @@ static int hf_h245_messageContent_item = -1; /* GenericParameter */ static int hf_h245_nonStandardData = -1; /* NonStandardParameter */ static int hf_h245_nonStandardIdentifier = -1; /* NonStandardIdentifier */ static int hf_h245_nsd_data = -1; /* T_data */ -static int hf_h245_object = -1; /* OBJECT_IDENTIFIER */ +static int hf_h245_object = -1; /* T_object */ static int hf_h245_h221NonStandardID = -1; /* H221NonStandardID */ static int hf_h245_t35CountryCode = -1; /* T_t35CountryCode */ static int hf_h245_t35Extension = -1; /* T_t35Extension */ @@ -2155,35 +2158,14 @@ static int dissect_type(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre static int -dissect_h245_OBJECT_IDENTIFIER(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { +dissect_h245_T_object(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_object_identifier(tvb, offset, pinfo, tree, hf_index, - NULL); + nsiOID); return offset; } static int dissect_object(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { - return dissect_h245_OBJECT_IDENTIFIER(tvb, offset, pinfo, tree, hf_h245_object); -} -static int dissect_protocolIdentifier(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { - return dissect_h245_OBJECT_IDENTIFIER(tvb, offset, pinfo, tree, hf_h245_protocolIdentifier); -} -static int dissect_algorithm(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { - return dissect_h245_OBJECT_IDENTIFIER(tvb, offset, pinfo, tree, hf_h245_algorithm); -} -static int dissect_antiSpamAlgorithm(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { - return dissect_h245_OBJECT_IDENTIFIER(tvb, offset, pinfo, tree, hf_h245_antiSpamAlgorithm); -} -static int dissect_oid(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { - return dissect_h245_OBJECT_IDENTIFIER(tvb, offset, pinfo, tree, hf_h245_oid); -} -static int dissect_escrowID(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { - return dissect_h245_OBJECT_IDENTIFIER(tvb, offset, pinfo, tree, hf_h245_escrowID); -} -static int dissect_field(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { - return dissect_h245_OBJECT_IDENTIFIER(tvb, offset, pinfo, tree, hf_h245_field); -} -static int dissect_algorithmOID(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { - return dissect_h245_OBJECT_IDENTIFIER(tvb, offset, pinfo, tree, hf_h245_algorithmOID); + return dissect_h245_T_object(tvb, offset, pinfo, tree, hf_h245_object); } @@ -2191,7 +2173,7 @@ static int dissect_algorithmOID(tvbuff_t *tvb, int offset, packet_info *pinfo, p static int dissect_h245_T_t35CountryCode(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index, - 0U, 255U, &t35CountryCode, NULL, FALSE); + 0U, 255U, &t35CountryCode, NULL, FALSE); return offset; } @@ -2204,7 +2186,7 @@ static int dissect_t35CountryCode(tvbuff_t *tvb, int offset, packet_info *pinfo, static int dissect_h245_T_t35Extension(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index, - 0U, 255U, &t35Extension, NULL, FALSE); + 0U, 255U, &t35Extension, NULL, FALSE); return offset; } @@ -2217,7 +2199,7 @@ static int dissect_t35Extension(tvbuff_t *tvb, int offset, packet_info *pinfo, p static int dissect_h245_T_manufacturerCode(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index, - 0U, 65535U, &manufacturerCode, NULL, FALSE); + 0U, 65535U, &manufacturerCode, NULL, FALSE); return offset; } @@ -2242,7 +2224,6 @@ dissect_h245_H221NonStandardID(tvbuff_t *tvb, int offset, packet_info *pinfo _U_ 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); return offset; } static int dissect_h221NonStandardID(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { @@ -2264,9 +2245,26 @@ static const per_choice_t NonStandardIdentifier_choice[] = { static int dissect_h245_NonStandardIdentifier(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { - offset = dissect_per_choice(tvb, offset, pinfo, tree, hf_index, - ett_h245_NonStandardIdentifier, NonStandardIdentifier_choice, "NonStandardIdentifier", - NULL); + 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; + } return offset; } @@ -2278,21 +2276,16 @@ static int dissect_vendor(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_t } + static int dissect_h245_T_data(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { - 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); - } - + tvbuff_t *next_tvb = NULL; + offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, + -1, -1, &next_tvb); + if (next_tvb && tvb_length(next_tvb)) { + call_dissector((nsp_handle)?nsp_handle:data_handle, next_tvb, pinfo, tree); + } return offset; } static int dissect_nsd_data(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { @@ -2307,6 +2300,7 @@ static const per_sequence_t NonStandardParameter_sequence[] = { static int dissect_h245_NonStandardParameter(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + nsp_handle = NULL; offset = dissect_per_sequence(tvb, offset, pinfo, tree, hf_index, ett_h245_NonStandardParameter, NonStandardParameter_sequence); @@ -2459,6 +2453,37 @@ static int dissect_h233AlgorithmIdentifier(tvbuff_t *tvb, int offset, packet_inf static int +dissect_h245_OBJECT_IDENTIFIER(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_per_object_identifier(tvb, offset, pinfo, tree, hf_index, + NULL); + + return offset; +} +static int dissect_protocolIdentifier(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { + return dissect_h245_OBJECT_IDENTIFIER(tvb, offset, pinfo, tree, hf_h245_protocolIdentifier); +} +static int dissect_algorithm(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { + return dissect_h245_OBJECT_IDENTIFIER(tvb, offset, pinfo, tree, hf_h245_algorithm); +} +static int dissect_antiSpamAlgorithm(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { + return dissect_h245_OBJECT_IDENTIFIER(tvb, offset, pinfo, tree, hf_h245_antiSpamAlgorithm); +} +static int dissect_oid(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { + return dissect_h245_OBJECT_IDENTIFIER(tvb, offset, pinfo, tree, hf_h245_oid); +} +static int dissect_escrowID(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { + return dissect_h245_OBJECT_IDENTIFIER(tvb, offset, pinfo, tree, hf_h245_escrowID); +} +static int dissect_field(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { + return dissect_h245_OBJECT_IDENTIFIER(tvb, offset, pinfo, tree, hf_h245_field); +} +static int dissect_algorithmOID(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { + return dissect_h245_OBJECT_IDENTIFIER(tvb, offset, pinfo, tree, hf_h245_algorithmOID); +} + + + +static int dissect_h245_INTEGER_1_256(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index, 1U, 256U, NULL, NULL, FALSE); @@ -3384,11 +3409,11 @@ static int dissect_internationalNumber(tvbuff_t *tvb, int offset, packet_info *p } + static int dissect_h245_OCTET_STRING_SIZE_1_20(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 1, 20, - NULL, NULL); + 1, 20, NULL); return offset; } @@ -4963,11 +4988,11 @@ static int dissect_t84(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree } + static int dissect_h245_OCTET_STRING(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - -1, -1, - NULL, NULL); + -1, -1, NULL); return offset; } @@ -5170,11 +5195,11 @@ static int dissect_standardOid(tvbuff_t *tvb, int offset, packet_info *pinfo, pr } + static int dissect_h245_OCTET_STRING_SIZE_16(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 16, 16, - NULL, NULL); + 16, 16, NULL); return offset; } @@ -9305,20 +9330,19 @@ static int dissect_v76LogicalChannelParameters(tvbuff_t *tvb, int offset, packet } + static int dissect_h245_Ipv4_network(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { -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); return offset; @@ -9368,11 +9392,11 @@ static int dissect_iPAddress(tvbuff_t *tvb, int offset, packet_info *pinfo, prot } + static int dissect_h245_OCTET_STRING_SIZE_6(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 6, 6, - NULL, NULL); + 6, 6, NULL); return offset; } @@ -9381,11 +9405,11 @@ static int dissect_node(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre } + static int dissect_h245_OCTET_STRING_SIZE_4(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 4, 4, - NULL, NULL); + 4, 4, NULL); return offset; } @@ -9403,11 +9427,11 @@ static int dissect_mip4_network(tvbuff_t *tvb, int offset, packet_info *pinfo, p } + static int dissect_h245_OCTET_STRING_SIZE_2(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 2, 2, - NULL, NULL); + 2, 2, NULL); return offset; } @@ -9988,11 +10012,11 @@ static int dissect_networkAddress(tvbuff_t *tvb, int offset, packet_info *pinfo, } + static int dissect_h245_OCTET_STRING_SIZE_1_255(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 1, 255, - NULL, NULL); + 1, 255, NULL); return offset; } @@ -10048,11 +10072,11 @@ static int dissect_separateStack(tvbuff_t *tvb, int offset, packet_info *pinfo, } + static int dissect_h245_OCTET_STRING_SIZE_1_65535(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 1, 65535, - NULL, NULL); + 1, 65535, NULL); return offset; } @@ -13243,11 +13267,11 @@ static int dissect_communicationModeResponse(tvbuff_t *tvb, int offset, packet_i } + static int dissect_h245_TerminalID(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 1, 128, - NULL, NULL); + 1, 128, NULL); return offset; } @@ -13293,11 +13317,11 @@ static int dissect_terminalIDResponse(tvbuff_t *tvb, int offset, packet_info *pi } + static int dissect_h245_ConferenceID(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 1, 32, - NULL, NULL); + 1, 32, NULL); return offset; } @@ -13323,11 +13347,11 @@ static int dissect_conferenceIDResponse(tvbuff_t *tvb, int offset, packet_info * } + static int dissect_h245_Password(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 1, 32, - NULL, NULL); + 1, 32, NULL); return offset; } @@ -15709,11 +15733,11 @@ static int dissect_rtp(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree } + static int dissect_h245_IV8(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 8, 8, - NULL, NULL); + 8, 8, NULL); return offset; } @@ -15722,11 +15746,11 @@ static int dissect_iv8(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree } + static int dissect_h245_IV16(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 16, 16, - NULL, NULL); + 16, 16, NULL); return offset; } @@ -15753,11 +15777,11 @@ static int dissect_paramS(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_t } + static int dissect_h245_OCTET_STRING_SIZE_1(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 1, 1, - NULL, NULL); + 1, 1, NULL); return offset; } @@ -16020,11 +16044,11 @@ static int dissect_conferenceIndication(tvbuff_t *tvb, int offset, packet_info * } + static int dissect_h245_OCTET_STRING_SIZE_1_256(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 1, 256, - NULL, NULL); + 1, 256, NULL); return offset; } diff --git a/epan/dissectors/packet-h245.h b/epan/dissectors/packet-h245.h index 2c0d3633a2..2d9094c11c 100644 --- a/epan/dissectors/packet-h245.h +++ b/epan/dissectors/packet-h245.h @@ -1,6 +1,6 @@ /* Do not modify this file. */ /* It is created automatically by the ASN.1 to Ethereal dissector compiler */ -/* ./packet-h245.h */ +/* .\packet-h245.h */ /* ../../tools/asn2eth.py -X -e -p h245 -c h245.cnf -s packet-h245-template h245.asn */ /* Input file: packet-h245-template.h */ diff --git a/epan/dissectors/packet-h450.c b/epan/dissectors/packet-h450.c index 43625bfae8..6c120bff0d 100644 --- a/epan/dissectors/packet-h450.c +++ b/epan/dissectors/packet-h450.c @@ -726,12 +726,10 @@ static int dissect_nonStandard(tvbuff_t *tvb, int offset, packet_info *pinfo, pr } + static int dissect_h450_NULL(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { - { proto_item *ti_tmp; - ti_tmp = proto_tree_add_item(tree, hf_index, tvb, offset>>8, 0, FALSE); - proto_item_append_text(ti_tmp, ": NULL"); - } + offset = dissect_per_null(tvb, offset, pinfo, tree, hf_index); return offset; } @@ -974,21 +972,21 @@ dissect_h450_H4501SupplementaryService(tvbuff_t *tvb, int offset, packet_info *p } + static int dissect_h450_Notassignedlocalopcode(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - -1, -1, - NULL, NULL); + -1, -1, NULL); return offset; } + static int dissect_h450_SubaddressInformation(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 1, 20, - NULL, NULL); + 1, 20, NULL); return offset; } @@ -1041,11 +1039,11 @@ static int dissect_userSpecifiedSubaddress(tvbuff_t *tvb, int offset, packet_inf } + static int dissect_h450_NSAPSubaddress(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 1, 20, - NULL, NULL); + 1, 20, NULL); return offset; } @@ -1382,10 +1380,11 @@ static int dissect_presentationAllowedIndicator(tvbuff_t *tvb, int offset, packe } + static int dissect_h450_OBJECT_IDENTIFIER(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_object_identifier(tvb, offset, pinfo, tree, hf_index, - NULL); + NULL); return offset; } @@ -1394,11 +1393,11 @@ static int dissect_extensionId(tvbuff_t *tvb, int offset, packet_info *pinfo, pr } + static int dissect_h450_ExtensionArgument(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - -1, -1, - NULL, NULL); + -1, -1, NULL); return offset; } @@ -1545,11 +1544,11 @@ static int dissect_nominatedInfo(tvbuff_t *tvb, int offset, packet_info *pinfo, } + static int dissect_h450_H225InformationElement(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - -1, -1, - NULL, NULL); + -1, -1, NULL); return offset; } @@ -2229,7 +2228,7 @@ static int dissect_originalDiversionReason(tvbuff_t *tvb, int offset, packet_inf static int dissect_h450_INTEGER_1_15(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index, - 1U, 15U, NULL, NULL, FALSE); + 1U, 15U, NULL, NULL, FALSE); return offset; } @@ -2776,7 +2775,7 @@ dissect_h450_RemoteRetrieveRes(tvbuff_t *tvb, int offset, packet_info *pinfo _U_ static int dissect_h450_ParkedToPosition(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index, - 0U, 65535U, NULL, NULL, FALSE); + 0U, 65535U, NULL, NULL, FALSE); return offset; } @@ -3075,7 +3074,7 @@ dissect_h450_CpickupNotifyArg(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, static int dissect_h450_INTEGER_0_255(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index, - 0U, 255U, NULL, NULL, FALSE); + 0U, 255U, NULL, NULL, FALSE); return offset; } @@ -3102,7 +3101,7 @@ dissect_h450_CallWaitingArg(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, p static int dissect_h450_INTEGER_0_65535(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index, - 0U, 65535U, NULL, NULL, FALSE); + 0U, 65535U, NULL, NULL, FALSE); return offset; } @@ -3154,7 +3153,7 @@ static int dissect_msgCentreId(tvbuff_t *tvb, int offset, packet_info *pinfo, pr static int dissect_h450_NbOfMessages(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index, - 0U, 65535U, NULL, NULL, FALSE); + 0U, 65535U, NULL, NULL, FALSE); return offset; } @@ -3179,7 +3178,7 @@ static int dissect_timestamp(tvbuff_t *tvb, int offset, packet_info *pinfo, prot static int dissect_h450_INTEGER_0_9(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index, - 0U, 9U, NULL, NULL, FALSE); + 0U, 9U, NULL, NULL, FALSE); return offset; } @@ -3330,11 +3329,11 @@ dissect_h450_MWIInterrogateRes(tvbuff_t *tvb, int offset, packet_info *pinfo _U_ } + static int dissect_h450_SimpleName(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, - 1, 50, - NULL, NULL); + 1, 50, NULL); return offset; } @@ -3590,7 +3589,7 @@ static const value_string h450_CICapabilityLevel_vals[] = { static int dissect_h450_CICapabilityLevel(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index, - 1U, 3U, NULL, NULL, FALSE); + 1U, 3U, NULL, NULL, FALSE); return offset; } @@ -3685,7 +3684,7 @@ static const value_string h450_CIProtectionLevel_vals[] = { static int dissect_h450_CIProtectionLevel(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index, - 0U, 3U, NULL, NULL, FALSE); + 0U, 3U, NULL, NULL, FALSE); return offset; } @@ -3883,7 +3882,7 @@ static int dissect_partyCategory(tvbuff_t *tvb, int offset, packet_info *pinfo, static int dissect_h450_SSCIProtectionLevel(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_index, - 0U, 3U, NULL, NULL, FALSE); + 0U, 3U, NULL, NULL, FALSE); return offset; } @@ -4045,15 +4044,11 @@ dissect_h4501_GeneralProblem(tvbuff_t *tvb, int offset, packet_info *pinfo, prot static int dissect_h4501_ReturnResult_result(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { - tvbuff_t *result_tvb; - guint32 result_offset=0; - guint32 result_len=0; + tvbuff_t *result_tvb = NULL; - offset=dissect_per_octet_string(tvb, offset, pinfo, tree, -1, -1, -1, &result_offset, &result_len); - - if(result_len){ - result_tvb = tvb_new_subset(tvb, result_offset, result_len, result_len); + offset=dissect_per_octet_string(tvb, offset, pinfo, tree, -1, -1, -1, &result_tvb); + if(tvb_length(result_tvb)){ switch (localOpcode) { case CallTransferIdentify: dissect_h450_CTIdentifyRes(result_tvb, 0, pinfo, tree, hf_h4502_CTIdentifyRes); @@ -4140,7 +4135,7 @@ static int dissect_h4501_parameter(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { /* TODO - decode return error parameter based on localErrorCode */ - offset=dissect_per_octet_string(tvb, offset, pinfo, tree, hf_h4501_parameter, -1, -1, NULL, NULL); + offset=dissect_per_octet_string(tvb, offset, pinfo, tree, hf_h4501_parameter, -1, -1, NULL); return offset; } static const value_string localErrorCode_vals[] = { @@ -4347,26 +4342,21 @@ dissect_h4501_ROS(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tre static int dissect_h4501_argument(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { - tvbuff_t *argument_tvb; - guint32 argument_offset=0; - guint32 argument_len=0; + tvbuff_t *argument_tvb = NULL; if ( is_globalcode ){ /* TODO call oid dissector * call_ber_oid_callback isn't realy apropriate ? */ - offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_h4501_globalargument, -1, -1, NULL, NULL); + offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_h4501_globalargument, -1, -1, NULL); is_globalcode = FALSE; return offset; } - offset=dissect_per_octet_string(tvb, offset, pinfo, tree, -1, -1, -1, &argument_offset, &argument_len); - - if(argument_len){ - argument_tvb = tvb_new_subset(tvb, argument_offset, argument_len, argument_len); - + offset=dissect_per_octet_string(tvb, offset, pinfo, tree, -1, -1, -1, &argument_tvb); + if(tvb_length(argument_tvb)){ switch (localOpcode) { /* h450.2 */ case CallTransferIdentify: /* Localvalue 7 */ diff --git a/epan/dissectors/packet-per.c b/epan/dissectors/packet-per.c index c5ce0c34e9..5250d6734a 100644 --- a/epan/dissectors/packet-per.c +++ b/epan/dissectors/packet-per.c @@ -274,7 +274,7 @@ DEBUG_ENTRY("dissect_per_sequence_of"); guint32 dissect_per_IA5String(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, int min_len, int max_len) { - offset=dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, min_len, max_len, NULL, NULL); + offset=dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, min_len, max_len, NULL); return offset; } @@ -1386,7 +1386,7 @@ DEBUG_ENTRY("dissect_per_bit_string"); hf_index can either be a FT_BYTES or an FT_STRING */ guint32 -dissect_per_octet_string(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, int min_len, int max_len, guint32 *value_offset, guint32 *value_len) +dissect_per_octet_string(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, int min_len, int max_len, tvbuff_t **value_tvb) { proto_tree *etr = NULL; proto_item *it = NULL; @@ -1477,8 +1477,8 @@ DEBUG_ENTRY("dissect_per_octet_string"); } } } - if (value_offset) *value_offset = val_start; - if (value_len) *value_len = val_length; + if (value_tvb) + *value_tvb = tvb_new_subset(tvb, val_start, val_length, val_length); return offset; } diff --git a/epan/dissectors/packet-per.h b/epan/dissectors/packet-per.h index 56c28aba59..173f2b9a9f 100644 --- a/epan/dissectors/packet-per.h +++ b/epan/dissectors/packet-per.h @@ -98,7 +98,7 @@ extern guint32 dissect_per_choice(tvbuff_t *tvb, guint32 offset, packet_info *pi extern guint32 dissect_per_sequence(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *parent_tree, int hf_index, gint ett_index, const per_sequence_t *sequence); -extern guint32 dissect_per_octet_string(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, int min_len, int max_len, guint32 *value_offset, guint32 *value_len); +extern guint32 dissect_per_octet_string(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, int min_len, int max_len, tvbuff_t **value_tvb); extern guint32 dissect_per_bit_string(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, int min_len, int max_len); diff --git a/epan/dissectors/packet-t38.c b/epan/dissectors/packet-t38.c index c7b96d338c..304624c49c 100644 --- a/epan/dissectors/packet-t38.c +++ b/epan/dissectors/packet-t38.c @@ -529,21 +529,22 @@ dissect_t38_Data_Field_field_type(tvbuff_t *tvb, int offset, packet_info *pinfo, static int dissect_t38_Data_Field_field_data(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { - guint32 value_offset = 0; - guint32 value_len = 0; + tvbuff_t *value_tvb = NULL; + guint32 value_len; offset=dissect_per_octet_string(tvb, offset, pinfo, tree, hf_t38_Data_Field_field_data, 1, 65535, - &value_offset, &value_len); + &value_tvb); + value_len = tvb_length(value_tvb); if (check_col(pinfo->cinfo, COL_INFO) && primary_part){ if(value_len < 8){ col_append_fstr(pinfo->cinfo, COL_INFO, "[%s]", - tvb_bytes_to_str(tvb,value_offset,value_len)); + tvb_bytes_to_str(value_tvb,0,value_len)); } else { col_append_fstr(pinfo->cinfo, COL_INFO, "[%s...]", - tvb_bytes_to_str(tvb,value_offset,7)); + tvb_bytes_to_str(value_tvb,0,7)); } } return offset; @@ -658,7 +659,7 @@ dissect_t38_fec_data_item(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_t { offset=dissect_per_octet_string(tvb, offset, pinfo, tree, hf_t38_fec_data_item, -1, -1, - NULL, NULL); + NULL); return offset; } diff --git a/tools/asn2eth.py b/tools/asn2eth.py index fd0a0b6195..78f036b5ce 100644 --- a/tools/asn2eth.py +++ b/tools/asn2eth.py @@ -2741,29 +2741,27 @@ class OctetStringType (Type): def GetTTag(self, ectx): return ('BER_CLASS_UNI', 'BER_UNI_TAG_OCTETSTRING') - def eth_type_fn(self, proto, tname, ectx): - out = ectx.eth_type_fn_hdr(tname) - (minv, maxv, ext) = self.eth_get_size_constr() - if (ectx.OBer()): - body = ectx.eth_fn_call('dissect_ber_octet_string', ret='offset', - par=(('implicit_tag', 'pinfo', 'tree', 'tvb', 'offset', 'hf_index'), - ('NULL',))) + def eth_type_default_pars(self, ectx): + pars = Type.eth_type_default_pars(self, ectx) + (pars['MIN_VAL'], pars['MAX_VAL'], pars['EXT']) = self.eth_get_size_constr() + return pars + + def eth_type_default_body(self, ectx, tname): + if (ectx.Ber()): + body = ectx.eth_fn_call('dissect_%(ER)s_octet_string', ret='offset', + par=(('%(IMPLICIT_TAG)s', '%(PINFO)s', '%(TREE)s', '%(TVB)s', '%(OFFSET)s', '%(HF_INDEX)s'), + ('%(VAL_PTR)s',),)) elif (ectx.NPer()): - body = ectx.eth_fn_call('dissect_pern_octet_string', ret='offset', - par=(('tvb', 'offset', 'pinfo', 'tree'), - ('hf_index', 'item', 'private_data'), - (minv, maxv, ext), - ('NULL', 'NULL'))) + body = ectx.eth_fn_call('dissect_%(ER)s_octet_string', ret='offset', + par=(('%(TVB)s', '%(OFFSET)s', '%(PINFO)s', '%(TREE)s', '%(HF_INDEX)s', 'item', 'private_data'), + ('%(MIN_VAL)s', '%(MAX_VAL)s', '%(EXT)s', '%(VAL_PTR)s',),)) elif (ectx.OPer()): - body = ectx.eth_fn_call('dissect_per_octet_string', ret='offset', - par=(('tvb', 'offset', 'pinfo', 'tree', 'hf_index'), - (minv, maxv), - ('NULL', 'NULL'))) + body = ectx.eth_fn_call('dissect_%(ER)s_octet_string', ret='offset', + par=(('%(TVB)s', '%(OFFSET)s', '%(PINFO)s', '%(TREE)s', '%(HF_INDEX)s'), + ('%(MIN_VAL)s', '%(MAX_VAL)s', '%(VAL_PTR)s',),)) else: body = '#error Can not decode %s' % (tname) - out += ectx.eth_type_fn_body(tname, body) - out += ectx.eth_type_fn_ftr(tname) - return out + return body #--- CharacterStringType ------------------------------------------------------ class CharacterStringType (Type): |