diff options
author | Anders Broman <anders.broman@ericsson.com> | 2005-10-24 21:42:19 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2005-10-24 21:42:19 +0000 |
commit | 314c36da9ab818ee9d47759cda10cb9466afbce7 (patch) | |
tree | 63b6cd3c22e99a490f472c65b08acdb48952b4c0 | |
parent | 149b419740ffdad03b11037819d6def9b9492651 (diff) |
From Graeme Lunt:
The ftbp.patch file includes:
a) A fix to acse.cnf which works around an asn2eth bug (it is the AE-qualifier EXPORT I want, but asn2eth doesn't generate the appropriate extern for the values). Also a small cosmetic change for EXTERNAL decodings.
b) New EXPORTs for the FTAM dissector for use in FTBP.
c) A fix to asn2eth to solve the problem if you EXPORT types that include a '-' character in the name (e.g. "AE-qualifier" from acse.cnf, "Date-and-Time-Attribute" from ftam.cnf). The problem is that asn2eth generates the "xxxx-exp.cnf" file using the 'C' name (which has replaced '-' with '_') rather than the original 'ASN' name. The fix just undoes the replacement as I couldn't see the original name being preserved anywhere. There still remains a problem if the type has a '.' in the name - but generally I don't think they do.
* Better ROS handling and registration
* Simplified RTSE registration
* X411 column information, extension naming and use of new RTSE/ROS registration
* X420 notification extensions, warnings removal and export of ExtensionsField (missed from recent FTBP patch).
* Better highlighting of S4406 protocol.
svn path=/trunk/; revision=16296
43 files changed, 2732 insertions, 241 deletions
diff --git a/asn1/acse/acse-exp.cnf b/asn1/acse/acse-exp.cnf index 26f1126f8b..7d309cbbc9 100644 --- a/asn1/acse/acse-exp.cnf +++ b/asn1/acse/acse-exp.cnf @@ -1,16 +1,18 @@ #.IMPORT_TAG EXTERNAL BER_CLASS_UNI 8 -AP_title BER_CLASS_ANY/*choice*/ -1/*choice*/ -AE_qualifier BER_CLASS_ANY/*choice*/ -1/*choice*/ -AE_invocation_identifier BER_CLASS_UNI BER_UNI_TAG_INTEGER -AP_invocation_identifier BER_CLASS_UNI BER_UNI_TAG_INTEGER +AP-title BER_CLASS_ANY/*choice*/ -1/*choice*/ +AE-qualifier BER_CLASS_ANY/*choice*/ -1/*choice*/ +ASO-qualifier BER_CLASS_ANY/*choice*/ -1/*choice*/ +AE-invocation-identifier BER_CLASS_UNI BER_UNI_TAG_INTEGER +AP-invocation-identifier BER_CLASS_UNI BER_UNI_TAG_INTEGER #.END #.TYPE_ATTR EXTERNAL TYPE = FT_NONE DISPLAY = BASE_NONE STRINGS = NULL BITMASK = 0 -AP_title TYPE = FT_UINT32 DISPLAY = BASE_DEC STRINGS = VALS(acse_AP_title_vals) BITMASK = 0 -AE_qualifier TYPE = FT_UINT32 DISPLAY = BASE_DEC STRINGS = VALS(acse_ASO_qualifier_vals) BITMASK = 0 -AE_invocation_identifier TYPE = FT_INT32 DISPLAY = BASE_DEC STRINGS = NULL BITMASK = 0 -AP_invocation_identifier TYPE = FT_INT32 DISPLAY = BASE_DEC STRINGS = NULL BITMASK = 0 +AP-title TYPE = FT_UINT32 DISPLAY = BASE_DEC STRINGS = VALS(acse_AP_title_vals) BITMASK = 0 +AE-qualifier TYPE = FT_UINT32 DISPLAY = BASE_DEC STRINGS = VALS(acse_ASO_qualifier_vals) BITMASK = 0 +ASO-qualifier TYPE = FT_UINT32 DISPLAY = BASE_DEC STRINGS = VALS(acse_ASO_qualifier_vals) BITMASK = 0 +AE-invocation-identifier TYPE = FT_INT32 DISPLAY = BASE_DEC STRINGS = NULL BITMASK = 0 +AP-invocation-identifier TYPE = FT_INT32 DISPLAY = BASE_DEC STRINGS = NULL BITMASK = 0 #.END diff --git a/asn1/acse/acse.cnf b/asn1/acse/acse.cnf index 38df7f4b0b..c80e625366 100644 --- a/asn1/acse/acse.cnf +++ b/asn1/acse/acse.cnf @@ -8,6 +8,7 @@ EXTERNAL AP-title AP-invocation-identifier AE-qualifier +ASO-qualifier AE-invocation-identifier #.TYPE_RENAME @@ -97,6 +98,6 @@ ACRQ-apdu/aSO-context-name aCRQ_aSO_context_name #.FN_BODY EXTERNAL/encoding/single-ASN1-type - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, top_tree ? top_tree : tree); #.END diff --git a/asn1/ftam/ftam.cnf b/asn1/ftam/ftam.cnf index bffe6f327a..d4f6af9448 100644 --- a/asn1/ftam/ftam.cnf +++ b/asn1/ftam/ftam.cnf @@ -9,6 +9,15 @@ ACSE-1 acse #.INCLUDE ../acse/acse-exp.cnf #.EXPORTS +Attribute-Extensions +Concurrency-Access +Date-and-Time-Attribute +Legal-Qualification-Attribute +Object-Availability-Attribute +Object-Size-Attribute +Pathname +Permitted-Actions-Attribute +Private-Use-Attribute #.PDU diff --git a/asn1/ftam/packet-ftam-template.h b/asn1/ftam/packet-ftam-template.h index 69a0ebd74d..1ee4af8288 100644 --- a/asn1/ftam/packet-ftam-template.h +++ b/asn1/ftam/packet-ftam-template.h @@ -31,6 +31,6 @@ #ifndef PACKET_FTAM_H #define PACKET_FTAM_H -/*#include "packet-ftam-exp.h"*/ +#include "packet-ftam-exp.h" #endif /* PACKET_FTAM_H */ diff --git a/asn1/ftbp/Makefile b/asn1/ftbp/Makefile new file mode 100644 index 0000000000..410a2fb3b4 --- /dev/null +++ b/asn1/ftbp/Makefile @@ -0,0 +1,17 @@ +# $Id$ + +DISSECTOR_FILES=packet-ftbp.c packet-ftbp.h + +all: generate_dissector + +generate_dissector: $(DISSECTOR_FILES) + +$(DISSECTOR_FILES): ../../tools/asn2eth.py ftbp.asn packet-ftbp-template.c packet-ftbp-template.h ftbp.cnf + python ../../tools/asn2eth.py -X -b -e -p ftbp -c ftbp.cnf -s packet-ftbp-template ftbp.asn + +clean: + rm -f parsetab.py $(DISSECTOR_FILES) + +copy_files: generate_dissector + cp $(DISSECTOR_FILES) ../../epan/dissectors + diff --git a/asn1/ftbp/Makefile.nmake b/asn1/ftbp/Makefile.nmake new file mode 100644 index 0000000000..30553ba04f --- /dev/null +++ b/asn1/ftbp/Makefile.nmake @@ -0,0 +1,42 @@ +## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake +# +# $Id$ + +include ../../config.nmake + +UNIX2DOS=$(PERL) ../../tools/unix2dos.pl + +PROTOCOL_NAME=ftbp +DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h + +all: generate_dissector + +generate_dissector: $(DISSECTOR_FILES) + +$(DISSECTOR_FILES): ../../tools/asn2eth.py ftbp.asn packet-$(PROTOCOL_NAME)-template.c packet-$(PROTOCOL_NAME)-template.h $(PROTOCOL_NAME).cnf +!IFDEF PYTHON + $(PYTHON) ../../tools/asn2eth.py -X -b -e -p $(PROTOCOL_NAME) -c $(PROTOCOL_NAME).cnf -s packet-$(PROTOCOL_NAME)-template ftbp.asn +!ELSE + @echo Error: You need Python to use asn2eth.py + @exit 1 +!ENDIF + +clean: + rm -f parsetab.py $(DISSECTOR_FILES) + +# Fix EOL in generated dissectors. Cygwin's python generates files with +# mixed EOL styles, which can't be commited to the SVN repository. +# Stuff included from template and "cnf" files has "\r\n" on windows, while +# the generated stuff has "\n". + +fix_eol: generate_dissector + move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp + move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp + $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c + $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h + del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp + +copy_files: generate_dissector fix_eol + xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d + xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d + diff --git a/asn1/ftbp/ftbp.asn b/asn1/ftbp/ftbp.asn new file mode 100644 index 0000000000..802e4147b9 --- /dev/null +++ b/asn1/ftbp/ftbp.asn @@ -0,0 +1,255 @@ +-- Module IPMSFileTransferBodyPartType (X.420:06/1999) +IPMSFileTransferBodyPartType {joint-iso-itu-t mhs(6) ipms(1) modules(0) + file-transfer-body-part-type(9)} DEFINITIONS IMPLICIT TAGS ::= +BEGIN + +-- Prologue +-- Exports everything. +IMPORTS + -- FTAM Attribute Types + Attribute-Extensions, Concurrency-Access, Date-and-Time-Attribute, + Legal-Qualification-Attribute, Object-Availability-Attribute, + Object-Size-Attribute, Pathname, Permitted-Actions-Attribute, + Private-Use-Attribute + --== + FROM ISO8571-FTAM {iso standard 8571 application-context(1) iso-ftam(1)} + -- ACSE definitions of AP-title and AE-qualifier + EXTERNAL, + AE-qualifier, AP-title + --== + FROM ACSE-1 {joint-iso-itu-t association-control(2) modules(0) apdus(0) + version1(1)} + -- IPMS Information Objects + EXTENDED-BODY-PART-TYPE, ExtensionsField + --== + FROM IPMSInformationObjects {joint-iso-itu-t mhs(6) ipms(1) modules(0) + information-objects(2) version-1999(1)} + -- IPMS Object Identifiers +-- id-ep-file-transfer, id-et-file-transfer + --== +-- FROM IPMSObjectIdentifiers {joint-iso-itu-t mhs(6) ipms(1) modules(0) +-- object-identifiers(0) version-1999(1)} + -- MTS Abstract Service + ORName + --== + FROM MTSAbstractService {joint-iso-itu-t mhs(6) mts(3) modules(0) + mts-abstract-service(1) version-1999(1)}; + +-- File Transfer body part +--file-transfer-body-part EXTENDED-BODY-PART-TYPE ::= { +-- PARAMETERS {FileTransferParameters +-- IDENTIFIED BY id-ep-file-transfer}, +-- DATA {FileTransferData +-- IDENTIFIED BY id-et-file-transfer} +--} + +FileTransferParameters ::= SEQUENCE { + related-stored-file [0] RelatedStoredFile OPTIONAL, + contents-type + [1] ContentsTypeParameter +-- DEFAULT +-- document-type: +-- {document-type-name +-- {iso standard 8571 document-type(5) unstructured-binary(3)}}--, + environment [2] EnvironmentParameter OPTIONAL, + compression [3] CompressionParameter OPTIONAL, + file-attributes [4] FileAttributes OPTIONAL, + extensions [5] ExtensionsField OPTIONAL +} + +FileTransferData ::= SEQUENCE OF EXTERNAL + +-- This conveys a sequence of data values representing file contents; +-- The rules for generating this sequence are implied by the value of the contents-type parameter. +RelatedStoredFile ::= + SET OF + SEQUENCE {file-identifier FileIdentifier, + relationship + Relationship -- DEFAULT explicit-relationship:unspecified + } + +FileIdentifier ::= CHOICE { + pathname-and-version [0] PathnameandVersion, + cross-reference [1] CrossReference +} + +PathnameandVersion ::= SEQUENCE { + pathname [0] Pathname-Attribute, + file-version [1] GraphicString OPTIONAL +} + +CrossReference ::= SEQUENCE { + application-cross-reference [0] OCTET STRING, + message-reference [1] MessageReference OPTIONAL, + body-part-reference [2] INTEGER OPTIONAL +} + +MessageReference ::= SET { + user [0] ORName OPTIONAL, + -- Defined in 8.5.5 of ITU-T Rec. X.411 | ISO/IEC 10021-4 + user-relative-identifier [1] PrintableString +} + +Relationship ::= CHOICE { + explicit-relationship [0] ExplicitRelationship, + descriptive-relationship [1] GraphicString +} + +ExplicitRelationship ::= INTEGER { + unspecified(0), new-file(1), replacement(2), extension(3)} + +ContentsTypeParameter ::= Contents-Type-Attribute + +Contents-Type-Attribute ::= CHOICE { + document-type + [0] SEQUENCE {document-type-name Document-Type-Name, + parameter [0] --DOCUMENT-PARAMETER.&Type -- ANY OPTIONAL + }, + -- The actual types to be used for values of the parameter field + -- are defined in the named document type. + constraint-set-and-abstract-syntax + [1] SEQUENCE {constraint-set-name Constraint-Set-Name, + abstract-syntax-name Abstract-Syntax-Name} +} + +Document-Type-Name ::= OBJECT IDENTIFIER + +--DOCUMENT-PARAMETER ::= CLASS {&Type +--} + +Constraint-Set-Name ::= OBJECT IDENTIFIER + +Abstract-Syntax-Name ::= OBJECT IDENTIFIER + +EnvironmentParameter ::= SEQUENCE { + application-reference [0] GeneralIdentifier OPTIONAL, + machine [1] GeneralIdentifier OPTIONAL, + operating-system [2] OBJECT IDENTIFIER OPTIONAL, + user-visible-string [3] SEQUENCE OF GraphicString OPTIONAL +} + +GeneralIdentifier ::= CHOICE { + registered-identifier [0] OBJECT IDENTIFIER, + descriptive-identifier [1] SEQUENCE OF GraphicString +} + +CompressionParameter ::= SEQUENCE { + compression-algorithm-id + [0] -- COMPRESSION-ALGORITHM.&id({CompressionAlgorithmTable}) --OBJECT IDENTIFIER, + compression-algorithm-param + [1] --COMPRESSION-ALGORITHM.&Type +-- ({CompressionAlgorithmTable}{@compression-algorithm-id}) + ANY +} + +--COMPRESSION-ALGORITHM ::= TYPE-IDENTIFIER + +--CompressionAlgorithmTable COMPRESSION-ALGORITHM ::= +-- {...} + +FileAttributes ::= SEQUENCE { + pathname Pathname-Attribute OPTIONAL, + permitted-actions + [1] Permitted-Actions-Attribute OPTIONAL, + storage-account [3] Account-Attribute OPTIONAL, + date-and-time-of-creation + [4] Date-and-Time-Attribute OPTIONAL, + date-and-time-of-last-modification + [5] Date-and-Time-Attribute OPTIONAL, + date-and-time-of-last-read-access + [6] Date-and-Time-Attribute OPTIONAL, + date-and-time-of-last-attribute-modification + [7] Date-and-Time-Attribute OPTIONAL, + identity-of-creator + [8] User-Identity-Attribute OPTIONAL, + identity-of-last-modifier + [9] User-Identity-Attribute OPTIONAL, + identity-of-last-reader + [10] User-Identity-Attribute OPTIONAL, + identity-of-last-attribute-modifier + [11] User-Identity-Attribute OPTIONAL, + object-availability + [12] Object-Availability-Attribute OPTIONAL, + object-size + [13] Object-Size-Attribute OPTIONAL, + future-object-size + [14] Object-Size-Attribute OPTIONAL, + access-control + [15] Access-Control-Attribute OPTIONAL, + legal-qualifications + [16] Legal-Qualification-Attribute OPTIONAL, + private-use + [17] Private-Use-Attribute OPTIONAL, + attribute-extensions + [22] Attribute-Extensions OPTIONAL +} + +Pathname-Attribute ::= CHOICE { + incomplete-pathname [0] Pathname, + complete-pathname [23] Pathname +} + +Account-Attribute ::= CHOICE { + no-value-available [0] NULL, + -- Indicates partial support of this attribute + actual-values Account +} + +Account ::= GraphicString + +User-Identity-Attribute ::= CHOICE { + no-value-available [0] NULL, + -- Indicates partial support of this attribute. + actual-values User-Identity +} + +User-Identity ::= GraphicString + +Access-Control-Attribute ::= CHOICE { + no-value-available [0] NULL, + -- Indicates partial support of this attribute. + actual-values [1] SET OF Access-Control-Element +} + +-- The semantics of this attribute are described in ISO 8571-2 +Access-Control-Element ::= SEQUENCE { + action-list [0] Access-Request, + concurrency-access [1] Concurrency-Access OPTIONAL, + identity [2] User-Identity OPTIONAL, + passwords [3] Access-Passwords OPTIONAL, + location [4] Application-Entity-Title OPTIONAL +} + +Access-Request ::= BIT STRING { + read(0), insert(1), replace(2), extend(3), erase(4), read-attribute(5), + change-attribute(6), delete-object(7)} + +Access-Passwords ::= SEQUENCE { + read-password [0] Password, + insert-password [1] Password, + replace-password [2] Password, + extend-password [3] Password, + erase-password [4] Password, + read-attribute-password [5] Password, + change-attribute-password [6] Password, + delete-password [7] Password, + pass-passwords [8] Pass-Passwords, + link-password [9] Password +} + +Password ::= CHOICE { + graphic-string GraphicString, + octet-string OCTET STRING +} + +Pass-Passwords ::= SEQUENCE OF Password + +Application-Entity-Title ::= SEQUENCE { + ap-title AP-title, + ae-qualifier AE-qualifier +} + +END -- of IPMSFileTransferBodyPartType + +-- Generated by Asnp, the ASN.1 pretty-printer of France Telecom R&D + diff --git a/asn1/ftbp/ftbp.cnf b/asn1/ftbp/ftbp.cnf new file mode 100644 index 0000000000..39d0b75680 --- /dev/null +++ b/asn1/ftbp/ftbp.cnf @@ -0,0 +1,29 @@ +#.MODULE_IMPORT +ISO8571-FTAM ftam +ACSE-1 acse +IPMSInformationObjects x420 +MTSAbstractService x411 + +#.INCLUDE ../ftam/ftam-exp.cnf +#.INCLUDE ../acse/acse-exp.cnf +#.INCLUDE ../x411/x411-exp.cnf +#.INCLUDE ../x420/x420-exp.cnf + +#.FIELD_RENAME +Account-Attribute/actual-values account-actual-values +User-Identity-Attribute/actual-values identity-actual-values + + +#.PDU +FileTransferData +FileTransferParameters + +#.REGISTER +FileTransferParameters B "2.6.1.11.12" "id-ep-file-transfer" +FileTransferData B "2.6.1.4.12" "id-et-file-transfer" + +#.FN_BODY T_parameter +/* XXX: Not implemented yet */ + +#.FN_BODY T_compression_algorithm_param +/* XXX: Not implemented yet */
\ No newline at end of file diff --git a/asn1/ftbp/packet-ftbp-template.c b/asn1/ftbp/packet-ftbp-template.c new file mode 100644 index 0000000000..e4f24acc3f --- /dev/null +++ b/asn1/ftbp/packet-ftbp-template.c @@ -0,0 +1,91 @@ +/* packet-ftbp.c + * Routines for File Transfer Body Part (FTBP) dissection (used in X.420 content) + * Graeme Lunt 2005 + * + * $Id$ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs <gerald@ethereal.com> + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <glib.h> +#include <epan/packet.h> +#include <epan/conversation.h> + +#include <stdio.h> +#include <string.h> + +#include "packet-ber.h" + +#include "packet-acse.h" +#include "packet-ftam.h" +#include "packet-x411.h" +#include "packet-x420.h" + +#include "packet-ftbp.h" + +#define PNAME "X.420 File Transfer Body Part" +#define PSNAME "FTBP" +#define PFNAME "ftbp" + +/* Initialize the protocol and registered fields */ +int proto_ftbp = -1; + +#include "packet-ftbp-hf.c" + +/* Initialize the subtree pointers */ +static gint ett_ftbp = -1; +#include "packet-ftbp-ett.c" + +#include "packet-ftbp-fn.c" + + +/*--- proto_register_ftbp -------------------------------------------*/ +void proto_register_ftbp(void) { + + /* List of fields */ + static hf_register_info hf[] = + { +#include "packet-ftbp-hfarr.c" + }; + + /* List of subtrees */ + static gint *ett[] = { + &ett_ftbp, +#include "packet-ftbp-ettarr.c" + }; + + /* Register protocol */ + proto_ftbp = proto_register_protocol(PNAME, PSNAME, PFNAME); + + /* Register fields and subtrees */ + proto_register_field_array(proto_ftbp, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); + +} + + +/*--- proto_reg_handoff_ftbp --- */ +void proto_reg_handoff_ftbp(void) { +#include "packet-ftbp-dis-tab.c" + +} diff --git a/asn1/ftbp/packet-ftbp-template.h b/asn1/ftbp/packet-ftbp-template.h new file mode 100644 index 0000000000..4a7b064dce --- /dev/null +++ b/asn1/ftbp/packet-ftbp-template.h @@ -0,0 +1,31 @@ +/* packet-ftbp.h + * Routines for File Transfer Body Part (FTBP) dissection (used in X.420 content) + * Graeme Lunt 2005 + * + * $Id$ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs <gerald@ethereal.com> + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef PACKET_FTBP_H +#define PACKET_FTBP_H + +/* #include "packet-ftbp-exp.h" */ + +#endif /* PACKET_FTBP_H */ diff --git a/asn1/ros/packet-ros-template.c b/asn1/ros/packet-ros-template.c index 6d50788596..4ec41b33b0 100644 --- a/asn1/ros/packet-ros-template.c +++ b/asn1/ros/packet-ros-template.c @@ -50,6 +50,8 @@ static struct SESSION_DATA_STRUCTURE* session = NULL; static proto_tree *top_tree=NULL; static guint32 opcode; +static dissector_handle_t ros_handle = NULL; + #include "packet-ros-hf.c" /* Initialize the subtree pointers */ @@ -61,10 +63,14 @@ static GHashTable *oid_table=NULL; static gint ett_ros_unknown = -1; void -register_ros_oid_dissector_handle(const char *oid, dissector_handle_t dissector, int proto _U_, const char *name) +register_ros_oid_dissector_handle(const char *oid, dissector_handle_t dissector, int proto _U_, const char *name, gboolean uses_rtse) { dissector_add_string("ros.oid", oid, dissector); g_hash_table_insert(oid_table, (gpointer)oid, (gpointer)name); + + if(!uses_rtse) + /* if we are not using RTSE, then we must register ROS with BER (ACSE) */ + register_ber_oid_dissector_handle(oid, ros_handle, proto, name); } static int @@ -77,7 +83,7 @@ call_ros_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info *p proto_item *item=NULL; proto_tree *next_tree=NULL; - item=proto_tree_add_text(tree, next_tvb, 0, tvb_length_remaining(tvb, offset), "RTSE: Dissector for OID:%s not implemented. Contact Ethereal developers if you want this supported", oid); + item=proto_tree_add_text(tree, next_tvb, 0, tvb_length_remaining(tvb, offset), "ROS: Dissector for OID:%s not implemented. Contact Ethereal developers if you want this supported", oid); if(item){ next_tree=proto_item_add_subtree(item, ett_ros_unknown); } @@ -173,4 +179,7 @@ void proto_register_ros(void) { /*--- proto_reg_handoff_ros --- */ void proto_reg_handoff_ros(void) { + + ros_handle = find_dissector("ros"); + } diff --git a/asn1/ros/packet-ros-template.h b/asn1/ros/packet-ros-template.h index fbd336407d..a5fd4385e9 100644 --- a/asn1/ros/packet-ros-template.h +++ b/asn1/ros/packet-ros-template.h @@ -47,6 +47,6 @@ # define ROS_OP_OPCODE_MASK (~ROS_OP_MASK) -void register_ros_oid_dissector_handle(const char *oid, dissector_handle_t dissector, int proto _U_, const char *name); +void register_ros_oid_dissector_handle(const char *oid, dissector_handle_t dissector, int proto _U_, const char *name, gboolean uses_rtse); #endif /* PACKET_ROS_H */ diff --git a/asn1/ros/ros.asn b/asn1/ros/ros.asn index d76707295e..5b7f20f789 100644 --- a/asn1/ros/ros.asn +++ b/asn1/ros/ros.asn @@ -49,13 +49,15 @@ Invoke --{InvokeId:InvokeIdSet, OPERATION:Operations}-- ::= SEQUENCE { -- RejectProblem:invoke-unrecognizedLinkedId) -- (CONSTRAINED BY { - - which has one or more linked operations- -} ! -- RejectProblem:invoke-linkedResponseUnexpected)-- OPTIONAL, - opcode INTEGER + opcode OperationCode -- OPERATION.&operationCode -- ({Operations} !RejectProblem:invoke-unrecognizedOperation)--, argument -- OPERATION.&ArgumentType -- ({Operations}{@opcode} !RejectProblem:invoke-mistypedArgument) -- ANY OPTIONAL } +OperationCode ::= INTEGER + --(CONSTRAINED BY { - - must conform to the above definition - -} ! -- RejectProblem:general-mistypedPDU) --(WITH COMPONENTS { @@ -78,7 +80,7 @@ ReturnResult --{OPERATION:Operations}-- ::= SEQUENCE { -- (CONSTRAINED BY { - - which returns a result - -} ! -- RejectProblem:returnResult-resultResponseUnexpected)--, result - SEQUENCE {opcode INTEGER + SEQUENCE {opcode OperationCode -- OPERATION.&operationCode({Operations}) -- (CONSTRAINED BY { - - identified by invokeId - -} ! -- RejectProblem:returnResult-unrecognizedInvocation)--, @@ -97,7 +99,7 @@ ReturnError --{ERROR:Errors}-- ::= SEQUENCE { -- RejectProblem:returnError-unrecognizedInvocation) -- (CONSTRAINED BY { - - which returns an error - -} ! -- RejectProblem:returnError-errorResponseUnexpected) --, - errcode INTEGER + errcode ErrorCode -- ERROR.&errorCode({Errors} !RejectProblem:returnError-unrecognizedError) -- (CONSTRAINED BY { - - must be in the &Errors field of the associated operation - - -- } !RejectProblem:returnError-unexpectedError)--, @@ -109,6 +111,8 @@ ReturnError --{ERROR:Errors}-- ::= SEQUENCE { --(CONSTRAINED BY { - - must conform to the above definition - -} ! -- RejectProblem:general-mistypedPDU) +ErrorCode ::= INTEGER + Reject ::= SEQUENCE { invokeId InvokeId, problem diff --git a/asn1/ros/ros.cnf b/asn1/ros/ros.cnf index 3c74d6b37c..511f97c9d2 100644 --- a/asn1/ros/ros.cnf +++ b/asn1/ros/ros.cnf @@ -2,7 +2,21 @@ InvokeId Code -#.FN_BODY opcode +#.TYPE_RENAME +ReturnResult/result/result OperationResult + +#.FIELD_RENAME +Reject/problem/invoke invokeProblem +ReturnResult/result/result operationResult +Reject/problem/returnError rejectError +Reject/problem/returnResult rejectResult + +#.FN_BODY OperationCode + + offset = dissect_ber_integer(FALSE, pinfo, tree, tvb, offset, hf_index, + &opcode); + +#.FN_BODY ErrorCode offset = dissect_ber_integer(FALSE, pinfo, tree, tvb, offset, hf_index, &opcode); @@ -26,7 +40,7 @@ Code offset = call_ros_oid_callback(oid, tvb, offset, pinfo, top_tree); } -#.FN_BODY T_result1 +#.FN_BODY OperationResult char *oid; /* not sure what the length should be - -1 for now */ proto_tree_add_text(tree, tvb, offset,-1, "return result"); diff --git a/asn1/rtse/packet-rtse-template.c b/asn1/rtse/packet-rtse-template.c index 33561b19ea..dc81920c8b 100644 --- a/asn1/rtse/packet-rtse-template.c +++ b/asn1/rtse/packet-rtse-template.c @@ -57,7 +57,10 @@ static guint32 app_proto=0; static proto_tree *top_tree=NULL; -int dissect_rtse_EXTERNAL(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_); +static dissector_handle_t rtse_handle = NULL; +static dissector_handle_t ros_handle = NULL; + +static int dissect_rtse_EXTERNAL(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_); #include "packet-rtse-hf.c" @@ -72,10 +75,26 @@ static GHashTable *oid_table=NULL; static gint ett_rtse_unknown = -1; void -register_rtse_oid_dissector_handle(const char *oid, dissector_handle_t dissector, int proto _U_, const char *name) +register_rtse_oid_dissector_handle(const char *oid, dissector_handle_t dissector, int proto _U_, const char *name, gboolean uses_ros) { - dissector_add_string("rtse.oid", oid, dissector); - g_hash_table_insert(oid_table, (gpointer)oid, (gpointer)name); + + /* save the name - but not used */ + g_hash_table_insert(oid_table, (gpointer)oid, (gpointer)name); + + /* register RTSE with the BER (ACSE) */ + register_ber_oid_dissector_handle(oid, rtse_handle, proto, name); + + if(uses_ros) { + /* make sure we call ROS ... */ + dissector_add_string("rtse.oid", oid, ros_handle); + + /* and then tell ROS how to dissect the AS*/ + register_ros_oid_dissector_handle(oid, dissector, proto, name, TRUE); + + } else { + /* otherwise we just remember how to dissect the AS */ + dissector_add_string("rtse.oid", oid, dissector); + } } static int @@ -186,4 +205,7 @@ void proto_register_rtse(void) { /*--- proto_reg_handoff_rtse --- */ void proto_reg_handoff_rtse(void) { + + rtse_handle = find_dissector("rtse"); + ros_handle = find_dissector("ros"); } diff --git a/asn1/rtse/packet-rtse-template.h b/asn1/rtse/packet-rtse-template.h index 901ac4bb83..aa6d6244cd 100644 --- a/asn1/rtse/packet-rtse-template.h +++ b/asn1/rtse/packet-rtse-template.h @@ -28,6 +28,6 @@ #include "packet-rtse-exp.h" -void register_rtse_oid_dissector_handle(const char *oid, dissector_handle_t dissector, int proto _U_, const char *name); +void register_rtse_oid_dissector_handle(const char *oid, dissector_handle_t dissector, int proto _U_, const char *name, gboolean uses_ros); #endif /* PACKET_RTSE_H */ diff --git a/asn1/rtse/rtse.cnf b/asn1/rtse/rtse.cnf index 1581362bc3..37519bc9f0 100644 --- a/asn1/rtse/rtse.cnf +++ b/asn1/rtse/rtse.cnf @@ -6,7 +6,30 @@ RTABapdu EXTERNAL #.FN_BODY RTORJapdu/userDataRJ -/*XXX not implemented yet */ + char *oid = NULL; + + switch(app_proto) { + case 1: /* mts-transfer-protocol-1984 */ + oid = "applicationProtocol.1"; + break; + case 12: /* mts-transfer-protocol */ + oid = "applicationProtocol.12"; + break; + default: + if(session && session->pres_ctx_id) + oid = find_oid_by_pres_ctx_id(pinfo, session->pres_ctx_id); + break; + } + + if(!oid) /* XXX: problem here is we haven't decoded the applicationProtocol yet - so we make assumptions! */ + oid = "applicationProtocol.12"; + + if(oid) { + if((session = (struct SESSION_DATA_STRUCTURE*)(pinfo->private_data)) != NULL) + session->ros_op = (ROS_OP_BIND | ROS_OP_ERROR); + + offset = call_rtse_oid_callback(oid, tvb, offset, pinfo, top_tree ? top_tree : tree); + } #.FN_BODY RTABapdu/userdataAB /*XXX not implemented yet */ diff --git a/asn1/s4406/packet-s4406-template.c b/asn1/s4406/packet-s4406-template.c index ae742e1715..8b883f38ac 100644 --- a/asn1/s4406/packet-s4406-template.c +++ b/asn1/s4406/packet-s4406-template.c @@ -42,7 +42,7 @@ #include "packet-x411.h" #include "packet-x420.h" -#define PNAME "STANAG 4406 Military Message Extensions" +#define PNAME "STANAG 4406 Military Message" #define PSNAME "STANAG 4406" #define PFNAME "s4406" @@ -58,6 +58,29 @@ static gint ett_s4406 = -1; #include "packet-s4406-fn.c" +/* +* Dissect STANAG 4406 PDUs inside a PPDU. +*/ +static void +dissect_s4406(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) +{ + int offset = 0; + proto_item *item=NULL; + proto_tree *tree=NULL; + + if(parent_tree){ + item = proto_tree_add_item(parent_tree, proto_s4406, tvb, 0, -1, FALSE); + tree = proto_item_add_subtree(item, ett_s4406); + } + + if (check_col(pinfo->cinfo, COL_PROTOCOL)) + col_set_str(pinfo->cinfo, COL_PROTOCOL, "S4406"); + if (check_col(pinfo->cinfo, COL_INFO)) + col_add_str(pinfo->cinfo, COL_INFO, "Military"); + + dissect_x420_InformationObject(TRUE, tvb, offset, pinfo , tree, -1); +} + /*--- proto_register_s4406 -------------------------------------------*/ @@ -89,4 +112,5 @@ void proto_register_s4406(void) { void proto_reg_handoff_s4406(void) { #include "packet-s4406-dis-tab.c" + register_ber_oid_dissector("1.3.26.0.4406.0.4.1", dissect_s4406, proto_s4406, "Military Message"); } diff --git a/asn1/s4406/s4406.cnf b/asn1/s4406/s4406.cnf index 4001163d40..5d123aa9c5 100644 --- a/asn1/s4406/s4406.cnf +++ b/asn1/s4406/s4406.cnf @@ -14,23 +14,40 @@ AddressListDesignator/type address_list_type MessageType/type message_type_type OtherRecipientDesignator/type other_recipient_type +#.PDU +MMHSPrecedence +MessageType +AddressListDesignator +ExemptedAddress +ExtendedAuthorisationInfo +DistributionCodes +HandlingInstructions +MessageInstructions +CodressMessage +OriginatorReference +OtherRecipientDesignator +PilotInformation +Acp127MessageIdentifier +OriginatorPlad +SecurityInformationLabels + #.REGISTER -MMHSPrecedence B "1.3.26.0.4406.0.2.0" "primary-precedence" -MMHSPrecedence B "1.3.26.0.4406.0.2.1" "copy-precedence" -MessageType B "1.3.26.0.4406.0.2.2" "message-type" -AddressListDesignator B "1.3.26.0.4406.0.2.3" "address-list-indicator" -ExemptedAddress B "1.3.26.0.4406.0.2.4" "exempted-address" -ExtendedAuthorisationInfo B "1.3.26.0.4406.0.2.5" "extended-authorisation-info" -DistributionCodes B "1.3.26.0.4406.0.2.6" "distribution-codes" -HandlingInstructions B "1.3.26.0.4406.0.2.7" "handling-instructions" -MessageInstructions B "1.3.26.0.4406.0.2.8" "message-instructions" -CodressMessage B "1.3.26.0.4406.0.2.9" "codress-message" -OriginatorReference B "1.3.26.0.4406.0.2.10" "originator-reference" -OtherRecipientDesignator B "1.3.26.0.4406.0.2.11" "other-recipients-indicator" -PilotInformation B "1.3.26.0.4406.0.2.12" "pilot-forwarding-info" -Acp127MessageIdentifier B "1.3.26.0.4406.0.2.13" "acp127-message-identifierr" -OriginatorPlad B "1.3.26.0.4406.0.2.14" "originator-plad" -SecurityInformationLabels B "1.3.26.0.4406.0.2.17" "information-labels" +MMHSPrecedence B "1.3.26.0.4406.0.2.0" "primary-precedence" +MMHSPrecedence B "1.3.26.0.4406.0.2.1" "copy-precedence" +MessageType B "1.3.26.0.4406.0.2.2" "message-type" +AddressListDesignator B "1.3.26.0.4406.0.2.3" "address-list-indicator" +ExemptedAddress B "1.3.26.0.4406.0.2.4" "exempted-address" +ExtendedAuthorisationInfo B "1.3.26.0.4406.0.2.5" "extended-authorisation-info" +DistributionCodes B "1.3.26.0.4406.0.2.6" "distribution-codes" +HandlingInstructions B "1.3.26.0.4406.0.2.7" "handling-instructions" +MessageInstructions B "1.3.26.0.4406.0.2.8" "message-instructions" +CodressMessage B "1.3.26.0.4406.0.2.9" "codress-message" +OriginatorReference B "1.3.26.0.4406.0.2.10" "originator-reference" +OtherRecipientDesignator B "1.3.26.0.4406.0.2.11" "other-recipients-indicator" +PilotInformation B "1.3.26.0.4406.0.2.12" "pilot-forwarding-info" +Acp127MessageIdentifier B "1.3.26.0.4406.0.2.13" "acp127-message-identifierr" +OriginatorPlad B "1.3.26.0.4406.0.2.14" "originator-plad" +SecurityInformationLabels B "1.3.26.0.4406.0.2.17" "information-labels" #.FN_BODY T_dist_value -/* XXX: not implemented */
\ No newline at end of file +/* XXX: not implemented */ diff --git a/asn1/x411/packet-x411-template.c b/asn1/x411/packet-x411-template.c index e668cb62fd..a02ed78ec0 100644 --- a/asn1/x411/packet-x411-template.c +++ b/asn1/x411/packet-x411-template.c @@ -46,7 +46,7 @@ #include "packet-x411.h" -#define PNAME "X.411 OSI Message Transfer Service" +#define PNAME "X.411 Message Transfer Service" #define PSNAME "X411" #define PFNAME "x411" @@ -56,6 +56,9 @@ int proto_x411 = -1; static struct SESSION_DATA_STRUCTURE* session = NULL; static int extension_id = 0; /* integer extension id */ static char object_identifier_id[BER_MAX_OID_STR_LEN]; /* content type identifier */ + +static proto_tree *top_tree=NULL; + static int call_x411_oid_callback(char *base_oid, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree); @@ -70,11 +73,14 @@ static gint ett_x411 = -1; static int call_x411_oid_callback(char *base_oid, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { - + char *name = NULL; char extension_oid[BER_MAX_OID_STR_LEN]; sprintf(extension_oid, "%s.%d", base_oid, extension_id); + name = get_ber_oid_name(extension_oid); + proto_item_append_text(tree, " (%s)", name ? name : extension_oid); + return call_ber_oid_callback(extension_oid, tvb, offset, pinfo, tree); } @@ -92,6 +98,10 @@ dissect_x411(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) proto_tree *tree=NULL; int (*x411_dissector)(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) = NULL; char *x411_op_name; + int hf_x411_index; + + /* save parent_tree so subdissectors can create new top nodes */ + top_tree=parent_tree; /* do we have operation information from the ROS dissector? */ if( !pinfo->private_data ){ @@ -109,22 +119,30 @@ dissect_x411(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) tree = proto_item_add_subtree(item, ett_x411); } if (check_col(pinfo->cinfo, COL_PROTOCOL)) - col_set_str(pinfo->cinfo, COL_PROTOCOL, "X411"); + col_set_str(pinfo->cinfo, COL_PROTOCOL, "P1"); if (check_col(pinfo->cinfo, COL_INFO)) col_clear(pinfo->cinfo, COL_INFO); switch(session->ros_op & ROS_OP_MASK) { case (ROS_OP_BIND | ROS_OP_ARGUMENT): /* BindInvoke */ x411_dissector = dissect_x411_MTABindArgument; - x411_op_name = "MTA-Bind-Argument"; + x411_op_name = "Bind-Argument"; + hf_x411_index = hf_x411_MTABindArgument_PDU; break; case (ROS_OP_BIND | ROS_OP_RESULT): /* BindResult */ x411_dissector = dissect_x411_MTABindResult; - x411_op_name = "MTA-Bind-Result"; + x411_op_name = "Bind-Result"; + hf_x411_index = hf_x411_MTABindResult_PDU; + break; + case (ROS_OP_BIND | ROS_OP_ERROR): /* BindError */ + x411_dissector = dissect_x411_MTABindError; + x411_op_name = "Bind-Error"; + hf_x411_index = hf_x411_MTABindError_PDU; break; case (ROS_OP_INVOKE | ROS_OP_ARGUMENT): /* Invoke Argument */ x411_dissector = dissect_x411_MTS_APDU; - x411_op_name = "MTA-Transfer"; + x411_op_name = "Transfer"; + hf_x411_index = hf_x411_MTS_APDU_PDU; break; default: proto_tree_add_text(tree, tvb, offset, -1,"Unsupported X411 PDU"); @@ -136,7 +154,7 @@ dissect_x411(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) while (tvb_reported_length_remaining(tvb, offset) > 0){ old_offset=offset; - offset=(*x411_dissector)(TRUE, tvb, offset, pinfo , tree, -1); + offset=(*x411_dissector)(FALSE, tvb, offset, pinfo , tree, hf_x411_index); if(offset == old_offset){ proto_tree_add_text(tree, tvb, offset, -1,"Internal error, zero-byte X411 PDU"); offset = tvb_length(tvb); @@ -177,26 +195,18 @@ void proto_reg_handoff_x411(void) { #include "packet-x411-dis-tab.c" - register_ber_oid_name("2.6.0.1.6", "id-ac-mts-transfer"); + /* APPLICATION CONTEXT */ - /* we register RTSE with BER (which is used by ACSE) */ - if((handle = find_dissector("rtse")) != NULL) { - register_ber_oid_dissector_handle("2.6.0.2.12", handle, 0 , "id-as-mta-rtse"); - register_ber_oid_dissector_handle("2.6.0.2.7", handle, 0 , "id-as-mtse"); - } + register_ber_oid_name("2.6.0.1.6", "id-ac-mts-transfer"); - /* then register ROS with RTSE */ - if((handle = find_dissector("ros")) != NULL) { - register_rtse_oid_dissector_handle("2.6.0.2.12", handle, 0 , "id-as-mta-rtse"); - } + /* ABSTRACT SYNTAXES */ - /* and then finally X411 with ROS and RTSE */ if((handle = find_dissector("x411")) != NULL) { - register_ros_oid_dissector_handle("2.6.0.2.12", handle, 0, "id-as-mta-rtse"); - register_rtse_oid_dissector_handle("2.6.0.2.7", handle, 0, "id-as-mtse"); + register_rtse_oid_dissector_handle("2.6.0.2.12", handle, 0, "id-as-mta-rtse", TRUE); + register_rtse_oid_dissector_handle("2.6.0.2.7", handle, 0, "id-as-mtse", FALSE); - register_rtse_oid_dissector_handle("applicationProtocol.1", handle, 0, "mts-transfer-protocol-1984"); - register_rtse_oid_dissector_handle("applicationProtocol.12", handle, 0, "mta-transfer-protocol"); + register_rtse_oid_dissector_handle("applicationProtocol.1", handle, 0, "mts-transfer-protocol-1984", FALSE); + register_rtse_oid_dissector_handle("applicationProtocol.12", handle, 0, "mta-transfer-protocol", FALSE); } diff --git a/asn1/x411/x411.cnf b/asn1/x411/x411.cnf index 0f3c24de48..2260d5fd73 100644 --- a/asn1/x411/x411.cnf +++ b/asn1/x411/x411.cnf @@ -118,6 +118,12 @@ MessageTransferEnvelope/per-recipient-fields/_item per-recipient-message-fields- MessageTransferEnvelope/per-recipient-fields per-recipient-message-fields ReportTransferContent/per-recipient-fields per-recipient-report-fields +#.PDU +MTABindArgument +MTABindResult +MTABindError +MTS-APDU + #.REGISTER RecipientReassignmentProhibited B "x411.extension.1" "recipient-reassignment-prohibited" MTSOriginatorRequestedAlternateRecipient B "x411.extension.2" "originator-requested-alternate-recipient" @@ -253,21 +259,19 @@ UniversalOrganizationalUnitNames B "x411.extension-attribute.27" "universal-orga NULL); -#.FN_BODY INTEGER - - offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, - &extension_id); +#.FN_PARS INTEGER + VAL_PTR = &extension_id -#.FN_BODY ExtendedContentType - offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, - hf_index, object_identifier_id); +#.FN_PARS ExtendedContentType + VAL_PTR = object_identifier_id +#.FN_PARS BuiltInContentType + VAL_PTR = &ict #.FN_BODY BuiltInContentType guint32 ict = -1; - offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, - &ict); + %(DEFAULT_BODY)s /* convert integer content type to oid for dispatch when the content is found */ switch(ict) { @@ -288,6 +292,19 @@ UniversalOrganizationalUnitNames B "x411.extension-attribute.27" "universal-orga offset = dissect_ber_octet_string(FALSE, pinfo, tree, tvb, offset, hf_index, &next_tvb); if (next_tvb) - (void) call_ber_oid_callback(object_identifier_id, next_tvb, 0, pinfo, tree); + (void) call_ber_oid_callback(object_identifier_id, next_tvb, 0, pinfo, top_tree ? top_tree : tree); + +#.FN_PARS MTAName + VAL_PTR = &mtaname + +#.FN_BODY MTAName + tvbuff_t *mtaname; + + %(DEFAULT_BODY)s + + if (check_col(pinfo->cinfo, COL_INFO)) { + col_append_fstr(pinfo->cinfo, COL_INFO, " %%s", tvb_get_string(mtaname, 0, tvb_length(mtaname))); + } #.END + diff --git a/asn1/x420/packet-x420-template.c b/asn1/x420/packet-x420-template.c index bb727a78c1..e17d6af99f 100644 --- a/asn1/x420/packet-x420-template.c +++ b/asn1/x420/packet-x420-template.c @@ -43,7 +43,7 @@ #include "packet-x420.h" -#define PNAME "X.420 OSI Information Object" +#define PNAME "X.420 Information Object" #define PSNAME "X420" #define PFNAME "x420" @@ -69,16 +69,16 @@ dissect_x420(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) int offset = 0; proto_item *item=NULL; proto_tree *tree=NULL; - int (*x420_dissector)(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) = NULL; if(parent_tree){ item = proto_tree_add_item(parent_tree, proto_x420, tvb, 0, -1, FALSE); tree = proto_item_add_subtree(item, ett_x420); } + if (check_col(pinfo->cinfo, COL_PROTOCOL)) - col_set_str(pinfo->cinfo, COL_PROTOCOL, "X420"); + col_set_str(pinfo->cinfo, COL_PROTOCOL, "P22"); if (check_col(pinfo->cinfo, COL_INFO)) - col_add_str(pinfo->cinfo, COL_INFO, "Interpersonal Message"); + col_add_str(pinfo->cinfo, COL_INFO, "InterPersonal"); dissect_x420_InformationObject(TRUE, tvb, offset, pinfo , tree, -1); } @@ -116,6 +116,6 @@ void proto_reg_handoff_x420(void) { register_ber_oid_dissector("2.6.1.10.0", dissect_x420, proto_x420, "InterPersonal Message (1984)"); register_ber_oid_dissector("2.6.1.10.1", dissect_x420, proto_x420, "InterPersonal Message (1988)"); - register_ber_oid_dissector("1.3.26.0.4406.0.4.1", dissect_x420, proto_x420, "Military Message"); + } diff --git a/asn1/x420/x420-exp.cnf b/asn1/x420/x420-exp.cnf index d515220732..5596ecc11c 100644 --- a/asn1/x420/x420-exp.cnf +++ b/asn1/x420/x420-exp.cnf @@ -1,8 +1,12 @@ #.IMPORT_TAG +InformationObject BER_CLASS_ANY/*choice*/ -1/*choice*/ ORDescriptor BER_CLASS_UNI BER_UNI_TAG_SET +ExtensionsField BER_CLASS_UNI BER_UNI_TAG_SET #.END #.TYPE_ATTR +InformationObject TYPE = FT_UINT32 DISPLAY = BASE_DEC STRINGS = VALS(x420_InformationObject_vals) BITMASK = 0 ORDescriptor TYPE = FT_NONE DISPLAY = BASE_NONE STRINGS = NULL BITMASK = 0 +ExtensionsField TYPE = FT_UINT32 DISPLAY = BASE_DEC STRINGS = NULL BITMASK = 0 #.END diff --git a/asn1/x420/x420.asn b/asn1/x420/x420.asn index 5fc3aa1a1d..70e0d93052 100644 --- a/asn1/x420/x420.asn +++ b/asn1/x420/x420.asn @@ -455,13 +455,14 @@ IPN ::= SET { -- }) -- }) -CommonFields ::= SET { - subject-ipm SubjectIPMField, - ipn-originator [1] IPNOriginatorField OPTIONAL, - ipm-intended-recipient [2] IPMIntendedRecipientField OPTIONAL, - conversion-eits ConversionEITsField OPTIONAL, - notification-extensions [3] NotificationExtensionsField OPTIONAL -} +-- CommonFields are always used with WITH COMPONENTS - which are manually expanded +--CommonFields ::= SET { +-- subject-ipm SubjectIPMField, +-- ipn-originator [1] IPNOriginatorField OPTIONAL, +-- ipm-intended-recipient [2] IPMIntendedRecipientField OPTIONAL, +-- conversion-eits ConversionEITsField OPTIONAL, +-- notification-extensions [3] NotificationExtensionsField OPTIONAL +--} NonReceiptFields ::= SET { non-receipt-reason [0] NonReceiptReasonField, diff --git a/asn1/x420/x420.cnf b/asn1/x420/x420.cnf index d55a5656f0..71e7148527 100644 --- a/asn1/x420/x420.cnf +++ b/asn1/x420/x420.cnf @@ -9,6 +9,8 @@ ACSE-1 acse #.EXPORTS ORDescriptor +InformationObject +ExtensionsField #.FIELD_RENAME @@ -31,21 +33,51 @@ EncryptedBodyPart/parameters encrypted_parameters TeletexParameters/non-basic-parameters teletex_non_basic_parameters G3FacsimileParameters/non-basic-parameters g3facsimile_non_basic_parameters +#.PDU +OriginatingUA +AbsenceAdvice +ChangeOfAddressAdvice +IPMAssemblyInstructions + #.REGISTER -OriginatingUA B "1.2.826.0.1004.10.1.1" "nexor-originating-ua" +OriginatingUA B "1.2.826.0.1004.10.1.1" "nexor-originating-ua" +AbsenceAdvice B "2.6.1.19.0" "id-on-absence-advice" +ChangeOfAddressAdvice B "2.6.1.19.1" "id-on-change-of-address-advice" +IPMAssemblyInstructions B "2.6.1.17.2" "id-mst-assembly-instructions" + +#.FN_PARS IPMSExtension/type + VAL_PTR = object_identifier_id #.FN_BODY IPMSExtension/type + char *name = NULL; - offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, - object_identifier_id); + %(DEFAULT_BODY)s + + name = get_ber_oid_name(object_identifier_id); + proto_item_append_text(tree, " (%%s)", name ? name : object_identifier_id); #.FN_BODY T_value offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); +#.FN_BODY IPM + + %(DEFAULT_BODY)s + if((hf_index == hf_x420_ipm) && check_col(pinfo->cinfo, COL_INFO)) + col_append_fstr(pinfo->cinfo, COL_INFO, " Message"); + + +#.FN_BODY IPN + + %(DEFAULT_BODY)s + if((hf_index == hf_x420_ipn) && check_col(pinfo->cinfo, COL_INFO)) + col_append_fstr(pinfo->cinfo, COL_INFO, " Notification"); + #.FN_BODY Interchange_Data_Element +/*ARGSUSED*/ /* XXX Not implemented yet */ #.FN_BODY NationallyDefinedBodyPart +/*ARGSUSED*/ /* XXX Not implemented yet */ diff --git a/epan/dissectors/packet-acse.c b/epan/dissectors/packet-acse.c index a7270f18b8..2fb969ef56 100644 --- a/epan/dissectors/packet-acse.c +++ b/epan/dissectors/packet-acse.c @@ -1,6 +1,6 @@ /* Do not modify this file. */ /* It is created automatically by the ASN.1 to Ethereal dissector compiler */ -/* ./packet-acse.c */ +/* .\packet-acse.c */ /* ../../tools/asn2eth.py -X -b -e -p acse -c acse.cnf -s packet-acse-template acse.asn */ /* Input file: packet-acse-template.c */ @@ -361,7 +361,7 @@ static int dissect_data_value_descriptor(packet_info *pinfo, proto_tree *tree, t static int dissect_acse_T_single_ASN1_type(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, top_tree ? top_tree : tree); return offset; @@ -622,7 +622,7 @@ static int dissect_aso_qualifier_form3(packet_info *pinfo, proto_tree *tree, tvb } -static const value_string acse_ASO_qualifier_vals[] = { +const value_string acse_ASO_qualifier_vals[] = { { 0, "aso-qualifier-form1" }, { 1, "aso-qualifier-form2" }, { 2, "aso-qualifier-form3" }, @@ -639,7 +639,7 @@ static const ber_choice_t ASO_qualifier_choice[] = { { 0, 0, 0, 0, NULL } }; -static int +int dissect_acse_ASO_qualifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { offset = dissect_ber_choice(pinfo, tree, tvb, offset, ASO_qualifier_choice, hf_index, ett_acse_ASO_qualifier, diff --git a/epan/dissectors/packet-acse.h b/epan/dissectors/packet-acse.h index 2cf1e27146..595d67750d 100644 --- a/epan/dissectors/packet-acse.h +++ b/epan/dissectors/packet-acse.h @@ -1,6 +1,6 @@ /* Do not modify this file. */ /* It is created automatically by the ASN.1 to Ethereal dissector compiler */ -/* ./packet-acse.h */ +/* .\packet-acse.h */ /* ../../tools/asn2eth.py -X -b -e -p acse -c acse.cnf -s packet-acse-template acse.asn */ /* Input file: packet-acse-template.h */ @@ -37,9 +37,11 @@ /*--- Included file: packet-acse-exp.h ---*/ extern const value_string acse_AP_title_vals[]; +extern const value_string acse_ASO_qualifier_vals[]; int dissect_acse_EXTERNAL(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); int dissect_acse_AP_title(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); int dissect_acse_AE_qualifier(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); +int dissect_acse_ASO_qualifier(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); int dissect_acse_AE_invocation_identifier(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); int dissect_acse_AP_invocation_identifier(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); diff --git a/epan/dissectors/packet-ftam.c b/epan/dissectors/packet-ftam.c index 41525b9658..e6364c16d4 100644 --- a/epan/dissectors/packet-ftam.c +++ b/epan/dissectors/packet-ftam.c @@ -1713,7 +1713,7 @@ static const ber_sequence_t Pathname_sequence_of[1] = { { BER_CLASS_UNI, BER_UNI_TAG_GraphicString, BER_FLAGS_NOOWNTAG, dissect_Pathname_item }, }; -static int +int dissect_ftam_Pathname(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset, Pathname_sequence_of, hf_index, ett_ftam_Pathname); @@ -2199,7 +2199,7 @@ static const asn_namedbit Permitted_Actions_Attribute_bits[] = { { 0, NULL, 0, 0, NULL, NULL } }; -static int +int dissect_ftam_Permitted_Actions_Attribute(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset, Permitted_Actions_Attribute_bits, hf_index, ett_ftam_Permitted_Actions_Attribute, @@ -2380,7 +2380,7 @@ static int dissect_actual_values8_impl(packet_info *pinfo, proto_tree *tree, tvb } -static const value_string ftam_Object_Availability_Attribute_vals[] = { +const value_string ftam_Object_Availability_Attribute_vals[] = { { 0, "no-value-available" }, { 1, "actual-values" }, { 0, NULL } @@ -2392,7 +2392,7 @@ static const ber_choice_t Object_Availability_Attribute_choice[] = { { 0, 0, 0, 0, NULL } }; -static int +int dissect_ftam_Object_Availability_Attribute(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { offset = dissect_ber_choice(pinfo, tree, tvb, offset, Object_Availability_Attribute_choice, hf_index, ett_ftam_Object_Availability_Attribute, @@ -2405,7 +2405,7 @@ static int dissect_object_availability(packet_info *pinfo, proto_tree *tree, tvb } -static const value_string ftam_Object_Size_Attribute_vals[] = { +const value_string ftam_Object_Size_Attribute_vals[] = { { 0, "no-value-available" }, { 1, "actual-values" }, { 0, NULL } @@ -2417,7 +2417,7 @@ static const ber_choice_t Object_Size_Attribute_choice[] = { { 0, 0, 0, 0, NULL } }; -static int +int dissect_ftam_Object_Size_Attribute(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { offset = dissect_ber_choice(pinfo, tree, tvb, offset, Object_Size_Attribute_choice, hf_index, ett_ftam_Object_Size_Attribute, @@ -2487,7 +2487,7 @@ static const ber_sequence_t Concurrency_Access_sequence[] = { { 0, 0, 0, NULL } }; -static int +int dissect_ftam_Concurrency_Access(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, Concurrency_Access_sequence, hf_index, ett_ftam_Concurrency_Access); @@ -2631,7 +2631,7 @@ static int dissect_path_access_control(packet_info *pinfo, proto_tree *tree, tvb } -static const value_string ftam_Legal_Qualification_Attribute_vals[] = { +const value_string ftam_Legal_Qualification_Attribute_vals[] = { { 0, "no-value-available" }, { 1, "actual-values" }, { 0, NULL } @@ -2643,7 +2643,7 @@ static const ber_choice_t Legal_Qualification_Attribute_choice[] = { { 0, 0, 0, 0, NULL } }; -static int +int dissect_ftam_Legal_Qualification_Attribute(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { offset = dissect_ber_choice(pinfo, tree, tvb, offset, Legal_Qualification_Attribute_choice, hf_index, ett_ftam_Legal_Qualification_Attribute, @@ -2656,7 +2656,7 @@ static int dissect_legal_qualification(packet_info *pinfo, proto_tree *tree, tvb } -static const value_string ftam_Private_Use_Attribute_vals[] = { +const value_string ftam_Private_Use_Attribute_vals[] = { { 0, "no-value-available" }, { 1, "abstract-Syntax-not-supported" }, { 2, "actual-values" }, @@ -2670,7 +2670,7 @@ static const ber_choice_t Private_Use_Attribute_choice[] = { { 0, 0, 0, 0, NULL } }; -static int +int dissect_ftam_Private_Use_Attribute(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { offset = dissect_ber_choice(pinfo, tree, tvb, offset, Private_Use_Attribute_choice, hf_index, ett_ftam_Private_Use_Attribute, @@ -2686,8 +2686,7 @@ static int dissect_private_use(packet_info *pinfo, proto_tree *tree, tvbuff_t *t static int dissect_ftam_Extension_Set_Identifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { - offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, - NULL); + offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL); return offset; } @@ -2699,8 +2698,7 @@ static int dissect_extension_set_identifier_impl(packet_info *pinfo, proto_tree static int dissect_ftam_T_extension_attribute_identifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { - offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, - object_identifier_id); + offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, object_identifier_id); return offset; } @@ -2778,7 +2776,7 @@ static const ber_sequence_t Attribute_Extensions_sequence_of[1] = { { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_Attribute_Extensions_item }, }; -static int +int dissect_ftam_Attribute_Extensions(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset, Attribute_Extensions_sequence_of, hf_index, ett_ftam_Attribute_Extensions); @@ -2957,8 +2955,7 @@ static int dissect_attribute_names_impl(packet_info *pinfo, proto_tree *tree, tv static int dissect_ftam_Extension_Attribute_identifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { - offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, - NULL); + offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL); return offset; } @@ -3066,7 +3063,7 @@ static int dissect_time_and_date_value_impl(packet_info *pinfo, proto_tree *tree } -static const value_string ftam_Date_and_Time_Attribute_vals[] = { +const value_string ftam_Date_and_Time_Attribute_vals[] = { { 0, "no-value-available" }, { 1, "actual-values" }, { 0, NULL } @@ -3078,7 +3075,7 @@ static const ber_choice_t Date_and_Time_Attribute_choice[] = { { 0, 0, 0, 0, NULL } }; -static int +int dissect_ftam_Date_and_Time_Attribute(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { offset = dissect_ber_choice(pinfo, tree, tvb, offset, Date_and_Time_Attribute_choice, hf_index, ett_ftam_Date_and_Time_Attribute, @@ -4674,8 +4671,7 @@ static int dissect_permitted_actions_Pattern_impl(packet_info *pinfo, proto_tree static int dissect_ftam_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { - offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, - NULL); + offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL); return offset; } @@ -4820,8 +4816,7 @@ static int dissect_object_availabiiity_Pattern_impl(packet_info *pinfo, proto_tr static int dissect_ftam_T_extension_attribute_identifier1(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { - offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, - object_identifier_id); + offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, object_identifier_id); return offset; } @@ -7370,11 +7365,11 @@ void proto_register_ftam(void) { "Path-Access-Passwords/_item", HFILL }}, { &hf_ftam_ap, { "ap", "ftam.ap", - FT_NONE, BASE_NONE, NULL, 0, + FT_UINT32, BASE_DEC, VALS(acse_AP_title_vals), 0, "AE-title/ap", HFILL }}, { &hf_ftam_ae, { "ae", "ftam.ae", - FT_NONE, BASE_NONE, NULL, 0, + FT_UINT32, BASE_DEC, VALS(acse_ASO_qualifier_vals), 0, "AE-title/ae", HFILL }}, { &hf_ftam_Attribute_Value_Assertions_item, { "Item", "ftam.Attribute_Value_Assertions_item", diff --git a/epan/dissectors/packet-ftam.h b/epan/dissectors/packet-ftam.h index f8897a6de8..f7dbf28b88 100644 --- a/epan/dissectors/packet-ftam.h +++ b/epan/dissectors/packet-ftam.h @@ -38,6 +38,25 @@ #ifndef PACKET_FTAM_H #define PACKET_FTAM_H -/*#include "packet-ftam-exp.h"*/ + +/*--- Included file: packet-ftam-exp.h ---*/ + +extern const value_string ftam_Date_and_Time_Attribute_vals[]; +extern const value_string ftam_Object_Availability_Attribute_vals[]; +extern const value_string ftam_Object_Size_Attribute_vals[]; +extern const value_string ftam_Legal_Qualification_Attribute_vals[]; +extern const value_string ftam_Private_Use_Attribute_vals[]; +int dissect_ftam_Concurrency_Access(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); +int dissect_ftam_Date_and_Time_Attribute(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); +int dissect_ftam_Object_Availability_Attribute(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); +int dissect_ftam_Object_Size_Attribute(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); +int dissect_ftam_Legal_Qualification_Attribute(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); +int dissect_ftam_Permitted_Actions_Attribute(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); +int dissect_ftam_Private_Use_Attribute(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); +int dissect_ftam_Attribute_Extensions(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); +int dissect_ftam_Pathname(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); + +/*--- End of included file: packet-ftam-exp.h ---*/ + #endif /* PACKET_FTAM_H */ diff --git a/epan/dissectors/packet-ftbp.c b/epan/dissectors/packet-ftbp.c new file mode 100644 index 0000000000..a853b0f6b4 --- /dev/null +++ b/epan/dissectors/packet-ftbp.c @@ -0,0 +1,1584 @@ +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* .\packet-ftbp.c */ +/* ../../tools/asn2eth.py -X -b -e -p ftbp -c ftbp.cnf -s packet-ftbp-template ftbp.asn */ + +/* Input file: packet-ftbp-template.c */ + +/* packet-ftbp.c + * Routines for File Transfer Body Part (FTBP) dissection (used in X.420 content) + * Graeme Lunt 2005 + * + * $Id$ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs <gerald@ethereal.com> + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <glib.h> +#include <epan/packet.h> +#include <epan/conversation.h> + +#include <stdio.h> +#include <string.h> + +#include "packet-ber.h" + +#include "packet-acse.h" +#include "packet-ftam.h" +#include "packet-x411.h" +#include "packet-x420.h" + +#include "packet-ftbp.h" + +#define PNAME "X.420 File Transfer Body Part" +#define PSNAME "FTBP" +#define PFNAME "ftbp" + +/* Initialize the protocol and registered fields */ +int proto_ftbp = -1; + + +/*--- Included file: packet-ftbp-hf.c ---*/ + +static int hf_ftbp_FileTransferParameters_PDU = -1; /* FileTransferParameters */ +static int hf_ftbp_FileTransferData_PDU = -1; /* FileTransferData */ +static int hf_ftbp_related_stored_file = -1; /* RelatedStoredFile */ +static int hf_ftbp_contents_type = -1; /* ContentsTypeParameter */ +static int hf_ftbp_environment = -1; /* EnvironmentParameter */ +static int hf_ftbp_compression = -1; /* CompressionParameter */ +static int hf_ftbp_file_attributes = -1; /* FileAttributes */ +static int hf_ftbp_extensions = -1; /* ExtensionsField */ +static int hf_ftbp_FileTransferData_item = -1; /* EXTERNAL */ +static int hf_ftbp_RelatedStoredFile_item = -1; /* RelatedStoredFile_item */ +static int hf_ftbp_file_identifier = -1; /* FileIdentifier */ +static int hf_ftbp_relationship = -1; /* Relationship */ +static int hf_ftbp_pathname_and_version = -1; /* PathnameandVersion */ +static int hf_ftbp_cross_reference = -1; /* CrossReference */ +static int hf_ftbp_pathname = -1; /* Pathname_Attribute */ +static int hf_ftbp_file_version = -1; /* GraphicString */ +static int hf_ftbp_application_cross_reference = -1; /* OCTET_STRING */ +static int hf_ftbp_message_reference = -1; /* MessageReference */ +static int hf_ftbp_body_part_reference = -1; /* INTEGER */ +static int hf_ftbp_user = -1; /* ORName */ +static int hf_ftbp_user_relative_identifier = -1; /* PrintableString */ +static int hf_ftbp_explicit_relationship = -1; /* ExplicitRelationship */ +static int hf_ftbp_descriptive_relationship = -1; /* GraphicString */ +static int hf_ftbp_document_type = -1; /* T_document_type */ +static int hf_ftbp_document_type_name = -1; /* Document_Type_Name */ +static int hf_ftbp_parameter = -1; /* T_parameter */ +static int hf_ftbp_constraint_set_and_abstract_syntax = -1; /* T_constraint_set_and_abstract_syntax */ +static int hf_ftbp_constraint_set_name = -1; /* Constraint_Set_Name */ +static int hf_ftbp_abstract_syntax_name = -1; /* Abstract_Syntax_Name */ +static int hf_ftbp_application_reference = -1; /* GeneralIdentifier */ +static int hf_ftbp_machine = -1; /* GeneralIdentifier */ +static int hf_ftbp_operating_system = -1; /* OBJECT_IDENTIFIER */ +static int hf_ftbp_user_visible_string = -1; /* T_user_visible_string */ +static int hf_ftbp_user_visible_string_item = -1; /* GraphicString */ +static int hf_ftbp_registered_identifier = -1; /* OBJECT_IDENTIFIER */ +static int hf_ftbp_descriptive_identifier = -1; /* T_descriptive_identifier */ +static int hf_ftbp_descriptive_identifier_item = -1; /* GraphicString */ +static int hf_ftbp_compression_algorithm_id = -1; /* OBJECT_IDENTIFIER */ +static int hf_ftbp_compression_algorithm_param = -1; /* T_compression_algorithm_param */ +static int hf_ftbp_permitted_actions = -1; /* Permitted_Actions_Attribute */ +static int hf_ftbp_storage_account = -1; /* Account_Attribute */ +static int hf_ftbp_date_and_time_of_creation = -1; /* Date_and_Time_Attribute */ +static int hf_ftbp_date_and_time_of_last_modification = -1; /* Date_and_Time_Attribute */ +static int hf_ftbp_date_and_time_of_last_read_access = -1; /* Date_and_Time_Attribute */ +static int hf_ftbp_date_and_time_of_last_attribute_modification = -1; /* Date_and_Time_Attribute */ +static int hf_ftbp_identity_of_creator = -1; /* User_Identity_Attribute */ +static int hf_ftbp_identity_of_last_modifier = -1; /* User_Identity_Attribute */ +static int hf_ftbp_identity_of_last_reader = -1; /* User_Identity_Attribute */ +static int hf_ftbp_identity_of_last_attribute_modifier = -1; /* User_Identity_Attribute */ +static int hf_ftbp_object_availability = -1; /* Object_Availability_Attribute */ +static int hf_ftbp_object_size = -1; /* Object_Size_Attribute */ +static int hf_ftbp_future_object_size = -1; /* Object_Size_Attribute */ +static int hf_ftbp_access_control = -1; /* Access_Control_Attribute */ +static int hf_ftbp_legal_qualifications = -1; /* Legal_Qualification_Attribute */ +static int hf_ftbp_private_use = -1; /* Private_Use_Attribute */ +static int hf_ftbp_attribute_extensions = -1; /* Attribute_Extensions */ +static int hf_ftbp_incomplete_pathname = -1; /* Pathname */ +static int hf_ftbp_complete_pathname = -1; /* Pathname */ +static int hf_ftbp_no_value_available = -1; /* NULL */ +static int hf_ftbp_account_actual_values = -1; /* Account */ +static int hf_ftbp_identity_actual_values = -1; /* User_Identity */ +static int hf_ftbp_actual_values = -1; /* SET_OF_Access_Control_Element */ +static int hf_ftbp_actual_values_item = -1; /* Access_Control_Element */ +static int hf_ftbp_action_list = -1; /* Access_Request */ +static int hf_ftbp_concurrency_access = -1; /* Concurrency_Access */ +static int hf_ftbp_identity = -1; /* User_Identity */ +static int hf_ftbp_passwords = -1; /* Access_Passwords */ +static int hf_ftbp_location = -1; /* Application_Entity_Title */ +static int hf_ftbp_read_password = -1; /* Password */ +static int hf_ftbp_insert_password = -1; /* Password */ +static int hf_ftbp_replace_password = -1; /* Password */ +static int hf_ftbp_extend_password = -1; /* Password */ +static int hf_ftbp_erase_password = -1; /* Password */ +static int hf_ftbp_read_attribute_password = -1; /* Password */ +static int hf_ftbp_change_attribute_password = -1; /* Password */ +static int hf_ftbp_delete_password = -1; /* Password */ +static int hf_ftbp_pass_passwords = -1; /* Pass_Passwords */ +static int hf_ftbp_link_password = -1; /* Password */ +static int hf_ftbp_graphic_string = -1; /* GraphicString */ +static int hf_ftbp_octet_string = -1; /* OCTET_STRING */ +static int hf_ftbp_Pass_Passwords_item = -1; /* Password */ +static int hf_ftbp_ap_title = -1; /* AP_title */ +static int hf_ftbp_ae_qualifier = -1; /* AE_qualifier */ +/* named bits */ +static int hf_ftbp_Access_Request_read = -1; +static int hf_ftbp_Access_Request_insert = -1; +static int hf_ftbp_Access_Request_replace = -1; +static int hf_ftbp_Access_Request_extend = -1; +static int hf_ftbp_Access_Request_erase = -1; +static int hf_ftbp_Access_Request_read_attribute = -1; +static int hf_ftbp_Access_Request_change_attribute = -1; +static int hf_ftbp_Access_Request_delete_object = -1; + +/*--- End of included file: packet-ftbp-hf.c ---*/ + + +/* Initialize the subtree pointers */ +static gint ett_ftbp = -1; + +/*--- Included file: packet-ftbp-ett.c ---*/ + +static gint ett_ftbp_FileTransferParameters = -1; +static gint ett_ftbp_FileTransferData = -1; +static gint ett_ftbp_RelatedStoredFile = -1; +static gint ett_ftbp_RelatedStoredFile_item = -1; +static gint ett_ftbp_FileIdentifier = -1; +static gint ett_ftbp_PathnameandVersion = -1; +static gint ett_ftbp_CrossReference = -1; +static gint ett_ftbp_MessageReference = -1; +static gint ett_ftbp_Relationship = -1; +static gint ett_ftbp_Contents_Type_Attribute = -1; +static gint ett_ftbp_T_document_type = -1; +static gint ett_ftbp_T_constraint_set_and_abstract_syntax = -1; +static gint ett_ftbp_EnvironmentParameter = -1; +static gint ett_ftbp_T_user_visible_string = -1; +static gint ett_ftbp_GeneralIdentifier = -1; +static gint ett_ftbp_T_descriptive_identifier = -1; +static gint ett_ftbp_CompressionParameter = -1; +static gint ett_ftbp_FileAttributes = -1; +static gint ett_ftbp_Pathname_Attribute = -1; +static gint ett_ftbp_Account_Attribute = -1; +static gint ett_ftbp_User_Identity_Attribute = -1; +static gint ett_ftbp_Access_Control_Attribute = -1; +static gint ett_ftbp_SET_OF_Access_Control_Element = -1; +static gint ett_ftbp_Access_Control_Element = -1; +static gint ett_ftbp_Access_Request = -1; +static gint ett_ftbp_Access_Passwords = -1; +static gint ett_ftbp_Password = -1; +static gint ett_ftbp_Pass_Passwords = -1; +static gint ett_ftbp_Application_Entity_Title = -1; + +/*--- End of included file: packet-ftbp-ett.c ---*/ + + + +/*--- Included file: packet-ftbp-fn.c ---*/ + +/*--- Fields for imported types ---*/ + +static int dissect_extensions_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x420_ExtensionsField(TRUE, tvb, offset, pinfo, tree, hf_ftbp_extensions); +} +static int dissect_FileTransferData_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_acse_EXTERNAL(FALSE, tvb, offset, pinfo, tree, hf_ftbp_FileTransferData_item); +} +static int dissect_user_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x411_ORName(TRUE, tvb, offset, pinfo, tree, hf_ftbp_user); +} +static int dissect_permitted_actions_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftam_Permitted_Actions_Attribute(TRUE, tvb, offset, pinfo, tree, hf_ftbp_permitted_actions); +} +static int dissect_date_and_time_of_creation_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftam_Date_and_Time_Attribute(TRUE, tvb, offset, pinfo, tree, hf_ftbp_date_and_time_of_creation); +} +static int dissect_date_and_time_of_last_modification_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftam_Date_and_Time_Attribute(TRUE, tvb, offset, pinfo, tree, hf_ftbp_date_and_time_of_last_modification); +} +static int dissect_date_and_time_of_last_read_access_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftam_Date_and_Time_Attribute(TRUE, tvb, offset, pinfo, tree, hf_ftbp_date_and_time_of_last_read_access); +} +static int dissect_date_and_time_of_last_attribute_modification_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftam_Date_and_Time_Attribute(TRUE, tvb, offset, pinfo, tree, hf_ftbp_date_and_time_of_last_attribute_modification); +} +static int dissect_object_availability_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftam_Object_Availability_Attribute(TRUE, tvb, offset, pinfo, tree, hf_ftbp_object_availability); +} +static int dissect_object_size_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftam_Object_Size_Attribute(TRUE, tvb, offset, pinfo, tree, hf_ftbp_object_size); +} +static int dissect_future_object_size_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftam_Object_Size_Attribute(TRUE, tvb, offset, pinfo, tree, hf_ftbp_future_object_size); +} +static int dissect_legal_qualifications_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftam_Legal_Qualification_Attribute(TRUE, tvb, offset, pinfo, tree, hf_ftbp_legal_qualifications); +} +static int dissect_private_use_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftam_Private_Use_Attribute(TRUE, tvb, offset, pinfo, tree, hf_ftbp_private_use); +} +static int dissect_attribute_extensions_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftam_Attribute_Extensions(TRUE, tvb, offset, pinfo, tree, hf_ftbp_attribute_extensions); +} +static int dissect_incomplete_pathname_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftam_Pathname(TRUE, tvb, offset, pinfo, tree, hf_ftbp_incomplete_pathname); +} +static int dissect_complete_pathname_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftam_Pathname(TRUE, tvb, offset, pinfo, tree, hf_ftbp_complete_pathname); +} +static int dissect_concurrency_access_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftam_Concurrency_Access(TRUE, tvb, offset, pinfo, tree, hf_ftbp_concurrency_access); +} +static int dissect_ap_title(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_acse_AP_title(FALSE, tvb, offset, pinfo, tree, hf_ftbp_ap_title); +} +static int dissect_ae_qualifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_acse_AE_qualifier(FALSE, tvb, offset, pinfo, tree, hf_ftbp_ae_qualifier); +} + + +static const value_string ftbp_Pathname_Attribute_vals[] = { + { 0, "incomplete-pathname" }, + { 23, "complete-pathname" }, + { 0, NULL } +}; + +static const ber_choice_t Pathname_Attribute_choice[] = { + { 0, BER_CLASS_CON, 0, 0, dissect_incomplete_pathname_impl }, + { 23, BER_CLASS_CON, 23, 0, dissect_complete_pathname_impl }, + { 0, 0, 0, 0, NULL } +}; + +static int +dissect_ftbp_Pathname_Attribute(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_choice(pinfo, tree, tvb, offset, + Pathname_Attribute_choice, hf_index, ett_ftbp_Pathname_Attribute, + NULL); + + return offset; +} +static int dissect_pathname(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_Pathname_Attribute(FALSE, tvb, offset, pinfo, tree, hf_ftbp_pathname); +} +static int dissect_pathname_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_Pathname_Attribute(TRUE, tvb, offset, pinfo, tree, hf_ftbp_pathname); +} + + + +static int +dissect_ftbp_GraphicString(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_GraphicString, + pinfo, tree, tvb, offset, hf_index, + NULL); + + return offset; +} +static int dissect_file_version_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_GraphicString(TRUE, tvb, offset, pinfo, tree, hf_ftbp_file_version); +} +static int dissect_descriptive_relationship_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_GraphicString(TRUE, tvb, offset, pinfo, tree, hf_ftbp_descriptive_relationship); +} +static int dissect_user_visible_string_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_GraphicString(FALSE, tvb, offset, pinfo, tree, hf_ftbp_user_visible_string_item); +} +static int dissect_descriptive_identifier_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_GraphicString(FALSE, tvb, offset, pinfo, tree, hf_ftbp_descriptive_identifier_item); +} +static int dissect_graphic_string(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_GraphicString(FALSE, tvb, offset, pinfo, tree, hf_ftbp_graphic_string); +} + + +static const ber_sequence_t PathnameandVersion_sequence[] = { + { BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG|BER_FLAGS_NOTCHKTAG, dissect_pathname_impl }, + { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_file_version_impl }, + { 0, 0, 0, NULL } +}; + +static int +dissect_ftbp_PathnameandVersion(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, + PathnameandVersion_sequence, hf_index, ett_ftbp_PathnameandVersion); + + return offset; +} +static int dissect_pathname_and_version_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_PathnameandVersion(TRUE, tvb, offset, pinfo, tree, hf_ftbp_pathname_and_version); +} + + + +static int +dissect_ftbp_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, + NULL); + + return offset; +} +static int dissect_application_cross_reference_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_OCTET_STRING(TRUE, tvb, offset, pinfo, tree, hf_ftbp_application_cross_reference); +} +static int dissect_octet_string(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_ftbp_octet_string); +} + + + +static int +dissect_ftbp_PrintableString(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_PrintableString, + pinfo, tree, tvb, offset, hf_index, + NULL); + + return offset; +} +static int dissect_user_relative_identifier_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_PrintableString(TRUE, tvb, offset, pinfo, tree, hf_ftbp_user_relative_identifier); +} + + +static const ber_sequence_t MessageReference_set[] = { + { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_user_impl }, + { BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_user_relative_identifier_impl }, + { 0, 0, 0, NULL } +}; + +static int +dissect_ftbp_MessageReference(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_set(implicit_tag, pinfo, tree, tvb, offset, + MessageReference_set, hf_index, ett_ftbp_MessageReference); + + return offset; +} +static int dissect_message_reference_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_MessageReference(TRUE, tvb, offset, pinfo, tree, hf_ftbp_message_reference); +} + + + +static int +dissect_ftbp_INTEGER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, + NULL); + + return offset; +} +static int dissect_body_part_reference_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_INTEGER(TRUE, tvb, offset, pinfo, tree, hf_ftbp_body_part_reference); +} + + +static const ber_sequence_t CrossReference_sequence[] = { + { BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_application_cross_reference_impl }, + { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_message_reference_impl }, + { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_body_part_reference_impl }, + { 0, 0, 0, NULL } +}; + +static int +dissect_ftbp_CrossReference(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, + CrossReference_sequence, hf_index, ett_ftbp_CrossReference); + + return offset; +} +static int dissect_cross_reference_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_CrossReference(TRUE, tvb, offset, pinfo, tree, hf_ftbp_cross_reference); +} + + +static const value_string ftbp_FileIdentifier_vals[] = { + { 0, "pathname-and-version" }, + { 1, "cross-reference" }, + { 0, NULL } +}; + +static const ber_choice_t FileIdentifier_choice[] = { + { 0, BER_CLASS_CON, 0, 0, dissect_pathname_and_version_impl }, + { 1, BER_CLASS_CON, 1, 0, dissect_cross_reference_impl }, + { 0, 0, 0, 0, NULL } +}; + +static int +dissect_ftbp_FileIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_choice(pinfo, tree, tvb, offset, + FileIdentifier_choice, hf_index, ett_ftbp_FileIdentifier, + NULL); + + return offset; +} +static int dissect_file_identifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_FileIdentifier(FALSE, tvb, offset, pinfo, tree, hf_ftbp_file_identifier); +} + + +static const value_string ftbp_ExplicitRelationship_vals[] = { + { 0, "unspecified" }, + { 1, "new-file" }, + { 2, "replacement" }, + { 3, "extension" }, + { 0, NULL } +}; + + +static int +dissect_ftbp_ExplicitRelationship(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, + NULL); + + return offset; +} +static int dissect_explicit_relationship_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_ExplicitRelationship(TRUE, tvb, offset, pinfo, tree, hf_ftbp_explicit_relationship); +} + + +static const value_string ftbp_Relationship_vals[] = { + { 0, "explicit-relationship" }, + { 1, "descriptive-relationship" }, + { 0, NULL } +}; + +static const ber_choice_t Relationship_choice[] = { + { 0, BER_CLASS_CON, 0, 0, dissect_explicit_relationship_impl }, + { 1, BER_CLASS_CON, 1, 0, dissect_descriptive_relationship_impl }, + { 0, 0, 0, 0, NULL } +}; + +static int +dissect_ftbp_Relationship(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_choice(pinfo, tree, tvb, offset, + Relationship_choice, hf_index, ett_ftbp_Relationship, + NULL); + + return offset; +} +static int dissect_relationship(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_Relationship(FALSE, tvb, offset, pinfo, tree, hf_ftbp_relationship); +} + + +static const ber_sequence_t RelatedStoredFile_item_sequence[] = { + { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_file_identifier }, + { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_relationship }, + { 0, 0, 0, NULL } +}; + +static int +dissect_ftbp_RelatedStoredFile_item(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, + RelatedStoredFile_item_sequence, hf_index, ett_ftbp_RelatedStoredFile_item); + + return offset; +} +static int dissect_RelatedStoredFile_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_RelatedStoredFile_item(FALSE, tvb, offset, pinfo, tree, hf_ftbp_RelatedStoredFile_item); +} + + +static const ber_sequence_t RelatedStoredFile_set_of[1] = { + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_RelatedStoredFile_item }, +}; + +static int +dissect_ftbp_RelatedStoredFile(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset, + RelatedStoredFile_set_of, hf_index, ett_ftbp_RelatedStoredFile); + + return offset; +} +static int dissect_related_stored_file_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_RelatedStoredFile(TRUE, tvb, offset, pinfo, tree, hf_ftbp_related_stored_file); +} + + + +static int +dissect_ftbp_Document_Type_Name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL); + + return offset; +} +static int dissect_document_type_name(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_Document_Type_Name(FALSE, tvb, offset, pinfo, tree, hf_ftbp_document_type_name); +} + + + +static int +dissect_ftbp_T_parameter(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +/* XXX: Not implemented yet */ + + + return offset; +} +static int dissect_parameter_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_T_parameter(TRUE, tvb, offset, pinfo, tree, hf_ftbp_parameter); +} + + +static const ber_sequence_t T_document_type_sequence[] = { + { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_document_type_name }, + { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_parameter_impl }, + { 0, 0, 0, NULL } +}; + +static int +dissect_ftbp_T_document_type(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, + T_document_type_sequence, hf_index, ett_ftbp_T_document_type); + + return offset; +} +static int dissect_document_type_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_T_document_type(TRUE, tvb, offset, pinfo, tree, hf_ftbp_document_type); +} + + + +static int +dissect_ftbp_Constraint_Set_Name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL); + + return offset; +} +static int dissect_constraint_set_name(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_Constraint_Set_Name(FALSE, tvb, offset, pinfo, tree, hf_ftbp_constraint_set_name); +} + + + +static int +dissect_ftbp_Abstract_Syntax_Name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL); + + return offset; +} +static int dissect_abstract_syntax_name(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_Abstract_Syntax_Name(FALSE, tvb, offset, pinfo, tree, hf_ftbp_abstract_syntax_name); +} + + +static const ber_sequence_t T_constraint_set_and_abstract_syntax_sequence[] = { + { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_constraint_set_name }, + { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_abstract_syntax_name }, + { 0, 0, 0, NULL } +}; + +static int +dissect_ftbp_T_constraint_set_and_abstract_syntax(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, + T_constraint_set_and_abstract_syntax_sequence, hf_index, ett_ftbp_T_constraint_set_and_abstract_syntax); + + return offset; +} +static int dissect_constraint_set_and_abstract_syntax_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_T_constraint_set_and_abstract_syntax(TRUE, tvb, offset, pinfo, tree, hf_ftbp_constraint_set_and_abstract_syntax); +} + + +static const value_string ftbp_Contents_Type_Attribute_vals[] = { + { 0, "document-type" }, + { 1, "constraint-set-and-abstract-syntax" }, + { 0, NULL } +}; + +static const ber_choice_t Contents_Type_Attribute_choice[] = { + { 0, BER_CLASS_CON, 0, 0, dissect_document_type_impl }, + { 1, BER_CLASS_CON, 1, 0, dissect_constraint_set_and_abstract_syntax_impl }, + { 0, 0, 0, 0, NULL } +}; + +static int +dissect_ftbp_Contents_Type_Attribute(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_choice(pinfo, tree, tvb, offset, + Contents_Type_Attribute_choice, hf_index, ett_ftbp_Contents_Type_Attribute, + NULL); + + return offset; +} + + + +static int +dissect_ftbp_ContentsTypeParameter(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ftbp_Contents_Type_Attribute(implicit_tag, tvb, offset, pinfo, tree, hf_index); + + return offset; +} +static int dissect_contents_type_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_ContentsTypeParameter(TRUE, tvb, offset, pinfo, tree, hf_ftbp_contents_type); +} + + + +static int +dissect_ftbp_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL); + + return offset; +} +static int dissect_operating_system_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_OBJECT_IDENTIFIER(TRUE, tvb, offset, pinfo, tree, hf_ftbp_operating_system); +} +static int dissect_registered_identifier_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_OBJECT_IDENTIFIER(TRUE, tvb, offset, pinfo, tree, hf_ftbp_registered_identifier); +} +static int dissect_compression_algorithm_id_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_OBJECT_IDENTIFIER(TRUE, tvb, offset, pinfo, tree, hf_ftbp_compression_algorithm_id); +} + + +static const ber_sequence_t T_descriptive_identifier_sequence_of[1] = { + { BER_CLASS_UNI, BER_UNI_TAG_GraphicString, BER_FLAGS_NOOWNTAG, dissect_descriptive_identifier_item }, +}; + +static int +dissect_ftbp_T_descriptive_identifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset, + T_descriptive_identifier_sequence_of, hf_index, ett_ftbp_T_descriptive_identifier); + + return offset; +} +static int dissect_descriptive_identifier_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_T_descriptive_identifier(TRUE, tvb, offset, pinfo, tree, hf_ftbp_descriptive_identifier); +} + + +static const value_string ftbp_GeneralIdentifier_vals[] = { + { 0, "registered-identifier" }, + { 1, "descriptive-identifier" }, + { 0, NULL } +}; + +static const ber_choice_t GeneralIdentifier_choice[] = { + { 0, BER_CLASS_CON, 0, 0, dissect_registered_identifier_impl }, + { 1, BER_CLASS_CON, 1, 0, dissect_descriptive_identifier_impl }, + { 0, 0, 0, 0, NULL } +}; + +static int +dissect_ftbp_GeneralIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_choice(pinfo, tree, tvb, offset, + GeneralIdentifier_choice, hf_index, ett_ftbp_GeneralIdentifier, + NULL); + + return offset; +} +static int dissect_application_reference_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_GeneralIdentifier(TRUE, tvb, offset, pinfo, tree, hf_ftbp_application_reference); +} +static int dissect_machine_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_GeneralIdentifier(TRUE, tvb, offset, pinfo, tree, hf_ftbp_machine); +} + + +static const ber_sequence_t T_user_visible_string_sequence_of[1] = { + { BER_CLASS_UNI, BER_UNI_TAG_GraphicString, BER_FLAGS_NOOWNTAG, dissect_user_visible_string_item }, +}; + +static int +dissect_ftbp_T_user_visible_string(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset, + T_user_visible_string_sequence_of, hf_index, ett_ftbp_T_user_visible_string); + + return offset; +} +static int dissect_user_visible_string_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_T_user_visible_string(TRUE, tvb, offset, pinfo, tree, hf_ftbp_user_visible_string); +} + + +static const ber_sequence_t EnvironmentParameter_sequence[] = { + { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG|BER_FLAGS_NOTCHKTAG, dissect_application_reference_impl }, + { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG|BER_FLAGS_NOTCHKTAG, dissect_machine_impl }, + { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_operating_system_impl }, + { BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_user_visible_string_impl }, + { 0, 0, 0, NULL } +}; + +static int +dissect_ftbp_EnvironmentParameter(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, + EnvironmentParameter_sequence, hf_index, ett_ftbp_EnvironmentParameter); + + return offset; +} +static int dissect_environment_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_EnvironmentParameter(TRUE, tvb, offset, pinfo, tree, hf_ftbp_environment); +} + + + +static int +dissect_ftbp_T_compression_algorithm_param(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +/* XXX: Not implemented yet */ + return offset; +} +static int dissect_compression_algorithm_param_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_T_compression_algorithm_param(TRUE, tvb, offset, pinfo, tree, hf_ftbp_compression_algorithm_param); +} + + +static const ber_sequence_t CompressionParameter_sequence[] = { + { BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_compression_algorithm_id_impl }, + { BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_compression_algorithm_param_impl }, + { 0, 0, 0, NULL } +}; + +static int +dissect_ftbp_CompressionParameter(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, + CompressionParameter_sequence, hf_index, ett_ftbp_CompressionParameter); + + return offset; +} +static int dissect_compression_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_CompressionParameter(TRUE, tvb, offset, pinfo, tree, hf_ftbp_compression); +} + + + +static int +dissect_ftbp_NULL(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_null(implicit_tag, pinfo, tree, tvb, offset, hf_index); + + return offset; +} +static int dissect_no_value_available_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_NULL(TRUE, tvb, offset, pinfo, tree, hf_ftbp_no_value_available); +} + + + +static int +dissect_ftbp_Account(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_GraphicString, + pinfo, tree, tvb, offset, hf_index, + NULL); + + return offset; +} +static int dissect_account_actual_values(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_Account(FALSE, tvb, offset, pinfo, tree, hf_ftbp_account_actual_values); +} + + +static const value_string ftbp_Account_Attribute_vals[] = { + { 0, "no-value-available" }, + { 1, "actual-values" }, + { 0, NULL } +}; + +static const ber_choice_t Account_Attribute_choice[] = { + { 0, BER_CLASS_CON, 0, 0, dissect_no_value_available_impl }, + { 1, BER_CLASS_UNI, BER_UNI_TAG_GraphicString, BER_FLAGS_NOOWNTAG, dissect_account_actual_values }, + { 0, 0, 0, 0, NULL } +}; + +static int +dissect_ftbp_Account_Attribute(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_choice(pinfo, tree, tvb, offset, + Account_Attribute_choice, hf_index, ett_ftbp_Account_Attribute, + NULL); + + return offset; +} +static int dissect_storage_account_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_Account_Attribute(TRUE, tvb, offset, pinfo, tree, hf_ftbp_storage_account); +} + + + +static int +dissect_ftbp_User_Identity(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_GraphicString, + pinfo, tree, tvb, offset, hf_index, + NULL); + + return offset; +} +static int dissect_identity_actual_values(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_User_Identity(FALSE, tvb, offset, pinfo, tree, hf_ftbp_identity_actual_values); +} +static int dissect_identity_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_User_Identity(TRUE, tvb, offset, pinfo, tree, hf_ftbp_identity); +} + + +static const value_string ftbp_User_Identity_Attribute_vals[] = { + { 0, "no-value-available" }, + { 1, "actual-values" }, + { 0, NULL } +}; + +static const ber_choice_t User_Identity_Attribute_choice[] = { + { 0, BER_CLASS_CON, 0, 0, dissect_no_value_available_impl }, + { 1, BER_CLASS_UNI, BER_UNI_TAG_GraphicString, BER_FLAGS_NOOWNTAG, dissect_identity_actual_values }, + { 0, 0, 0, 0, NULL } +}; + +static int +dissect_ftbp_User_Identity_Attribute(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_choice(pinfo, tree, tvb, offset, + User_Identity_Attribute_choice, hf_index, ett_ftbp_User_Identity_Attribute, + NULL); + + return offset; +} +static int dissect_identity_of_creator_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_User_Identity_Attribute(TRUE, tvb, offset, pinfo, tree, hf_ftbp_identity_of_creator); +} +static int dissect_identity_of_last_modifier_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_User_Identity_Attribute(TRUE, tvb, offset, pinfo, tree, hf_ftbp_identity_of_last_modifier); +} +static int dissect_identity_of_last_reader_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_User_Identity_Attribute(TRUE, tvb, offset, pinfo, tree, hf_ftbp_identity_of_last_reader); +} +static int dissect_identity_of_last_attribute_modifier_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_User_Identity_Attribute(TRUE, tvb, offset, pinfo, tree, hf_ftbp_identity_of_last_attribute_modifier); +} + + +static const asn_namedbit Access_Request_bits[] = { + { 0, &hf_ftbp_Access_Request_read, -1, -1, "read", NULL }, + { 1, &hf_ftbp_Access_Request_insert, -1, -1, "insert", NULL }, + { 2, &hf_ftbp_Access_Request_replace, -1, -1, "replace", NULL }, + { 3, &hf_ftbp_Access_Request_extend, -1, -1, "extend", NULL }, + { 4, &hf_ftbp_Access_Request_erase, -1, -1, "erase", NULL }, + { 5, &hf_ftbp_Access_Request_read_attribute, -1, -1, "read-attribute", NULL }, + { 6, &hf_ftbp_Access_Request_change_attribute, -1, -1, "change-attribute", NULL }, + { 7, &hf_ftbp_Access_Request_delete_object, -1, -1, "delete-object", NULL }, + { 0, NULL, 0, 0, NULL, NULL } +}; + +static int +dissect_ftbp_Access_Request(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset, + Access_Request_bits, hf_index, ett_ftbp_Access_Request, + NULL); + + return offset; +} +static int dissect_action_list_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_Access_Request(TRUE, tvb, offset, pinfo, tree, hf_ftbp_action_list); +} + + +static const value_string ftbp_Password_vals[] = { + { 0, "graphic-string" }, + { 1, "octet-string" }, + { 0, NULL } +}; + +static const ber_choice_t Password_choice[] = { + { 0, BER_CLASS_UNI, BER_UNI_TAG_GraphicString, BER_FLAGS_NOOWNTAG, dissect_graphic_string }, + { 1, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_octet_string }, + { 0, 0, 0, 0, NULL } +}; + +static int +dissect_ftbp_Password(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_choice(pinfo, tree, tvb, offset, + Password_choice, hf_index, ett_ftbp_Password, + NULL); + + return offset; +} +static int dissect_read_password_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_Password(TRUE, tvb, offset, pinfo, tree, hf_ftbp_read_password); +} +static int dissect_insert_password_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_Password(TRUE, tvb, offset, pinfo, tree, hf_ftbp_insert_password); +} +static int dissect_replace_password_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_Password(TRUE, tvb, offset, pinfo, tree, hf_ftbp_replace_password); +} +static int dissect_extend_password_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_Password(TRUE, tvb, offset, pinfo, tree, hf_ftbp_extend_password); +} +static int dissect_erase_password_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_Password(TRUE, tvb, offset, pinfo, tree, hf_ftbp_erase_password); +} +static int dissect_read_attribute_password_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_Password(TRUE, tvb, offset, pinfo, tree, hf_ftbp_read_attribute_password); +} +static int dissect_change_attribute_password_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_Password(TRUE, tvb, offset, pinfo, tree, hf_ftbp_change_attribute_password); +} +static int dissect_delete_password_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_Password(TRUE, tvb, offset, pinfo, tree, hf_ftbp_delete_password); +} +static int dissect_link_password_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_Password(TRUE, tvb, offset, pinfo, tree, hf_ftbp_link_password); +} +static int dissect_Pass_Passwords_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_Password(FALSE, tvb, offset, pinfo, tree, hf_ftbp_Pass_Passwords_item); +} + + +static const ber_sequence_t Pass_Passwords_sequence_of[1] = { + { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_Pass_Passwords_item }, +}; + +static int +dissect_ftbp_Pass_Passwords(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset, + Pass_Passwords_sequence_of, hf_index, ett_ftbp_Pass_Passwords); + + return offset; +} +static int dissect_pass_passwords_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_Pass_Passwords(TRUE, tvb, offset, pinfo, tree, hf_ftbp_pass_passwords); +} + + +static const ber_sequence_t Access_Passwords_sequence[] = { + { BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG|BER_FLAGS_NOTCHKTAG, dissect_read_password_impl }, + { BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG|BER_FLAGS_NOTCHKTAG, dissect_insert_password_impl }, + { BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG|BER_FLAGS_NOTCHKTAG, dissect_replace_password_impl }, + { BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG|BER_FLAGS_NOTCHKTAG, dissect_extend_password_impl }, + { BER_CLASS_CON, 4, BER_FLAGS_IMPLTAG|BER_FLAGS_NOTCHKTAG, dissect_erase_password_impl }, + { BER_CLASS_CON, 5, BER_FLAGS_IMPLTAG|BER_FLAGS_NOTCHKTAG, dissect_read_attribute_password_impl }, + { BER_CLASS_CON, 6, BER_FLAGS_IMPLTAG|BER_FLAGS_NOTCHKTAG, dissect_change_attribute_password_impl }, + { BER_CLASS_CON, 7, BER_FLAGS_IMPLTAG|BER_FLAGS_NOTCHKTAG, dissect_delete_password_impl }, + { BER_CLASS_CON, 8, BER_FLAGS_IMPLTAG, dissect_pass_passwords_impl }, + { BER_CLASS_CON, 9, BER_FLAGS_IMPLTAG|BER_FLAGS_NOTCHKTAG, dissect_link_password_impl }, + { 0, 0, 0, NULL } +}; + +static int +dissect_ftbp_Access_Passwords(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, + Access_Passwords_sequence, hf_index, ett_ftbp_Access_Passwords); + + return offset; +} +static int dissect_passwords_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_Access_Passwords(TRUE, tvb, offset, pinfo, tree, hf_ftbp_passwords); +} + + +static const ber_sequence_t Application_Entity_Title_sequence[] = { + { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_ap_title }, + { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_ae_qualifier }, + { 0, 0, 0, NULL } +}; + +static int +dissect_ftbp_Application_Entity_Title(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, + Application_Entity_Title_sequence, hf_index, ett_ftbp_Application_Entity_Title); + + return offset; +} +static int dissect_location_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_Application_Entity_Title(TRUE, tvb, offset, pinfo, tree, hf_ftbp_location); +} + + +static const ber_sequence_t Access_Control_Element_sequence[] = { + { BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_action_list_impl }, + { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_concurrency_access_impl }, + { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_identity_impl }, + { BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_passwords_impl }, + { BER_CLASS_CON, 4, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_location_impl }, + { 0, 0, 0, NULL } +}; + +static int +dissect_ftbp_Access_Control_Element(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, + Access_Control_Element_sequence, hf_index, ett_ftbp_Access_Control_Element); + + return offset; +} +static int dissect_actual_values_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_Access_Control_Element(FALSE, tvb, offset, pinfo, tree, hf_ftbp_actual_values_item); +} + + +static const ber_sequence_t SET_OF_Access_Control_Element_set_of[1] = { + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_actual_values_item }, +}; + +static int +dissect_ftbp_SET_OF_Access_Control_Element(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset, + SET_OF_Access_Control_Element_set_of, hf_index, ett_ftbp_SET_OF_Access_Control_Element); + + return offset; +} +static int dissect_actual_values_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_SET_OF_Access_Control_Element(TRUE, tvb, offset, pinfo, tree, hf_ftbp_actual_values); +} + + +static const value_string ftbp_Access_Control_Attribute_vals[] = { + { 0, "no-value-available" }, + { 1, "actual-values" }, + { 0, NULL } +}; + +static const ber_choice_t Access_Control_Attribute_choice[] = { + { 0, BER_CLASS_CON, 0, 0, dissect_no_value_available_impl }, + { 1, BER_CLASS_CON, 1, 0, dissect_actual_values_impl }, + { 0, 0, 0, 0, NULL } +}; + +static int +dissect_ftbp_Access_Control_Attribute(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_choice(pinfo, tree, tvb, offset, + Access_Control_Attribute_choice, hf_index, ett_ftbp_Access_Control_Attribute, + NULL); + + return offset; +} +static int dissect_access_control_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_Access_Control_Attribute(TRUE, tvb, offset, pinfo, tree, hf_ftbp_access_control); +} + + +static const ber_sequence_t FileAttributes_sequence[] = { + { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_pathname }, + { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_permitted_actions_impl }, + { BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG|BER_FLAGS_NOTCHKTAG, dissect_storage_account_impl }, + { BER_CLASS_CON, 4, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_date_and_time_of_creation_impl }, + { BER_CLASS_CON, 5, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_date_and_time_of_last_modification_impl }, + { BER_CLASS_CON, 6, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_date_and_time_of_last_read_access_impl }, + { BER_CLASS_CON, 7, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_date_and_time_of_last_attribute_modification_impl }, + { BER_CLASS_CON, 8, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG|BER_FLAGS_NOTCHKTAG, dissect_identity_of_creator_impl }, + { BER_CLASS_CON, 9, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG|BER_FLAGS_NOTCHKTAG, dissect_identity_of_last_modifier_impl }, + { BER_CLASS_CON, 10, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG|BER_FLAGS_NOTCHKTAG, dissect_identity_of_last_reader_impl }, + { BER_CLASS_CON, 11, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG|BER_FLAGS_NOTCHKTAG, dissect_identity_of_last_attribute_modifier_impl }, + { BER_CLASS_CON, 12, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_object_availability_impl }, + { BER_CLASS_CON, 13, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_object_size_impl }, + { BER_CLASS_CON, 14, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_future_object_size_impl }, + { BER_CLASS_CON, 15, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG|BER_FLAGS_NOTCHKTAG, dissect_access_control_impl }, + { BER_CLASS_CON, 16, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_legal_qualifications_impl }, + { BER_CLASS_CON, 17, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_private_use_impl }, + { BER_CLASS_CON, 22, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_attribute_extensions_impl }, + { 0, 0, 0, NULL } +}; + +static int +dissect_ftbp_FileAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, + FileAttributes_sequence, hf_index, ett_ftbp_FileAttributes); + + return offset; +} +static int dissect_file_attributes_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ftbp_FileAttributes(TRUE, tvb, offset, pinfo, tree, hf_ftbp_file_attributes); +} + + +static const ber_sequence_t FileTransferParameters_sequence[] = { + { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_related_stored_file_impl }, + { BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG|BER_FLAGS_NOTCHKTAG, dissect_contents_type_impl }, + { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_environment_impl }, + { BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_compression_impl }, + { BER_CLASS_CON, 4, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_file_attributes_impl }, + { BER_CLASS_CON, 5, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_extensions_impl }, + { 0, 0, 0, NULL } +}; + +static int +dissect_ftbp_FileTransferParameters(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, + FileTransferParameters_sequence, hf_index, ett_ftbp_FileTransferParameters); + + return offset; +} + + +static const ber_sequence_t FileTransferData_sequence_of[1] = { + { BER_CLASS_UNI, 8, BER_FLAGS_NOOWNTAG, dissect_FileTransferData_item }, +}; + +static int +dissect_ftbp_FileTransferData(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset, + FileTransferData_sequence_of, hf_index, ett_ftbp_FileTransferData); + + return offset; +} + +/*--- PDUs ---*/ + +static void dissect_FileTransferParameters_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { + dissect_ftbp_FileTransferParameters(FALSE, tvb, 0, pinfo, tree, hf_ftbp_FileTransferParameters_PDU); +} +static void dissect_FileTransferData_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { + dissect_ftbp_FileTransferData(FALSE, tvb, 0, pinfo, tree, hf_ftbp_FileTransferData_PDU); +} + + +/*--- End of included file: packet-ftbp-fn.c ---*/ + + + +/*--- proto_register_ftbp -------------------------------------------*/ +void proto_register_ftbp(void) { + + /* List of fields */ + static hf_register_info hf[] = + { + +/*--- Included file: packet-ftbp-hfarr.c ---*/ + + { &hf_ftbp_FileTransferParameters_PDU, + { "FileTransferParameters", "ftbp.FileTransferParameters", + FT_NONE, BASE_NONE, NULL, 0, + "FileTransferParameters", HFILL }}, + { &hf_ftbp_FileTransferData_PDU, + { "FileTransferData", "ftbp.FileTransferData", + FT_UINT32, BASE_DEC, NULL, 0, + "FileTransferData", HFILL }}, + { &hf_ftbp_related_stored_file, + { "related-stored-file", "ftbp.related_stored_file", + FT_UINT32, BASE_DEC, NULL, 0, + "FileTransferParameters/related-stored-file", HFILL }}, + { &hf_ftbp_contents_type, + { "contents-type", "ftbp.contents_type", + FT_UINT32, BASE_DEC, VALS(ftbp_Contents_Type_Attribute_vals), 0, + "FileTransferParameters/contents-type", HFILL }}, + { &hf_ftbp_environment, + { "environment", "ftbp.environment", + FT_NONE, BASE_NONE, NULL, 0, + "FileTransferParameters/environment", HFILL }}, + { &hf_ftbp_compression, + { "compression", "ftbp.compression", + FT_NONE, BASE_NONE, NULL, 0, + "FileTransferParameters/compression", HFILL }}, + { &hf_ftbp_file_attributes, + { "file-attributes", "ftbp.file_attributes", + FT_NONE, BASE_NONE, NULL, 0, + "FileTransferParameters/file-attributes", HFILL }}, + { &hf_ftbp_extensions, + { "extensions", "ftbp.extensions", + FT_UINT32, BASE_DEC, NULL, 0, + "FileTransferParameters/extensions", HFILL }}, + { &hf_ftbp_FileTransferData_item, + { "Item", "ftbp.FileTransferData_item", + FT_NONE, BASE_NONE, NULL, 0, + "FileTransferData/_item", HFILL }}, + { &hf_ftbp_RelatedStoredFile_item, + { "Item", "ftbp.RelatedStoredFile_item", + FT_NONE, BASE_NONE, NULL, 0, + "RelatedStoredFile/_item", HFILL }}, + { &hf_ftbp_file_identifier, + { "file-identifier", "ftbp.file_identifier", + FT_UINT32, BASE_DEC, VALS(ftbp_FileIdentifier_vals), 0, + "RelatedStoredFile/_item/file-identifier", HFILL }}, + { &hf_ftbp_relationship, + { "relationship", "ftbp.relationship", + FT_UINT32, BASE_DEC, VALS(ftbp_Relationship_vals), 0, + "RelatedStoredFile/_item/relationship", HFILL }}, + { &hf_ftbp_pathname_and_version, + { "pathname-and-version", "ftbp.pathname_and_version", + FT_NONE, BASE_NONE, NULL, 0, + "FileIdentifier/pathname-and-version", HFILL }}, + { &hf_ftbp_cross_reference, + { "cross-reference", "ftbp.cross_reference", + FT_NONE, BASE_NONE, NULL, 0, + "FileIdentifier/cross-reference", HFILL }}, + { &hf_ftbp_pathname, + { "pathname", "ftbp.pathname", + FT_UINT32, BASE_DEC, VALS(ftbp_Pathname_Attribute_vals), 0, + "", HFILL }}, + { &hf_ftbp_file_version, + { "file-version", "ftbp.file_version", + FT_STRING, BASE_NONE, NULL, 0, + "PathnameandVersion/file-version", HFILL }}, + { &hf_ftbp_application_cross_reference, + { "application-cross-reference", "ftbp.application_cross_reference", + FT_BYTES, BASE_HEX, NULL, 0, + "CrossReference/application-cross-reference", HFILL }}, + { &hf_ftbp_message_reference, + { "message-reference", "ftbp.message_reference", + FT_NONE, BASE_NONE, NULL, 0, + "CrossReference/message-reference", HFILL }}, + { &hf_ftbp_body_part_reference, + { "body-part-reference", "ftbp.body_part_reference", + FT_INT32, BASE_DEC, NULL, 0, + "CrossReference/body-part-reference", HFILL }}, + { &hf_ftbp_user, + { "user", "ftbp.user", + FT_NONE, BASE_NONE, NULL, 0, + "MessageReference/user", HFILL }}, + { &hf_ftbp_user_relative_identifier, + { "user-relative-identifier", "ftbp.user_relative_identifier", + FT_STRING, BASE_NONE, NULL, 0, + "MessageReference/user-relative-identifier", HFILL }}, + { &hf_ftbp_explicit_relationship, + { "explicit-relationship", "ftbp.explicit_relationship", + FT_INT32, BASE_DEC, VALS(ftbp_ExplicitRelationship_vals), 0, + "Relationship/explicit-relationship", HFILL }}, + { &hf_ftbp_descriptive_relationship, + { "descriptive-relationship", "ftbp.descriptive_relationship", + FT_STRING, BASE_NONE, NULL, 0, + "Relationship/descriptive-relationship", HFILL }}, + { &hf_ftbp_document_type, + { "document-type", "ftbp.document_type", + FT_NONE, BASE_NONE, NULL, 0, + "Contents-Type-Attribute/document-type", HFILL }}, + { &hf_ftbp_document_type_name, + { "document-type-name", "ftbp.document_type_name", + FT_STRING, BASE_NONE, NULL, 0, + "Contents-Type-Attribute/document-type/document-type-name", HFILL }}, + { &hf_ftbp_parameter, + { "parameter", "ftbp.parameter", + FT_NONE, BASE_NONE, NULL, 0, + "Contents-Type-Attribute/document-type/parameter", HFILL }}, + { &hf_ftbp_constraint_set_and_abstract_syntax, + { "constraint-set-and-abstract-syntax", "ftbp.constraint_set_and_abstract_syntax", + FT_NONE, BASE_NONE, NULL, 0, + "Contents-Type-Attribute/constraint-set-and-abstract-syntax", HFILL }}, + { &hf_ftbp_constraint_set_name, + { "constraint-set-name", "ftbp.constraint_set_name", + FT_STRING, BASE_NONE, NULL, 0, + "Contents-Type-Attribute/constraint-set-and-abstract-syntax/constraint-set-name", HFILL }}, + { &hf_ftbp_abstract_syntax_name, + { "abstract-syntax-name", "ftbp.abstract_syntax_name", + FT_STRING, BASE_NONE, NULL, 0, + "Contents-Type-Attribute/constraint-set-and-abstract-syntax/abstract-syntax-name", HFILL }}, + { &hf_ftbp_application_reference, + { "application-reference", "ftbp.application_reference", + FT_UINT32, BASE_DEC, VALS(ftbp_GeneralIdentifier_vals), 0, + "EnvironmentParameter/application-reference", HFILL }}, + { &hf_ftbp_machine, + { "machine", "ftbp.machine", + FT_UINT32, BASE_DEC, VALS(ftbp_GeneralIdentifier_vals), 0, + "EnvironmentParameter/machine", HFILL }}, + { &hf_ftbp_operating_system, + { "operating-system", "ftbp.operating_system", + FT_STRING, BASE_NONE, NULL, 0, + "EnvironmentParameter/operating-system", HFILL }}, + { &hf_ftbp_user_visible_string, + { "user-visible-string", "ftbp.user_visible_string", + FT_UINT32, BASE_DEC, NULL, 0, + "EnvironmentParameter/user-visible-string", HFILL }}, + { &hf_ftbp_user_visible_string_item, + { "Item", "ftbp.user_visible_string_item", + FT_STRING, BASE_NONE, NULL, 0, + "EnvironmentParameter/user-visible-string/_item", HFILL }}, + { &hf_ftbp_registered_identifier, + { "registered-identifier", "ftbp.registered_identifier", + FT_STRING, BASE_NONE, NULL, 0, + "GeneralIdentifier/registered-identifier", HFILL }}, + { &hf_ftbp_descriptive_identifier, + { "descriptive-identifier", "ftbp.descriptive_identifier", + FT_UINT32, BASE_DEC, NULL, 0, + "GeneralIdentifier/descriptive-identifier", HFILL }}, + { &hf_ftbp_descriptive_identifier_item, + { "Item", "ftbp.descriptive_identifier_item", + FT_STRING, BASE_NONE, NULL, 0, + "GeneralIdentifier/descriptive-identifier/_item", HFILL }}, + { &hf_ftbp_compression_algorithm_id, + { "compression-algorithm-id", "ftbp.compression_algorithm_id", + FT_STRING, BASE_NONE, NULL, 0, + "CompressionParameter/compression-algorithm-id", HFILL }}, + { &hf_ftbp_compression_algorithm_param, + { "compression-algorithm-param", "ftbp.compression_algorithm_param", + FT_NONE, BASE_NONE, NULL, 0, + "CompressionParameter/compression-algorithm-param", HFILL }}, + { &hf_ftbp_permitted_actions, + { "permitted-actions", "ftbp.permitted_actions", + FT_BYTES, BASE_HEX, NULL, 0, + "FileAttributes/permitted-actions", HFILL }}, + { &hf_ftbp_storage_account, + { "storage-account", "ftbp.storage_account", + FT_UINT32, BASE_DEC, VALS(ftbp_Account_Attribute_vals), 0, + "FileAttributes/storage-account", HFILL }}, + { &hf_ftbp_date_and_time_of_creation, + { "date-and-time-of-creation", "ftbp.date_and_time_of_creation", + FT_UINT32, BASE_DEC, VALS(ftam_Date_and_Time_Attribute_vals), 0, + "FileAttributes/date-and-time-of-creation", HFILL }}, + { &hf_ftbp_date_and_time_of_last_modification, + { "date-and-time-of-last-modification", "ftbp.date_and_time_of_last_modification", + FT_UINT32, BASE_DEC, VALS(ftam_Date_and_Time_Attribute_vals), 0, + "FileAttributes/date-and-time-of-last-modification", HFILL }}, + { &hf_ftbp_date_and_time_of_last_read_access, + { "date-and-time-of-last-read-access", "ftbp.date_and_time_of_last_read_access", + FT_UINT32, BASE_DEC, VALS(ftam_Date_and_Time_Attribute_vals), 0, + "FileAttributes/date-and-time-of-last-read-access", HFILL }}, + { &hf_ftbp_date_and_time_of_last_attribute_modification, + { "date-and-time-of-last-attribute-modification", "ftbp.date_and_time_of_last_attribute_modification", + FT_UINT32, BASE_DEC, VALS(ftam_Date_and_Time_Attribute_vals), 0, + "FileAttributes/date-and-time-of-last-attribute-modification", HFILL }}, + { &hf_ftbp_identity_of_creator, + { "identity-of-creator", "ftbp.identity_of_creator", + FT_UINT32, BASE_DEC, VALS(ftbp_User_Identity_Attribute_vals), 0, + "FileAttributes/identity-of-creator", HFILL }}, + { &hf_ftbp_identity_of_last_modifier, + { "identity-of-last-modifier", "ftbp.identity_of_last_modifier", + FT_UINT32, BASE_DEC, VALS(ftbp_User_Identity_Attribute_vals), 0, + "FileAttributes/identity-of-last-modifier", HFILL }}, + { &hf_ftbp_identity_of_last_reader, + { "identity-of-last-reader", "ftbp.identity_of_last_reader", + FT_UINT32, BASE_DEC, VALS(ftbp_User_Identity_Attribute_vals), 0, + "FileAttributes/identity-of-last-reader", HFILL }}, + { &hf_ftbp_identity_of_last_attribute_modifier, + { "identity-of-last-attribute-modifier", "ftbp.identity_of_last_attribute_modifier", + FT_UINT32, BASE_DEC, VALS(ftbp_User_Identity_Attribute_vals), 0, + "FileAttributes/identity-of-last-attribute-modifier", HFILL }}, + { &hf_ftbp_object_availability, + { "object-availability", "ftbp.object_availability", + FT_UINT32, BASE_DEC, VALS(ftam_Object_Availability_Attribute_vals), 0, + "FileAttributes/object-availability", HFILL }}, + { &hf_ftbp_object_size, + { "object-size", "ftbp.object_size", + FT_UINT32, BASE_DEC, VALS(ftam_Object_Size_Attribute_vals), 0, + "FileAttributes/object-size", HFILL }}, + { &hf_ftbp_future_object_size, + { "future-object-size", "ftbp.future_object_size", + FT_UINT32, BASE_DEC, VALS(ftam_Object_Size_Attribute_vals), 0, + "FileAttributes/future-object-size", HFILL }}, + { &hf_ftbp_access_control, + { "access-control", "ftbp.access_control", + FT_UINT32, BASE_DEC, VALS(ftbp_Access_Control_Attribute_vals), 0, + "FileAttributes/access-control", HFILL }}, + { &hf_ftbp_legal_qualifications, + { "legal-qualifications", "ftbp.legal_qualifications", + FT_UINT32, BASE_DEC, VALS(ftam_Legal_Qualification_Attribute_vals), 0, + "FileAttributes/legal-qualifications", HFILL }}, + { &hf_ftbp_private_use, + { "private-use", "ftbp.private_use", + FT_UINT32, BASE_DEC, VALS(ftam_Private_Use_Attribute_vals), 0, + "FileAttributes/private-use", HFILL }}, + { &hf_ftbp_attribute_extensions, + { "attribute-extensions", "ftbp.attribute_extensions", + FT_UINT32, BASE_DEC, NULL, 0, + "FileAttributes/attribute-extensions", HFILL }}, + { &hf_ftbp_incomplete_pathname, + { "incomplete-pathname", "ftbp.incomplete_pathname", + FT_UINT32, BASE_DEC, NULL, 0, + "Pathname-Attribute/incomplete-pathname", HFILL }}, + { &hf_ftbp_complete_pathname, + { "complete-pathname", "ftbp.complete_pathname", + FT_UINT32, BASE_DEC, NULL, 0, + "Pathname-Attribute/complete-pathname", HFILL }}, + { &hf_ftbp_no_value_available, + { "no-value-available", "ftbp.no_value_available", + FT_NONE, BASE_NONE, NULL, 0, + "", HFILL }}, + { &hf_ftbp_account_actual_values, + { "actual-values", "ftbp.actual_values", + FT_STRING, BASE_NONE, NULL, 0, + "Account-Attribute/actual-values", HFILL }}, + { &hf_ftbp_identity_actual_values, + { "actual-values", "ftbp.actual_values", + FT_STRING, BASE_NONE, NULL, 0, + "User-Identity-Attribute/actual-values", HFILL }}, + { &hf_ftbp_actual_values, + { "actual-values", "ftbp.actual_values", + FT_UINT32, BASE_DEC, NULL, 0, + "Access-Control-Attribute/actual-values", HFILL }}, + { &hf_ftbp_actual_values_item, + { "Item", "ftbp.actual_values_item", + FT_NONE, BASE_NONE, NULL, 0, + "Access-Control-Attribute/actual-values/_item", HFILL }}, + { &hf_ftbp_action_list, + { "action-list", "ftbp.action_list", + FT_BYTES, BASE_HEX, NULL, 0, + "Access-Control-Element/action-list", HFILL }}, + { &hf_ftbp_concurrency_access, + { "concurrency-access", "ftbp.concurrency_access", + FT_NONE, BASE_NONE, NULL, 0, + "Access-Control-Element/concurrency-access", HFILL }}, + { &hf_ftbp_identity, + { "identity", "ftbp.identity", + FT_STRING, BASE_NONE, NULL, 0, + "Access-Control-Element/identity", HFILL }}, + { &hf_ftbp_passwords, + { "passwords", "ftbp.passwords", + FT_NONE, BASE_NONE, NULL, 0, + "Access-Control-Element/passwords", HFILL }}, + { &hf_ftbp_location, + { "location", "ftbp.location", + FT_NONE, BASE_NONE, NULL, 0, + "Access-Control-Element/location", HFILL }}, + { &hf_ftbp_read_password, + { "read-password", "ftbp.read_password", + FT_UINT32, BASE_DEC, VALS(ftbp_Password_vals), 0, + "Access-Passwords/read-password", HFILL }}, + { &hf_ftbp_insert_password, + { "insert-password", "ftbp.insert_password", + FT_UINT32, BASE_DEC, VALS(ftbp_Password_vals), 0, + "Access-Passwords/insert-password", HFILL }}, + { &hf_ftbp_replace_password, + { "replace-password", "ftbp.replace_password", + FT_UINT32, BASE_DEC, VALS(ftbp_Password_vals), 0, + "Access-Passwords/replace-password", HFILL }}, + { &hf_ftbp_extend_password, + { "extend-password", "ftbp.extend_password", + FT_UINT32, BASE_DEC, VALS(ftbp_Password_vals), 0, + "Access-Passwords/extend-password", HFILL }}, + { &hf_ftbp_erase_password, + { "erase-password", "ftbp.erase_password", + FT_UINT32, BASE_DEC, VALS(ftbp_Password_vals), 0, + "Access-Passwords/erase-password", HFILL }}, + { &hf_ftbp_read_attribute_password, + { "read-attribute-password", "ftbp.read_attribute_password", + FT_UINT32, BASE_DEC, VALS(ftbp_Password_vals), 0, + "Access-Passwords/read-attribute-password", HFILL }}, + { &hf_ftbp_change_attribute_password, + { "change-attribute-password", "ftbp.change_attribute_password", + FT_UINT32, BASE_DEC, VALS(ftbp_Password_vals), 0, + "Access-Passwords/change-attribute-password", HFILL }}, + { &hf_ftbp_delete_password, + { "delete-password", "ftbp.delete_password", + FT_UINT32, BASE_DEC, VALS(ftbp_Password_vals), 0, + "Access-Passwords/delete-password", HFILL }}, + { &hf_ftbp_pass_passwords, + { "pass-passwords", "ftbp.pass_passwords", + FT_UINT32, BASE_DEC, NULL, 0, + "Access-Passwords/pass-passwords", HFILL }}, + { &hf_ftbp_link_password, + { "link-password", "ftbp.link_password", + FT_UINT32, BASE_DEC, VALS(ftbp_Password_vals), 0, + "Access-Passwords/link-password", HFILL }}, + { &hf_ftbp_graphic_string, + { "graphic-string", "ftbp.graphic_string", + FT_STRING, BASE_NONE, NULL, 0, + "Password/graphic-string", HFILL }}, + { &hf_ftbp_octet_string, + { "octet-string", "ftbp.octet_string", + FT_BYTES, BASE_HEX, NULL, 0, + "Password/octet-string", HFILL }}, + { &hf_ftbp_Pass_Passwords_item, + { "Item", "ftbp.Pass_Passwords_item", + FT_UINT32, BASE_DEC, VALS(ftbp_Password_vals), 0, + "Pass-Passwords/_item", HFILL }}, + { &hf_ftbp_ap_title, + { "ap-title", "ftbp.ap_title", + FT_UINT32, BASE_DEC, VALS(acse_AP_title_vals), 0, + "Application-Entity-Title/ap-title", HFILL }}, + { &hf_ftbp_ae_qualifier, + { "ae-qualifier", "ftbp.ae_qualifier", + FT_UINT32, BASE_DEC, VALS(acse_ASO_qualifier_vals), 0, + "Application-Entity-Title/ae-qualifier", HFILL }}, + { &hf_ftbp_Access_Request_read, + { "read", "ftbp.read", + FT_BOOLEAN, 8, NULL, 0x80, + "", HFILL }}, + { &hf_ftbp_Access_Request_insert, + { "insert", "ftbp.insert", + FT_BOOLEAN, 8, NULL, 0x40, + "", HFILL }}, + { &hf_ftbp_Access_Request_replace, + { "replace", "ftbp.replace", + FT_BOOLEAN, 8, NULL, 0x20, + "", HFILL }}, + { &hf_ftbp_Access_Request_extend, + { "extend", "ftbp.extend", + FT_BOOLEAN, 8, NULL, 0x10, + "", HFILL }}, + { &hf_ftbp_Access_Request_erase, + { "erase", "ftbp.erase", + FT_BOOLEAN, 8, NULL, 0x08, + "", HFILL }}, + { &hf_ftbp_Access_Request_read_attribute, + { "read-attribute", "ftbp.read-attribute", + FT_BOOLEAN, 8, NULL, 0x04, + "", HFILL }}, + { &hf_ftbp_Access_Request_change_attribute, + { "change-attribute", "ftbp.change-attribute", + FT_BOOLEAN, 8, NULL, 0x02, + "", HFILL }}, + { &hf_ftbp_Access_Request_delete_object, + { "delete-object", "ftbp.delete-object", + FT_BOOLEAN, 8, NULL, 0x01, + "", HFILL }}, + +/*--- End of included file: packet-ftbp-hfarr.c ---*/ + + }; + + /* List of subtrees */ + static gint *ett[] = { + &ett_ftbp, + +/*--- Included file: packet-ftbp-ettarr.c ---*/ + + &ett_ftbp_FileTransferParameters, + &ett_ftbp_FileTransferData, + &ett_ftbp_RelatedStoredFile, + &ett_ftbp_RelatedStoredFile_item, + &ett_ftbp_FileIdentifier, + &ett_ftbp_PathnameandVersion, + &ett_ftbp_CrossReference, + &ett_ftbp_MessageReference, + &ett_ftbp_Relationship, + &ett_ftbp_Contents_Type_Attribute, + &ett_ftbp_T_document_type, + &ett_ftbp_T_constraint_set_and_abstract_syntax, + &ett_ftbp_EnvironmentParameter, + &ett_ftbp_T_user_visible_string, + &ett_ftbp_GeneralIdentifier, + &ett_ftbp_T_descriptive_identifier, + &ett_ftbp_CompressionParameter, + &ett_ftbp_FileAttributes, + &ett_ftbp_Pathname_Attribute, + &ett_ftbp_Account_Attribute, + &ett_ftbp_User_Identity_Attribute, + &ett_ftbp_Access_Control_Attribute, + &ett_ftbp_SET_OF_Access_Control_Element, + &ett_ftbp_Access_Control_Element, + &ett_ftbp_Access_Request, + &ett_ftbp_Access_Passwords, + &ett_ftbp_Password, + &ett_ftbp_Pass_Passwords, + &ett_ftbp_Application_Entity_Title, + +/*--- End of included file: packet-ftbp-ettarr.c ---*/ + + }; + + /* Register protocol */ + proto_ftbp = proto_register_protocol(PNAME, PSNAME, PFNAME); + + /* Register fields and subtrees */ + proto_register_field_array(proto_ftbp, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); + +} + + +/*--- proto_reg_handoff_ftbp --- */ +void proto_reg_handoff_ftbp(void) { + +/*--- Included file: packet-ftbp-dis-tab.c ---*/ + + register_ber_oid_dissector("2.6.1.11.12", dissect_FileTransferParameters_PDU, proto_ftbp, "id-ep-file-transfer"); + register_ber_oid_dissector("2.6.1.4.12", dissect_FileTransferData_PDU, proto_ftbp, "id-et-file-transfer"); + + +/*--- End of included file: packet-ftbp-dis-tab.c ---*/ + + +} diff --git a/epan/dissectors/packet-ftbp.h b/epan/dissectors/packet-ftbp.h new file mode 100644 index 0000000000..8af964a2fb --- /dev/null +++ b/epan/dissectors/packet-ftbp.h @@ -0,0 +1,38 @@ +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* .\packet-ftbp.h */ +/* ../../tools/asn2eth.py -X -b -e -p ftbp -c ftbp.cnf -s packet-ftbp-template ftbp.asn */ + +/* Input file: packet-ftbp-template.h */ + +/* packet-ftbp.h + * Routines for File Transfer Body Part (FTBP) dissection (used in X.420 content) + * Graeme Lunt 2005 + * + * $Id$ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs <gerald@ethereal.com> + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef PACKET_FTBP_H +#define PACKET_FTBP_H + +/* #include "packet-ftbp-exp.h" */ + +#endif /* PACKET_FTBP_H */ diff --git a/epan/dissectors/packet-ldap.c b/epan/dissectors/packet-ldap.c index faaf6ef49f..60430258e8 100644 --- a/epan/dissectors/packet-ldap.c +++ b/epan/dissectors/packet-ldap.c @@ -3185,4 +3185,26 @@ proto_reg_handoff_ldap(void) gssapi_handle = find_dissector("gssapi"); gssapi_wrap_handle = find_dissector("gssapi_verf"); + +/* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dsml/dsml/ldap_controls_and_session_support.asp */ +register_ber_oid_name("1.2.840.113556.1.4.319","LDAP_PAGED_RESULT_OID_STRING"); +register_ber_oid_name("1.2.840.113556.1.4.417","LDAP_SERVER_SHOW_DELETED_OID"); +register_ber_oid_name("1.2.840.113556.1.4.473","LDAP_SERVER_SORT_OID"); +register_ber_oid_name("1.2.840.113556.1.4.521","LDAP_SERVER_CROSSDOM_MOVE_TARGET_OID"); +register_ber_oid_name("1.2.840.113556.1.4.528","LDAP_SERVER_NOTIFICATION_OID"); +register_ber_oid_name("1.2.840.113556.1.4.529","LDAP_SERVER_EXTENDED_DN_OID"); +register_ber_oid_name("1.2.840.113556.1.4.619","LDAP_SERVER_LAZY_COMMIT_OID"); +register_ber_oid_name("1.2.840.113556.1.4.801","LDAP_SERVER_SD_FLAGS_OID"); +register_ber_oid_name("1.2.840.113556.1.4.805","LDAP_SERVER_TREE_DELETE_OID"); +register_ber_oid_name("1.2.840.113556.1.4.841","LDAP_SERVER_DIRSYNC_OID"); +register_ber_oid_name("1.2.840.113556.1.4.970 ","None"); +register_ber_oid_name("1.2.840.113556.1.4.1338","LDAP_SERVER_VERIFY_NAME_OID"); +register_ber_oid_name("1.2.840.113556.1.4.1339","LDAP_SERVER_DOMAIN_SCOPE_OID"); +register_ber_oid_name("1.2.840.113556.1.4.1340","LDAP_SERVER_SEARCH_OPTIONS_OID"); +register_ber_oid_name("1.2.840.113556.1.4.1413","LDAP_SERVER_PERMISSIVE_MODIFY_OID"); +register_ber_oid_name("1.2.840.113556.1.4.1504","LDAP_SERVER_ASQ_OID"); +register_ber_oid_name("1.2.840.113556.1.4.1781","LDAP_SERVER_FAST_BIND_OID"); +register_ber_oid_name("1.3.6.1.4.1.1466.101.119.1","None"); +register_ber_oid_name("1.3.6.1.4.1.1466.20037","LDAP_START_TLS_OID"); +register_ber_oid_name("2.16.840.1.113730.3.4.9","LDAP_CONTROL_VLVREQUEST VLV"); } diff --git a/epan/dissectors/packet-ros.c b/epan/dissectors/packet-ros.c index c2ac071bdb..68b7cd1286 100644 --- a/epan/dissectors/packet-ros.c +++ b/epan/dissectors/packet-ros.c @@ -57,6 +57,8 @@ static struct SESSION_DATA_STRUCTURE* session = NULL; static proto_tree *top_tree=NULL; static guint32 opcode; +static dissector_handle_t ros_handle = NULL; + /*--- Included file: packet-ros-hf.c ---*/ @@ -72,17 +74,17 @@ static int hf_ros_unbind_result = -1; /* T_unbind_result */ static int hf_ros_unbind_error = -1; /* T_unbind_error */ static int hf_ros_invokeId = -1; /* InvokeId */ static int hf_ros_linkedId = -1; /* INTEGER */ -static int hf_ros_opcode = -1; /* INTEGER */ +static int hf_ros_opcode = -1; /* OperationCode */ static int hf_ros_argument = -1; /* T_argument */ static int hf_ros_result = -1; /* T_result */ -static int hf_ros_result1 = -1; /* T_result1 */ -static int hf_ros_errcode = -1; /* INTEGER */ +static int hf_ros_operationResult = -1; /* OperationResult */ +static int hf_ros_errcode = -1; /* ErrorCode */ static int hf_ros_parameter = -1; /* T_parameter */ static int hf_ros_problem = -1; /* T_problem */ static int hf_ros_general = -1; /* GeneralProblem */ -static int hf_ros_invoke1 = -1; /* InvokeProblem */ -static int hf_ros_returnResult1 = -1; /* ReturnResultProblem */ -static int hf_ros_returnError1 = -1; /* ReturnErrorProblem */ +static int hf_ros_invokeProblem = -1; /* InvokeProblem */ +static int hf_ros_rejectResult = -1; /* ReturnResultProblem */ +static int hf_ros_rejectError = -1; /* ReturnErrorProblem */ static int hf_ros_present = -1; /* INTEGER */ static int hf_ros_absent = -1; /* NULL */ static int hf_ros_local = -1; /* INTEGER */ @@ -114,10 +116,14 @@ static GHashTable *oid_table=NULL; static gint ett_ros_unknown = -1; void -register_ros_oid_dissector_handle(const char *oid, dissector_handle_t dissector, int proto _U_, const char *name) +register_ros_oid_dissector_handle(const char *oid, dissector_handle_t dissector, int proto _U_, const char *name, gboolean uses_rtse) { dissector_add_string("ros.oid", oid, dissector); g_hash_table_insert(oid_table, (gpointer)oid, (gpointer)name); + + if(!uses_rtse) + /* if we are not using RTSE, then we must register ROS with BER (ACSE) */ + register_ber_oid_dissector_handle(oid, ros_handle, proto, name); } static int @@ -130,7 +136,7 @@ call_ros_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info *p proto_item *item=NULL; proto_tree *next_tree=NULL; - item=proto_tree_add_text(tree, next_tvb, 0, tvb_length_remaining(tvb, offset), "RTSE: Dissector for OID:%s not implemented. Contact Ethereal developers if you want this supported", oid); + item=proto_tree_add_text(tree, next_tvb, 0, tvb_length_remaining(tvb, offset), "ROS: Dissector for OID:%s not implemented. Contact Ethereal developers if you want this supported", oid); if(item){ next_tree=proto_item_add_subtree(item, ett_ros_unknown); } @@ -164,12 +170,6 @@ dissect_ros_INTEGER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet static int dissect_linkedId_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { return dissect_ros_INTEGER(TRUE, tvb, offset, pinfo, tree, hf_ros_linkedId); } -static int dissect_opcode(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { - return dissect_ros_INTEGER(FALSE, tvb, offset, pinfo, tree, hf_ros_opcode); -} -static int dissect_errcode(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { - return dissect_ros_INTEGER(FALSE, tvb, offset, pinfo, tree, hf_ros_errcode); -} static int dissect_present(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { return dissect_ros_INTEGER(FALSE, tvb, offset, pinfo, tree, hf_ros_present); } @@ -217,6 +217,21 @@ static int dissect_invokeId(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, static int +dissect_ros_OperationCode(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + + offset = dissect_ber_integer(FALSE, pinfo, tree, tvb, offset, hf_index, + &opcode); + + + return offset; +} +static int dissect_opcode(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ros_OperationCode(FALSE, tvb, offset, pinfo, tree, hf_ros_opcode); +} + + + +static int dissect_ros_T_argument(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { char *oid; /* not sure what the length should be - -1 for now */ @@ -260,7 +275,7 @@ static int dissect_invoke_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *t static int -dissect_ros_T_result1(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +dissect_ros_OperationResult(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { char *oid; /* not sure what the length should be - -1 for now */ proto_tree_add_text(tree, tvb, offset,-1, "return result"); @@ -276,14 +291,14 @@ dissect_ros_T_result1(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, pack return offset; } -static int dissect_result1(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { - return dissect_ros_T_result1(FALSE, tvb, offset, pinfo, tree, hf_ros_result1); +static int dissect_operationResult(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ros_OperationResult(FALSE, tvb, offset, pinfo, tree, hf_ros_operationResult); } static const ber_sequence_t T_result_sequence[] = { { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_opcode }, - { BER_CLASS_ANY, 0, BER_FLAGS_NOOWNTAG, dissect_result1 }, + { BER_CLASS_ANY, 0, BER_FLAGS_NOOWNTAG, dissect_operationResult }, { 0, 0, 0, NULL } }; @@ -319,6 +334,21 @@ static int dissect_returnResult_impl(packet_info *pinfo, proto_tree *tree, tvbuf static int +dissect_ros_ErrorCode(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + + offset = dissect_ber_integer(FALSE, pinfo, tree, tvb, offset, hf_index, + &opcode); + + + return offset; +} +static int dissect_errcode(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ros_ErrorCode(FALSE, tvb, offset, pinfo, tree, hf_ros_errcode); +} + + + +static int dissect_ros_T_parameter(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { char *oid; /* not sure what the length should be - -1 for now */ @@ -400,8 +430,8 @@ dissect_ros_InvokeProblem(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, return offset; } -static int dissect_invoke1_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { - return dissect_ros_InvokeProblem(TRUE, tvb, offset, pinfo, tree, hf_ros_invoke1); +static int dissect_invokeProblem_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ros_InvokeProblem(TRUE, tvb, offset, pinfo, tree, hf_ros_invokeProblem); } @@ -420,8 +450,8 @@ dissect_ros_ReturnResultProblem(gboolean implicit_tag _U_, tvbuff_t *tvb, int of return offset; } -static int dissect_returnResult1_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { - return dissect_ros_ReturnResultProblem(TRUE, tvb, offset, pinfo, tree, hf_ros_returnResult1); +static int dissect_rejectResult_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ros_ReturnResultProblem(TRUE, tvb, offset, pinfo, tree, hf_ros_rejectResult); } @@ -442,8 +472,8 @@ dissect_ros_ReturnErrorProblem(gboolean implicit_tag _U_, tvbuff_t *tvb, int off return offset; } -static int dissect_returnError1_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { - return dissect_ros_ReturnErrorProblem(TRUE, tvb, offset, pinfo, tree, hf_ros_returnError1); +static int dissect_rejectError_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_ros_ReturnErrorProblem(TRUE, tvb, offset, pinfo, tree, hf_ros_rejectError); } @@ -457,9 +487,9 @@ static const value_string ros_T_problem_vals[] = { static const ber_choice_t T_problem_choice[] = { { 0, BER_CLASS_CON, 0, 0, dissect_general_impl }, - { 1, BER_CLASS_CON, 1, 0, dissect_invoke1_impl }, - { 2, BER_CLASS_CON, 2, 0, dissect_returnResult1_impl }, - { 3, BER_CLASS_CON, 3, 0, dissect_returnError1_impl }, + { 1, BER_CLASS_CON, 1, 0, dissect_invokeProblem_impl }, + { 2, BER_CLASS_CON, 2, 0, dissect_rejectResult_impl }, + { 3, BER_CLASS_CON, 3, 0, dissect_rejectError_impl }, { 0, 0, 0, 0, NULL } }; @@ -695,8 +725,7 @@ dissect_ros_RejectProblem(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, static int dissect_ros_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { - offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, - NULL); + offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL); return offset; } @@ -857,7 +886,7 @@ void proto_register_ros(void) { { "result", "ros.result", FT_NONE, BASE_NONE, NULL, 0, "ReturnResult/result", HFILL }}, - { &hf_ros_result1, + { &hf_ros_operationResult, { "result", "ros.result", FT_NONE, BASE_NONE, NULL, 0, "ReturnResult/result/result", HFILL }}, @@ -877,15 +906,15 @@ void proto_register_ros(void) { { "general", "ros.general", FT_INT32, BASE_DEC, VALS(ros_GeneralProblem_vals), 0, "Reject/problem/general", HFILL }}, - { &hf_ros_invoke1, + { &hf_ros_invokeProblem, { "invoke", "ros.invoke", FT_INT32, BASE_DEC, VALS(ros_InvokeProblem_vals), 0, "Reject/problem/invoke", HFILL }}, - { &hf_ros_returnResult1, + { &hf_ros_rejectResult, { "returnResult", "ros.returnResult", FT_INT32, BASE_DEC, VALS(ros_ReturnResultProblem_vals), 0, "Reject/problem/returnResult", HFILL }}, - { &hf_ros_returnError1, + { &hf_ros_rejectError, { "returnError", "ros.returnError", FT_INT32, BASE_DEC, VALS(ros_ReturnErrorProblem_vals), 0, "Reject/problem/returnError", HFILL }}, @@ -945,4 +974,7 @@ void proto_register_ros(void) { /*--- proto_reg_handoff_ros --- */ void proto_reg_handoff_ros(void) { + + ros_handle = find_dissector("ros"); + } diff --git a/epan/dissectors/packet-ros.h b/epan/dissectors/packet-ros.h index e7e44adbd1..adb24e9702 100644 --- a/epan/dissectors/packet-ros.h +++ b/epan/dissectors/packet-ros.h @@ -63,6 +63,6 @@ int dissect_ros_Code(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_in # define ROS_OP_OPCODE_MASK (~ROS_OP_MASK) -void register_ros_oid_dissector_handle(const char *oid, dissector_handle_t dissector, int proto _U_, const char *name); +void register_ros_oid_dissector_handle(const char *oid, dissector_handle_t dissector, int proto _U_, const char *name, gboolean uses_rtse); #endif /* PACKET_ROS_H */ diff --git a/epan/dissectors/packet-rtse.c b/epan/dissectors/packet-rtse.c index 0a31ddab6a..5852d5d441 100644 --- a/epan/dissectors/packet-rtse.c +++ b/epan/dissectors/packet-rtse.c @@ -1,6 +1,6 @@ /* Do not modify this file. */ /* It is created automatically by the ASN.1 to Ethereal dissector compiler */ -/* ./packet-rtse.c */ +/* .\packet-rtse.c */ /* ../../tools/asn2eth.py -X -b -e -p rtse -c rtse.cnf -s packet-rtse-template rtse.asn */ /* Input file: packet-rtse-template.c */ @@ -64,7 +64,10 @@ static guint32 app_proto=0; static proto_tree *top_tree=NULL; -int dissect_rtse_EXTERNAL(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_); +static dissector_handle_t rtse_handle = NULL; +static dissector_handle_t ros_handle = NULL; + +static int dissect_rtse_EXTERNAL(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_); @@ -130,10 +133,26 @@ static GHashTable *oid_table=NULL; static gint ett_rtse_unknown = -1; void -register_rtse_oid_dissector_handle(const char *oid, dissector_handle_t dissector, int proto _U_, const char *name) +register_rtse_oid_dissector_handle(const char *oid, dissector_handle_t dissector, int proto _U_, const char *name, gboolean uses_ros) { - dissector_add_string("rtse.oid", oid, dissector); - g_hash_table_insert(oid_table, (gpointer)oid, (gpointer)name); + + /* save the name - but not used */ + g_hash_table_insert(oid_table, (gpointer)oid, (gpointer)name); + + /* register RTSE with the BER (ACSE) */ + register_ber_oid_dissector_handle(oid, rtse_handle, proto, name); + + if(uses_ros) { + /* make sure we call ROS ... */ + dissector_add_string("rtse.oid", oid, ros_handle); + + /* and then tell ROS how to dissect the AS*/ + register_ros_oid_dissector_handle(oid, dissector, proto, name, TRUE); + + } else { + /* otherwise we just remember how to dissect the AS */ + dissector_add_string("rtse.oid", oid, dissector); + } } static int @@ -467,7 +486,30 @@ static int dissect_refuseReason_impl(packet_info *pinfo, proto_tree *tree, tvbuf static int dissect_rtse_T_userDataRJ(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { -/*XXX not implemented yet */ + char *oid = NULL; + + switch(app_proto) { + case 1: /* mts-transfer-protocol-1984 */ + oid = "applicationProtocol.1"; + break; + case 12: /* mts-transfer-protocol */ + oid = "applicationProtocol.12"; + break; + default: + if(session && session->pres_ctx_id) + oid = find_oid_by_pres_ctx_id(pinfo, session->pres_ctx_id); + break; + } + + if(!oid) /* XXX: problem here is we haven't decoded the applicationProtocol yet - so we make assumptions! */ + oid = "applicationProtocol.12"; + + if(oid) { + if((session = (struct SESSION_DATA_STRUCTURE*)(pinfo->private_data)) != NULL) + session->ros_op = (ROS_OP_BIND | ROS_OP_ERROR); + + offset = call_rtse_oid_callback(oid, tvb, offset, pinfo, top_tree ? top_tree : tree); + } return offset; @@ -988,4 +1030,7 @@ void proto_register_rtse(void) { /*--- proto_reg_handoff_rtse --- */ void proto_reg_handoff_rtse(void) { + + rtse_handle = find_dissector("rtse"); + ros_handle = find_dissector("ros"); } diff --git a/epan/dissectors/packet-rtse.h b/epan/dissectors/packet-rtse.h index 2757ebf0d6..32e25ebb39 100644 --- a/epan/dissectors/packet-rtse.h +++ b/epan/dissectors/packet-rtse.h @@ -1,6 +1,6 @@ /* Do not modify this file. */ /* It is created automatically by the ASN.1 to Ethereal dissector compiler */ -/* ./packet-rtse.h */ +/* .\packet-rtse.h */ /* ../../tools/asn2eth.py -X -b -e -p rtse -c rtse.cnf -s packet-rtse-template rtse.asn */ /* Input file: packet-rtse-template.h */ @@ -45,6 +45,6 @@ int dissect_rtse_EXTERNAL(gboolean implicit_tag, tvbuff_t *tvb, int offset, pack /*--- End of included file: packet-rtse-exp.h ---*/ -void register_rtse_oid_dissector_handle(const char *oid, dissector_handle_t dissector, int proto _U_, const char *name); +void register_rtse_oid_dissector_handle(const char *oid, dissector_handle_t dissector, int proto _U_, const char *name, gboolean uses_ros); #endif /* PACKET_RTSE_H */ diff --git a/epan/dissectors/packet-s4406.c b/epan/dissectors/packet-s4406.c index 1f52713052..34c6166e5e 100644 --- a/epan/dissectors/packet-s4406.c +++ b/epan/dissectors/packet-s4406.c @@ -1,6 +1,6 @@ /* Do not modify this file. */ /* It is created automatically by the ASN.1 to Ethereal dissector compiler */ -/* ./packet-s4406.c */ +/* .\packet-s4406.c */ /* ../../tools/asn2eth.py -X -b -e -p s4406 -c s4406.cnf -s packet-s4406-template s4406.asn */ /* Input file: packet-s4406-template.c */ @@ -49,7 +49,7 @@ #include "packet-x411.h" #include "packet-x420.h" -#define PNAME "STANAG 4406 Military Message Extensions" +#define PNAME "STANAG 4406 Military Message" #define PSNAME "STANAG 4406" #define PFNAME "s4406" @@ -208,8 +208,7 @@ static int dissect_sics_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb static int dissect_s4406_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { - offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, - NULL); + offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL); return offset; } @@ -222,6 +221,7 @@ static int dissect_dist_type(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb static int dissect_s4406_T_dist_value(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { /* XXX: not implemented */ + return offset; } static int dissect_dist_value(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { @@ -695,6 +695,29 @@ static void dissect_SecurityInformationLabels_PDU(tvbuff_t *tvb, packet_info *pi +/* +* Dissect STANAG 4406 PDUs inside a PPDU. +*/ +static void +dissect_s4406(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) +{ + int offset = 0; + proto_item *item=NULL; + proto_tree *tree=NULL; + + if(parent_tree){ + item = proto_tree_add_item(parent_tree, proto_s4406, tvb, 0, -1, FALSE); + tree = proto_item_add_subtree(item, ett_s4406); + } + + if (check_col(pinfo->cinfo, COL_PROTOCOL)) + col_set_str(pinfo->cinfo, COL_PROTOCOL, "S4406"); + if (check_col(pinfo->cinfo, COL_INFO)) + col_add_str(pinfo->cinfo, COL_INFO, "Military"); + + dissect_x420_InformationObject(TRUE, tvb, offset, pinfo , tree, -1); +} + /*--- proto_register_s4406 -------------------------------------------*/ @@ -945,4 +968,5 @@ void proto_reg_handoff_s4406(void) { /*--- End of included file: packet-s4406-dis-tab.c ---*/ + register_ber_oid_dissector("1.3.26.0.4406.0.4.1", dissect_s4406, proto_s4406, "Military Message"); } diff --git a/epan/dissectors/packet-s4406.h b/epan/dissectors/packet-s4406.h index b6cf164ecf..14caf7ee91 100644 --- a/epan/dissectors/packet-s4406.h +++ b/epan/dissectors/packet-s4406.h @@ -1,6 +1,6 @@ /* Do not modify this file. */ /* It is created automatically by the ASN.1 to Ethereal dissector compiler */ -/* ./packet-s4406.h */ +/* .\packet-s4406.h */ /* ../../tools/asn2eth.py -X -b -e -p s4406 -c s4406.cnf -s packet-s4406-template s4406.asn */ /* Input file: packet-s4406-template.h */ diff --git a/epan/dissectors/packet-x411.c b/epan/dissectors/packet-x411.c index 9a3b01bae5..b0b76b51c2 100644 --- a/epan/dissectors/packet-x411.c +++ b/epan/dissectors/packet-x411.c @@ -1,6 +1,6 @@ /* Do not modify this file. */ /* It is created automatically by the ASN.1 to Ethereal dissector compiler */ -/* ./packet-x411.c */ +/* .\packet-x411.c */ /* ../../tools/asn2eth.py -X -b -e -p x411 -c x411.cnf -s packet-x411-template x411.asn */ /* Input file: packet-x411-template.c */ @@ -53,7 +53,7 @@ #include "packet-x411.h" -#define PNAME "X.411 OSI Message Transfer Service" +#define PNAME "X.411 Message Transfer Service" #define PSNAME "X411" #define PFNAME "x411" @@ -63,12 +63,19 @@ int proto_x411 = -1; static struct SESSION_DATA_STRUCTURE* session = NULL; static int extension_id = 0; /* integer extension id */ static char object_identifier_id[BER_MAX_OID_STR_LEN]; /* content type identifier */ + +static proto_tree *top_tree=NULL; + static int call_x411_oid_callback(char *base_oid, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree); /*--- Included file: packet-x411-hf.c ---*/ +static int hf_x411_MTABindArgument_PDU = -1; /* MTABindArgument */ +static int hf_x411_MTABindResult_PDU = -1; /* MTABindResult */ +static int hf_x411_MTABindError_PDU = -1; /* MTABindError */ +static int hf_x411_MTS_APDU_PDU = -1; /* MTS_APDU */ static int hf_x411_InternalTraceInformation_PDU = -1; /* InternalTraceInformation */ static int hf_x411_TraceInformation_PDU = -1; /* TraceInformation */ static int hf_x411_RecipientReassignmentProhibited_PDU = -1; /* RecipientReassignmentProhibited */ @@ -712,9 +719,17 @@ static int dissect_empty_result(packet_info *pinfo, proto_tree *tree, tvbuff_t * static int dissect_x411_MTAName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { - offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_IA5String, + tvbuff_t *mtaname; + + offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_IA5String, pinfo, tree, tvb, offset, hf_index, - NULL); + &mtaname); + + + if (check_col(pinfo->cinfo, COL_INFO)) { + col_append_fstr(pinfo->cinfo, COL_INFO, " %s", tvb_get_string(mtaname, 0, tvb_length(mtaname))); + } + return offset; } @@ -1556,11 +1571,9 @@ static int dissect_built_in_domain_defined_attributes(packet_info *pinfo, proto_ static int dissect_x411_INTEGER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { - offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, &extension_id); - return offset; } static int dissect_messages_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { @@ -1900,9 +1913,10 @@ static int dissect_x411_BuiltInContentType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { guint32 ict = -1; - offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, + offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, &ict); + /* convert integer content type to oid for dispatch when the content is found */ switch(ict) { case 2: @@ -1929,10 +1943,7 @@ static int dissect_built_in_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t static int dissect_x411_ExtendedContentType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { - offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, - hf_index, object_identifier_id); - - + offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, object_identifier_id); return offset; } @@ -2546,7 +2557,7 @@ dissect_x411_Content(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packe offset = dissect_ber_octet_string(FALSE, pinfo, tree, tvb, offset, hf_index, &next_tvb); if (next_tvb) - (void) call_ber_oid_callback(object_identifier_id, next_tvb, 0, pinfo, tree); + (void) call_ber_oid_callback(object_identifier_id, next_tvb, 0, pinfo, top_tree ? top_tree : tree); return offset; @@ -6291,6 +6302,18 @@ dissect_x411_NonBasicParameters(gboolean implicit_tag _U_, tvbuff_t *tvb, int of /*--- PDUs ---*/ +static void dissect_MTABindArgument_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { + dissect_x411_MTABindArgument(FALSE, tvb, 0, pinfo, tree, hf_x411_MTABindArgument_PDU); +} +static void dissect_MTABindResult_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { + dissect_x411_MTABindResult(FALSE, tvb, 0, pinfo, tree, hf_x411_MTABindResult_PDU); +} +static void dissect_MTABindError_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { + dissect_x411_MTABindError(FALSE, tvb, 0, pinfo, tree, hf_x411_MTABindError_PDU); +} +static void dissect_MTS_APDU_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { + dissect_x411_MTS_APDU(FALSE, tvb, 0, pinfo, tree, hf_x411_MTS_APDU_PDU); +} static void dissect_InternalTraceInformation_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { dissect_x411_InternalTraceInformation(FALSE, tvb, 0, pinfo, tree, hf_x411_InternalTraceInformation_PDU); } @@ -6434,11 +6457,14 @@ static void dissect_PhysicalDeliveryOfficeName_PDU(tvbuff_t *tvb, packet_info *p static int call_x411_oid_callback(char *base_oid, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { - + char *name = NULL; char extension_oid[BER_MAX_OID_STR_LEN]; sprintf(extension_oid, "%s.%d", base_oid, extension_id); + name = get_ber_oid_name(extension_oid); + proto_item_append_text(tree, " (%s)", name ? name : extension_oid); + return call_ber_oid_callback(extension_oid, tvb, offset, pinfo, tree); } @@ -6456,6 +6482,10 @@ dissect_x411(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) proto_tree *tree=NULL; int (*x411_dissector)(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) = NULL; char *x411_op_name; + int hf_x411_index; + + /* save parent_tree so subdissectors can create new top nodes */ + top_tree=parent_tree; /* do we have operation information from the ROS dissector? */ if( !pinfo->private_data ){ @@ -6473,22 +6503,30 @@ dissect_x411(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) tree = proto_item_add_subtree(item, ett_x411); } if (check_col(pinfo->cinfo, COL_PROTOCOL)) - col_set_str(pinfo->cinfo, COL_PROTOCOL, "X411"); + col_set_str(pinfo->cinfo, COL_PROTOCOL, "P1"); if (check_col(pinfo->cinfo, COL_INFO)) col_clear(pinfo->cinfo, COL_INFO); switch(session->ros_op & ROS_OP_MASK) { case (ROS_OP_BIND | ROS_OP_ARGUMENT): /* BindInvoke */ x411_dissector = dissect_x411_MTABindArgument; - x411_op_name = "MTA-Bind-Argument"; + x411_op_name = "Bind-Argument"; + hf_x411_index = hf_x411_MTABindArgument_PDU; break; case (ROS_OP_BIND | ROS_OP_RESULT): /* BindResult */ x411_dissector = dissect_x411_MTABindResult; - x411_op_name = "MTA-Bind-Result"; + x411_op_name = "Bind-Result"; + hf_x411_index = hf_x411_MTABindResult_PDU; + break; + case (ROS_OP_BIND | ROS_OP_ERROR): /* BindError */ + x411_dissector = dissect_x411_MTABindError; + x411_op_name = "Bind-Error"; + hf_x411_index = hf_x411_MTABindError_PDU; break; case (ROS_OP_INVOKE | ROS_OP_ARGUMENT): /* Invoke Argument */ x411_dissector = dissect_x411_MTS_APDU; - x411_op_name = "MTA-Transfer"; + x411_op_name = "Transfer"; + hf_x411_index = hf_x411_MTS_APDU_PDU; break; default: proto_tree_add_text(tree, tvb, offset, -1,"Unsupported X411 PDU"); @@ -6500,7 +6538,7 @@ dissect_x411(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) while (tvb_reported_length_remaining(tvb, offset) > 0){ old_offset=offset; - offset=(*x411_dissector)(TRUE, tvb, offset, pinfo , tree, -1); + offset=(*x411_dissector)(FALSE, tvb, offset, pinfo , tree, hf_x411_index); if(offset == old_offset){ proto_tree_add_text(tree, tvb, offset, -1,"Internal error, zero-byte X411 PDU"); offset = tvb_length(tvb); @@ -6519,6 +6557,22 @@ void proto_register_x411(void) { /*--- Included file: packet-x411-hfarr.c ---*/ + { &hf_x411_MTABindArgument_PDU, + { "MTABindArgument", "x411.MTABindArgument", + FT_UINT32, BASE_DEC, VALS(x411_MTABindArgument_vals), 0, + "MTABindArgument", HFILL }}, + { &hf_x411_MTABindResult_PDU, + { "MTABindResult", "x411.MTABindResult", + FT_UINT32, BASE_DEC, VALS(x411_MTABindResult_vals), 0, + "MTABindResult", HFILL }}, + { &hf_x411_MTABindError_PDU, + { "MTABindError", "x411.MTABindError", + FT_UINT32, BASE_DEC, VALS(x411_MTABindError_vals), 0, + "MTABindError", HFILL }}, + { &hf_x411_MTS_APDU_PDU, + { "MTS-APDU", "x411.MTS_APDU", + FT_UINT32, BASE_DEC, VALS(x411_MTS_APDU_vals), 0, + "MTS-APDU", HFILL }}, { &hf_x411_InternalTraceInformation_PDU, { "InternalTraceInformation", "x411.InternalTraceInformation", FT_UINT32, BASE_DEC, NULL, 0, @@ -8412,26 +8466,18 @@ void proto_reg_handoff_x411(void) { /*--- End of included file: packet-x411-dis-tab.c ---*/ - register_ber_oid_name("2.6.0.1.6", "id-ac-mts-transfer"); + /* APPLICATION CONTEXT */ - /* we register RTSE with BER (which is used by ACSE) */ - if((handle = find_dissector("rtse")) != NULL) { - register_ber_oid_dissector_handle("2.6.0.2.12", handle, 0 , "id-as-mta-rtse"); - register_ber_oid_dissector_handle("2.6.0.2.7", handle, 0 , "id-as-mtse"); - } + register_ber_oid_name("2.6.0.1.6", "id-ac-mts-transfer"); - /* then register ROS with RTSE */ - if((handle = find_dissector("ros")) != NULL) { - register_rtse_oid_dissector_handle("2.6.0.2.12", handle, 0 , "id-as-mta-rtse"); - } + /* ABSTRACT SYNTAXES */ - /* and then finally X411 with ROS and RTSE */ if((handle = find_dissector("x411")) != NULL) { - register_ros_oid_dissector_handle("2.6.0.2.12", handle, 0, "id-as-mta-rtse"); - register_rtse_oid_dissector_handle("2.6.0.2.7", handle, 0, "id-as-mtse"); + register_rtse_oid_dissector_handle("2.6.0.2.12", handle, 0, "id-as-mta-rtse", TRUE); + register_rtse_oid_dissector_handle("2.6.0.2.7", handle, 0, "id-as-mtse", FALSE); - register_rtse_oid_dissector_handle("applicationProtocol.1", handle, 0, "mts-transfer-protocol-1984"); - register_rtse_oid_dissector_handle("applicationProtocol.12", handle, 0, "mta-transfer-protocol"); + register_rtse_oid_dissector_handle("applicationProtocol.1", handle, 0, "mts-transfer-protocol-1984", FALSE); + register_rtse_oid_dissector_handle("applicationProtocol.12", handle, 0, "mta-transfer-protocol", FALSE); } diff --git a/epan/dissectors/packet-x411.h b/epan/dissectors/packet-x411.h index 4477b3c394..cde0bd7408 100644 --- a/epan/dissectors/packet-x411.h +++ b/epan/dissectors/packet-x411.h @@ -1,6 +1,6 @@ /* Do not modify this file. */ /* It is created automatically by the ASN.1 to Ethereal dissector compiler */ -/* ./packet-x411.h */ +/* .\packet-x411.h */ /* ../../tools/asn2eth.py -X -b -e -p x411 -c x411.cnf -s packet-x411-template x411.asn */ /* Input file: packet-x411-template.h */ diff --git a/epan/dissectors/packet-x420.c b/epan/dissectors/packet-x420.c index bf83bb8ab8..f711388dc6 100644 --- a/epan/dissectors/packet-x420.c +++ b/epan/dissectors/packet-x420.c @@ -50,7 +50,7 @@ #include "packet-x420.h" -#define PNAME "X.420 OSI Information Object" +#define PNAME "X.420 Information Object" #define PSNAME "X420" #define PFNAME "x420" @@ -62,6 +62,9 @@ static char object_identifier_id[BER_MAX_OID_STR_LEN]; /* content type identifie /*--- Included file: packet-x420-hf.c ---*/ +static int hf_x420_AbsenceAdvice_PDU = -1; /* AbsenceAdvice */ +static int hf_x420_ChangeOfAddressAdvice_PDU = -1; /* ChangeOfAddressAdvice */ +static int hf_x420_IPMAssemblyInstructions_PDU = -1; /* IPMAssemblyInstructions */ static int hf_x420_OriginatingUA_PDU = -1; /* OriginatingUA */ static int hf_x420_ipm = -1; /* IPM */ static int hf_x420_ipn = -1; /* IPN */ @@ -231,7 +234,6 @@ static gint ett_x420_MessageBodyPart = -1; static gint ett_x420_MessageParameters = -1; static gint ett_x420_IPN = -1; static gint ett_x420_T_choice = -1; -static gint ett_x420_CommonFields = -1; static gint ett_x420_NonReceiptFields = -1; static gint ett_x420_ReceiptFields = -1; static gint ett_x420_NotificationExtensionsField = -1; @@ -483,9 +485,13 @@ static int dissect_telex_compatible_impl(packet_info *pinfo, proto_tree *tree, t static int dissect_x420_T_type(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + char *name = NULL; - offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, - object_identifier_id); + offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, object_identifier_id); + + + name = get_ber_oid_name(object_identifier_id); + proto_item_append_text(tree, " (%s)", name ? name : object_identifier_id); return offset; @@ -849,7 +855,7 @@ static const ber_sequence_t ExtensionsField_set_of[1] = { { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ExtensionsField_item }, }; -static int +int dissect_x420_ExtensionsField(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset, ExtensionsField_set_of, hf_index, ett_x420_ExtensionsField); @@ -1044,6 +1050,7 @@ static int dissect_g3_facsimile_impl(packet_info *pinfo, proto_tree *tree, tvbuf static int dissect_x420_Interchange_Data_Element(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +/*ARGSUSED*/ /* XXX Not implemented yet */ @@ -1340,6 +1347,7 @@ static int dissect_bilaterally_defined_impl(packet_info *pinfo, proto_tree *tree static int dissect_x420_NationallyDefinedBodyPart(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +/*ARGSUSED*/ /* XXX Not implemented yet */ @@ -1438,9 +1446,15 @@ static const ber_sequence_t IPM_sequence[] = { static int dissect_x420_IPM(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { - offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, + + offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, IPM_sequence, hf_index, ett_x420_IPM); + if((hf_index == hf_x420_ipm) && check_col(pinfo->cinfo, COL_INFO)) + col_append_fstr(pinfo->cinfo, COL_INFO, " Message"); + + + return offset; } @@ -1755,9 +1769,14 @@ static const ber_sequence_t IPN_set[] = { static int dissect_x420_IPN(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { - offset = dissect_ber_set(implicit_tag, pinfo, tree, tvb, offset, + + offset = dissect_ber_set(implicit_tag, pinfo, tree, tvb, offset, IPN_set, hf_index, ett_x420_IPN); + if((hf_index == hf_x420_ipn) && check_col(pinfo->cinfo, COL_INFO)) + col_append_fstr(pinfo->cinfo, COL_INFO, " Notification"); + + return offset; } static int dissect_ipn_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { @@ -1765,7 +1784,7 @@ static int dissect_ipn_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, } -static const value_string x420_InformationObject_vals[] = { +const value_string x420_InformationObject_vals[] = { { 0, "ipm" }, { 1, "ipn" }, { 0, NULL } @@ -1777,7 +1796,7 @@ static const ber_choice_t InformationObject_choice[] = { { 0, 0, 0, 0, NULL } }; -static int +int dissect_x420_InformationObject(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { offset = dissect_ber_choice(pinfo, tree, tvb, offset, InformationObject_choice, hf_index, ett_x420_InformationObject, @@ -1787,24 +1806,6 @@ dissect_x420_InformationObject(gboolean implicit_tag _U_, tvbuff_t *tvb, int off } -static const ber_sequence_t CommonFields_set[] = { - { BER_CLASS_APP, 11, BER_FLAGS_NOOWNTAG, dissect_subject_ipm }, - { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ipn_originator_impl }, - { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_ipm_intended_recipient_impl }, - { BER_CLASS_APP, 5, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_conversion_eits }, - { BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_notification_extensions_impl }, - { 0, 0, 0, NULL } -}; - -static int -dissect_x420_CommonFields(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { - offset = dissect_ber_set(implicit_tag, pinfo, tree, tvb, offset, - CommonFields_set, hf_index, ett_x420_CommonFields); - - return offset; -} - - static const ber_sequence_t AbsenceAdvice_sequence[] = { { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_advice }, { BER_CLASS_UNI, BER_UNI_TAG_UTCTime, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_next_available }, @@ -1959,6 +1960,15 @@ dissect_x420_OriginatingUA(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, /*--- PDUs ---*/ +static void dissect_AbsenceAdvice_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { + dissect_x420_AbsenceAdvice(FALSE, tvb, 0, pinfo, tree, hf_x420_AbsenceAdvice_PDU); +} +static void dissect_ChangeOfAddressAdvice_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { + dissect_x420_ChangeOfAddressAdvice(FALSE, tvb, 0, pinfo, tree, hf_x420_ChangeOfAddressAdvice_PDU); +} +static void dissect_IPMAssemblyInstructions_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { + dissect_x420_IPMAssemblyInstructions(FALSE, tvb, 0, pinfo, tree, hf_x420_IPMAssemblyInstructions_PDU); +} static void dissect_OriginatingUA_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { dissect_x420_OriginatingUA(FALSE, tvb, 0, pinfo, tree, hf_x420_OriginatingUA_PDU); } @@ -1976,16 +1986,16 @@ dissect_x420(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) int offset = 0; proto_item *item=NULL; proto_tree *tree=NULL; - int (*x420_dissector)(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) = NULL; if(parent_tree){ item = proto_tree_add_item(parent_tree, proto_x420, tvb, 0, -1, FALSE); tree = proto_item_add_subtree(item, ett_x420); } + if (check_col(pinfo->cinfo, COL_PROTOCOL)) - col_set_str(pinfo->cinfo, COL_PROTOCOL, "X420"); + col_set_str(pinfo->cinfo, COL_PROTOCOL, "P22"); if (check_col(pinfo->cinfo, COL_INFO)) - col_add_str(pinfo->cinfo, COL_INFO, "Interpersonal Message"); + col_add_str(pinfo->cinfo, COL_INFO, "InterPersonal"); dissect_x420_InformationObject(TRUE, tvb, offset, pinfo , tree, -1); } @@ -2000,6 +2010,18 @@ void proto_register_x420(void) { /*--- Included file: packet-x420-hfarr.c ---*/ + { &hf_x420_AbsenceAdvice_PDU, + { "AbsenceAdvice", "x420.AbsenceAdvice", + FT_NONE, BASE_NONE, NULL, 0, + "AbsenceAdvice", HFILL }}, + { &hf_x420_ChangeOfAddressAdvice_PDU, + { "ChangeOfAddressAdvice", "x420.ChangeOfAddressAdvice", + FT_NONE, BASE_NONE, NULL, 0, + "ChangeOfAddressAdvice", HFILL }}, + { &hf_x420_IPMAssemblyInstructions_PDU, + { "IPMAssemblyInstructions", "x420.IPMAssemblyInstructions", + FT_NONE, BASE_NONE, NULL, 0, + "IPMAssemblyInstructions", HFILL }}, { &hf_x420_OriginatingUA_PDU, { "OriginatingUA", "x420.OriginatingUA", FT_STRING, BASE_NONE, NULL, 0, @@ -2331,23 +2353,23 @@ void proto_register_x420(void) { { &hf_x420_subject_ipm, { "subject-ipm", "x420.subject_ipm", FT_NONE, BASE_NONE, NULL, 0, - "", HFILL }}, + "IPN/subject-ipm", HFILL }}, { &hf_x420_ipn_originator, { "ipn-originator", "x420.ipn_originator", FT_NONE, BASE_NONE, NULL, 0, - "", HFILL }}, + "IPN/ipn-originator", HFILL }}, { &hf_x420_ipm_intended_recipient, { "ipm-intended-recipient", "x420.ipm_intended_recipient", FT_NONE, BASE_NONE, NULL, 0, - "", HFILL }}, + "IPN/ipm-intended-recipient", HFILL }}, { &hf_x420_conversion_eits, { "conversion-eits", "x420.conversion_eits", FT_NONE, BASE_NONE, NULL, 0, - "", HFILL }}, + "IPN/conversion-eits", HFILL }}, { &hf_x420_notification_extensions, { "notification-extensions", "x420.notification_extensions", FT_UINT32, BASE_DEC, NULL, 0, - "", HFILL }}, + "IPN/notification-extensions", HFILL }}, { &hf_x420_choice, { "choice", "x420.choice", FT_UINT32, BASE_DEC, VALS(x420_T_choice_vals), 0, @@ -2533,7 +2555,6 @@ void proto_register_x420(void) { &ett_x420_MessageParameters, &ett_x420_IPN, &ett_x420_T_choice, - &ett_x420_CommonFields, &ett_x420_NonReceiptFields, &ett_x420_ReceiptFields, &ett_x420_NotificationExtensionsField, @@ -2568,6 +2589,9 @@ void proto_reg_handoff_x420(void) { /*--- Included file: packet-x420-dis-tab.c ---*/ register_ber_oid_dissector("1.2.826.0.1004.10.1.1", dissect_OriginatingUA_PDU, proto_x420, "nexor-originating-ua"); + register_ber_oid_dissector("2.6.1.19.0", dissect_AbsenceAdvice_PDU, proto_x420, "id-on-absence-advice"); + register_ber_oid_dissector("2.6.1.19.1", dissect_ChangeOfAddressAdvice_PDU, proto_x420, "id-on-change-of-address-advice"); + register_ber_oid_dissector("2.6.1.17.2", dissect_IPMAssemblyInstructions_PDU, proto_x420, "id-mst-assembly-instructions"); /*--- End of included file: packet-x420-dis-tab.c ---*/ @@ -2575,6 +2599,6 @@ void proto_reg_handoff_x420(void) { register_ber_oid_dissector("2.6.1.10.0", dissect_x420, proto_x420, "InterPersonal Message (1984)"); register_ber_oid_dissector("2.6.1.10.1", dissect_x420, proto_x420, "InterPersonal Message (1988)"); - register_ber_oid_dissector("1.3.26.0.4406.0.4.1", dissect_x420, proto_x420, "Military Message"); + } diff --git a/epan/dissectors/packet-x420.h b/epan/dissectors/packet-x420.h index e1ff32e842..df407149af 100644 --- a/epan/dissectors/packet-x420.h +++ b/epan/dissectors/packet-x420.h @@ -36,7 +36,10 @@ /*--- Included file: packet-x420-exp.h ---*/ +extern const value_string x420_InformationObject_vals[]; +int dissect_x420_InformationObject(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); int dissect_x420_ORDescriptor(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); +int dissect_x420_ExtensionsField(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); /*--- End of included file: packet-x420-exp.h ---*/ diff --git a/tools/asn2eth.py b/tools/asn2eth.py index 3d4121767a..2954f624ed 100755 --- a/tools/asn2eth.py +++ b/tools/asn2eth.py @@ -138,6 +138,9 @@ oid_names = { def asn2c(id): return id.replace('-', '_').replace('.', '_') +def c2asn(id): + return id.replace('_', '-') + class LexError(Exception): pass class ParseError(Exception): pass @@ -986,13 +989,13 @@ class EthCtx: fx.write('#.IMPORT_TAG\n') for t in self.eth_export_ord: # tags if (self.eth_type[t]['export'] & 0x01): - fx.write('%-24s ' % (t)) + fx.write('%-24s ' % c2asn(t)) fx.write('%s %s\n' % self.eth_type[t]['val'].GetTag(self)) fx.write('#.END\n\n') fx.write('#.TYPE_ATTR\n') for t in self.eth_export_ord: # attributes if (self.eth_type[t]['export'] & 0x01): - fx.write('%-24s ' % (t)) + fx.write('%-24s ' % c2asn(t)) attr = self.eth_get_type_attr(self.eth_type[t]['ref'][0]).copy() fx.write('TYPE = %(TYPE)-9s DISPLAY = %(DISPLAY)-9s STRINGS = %(STRINGS)s BITMASK = %(BITMASK)s\n' % attr) fx.write('#.END\n\n') |