aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/idmp
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2016-03-09 03:17:51 +0000
committerJoão Valverde <j@v6e.pt>2016-03-13 21:30:24 +0000
commit54a520d4a1151c68d0b4e5f09a8d82466fa499f3 (patch)
tree7aacae160382098ce651ac862a5dfd5de4beff94 /asn1/idmp
parentc1f3c935bdd33090c87f0d2f84842ce9729b747a (diff)
Move /asn1 to /epan/dissectors
Change-Id: I1208fe3c2ba428995526f561e8f792b8d871e9a9 Reviewed-on: https://code.wireshark.org/review/14388 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'asn1/idmp')
-rw-r--r--asn1/idmp/CMakeLists.txt58
-rw-r--r--asn1/idmp/CommonProtocolSpecification.asn119
-rw-r--r--asn1/idmp/IDMProtocolSpecification.asn124
-rw-r--r--asn1/idmp/Makefile.am23
-rw-r--r--asn1/idmp/Makefile.common55
-rw-r--r--asn1/idmp/Makefile.nmake26
-rw-r--r--asn1/idmp/idmp.cnf78
-rw-r--r--asn1/idmp/packet-idmp-template.c392
-rw-r--r--asn1/idmp/packet-idmp-template.h32
9 files changed, 0 insertions, 907 deletions
diff --git a/asn1/idmp/CMakeLists.txt b/asn1/idmp/CMakeLists.txt
deleted file mode 100644
index f2f5472b5d..0000000000
--- a/asn1/idmp/CMakeLists.txt
+++ /dev/null
@@ -1,58 +0,0 @@
-# CMakeLists.txt
-#
-# Wireshark - Network traffic analyzer
-# By Gerald Combs <gerald@wireshark.org>
-# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-
-set( PROTOCOL_NAME idmp )
-
-set( PROTO_OPT )
-
-set( EXPORT_FILES
- ${PROTOCOL_NAME}-exp.cnf
-)
-
-set( EXT_ASN_FILE_LIST
-)
-
-set( ASN_FILE_LIST
- IDMProtocolSpecification.asn
- CommonProtocolSpecification.asn
-)
-
-set( EXTRA_DIST
- ${ASN_FILE_LIST}
- packet-${PROTOCOL_NAME}-template.c
- packet-${PROTOCOL_NAME}-template.h
- ${PROTOCOL_NAME}.cnf
-)
-
-set( SRC_FILES
- ${EXTRA_DIST}
- ${EXT_ASN_FILE_LIST}
-)
-
-set( A2W_FLAGS -b -L )
-
-set( EXTRA_CNF
- "${CMAKE_CURRENT_BINARY_DIR}/../x509af/x509af-exp.cnf"
- "${CMAKE_CURRENT_BINARY_DIR}/../x509ce/x509ce-exp.cnf"
-)
-
-ASN2WRS()
-
diff --git a/asn1/idmp/CommonProtocolSpecification.asn b/asn1/idmp/CommonProtocolSpecification.asn
deleted file mode 100644
index e636709ed0..0000000000
--- a/asn1/idmp/CommonProtocolSpecification.asn
+++ /dev/null
@@ -1,119 +0,0 @@
--- http://www.itu.int/ITU-T/formal-language/itu-t/x/x519/2005/CommonProtocolSpecification.asn
--- Module CommonProtocolSpecification (X.519:08/2005)
-CommonProtocolSpecification {joint-iso-itu-t ds(5) module(1)
- commonProtocolSpecification(35) 5} DEFINITIONS ::=
-BEGIN
-
--- EXPORTS All
--- The types and values defined in this module are exported for use in the
--- other ASN.1 modules contained within the Directory Specifications, and for
--- the use of other applications which will use them to access Directory
--- services. Other applications may use them for their own purposes, but this
--- will not constrain extensions and modifications needed to maintain or
--- improve the Directory service.
-IMPORTS
- -- from ITU-T Rec. X.501 | ISO/IEC 9594-2
- opBindingManagement
- FROM UsefulDefinitions {joint-iso-itu-t ds(5) module(1)
- usefulDefinitions(0) 5}
- establishOperationalBinding, modifyOperationalBinding,
- terminateOperationalBinding
- FROM OperationalBindingManagement opBindingManagement;
-
-OPERATION ::= CLASS {
- &ArgumentType OPTIONAL,
- &ResultType OPTIONAL,
- &Errors ERROR OPTIONAL,
- &operationCode Code UNIQUE OPTIONAL
-}
-WITH SYNTAX {
- [ARGUMENT &ArgumentType]
- [RESULT &ResultType]
- [ERRORS &Errors]
- [CODE &operationCode]
-}
-
-ERROR ::= CLASS {&ParameterType ,
- &errorCode Code UNIQUE OPTIONAL
-}WITH SYNTAX {PARAMETER &ParameterType
- [CODE &errorCode]
-}
-
-Code ::= CHOICE {local INTEGER,
- global OBJECT IDENTIFIER
-}
-
-InvokeId ::= CHOICE {present INTEGER,
- absent NULL
-}
-
--- operation codes for DAP and DSP
-id-opcode-read Code ::= local:1
-
-id-opcode-compare Code ::= local:2
-
-id-opcode-abandon Code ::= local:3
-
-id-opcode-list Code ::= local:4
-
-id-opcode-search Code ::= local:5
-
-id-opcode-addEntry Code ::= local:6
-
-id-opcode-removeEntry Code ::= local:7
-
-id-opcode-modifyEntry Code ::= local:8
-
-id-opcode-modifyDN Code ::= local:9
-
--- operation codes for DISP
-id-opcode-requestShadowUpdate Code ::= local:1
-
-id-opcode-updateShadow Code ::= local:2
-
-id-opcode-coordinateShadowUpdate Code ::= local:3
-
--- operation codes for DOP
-id-op-establishOperationalBinding Code ::= local:100
-
-id-op-modifyOperationalBinding Code ::= local:102
-
-id-op-terminateOperationalBinding Code ::= local:101
-
--- error codes for DAP and DSP
-id-errcode-attributeError Code ::= local:1
-
-id-errcode-nameError Code ::= local:2
-
-id-errcode-serviceError Code ::= local:3
-
-id-errcode-referral Code ::= local:4
-
-id-errcode-abandoned Code ::= local:5
-
-id-errcode-securityError Code ::= local:6
-
-id-errcode-abandonFailed Code ::= local:7
-
-id-errcode-updateError Code ::= local:8
-
-id-errcode-dsaReferral Code ::= local:9
-
--- error code for DISP
-id-errcode-shadowError Code ::= local:1
-
--- error code for DOP
-id-err-operationalBindingError Code ::= local:100
-
-DOP-Invokable OPERATION ::=
- {establishOperationalBinding | modifyOperationalBinding |
- terminateOperationalBinding}
-
-DOP-Returnable OPERATION ::=
- {establishOperationalBinding | modifyOperationalBinding |
- terminateOperationalBinding}
-
-END -- CommonProtocolSpecification
-
--- Generated by Asnp, the ASN.1 pretty-printer of France Telecom R&D
-
diff --git a/asn1/idmp/IDMProtocolSpecification.asn b/asn1/idmp/IDMProtocolSpecification.asn
deleted file mode 100644
index 9bd33eef8b..0000000000
--- a/asn1/idmp/IDMProtocolSpecification.asn
+++ /dev/null
@@ -1,124 +0,0 @@
--- http://www.itu.int/ITU-T/formal-language/itu-t/x/x519/2005/IDMProtocolSpecification.asn
--- Module IDMProtocolSpecification (X.519:08/2005)
-IDMProtocolSpecification {joint-iso-itu-t ds(5) module(1)
- iDMProtocolSpecification(30) 5} DEFINITIONS ::=
-BEGIN
-
--- EXPORTS All
--- The types and values defined in this module are exported for use in the other ASN.1 modules contained
--- within the Directory Specifications, and for the use of other applications which will use them to access Directory
--- services. Other applications may use them for their own purposes, but this will not constrain extensions
--- and modifications needed to maintain or improve the Directory service.
-IMPORTS
- -- from ITU-T Rec. X.501 | ISO/IEC 9594-2
- certificateExtensions, commonProtocolSpecification, directoryAbstractService,
- directoryIDMProtocols, enhancedSecurity
- FROM UsefulDefinitions {joint-iso-itu-t ds(5) module(1)
- usefulDefinitions(0) 5}
- -- from ITU-T Rec. X.509 | ISO/IEC 9594-8
- GeneralName
- FROM CertificateExtensions certificateExtensions
- -- from ITU-T Rec. X.511 | ISO/IEC 9594-3
- SecurityProblem, ServiceProblem, Versions
- FROM DirectoryAbstractService directoryAbstractService
- -- from ITU-T Rec. X.519 | ISO/IEC 9594-5
- InvokeId, OPERATION
- FROM CommonProtocolSpecification commonProtocolSpecification;
-
--- IDM-protocol information object class
-IDM-PROTOCOL ::= CLASS {
- &bind-operation OPERATION,
- &Operations OPERATION,
- &id OBJECT IDENTIFIER UNIQUE
-}WITH SYNTAX {BIND-OPERATION &bind-operation
- OPERATIONS &Operations
- ID &id
-}
-
--- IDM protocol
-IDM-PDU{IDM-PROTOCOL:protocol} ::= CHOICE {
- bind [0] IdmBind{{protocol}},
- bindResult [1] IdmBindResult{{protocol}},
- bindError [2] IdmBindError{{protocol}},
- request [3] Request{{protocol.&Operations}},
- result [4] IdmResult{{protocol.&Operations}},
- error [5] Error{{protocol.&Operations}},
- reject [6] IdmReject,
- unbind [7] Unbind,
- abort [8] Abort,
- startTLS [9] StartTLS,
- tLSResponse [10] TLSResponse
-}
-
-IdmBind{IDM-PROTOCOL:Protocols} ::= SEQUENCE {
- protocolID IDM-PROTOCOL.&id({Protocols}),
- callingAETitle [0] GeneralName OPTIONAL,
- calledAETitle [1] GeneralName OPTIONAL,
- argument
- [2] IDM-PROTOCOL.&bind-operation.&ArgumentType({Protocols}{@protocolID})
-}
-
-IdmBindResult{IDM-PROTOCOL:Protocols} ::= SEQUENCE {
- protocolID IDM-PROTOCOL.&id({Protocols}),
- respondingAETitle [0] GeneralName OPTIONAL,
- result
- [1] IDM-PROTOCOL.&bind-operation.&ResultType({Protocols}{@protocolID})
-}
-
-IdmBindError{IDM-PROTOCOL:Protocols} ::= SEQUENCE {
- protocolID IDM-PROTOCOL.&id({Protocols}),
- errcode
- IDM-PROTOCOL.&bind-operation.&Errors.&errorCode({Protocols}{@protocolID}),
- respondingAETitle [0] GeneralName OPTIONAL,
- aETitleError
- ENUMERATED {callingAETitleNotAccepted(0), calledAETitleNotRecognized(1)}
- OPTIONAL,
- error
- [1] IDM-PROTOCOL.&bind-operation.&Errors.&ParameterType
- ({Protocols}{@protocolID, @errcode})
-}
-
-Unbind ::= NULL
-
-Request{OPERATION:Operations} ::= SEQUENCE {
- invokeID INTEGER,
- opcode OPERATION.&operationCode({Operations}),
- argument OPERATION.&ArgumentType({Operations}{@opcode})
-}
-
-IdmResult{OPERATION:Operations} ::= SEQUENCE {
- invokeID InvokeId,
- opcode OPERATION.&operationCode({Operations}),
- result OPERATION.&ResultType({Operations}{@opcode})
-}
-
-Error{OPERATION:Operations} ::= SEQUENCE {
- invokeID INTEGER,
- errcode OPERATION.&Errors.&errorCode({Operations}),
- error OPERATION.&Errors.&ParameterType({Operations}{@errcode})
-}
-
-IdmReject ::= SEQUENCE {
- invokeID INTEGER,
- reason
- ENUMERATED {mistypedPDU(0), duplicateInvokeIDRequest(1),
- unsupportedOperationRequest(2), unknownOperationRequest(3),
- mistypedArgumentRequest(4), resourceLimitationRequest(5),
- unknownInvokeIDResult(6), mistypedResultRequest(7),
- unknownInvokeIDError(8), unknownError(9),
- mistypedParameterError(10)}
-}
-
-Abort ::= ENUMERATED {
- mistypedPDU(0), unboundRequest(1), invalidPDU(2), resourceLimitation(3),
- connectionFailed(4), invalidProtocol(5), reasonNotSpecified(6)}
-
-StartTLS ::= NULL
-
-TLSResponse ::= ENUMERATED {
- success(0), operationsError(1), protocolError(2), unavailable(3)}
-
-END -- IDMProtocolSpecification
-
--- Generated by Asnp, the ASN.1 pretty-printer of France Telecom R&D
-
diff --git a/asn1/idmp/Makefile.am b/asn1/idmp/Makefile.am
deleted file mode 100644
index 72d28e600b..0000000000
--- a/asn1/idmp/Makefile.am
+++ /dev/null
@@ -1,23 +0,0 @@
-# Wireshark - Network traffic analyzer
-# By Gerald Combs <gerald@wireshark.org>
-# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-
-include ../Makefile.preinc
-include Makefile.common
-include ../Makefile.inc
-
diff --git a/asn1/idmp/Makefile.common b/asn1/idmp/Makefile.common
deleted file mode 100644
index 0e9cb3c83e..0000000000
--- a/asn1/idmp/Makefile.common
+++ /dev/null
@@ -1,55 +0,0 @@
-# Wireshark - Network traffic analyzer
-# By Gerald Combs <gerald@wireshark.org>
-# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-
-PROTOCOL_NAME=idmp
-
-EXPORT_FILES = \
- $(PROTOCOL_NAME)-exp.cnf
-
-EXT_ASN_FILE_LIST =
-
-ASN_FILE_LIST = \
- IDMProtocolSpecification.asn \
- CommonProtocolSpecification.asn
-
-# The packet-$(PROTOCOL_NAME)-template.h and $(PROTOCOL_NAME).asn
-# files do not exist for all protocols: Please add/remove as required.
-EXTRA_DIST = \
- $(EXTRA_DIST_COMMON) \
- $(ASN_FILE_LIST) \
- packet-$(PROTOCOL_NAME)-template.c \
- packet-$(PROTOCOL_NAME)-template.h \
- $(PROTOCOL_NAME).cnf
-
-SRC_FILES = \
- $(EXTRA_DIST) \
- $(EXT_ASN_FILE_LIST)
-
-A2W_FLAGS= -b -L
-
-EXTRA_CNF= \
- $(builddir)/../x509af/x509af-exp.cnf \
- $(builddir)/../x509ce/x509ce-exp.cnf
-
-$(builddir)/../x509af/x509af-exp.cnf:
- (cd $(builddir)/../x509af && $(MAKE_CNF_EXPORT))
-
-$(builddir)/../x509ce/x509ce-exp.cnf:
- (cd $(builddir)/../x509ce && $(MAKE_CNF_EXPORT))
-
diff --git a/asn1/idmp/Makefile.nmake b/asn1/idmp/Makefile.nmake
deleted file mode 100644
index fc70f2382f..0000000000
--- a/asn1/idmp/Makefile.nmake
+++ /dev/null
@@ -1,26 +0,0 @@
-## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
-#
-# Wireshark - Network traffic analyzer
-# By Gerald Combs <gerald@wireshark.org>
-# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-
-include ../../config.nmake
-include ../Makefile.preinc.nmake
-include Makefile.common
-include ../Makefile.inc.nmake
-
diff --git a/asn1/idmp/idmp.cnf b/asn1/idmp/idmp.cnf
deleted file mode 100644
index eb85638e88..0000000000
--- a/asn1/idmp/idmp.cnf
+++ /dev/null
@@ -1,78 +0,0 @@
-#.IMPORT ../x509ce/x509ce-exp.cnf
-
-
-#.CLASS OPERATION
-&ArgumentType
-&argumentTypeOptional BooleanType
-&ResultType
-&resultTypeOptional BooleanType
-&Errors _FixedTypeValueSetFieldSpec
-&errorsOptional BooleanType
-&operationCode TypeReference Code
-#.END
-
-#.TF_RENAME
-IdmBind/argument bind_argument
-IdmBindError/errcode bind_errcode
-IdmBindError/error bind_error
-IdmBindResult/result bind_result
-
-#.FIELD_RENAME
-IDM-PDU/error idm_error
-IDM-PDU/result idm_result
-
-IdmResult/invokeID idm_invokeID
-
-#.FN_BODY IdmBind/argument
- struct SESSION_DATA_STRUCTURE *session = (struct SESSION_DATA_STRUCTURE*)actx->private_data;
-
- return call_idmp_oid_callback(tvb, offset, actx->pinfo, (ROS_OP_BIND | ROS_OP_ARGUMENT), top_tree, session);
-
-#.END
-
-#.FN_PARS OBJECT_IDENTIFIER FN_VARIANT = _str VAL_PTR = &protocolID
-
-
-#.FN_BODY IdmBindResult/result
- struct SESSION_DATA_STRUCTURE *session = (struct SESSION_DATA_STRUCTURE*)actx->private_data;
-
- return call_idmp_oid_callback(tvb, offset, actx->pinfo, (ROS_OP_BIND | ROS_OP_RESULT), top_tree, session);
-
-#.END
-
-#.FN_BODY IdmBindError/errcode
-
-#.END
-
-#.FN_BODY IdmBindError/error
- struct SESSION_DATA_STRUCTURE *session = (struct SESSION_DATA_STRUCTURE*)actx->private_data;
-
- return call_idmp_oid_callback(tvb, offset, actx->pinfo, (ROS_OP_BIND| ROS_OP_ERROR), top_tree, session);
-
-#.END
-
-#.FN_PARS Code/local VAL_PTR = &opcode
-
-#.FN_BODY Request/argument
- struct SESSION_DATA_STRUCTURE *session = (struct SESSION_DATA_STRUCTURE*)actx->private_data;
-
- return call_idmp_oid_callback(tvb, offset, actx->pinfo, (ROS_OP_INVOKE | ROS_OP_ARGUMENT | opcode), top_tree, session);
-
-#.END
-
-#.FN_BODY IdmResult/result
- struct SESSION_DATA_STRUCTURE *session = (struct SESSION_DATA_STRUCTURE*)actx->private_data;
-
- return call_idmp_oid_callback(tvb, offset, actx->pinfo, (ROS_OP_INVOKE | ROS_OP_RESULT | opcode), top_tree, session);
-
-#.END
-
-#.FN_BODY Error/errcode
-
-#.END
-
-#.FN_BODY Error/error
-
-#.END
-
-
diff --git a/asn1/idmp/packet-idmp-template.c b/asn1/idmp/packet-idmp-template.c
deleted file mode 100644
index a57a035b4d..0000000000
--- a/asn1/idmp/packet-idmp-template.c
+++ /dev/null
@@ -1,392 +0,0 @@
-/* packet-idmp.c
- * Routines for X.519 Internet Directly Mapped Procotol (IDMP) packet dissection
- * Graeme Lunt 2010
- *
- * Wireshark - Network traffic analyzer
- * By Gerald Combs <gerald@wireshark.org>
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include "config.h"
-
-#include <epan/packet.h>
-#include <epan/prefs.h>
-#include <epan/reassemble.h>
-#include <epan/conversation.h>
-#include <epan/oids.h>
-#include <epan/asn1.h>
-#include <epan/ipproto.h>
-#include <epan/strutil.h>
-
-#include <wsutil/str_util.h>
-
-#include "packet-tcp.h"
-
-#include "packet-ber.h"
-#include "packet-ros.h"
-#include "packet-x509ce.h"
-
-
-#define PNAME "X.519 Internet Directly Mapped Protocol"
-#define PSNAME "IDMP"
-#define PFNAME "idmp"
-
-void proto_register_idmp(void);
-void proto_reg_handoff_idm(void);
-static void prefs_register_idmp(void); /* forward declaration for use in preferences registration */
-void register_idmp_protocol_info(const char *oid, const ros_info_t *rinfo, int proto _U_, const char *name);
-
-static gboolean idmp_desegment = TRUE;
-static guint global_idmp_tcp_port = 1102; /* made up for now */
-static gboolean idmp_reassemble = TRUE;
-static guint tcp_port = 0;
-static dissector_handle_t idmp_handle = NULL;
-
-static proto_tree *top_tree = NULL;
-static const char *protocolID = NULL;
-static const char *saved_protocolID = NULL;
-static guint32 opcode = -1;
-
-/* Initialize the protocol and registered fields */
-int proto_idmp = -1;
-
-static int hf_idmp_version = -1;
-static int hf_idmp_final = -1;
-static int hf_idmp_length = -1;
-static int hf_idmp_PDU = -1;
-
-static reassembly_table idmp_reassembly_table;
-
-static int hf_idmp_fragments = -1;
-static int hf_idmp_fragment = -1;
-static int hf_idmp_fragment_overlap = -1;
-static int hf_idmp_fragment_overlap_conflicts = -1;
-static int hf_idmp_fragment_multiple_tails = -1;
-static int hf_idmp_fragment_too_long_fragment = -1;
-static int hf_idmp_fragment_error = -1;
-static int hf_idmp_fragment_count = -1;
-static int hf_idmp_reassembled_in = -1;
-static int hf_idmp_reassembled_length = -1;
-static int hf_idmp_segment_data = -1;
-
-static gint ett_idmp_fragment = -1;
-static gint ett_idmp_fragments = -1;
-
-static const fragment_items idmp_frag_items = {
- /* Fragment subtrees */
- &ett_idmp_fragment,
- &ett_idmp_fragments,
- /* Fragment fields */
- &hf_idmp_fragments,
- &hf_idmp_fragment,
- &hf_idmp_fragment_overlap,
- &hf_idmp_fragment_overlap_conflicts,
- &hf_idmp_fragment_multiple_tails,
- &hf_idmp_fragment_too_long_fragment,
- &hf_idmp_fragment_error,
- &hf_idmp_fragment_count,
- /* Reassembled in field */
- &hf_idmp_reassembled_in,
- /* Reassembled length field */
- &hf_idmp_reassembled_length,
- /* Reassembled data field */
- NULL,
- /* Tag */
- "IDMP fragments"
-};
-
-
-static int call_idmp_oid_callback(tvbuff_t *tvb, int offset, packet_info *pinfo, int op, proto_tree *tree, struct SESSION_DATA_STRUCTURE *session)
-{
- if(session != NULL) {
-
- if((!saved_protocolID) && (op == (ROS_OP_BIND | ROS_OP_RESULT))) {
- /* save for subsequent operations - should be into session data */
- saved_protocolID = wmem_strdup(wmem_file_scope(), protocolID);
- }
-
- /* mimic ROS! */
- session->ros_op = op;
- offset = call_ros_oid_callback(saved_protocolID ? saved_protocolID : protocolID, tvb, offset, pinfo, tree, session);
- }
-
- return offset;
-
-}
-
-#include "packet-idmp-hf.c"
-
-/* Initialize the subtree pointers */
-static gint ett_idmp = -1;
-#include "packet-idmp-ett.c"
-
-#include "packet-idmp-fn.c"
-
-void
-register_idmp_protocol_info(const char *oid, const ros_info_t *rinfo, int proto _U_, const char *name)
-{
- /* just register with ROS for now */
- register_ros_protocol_info(oid, rinfo, proto, name, FALSE);
-}
-
-
-static int dissect_idmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data _U_)
-{
- int offset = 0;
-
- proto_item *item;
- proto_tree *tree;
- asn1_ctx_t asn1_ctx;
- struct SESSION_DATA_STRUCTURE session;
- gboolean idmp_final;
- guint32 idmp_length;
- fragment_head *fd_head;
- conversation_t *conv;
- guint32 dst_ref = 0;
-
- asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
-
- conv = find_conversation (pinfo->num, &pinfo->src, &pinfo->dst,
- pinfo->ptype, pinfo->srcport, pinfo->destport, 0);
- if (conv) {
- /* Found a conversation, also use index for the generated dst_ref */
- dst_ref = conv->index;
- }
-
- /* save parent_tree so subdissectors can create new top nodes */
- top_tree=parent_tree;
-
- item = proto_tree_add_item(parent_tree, proto_idmp, tvb, 0, -1, ENC_NA);
- tree = proto_item_add_subtree(item, ett_idmp);
-
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "IDMP");
-
- /* now check the segment fields */
-
- proto_tree_add_item(tree, hf_idmp_version, tvb, offset, 1, ENC_BIG_ENDIAN); offset++;
- proto_tree_add_item(tree, hf_idmp_final, tvb, offset, 1, ENC_BIG_ENDIAN);
- idmp_final = tvb_get_guint8(tvb, offset); offset++;
- proto_tree_add_item(tree, hf_idmp_length, tvb, offset, 4, ENC_BIG_ENDIAN);
- idmp_length = tvb_get_ntohl(tvb, offset); offset += 4;
-
- asn1_ctx.private_data = &session;
-
- if(idmp_reassemble) {
-
- pinfo->fragmented = !idmp_final;
-
- col_append_fstr(pinfo->cinfo, COL_INFO, " [%sIDMP fragment, %u byte%s]",
- idmp_final ? "Final " : "" ,
- idmp_length, plurality(idmp_length, "", "s"));
-
- fd_head = fragment_add_seq_next(&idmp_reassembly_table, tvb, offset,
- pinfo, dst_ref, NULL,
- idmp_length, !idmp_final);
-
- if(fd_head && fd_head->next) {
- proto_tree_add_item(tree, hf_idmp_segment_data, tvb, offset, (idmp_length) ? -1 : 0, ENC_NA);
-
- if (idmp_final) {
- /* This is the last segment */
- tvb = process_reassembled_data (tvb, offset, pinfo,
- "Reassembled IDMP", fd_head, &idmp_frag_items, NULL, tree);
- offset = 0;
- } else if (pinfo->num != fd_head->reassembled_in) {
- /* Add a "Reassembled in" link if not reassembled in this frame */
- proto_tree_add_uint (tree, hf_idmp_reassembled_in,
- tvb, 0, 0, fd_head->reassembled_in);
- }
- }
-
- } else {
- if(!idmp_final) {
-
- col_append_fstr(pinfo->cinfo, COL_INFO, " [IDMP fragment, %u byte%s, IDMP reassembly not enabled]",
- idmp_length, plurality(idmp_length, "", "s"));
-
- proto_tree_add_bytes_format_value(tree, hf_idmp_segment_data, tvb, offset, (idmp_length) ? -1 : 0,
- NULL, "(IDMP reassembly not enabled)");
- }
- }
- /* not reassembling - just dissect */
- if(idmp_final) {
- asn1_ctx.private_data = &session;
- dissect_idmp_IDM_PDU(FALSE, tvb, offset, &asn1_ctx, tree, hf_idmp_PDU);
- }
-
- return tvb_captured_length(tvb);
-}
-
-static guint get_idmp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
- int offset, void *data _U_)
-{
- guint32 len;
-
- len = tvb_get_ntohl(tvb, offset + 2);
-
- return len + 6;
-}
-
-static int dissect_idmp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data)
-{
- tcp_dissect_pdus(tvb, pinfo, parent_tree, idmp_desegment, 0, get_idmp_pdu_len, dissect_idmp, data);
- return tvb_captured_length(tvb);
-}
-
-static void idmp_reassemble_init (void)
-{
- reassembly_table_init (&idmp_reassembly_table,
- &addresses_reassembly_table_functions);
-}
-
-static void idmp_reassemble_cleanup(void)
-{
- reassembly_table_destroy(&idmp_reassembly_table);
- saved_protocolID = NULL;
-}
-
-/*--- proto_register_idmp -------------------------------------------*/
-void proto_register_idmp(void)
-{
- /* List of fields */
- static hf_register_info hf[] = {
- { &hf_idmp_version,
- { "version", "idmp.version",
- FT_INT8, BASE_DEC, NULL, 0,
- "idmp.INTEGER", HFILL }},
- { &hf_idmp_final,
- { "final", "idmp.final",
- FT_BOOLEAN, BASE_NONE, NULL, 0,
- "idmp.BOOLEAN", HFILL }},
- { &hf_idmp_length,
- { "length", "idmp.length",
- FT_INT32, BASE_DEC, NULL, 0,
- "idmp.INTEGER", HFILL }},
- { &hf_idmp_PDU,
- { "IDM-PDU", "idmp.pdu",
- FT_UINT32, BASE_DEC, VALS(idmp_IDM_PDU_vals), 0,
- "idmp.PDU", HFILL }},
- /* Fragment entries */
- { &hf_idmp_fragments,
- { "IDMP fragments", "idmp.fragments", FT_NONE, BASE_NONE,
- NULL, 0x00, NULL, HFILL } },
- { &hf_idmp_fragment,
- { "IDMP fragment", "idmp.fragment", FT_FRAMENUM, BASE_NONE,
- NULL, 0x00, NULL, HFILL } },
- { &hf_idmp_fragment_overlap,
- { "IDMP fragment overlap", "idmp.fragment.overlap", FT_BOOLEAN,
- BASE_NONE, NULL, 0x00, NULL, HFILL } },
- { &hf_idmp_fragment_overlap_conflicts,
- { "IDMP fragment overlapping with conflicting data",
- "idmp.fragment.overlap.conflicts", FT_BOOLEAN, BASE_NONE,
- NULL, 0x00, NULL, HFILL } },
- { &hf_idmp_fragment_multiple_tails,
- { "IDMP has multiple tail fragments",
- "idmp.fragment.multiple_tails", FT_BOOLEAN, BASE_NONE,
- NULL, 0x00, NULL, HFILL } },
- { &hf_idmp_fragment_too_long_fragment,
- { "IDMP fragment too long", "idmp.fragment.too_long_fragment",
- FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL } },
- { &hf_idmp_fragment_error,
- { "IDMP defragmentation error", "idmp.fragment.error", FT_FRAMENUM,
- BASE_NONE, NULL, 0x00, NULL, HFILL } },
- { &hf_idmp_fragment_count,
- { "IDMP fragment count", "idmp.fragment.count", FT_UINT32, BASE_DEC,
- NULL, 0x00, NULL, HFILL } },
- { &hf_idmp_reassembled_in,
- { "Reassembled IDMP in frame", "idmp.reassembled.in", FT_FRAMENUM, BASE_NONE,
- NULL, 0x00, "This IDMP packet is reassembled in this frame", HFILL } },
- { &hf_idmp_reassembled_length,
- { "Reassembled IDMP length", "idmp.reassembled.length", FT_UINT32, BASE_DEC,
- NULL, 0x00, "The total length of the reassembled payload", HFILL } },
- { &hf_idmp_segment_data,
- { "IDMP segment data", "idmp.segment_data", FT_BYTES, BASE_NONE,
- NULL, 0x00, NULL, HFILL } },
-
-#include "packet-idmp-hfarr.c"
- };
-
- /* List of subtrees */
- static gint *ett[] = {
- &ett_idmp,
- &ett_idmp_fragment,
- &ett_idmp_fragments,
-#include "packet-idmp-ettarr.c"
- };
- module_t *idmp_module;
-
- /* Register protocol */
- proto_idmp = proto_register_protocol(PNAME, PSNAME, PFNAME);
-
- /* Register fields and subtrees */
- proto_register_field_array(proto_idmp, hf, array_length(hf));
- proto_register_subtree_array(ett, array_length(ett));
-
- register_dissector("idmp", dissect_idmp_tcp, proto_idmp);
-
- register_init_routine (&idmp_reassemble_init);
- register_cleanup_routine (&idmp_reassemble_cleanup);
-
- /* Register our configuration options for IDMP, particularly our port */
-
- idmp_module = prefs_register_protocol_subtree("OSI/X.500", proto_idmp, prefs_register_idmp);
-
- prefs_register_bool_preference(idmp_module, "desegment_idmp_messages",
- "Reassemble IDMP messages spanning multiple TCP segments",
- "Whether the IDMP dissector should reassemble messages spanning multiple TCP segments."
- " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
- &idmp_desegment);
-
- prefs_register_bool_preference(idmp_module, "reassemble",
- "Reassemble segmented IDMP datagrams",
- "Whether segmented IDMP datagrams should be reassembled."
- " To use this option, you must also enable"
- " \"Allow subdissectors to reassemble TCP streams\""
- " in the TCP protocol settings.", &idmp_reassemble);
-
- prefs_register_uint_preference(idmp_module, "tcp.port", "IDMP TCP Port",
- "Set the port for Internet Directly Mapped Protocol requests/responses",
- 10, &global_idmp_tcp_port);
-
-}
-
-
-/*--- proto_reg_handoff_idm --- */
-void proto_reg_handoff_idm(void) {
-
- /* remember the idm handler for change in preferences */
- idmp_handle = find_dissector(PFNAME);
-
-}
-
-
-static void
-prefs_register_idmp(void)
-{
-
- /* de-register the old port */
- /* port 102 is registered by TPKT - don't undo this! */
- if(idmp_handle)
- dissector_delete_uint("tcp.port", tcp_port, idmp_handle);
-
- /* Set our port number for future use */
- tcp_port = global_idmp_tcp_port;
-
- if((tcp_port > 0) && idmp_handle)
- dissector_add_uint("tcp.port", global_idmp_tcp_port, idmp_handle);
-
-}
diff --git a/asn1/idmp/packet-idmp-template.h b/asn1/idmp/packet-idmp-template.h
deleted file mode 100644
index de48d9db4a..0000000000
--- a/asn1/idmp/packet-idmp-template.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* packet-idmp.h
- * Routines for X.519 Internet Directly Mapped Protocol (IDMP) packet dissection
- * Graeme Lunt 2010
- *
- * Wireshark - Network traffic analyzer
- * By Gerald Combs <gerald@wireshark.org>
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef PACKET_IDM_H
-#define PACKET_IDM_H
-
-#include <packet-ros.h>
-
-void
-register_idmp_protocol_info(const char *oid, const ros_info_t *rinfo, int proto _U_, const char *name);
-
-#endif /* PACKET_IDM_H */