diff options
author | Jörg Mayer <jmayer@loplof.de> | 2007-10-10 12:06:30 +0000 |
---|---|---|
committer | Jörg Mayer <jmayer@loplof.de> | 2007-10-10 12:06:30 +0000 |
commit | 973239b13c691f18d5db8cb4d32a9057dec4da52 (patch) | |
tree | 8a67631f32ba86d7cfe07ec623f8b3821c6e8b45 /asn1/tcap | |
parent | 99ea1247840bf34aae1d960fa762e18076f16cd3 (diff) |
Split tcap into tcap and ansi-tcap. Just assume that all the
extra asn files belong to ansi-tcap.
svn path=/trunk/; revision=23134
Diffstat (limited to 'asn1/tcap')
-rw-r--r-- | asn1/tcap/DialoguePDUs.asn | 80 | ||||
-rw-r--r-- | asn1/tcap/Makefile | 23 | ||||
-rw-r--r-- | asn1/tcap/Makefile.am | 25 | ||||
-rw-r--r-- | asn1/tcap/Makefile.common | 49 | ||||
-rw-r--r-- | asn1/tcap/Makefile.nmake | 81 | ||||
-rw-r--r-- | asn1/tcap/TC-Notation-Extensions.asn | 87 | ||||
-rw-r--r-- | asn1/tcap/TCAP-Remote-Operations-Information-Objects.asn | 129 | ||||
-rw-r--r-- | asn1/tcap/TCAPMessages.asn | 96 | ||||
-rw-r--r-- | asn1/tcap/TCAPPackage.asn | 242 | ||||
-rw-r--r-- | asn1/tcap/UnidialoguePDUs.asn | 25 | ||||
-rw-r--r-- | asn1/tcap/ansi_tcap.cnf | 141 | ||||
-rw-r--r-- | asn1/tcap/packet-ansi_tcap-template.c | 495 | ||||
-rw-r--r-- | asn1/tcap/packet-ansi_tcap-template.h | 65 |
13 files changed, 96 insertions, 1442 deletions
diff --git a/asn1/tcap/DialoguePDUs.asn b/asn1/tcap/DialoguePDUs.asn deleted file mode 100644 index 64b9f8ac5a..0000000000 --- a/asn1/tcap/DialoguePDUs.asn +++ /dev/null @@ -1,80 +0,0 @@ --- $Id$ --- Generated by Asnp, the pretty-printer of France Telecom R&D (http://asn1.elibel.tm.fr/asnp/) -DialoguePDUs {itu-t recommendation q 773 modules(2) dialoguePDUs(2) version1(1) - } DEFINITIONS ::= -BEGIN - -EXPORTS dialogue-as-id, DialoguePDU; - --- abstract syntax name for structured dialogue APDUs -dialogue-as-id OBJECT IDENTIFIER ::= - {itu-t recommendation q 773 as(1) dialogue-as(1) version1(1)} - -DialoguePDU ::= CHOICE { - dialogueRequest AARQ-apdu, - dialogueResponse AARE-apdu, - dialogueAbort ABRT-apdu -} - -AARQ-apdu ::= [APPLICATION 0] IMPLICIT SEQUENCE { - protocol-version - [0] IMPLICIT BIT STRING {version1(0)} DEFAULT {version1}, - application-context-name [1] OBJECT IDENTIFIER, - user-information [30] IMPLICIT SEQUENCE OF EXTERNAL OPTIONAL -} - -AARE-apdu ::= [APPLICATION 1] IMPLICIT SEQUENCE { - protocol-version - [0] IMPLICIT BIT STRING {version1(0)} DEFAULT {version1}, - application-context-name [1] OBJECT IDENTIFIER, - result [2] Associate-result, - result-source-diagnostic [3] Associate-source-diagnostic, - user-information [30] IMPLICIT SEQUENCE OF EXTERNAL OPTIONAL -} - --- RLRQ PDU is currently not used. --- It is included for completeness only. -RLRQ-apdu ::= [APPLICATION 2] IMPLICIT SEQUENCE { - reason [0] IMPLICIT Release-request-reason OPTIONAL, - user-information [30] IMPLICIT SEQUENCE OF EXTERNAL OPTIONAL -} - --- RLRE PDU is currently not used. --- It is included for completeness only -RLRE-apdu ::= [APPLICATION 3] IMPLICIT SEQUENCE { - reason [0] IMPLICIT Release-response-reason OPTIONAL, - user-information [30] IMPLICIT SEQUENCE OF EXTERNAL OPTIONAL -} - -ABRT-apdu ::= [APPLICATION 4] IMPLICIT SEQUENCE { - abort-source [0] IMPLICIT ABRT-source, - user-information [30] IMPLICIT SEQUENCE OF EXTERNAL OPTIONAL -} - -ABRT-source ::= INTEGER {dialogue-service-user(0), dialogue-service-provider(1) -} - -Associate-result ::= INTEGER {accepted(0), reject-permanent(1)} - -Associate-source-diagnostic ::= CHOICE { - dialogue-service-user - [1] INTEGER {null(0), no-reason-given(1), - application-context-name-not-supported(2)}, - dialogue-service-provider - [2] INTEGER {null(0), no-reason-given(1), no-common-dialogue-portion(2)} -} - --- Release-request-reason is currently not used. --- It is included for completeness only. -Release-request-reason ::= INTEGER {normal(0), urgent(1), user-defined(30) -} - --- Release-response-reason is currently not used. --- It is included for completeness only. -Release-response-reason ::= INTEGER { - normal(0), not-finished(1), user-defined(30)} - -END -- DialoguePDUs - --- Generated by Asnp, the ASN.1 pretty-printer of France Telecom R&D - diff --git a/asn1/tcap/Makefile b/asn1/tcap/Makefile deleted file mode 100644 index 6313b6b775..0000000000 --- a/asn1/tcap/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -# $Id$ - -TCAP_FILES=packet-tcap.c packet-tcap.h -ANSI_FILES=packet-ansi_tcap.c packet-ansi_tcap.h -DISSECTOR_FILES=$(TCAP_FILES) $(ANSI_FILES) -TCAP_ASN=tcap.asn -ANSI_ASN=TCAP-Remote-Operations-Information-Objects.asn TCAPPackage.asn - -all: generate_dissector - -generate_dissector: $(DISSECTOR_FILES) - -$(TCAP_FILES): ../../tools/asn2wrs.py $(TCAP_ASN) packet-tcap-template.c packet-tcap-template.h tcap.cnf - python ../../tools/asn2wrs.py -b -e -p tcap -c tcap.cnf -s packet-tcap-template $(TCAP_ASN) - -$(ANSI_FILES): ../../tools/asn2wrs.py $(ANSI_ASN) packet-ansi_tcap-template.c packet-ansi_tcap-template.h ansi_tcap.cnf - python ../../tools/asn2wrs.py -b -X -T -e -p ansi_tcap -c ansi_tcap.cnf -s packet-ansi_tcap-template $(ANSI_ASN) - -clean: - rm -f parsetab.py $(DISSECTOR_FILES) - -copy_files: generate_dissector - cp $(DISSECTOR_FILES) ../../epan/dissectors diff --git a/asn1/tcap/Makefile.am b/asn1/tcap/Makefile.am new file mode 100644 index 0000000000..a034690647 --- /dev/null +++ b/asn1/tcap/Makefile.am @@ -0,0 +1,25 @@ +# $Id$ +# +# +# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +include Makefile.common +include ../Makefile.inc + diff --git a/asn1/tcap/Makefile.common b/asn1/tcap/Makefile.common new file mode 100644 index 0000000000..349a325a26 --- /dev/null +++ b/asn1/tcap/Makefile.common @@ -0,0 +1,49 @@ +# $Id$ +# +# +# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +PROTOCOL_NAME=tcap + +DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c \ + packet-$(PROTOCOL_NAME).h + +NEED_PACKET_PROTO_H = 1 + +EXT_ASN_FILE_LIST = + +ASN_FILE_LIST = $(PROTOCOL_NAME).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 = \ + $(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 -e + +EXTRA_CNF= + diff --git a/asn1/tcap/Makefile.nmake b/asn1/tcap/Makefile.nmake index 1222430b20..b3fa922696 100644 --- a/asn1/tcap/Makefile.nmake +++ b/asn1/tcap/Makefile.nmake @@ -1,65 +1,28 @@ ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake # # $Id$ +# +# +# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -include ../../config.nmake - -UNIX2DOS=$(PERL) ../../tools/unix2dos.pl - -PROTOCOL_NAME=tcap -PROTOCOL_NAME2=ansi_tcap -ITU_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h -ANSI_FILES=packet-$(PROTOCOL_NAME2).c packet-$(PROTOCOL_NAME2).h -DISSECTOR_FILES=$(ITU_FILES) $(ANSI_FILES) -TCAP_ASN=tcap.asn -ANSI_ASN_FILES= TCAP-Remote-Operations-Information-Objects.asn TCAPPackage.asn - -all: generate_dissector - -generate_dissector: $(DISSECTOR_FILES) - -$(ITU_FILES): ../../tools/asn2wrs.py $(TCAP_ASN) packet-$(PROTOCOL_NAME)-template.c packet-$(PROTOCOL_NAME)-template.h tcap.cnf -!IFDEF PYTHON - $(PYTHON) "../../tools/asn2wrs.py" -b -e -p $(PROTOCOL_NAME) -c tcap.cnf -s packet-$(PROTOCOL_NAME)-template $(TCAP_ASN) -!ELSE - @echo Error: You need Python to use asn2wrs.py - @exit 1 -!ENDIF - -$(ANSI_FILES): ../../tools/asn2wrs.py $(ANSI_ASN_FILES) packet-$(PROTOCOL_NAME2)-template.c packet-$(PROTOCOL_NAME2)-template.h ansi_tcap.cnf -!IFDEF PYTHON - $(PYTHON) "../../tools/asn2wrs.py" -b -X -T -e -p $(PROTOCOL_NAME2) -c ansi_tcap.cnf -s packet-$(PROTOCOL_NAME2)-template $(ANSI_ASN_FILES) -!ELSE - @echo Error: You need Python to use asn2wrs.py - @exit 1 -!ENDIF - -clean: - rm -f parsetab.py parsetab.pyc $(DISSECTOR_FILES) - -distclean: clean - -maintainer-clean: distclean - -# 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 - move packet-$(PROTOCOL_NAME2).c packet-$(PROTOCOL_NAME2).c.tmp - move packet-$(PROTOCOL_NAME2).h packet-$(PROTOCOL_NAME2).h.tmp - $(UNIX2DOS) < packet-$(PROTOCOL_NAME2).c.tmp > packet-$(PROTOCOL_NAME2).c - $(UNIX2DOS) < packet-$(PROTOCOL_NAME2).h.tmp > packet-$(PROTOCOL_NAME2).h - del /f packet-$(PROTOCOL_NAME2).c.tmp packet-$(PROTOCOL_NAME2).h.tmp +include Makefile.common +include ../../config.nmake +include ../Makefile.inc.nmake -copy_files: generate_dissector fix_eol - xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y - xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y - xcopy packet-$(PROTOCOL_NAME2).c ..\..\epan\dissectors /d /y - xcopy packet-$(PROTOCOL_NAME2).h ..\..\epan\dissectors /d /y diff --git a/asn1/tcap/TC-Notation-Extensions.asn b/asn1/tcap/TC-Notation-Extensions.asn deleted file mode 100644 index f389cae443..0000000000 --- a/asn1/tcap/TC-Notation-Extensions.asn +++ /dev/null @@ -1,87 +0,0 @@ --- Module TC-Notation-Extensions (Q.775:06/1997) - -TC-Notation-Extensions {itu-t recommendation q 775 modules(2) - notation-extension(4) version1(1)} DEFINITIONS ::= -BEGIN - -IMPORTS - TCMessage{} - FROM TCAPMessages {itu-t recommendation q 773 modules(2) messages(1) - version3(3)} - Bind{}, Unbind{} - FROM Remote-Operations-Generic-ROS-PDUs {joint-iso-itu-t - remote-operations(4) generic-ROS-PDUs(6) version1(0)} - AllOperations{}, ConsumerPerforms{}, SupplierPerforms{}, combine{} - FROM Remote-Operations-Useful-Definitions {joint-iso-itu-t - remote-operations(4) useful-definitions(7) version1(0)} - CONTRACT, OPERATION-PACKAGE - FROM Remote-Operations-Information-Objects {joint-iso-itu-t - remote-operations(4) informationObjects(5) version1(0)} - UniDialoguePDU, uniDialogue-as-id - FROM UnidialoguePDUs {itu-t recommendation q 773 modules(2) - unidialoguePDUs(3) version1(1)} - DialoguePDU, dialogue-as-id - FROM DialoguePDUs {itu-t recommendation q 773 modules(2) dialoguePDUs(2) - version1(1)}; - -APPLICATION-CONTEXT ::= CLASS { - &associationContract CONTRACT, - &dialogueMode DialogueMode, - &termination Termination OPTIONAL, - &componentGrouping BOOLEAN DEFAULT TRUE, - &dialogueAndComponentGrouping BOOLEAN DEFAULT TRUE, - &AdditionalASEs OBJECT IDENTIFIER OPTIONAL, - &AbstractSyntaxes ABSTRACT-SYNTAX, - &applicationContextName OBJECT IDENTIFIER UNIQUE -} -WITH SYNTAX { - CONTRACT &associationContract - DIALOGUE MODE &dialogueMode - [TERMINATION &termination] - [COMPONENT GROUPING ALLOWED &componentGrouping] - [DIALOGUE WITH COMPONENTS ALLOWED &dialogueAndComponentGrouping] - [ADDITIONAL ASES &AdditionalASEs] - ABSTRACT SYNTAXES &AbstractSyntaxes - APPLICATION CONTEXT NAME &applicationContextName -} - -DialogueMode ::= ENUMERATED {structured(1), unstructured(2)} - -Termination ::= ENUMERATED {basic(1), prearranged(2)} - -dialogue-abstract-syntax ABSTRACT-SYNTAX ::= { - DialoguePDU - IDENTIFIED BY dialogue-as-id -} - -uniDialogue-abstract-syntax ABSTRACT-SYNTAX ::= { - UniDialoguePDU - IDENTIFIED BY uniDialogue-as-id -} - -TCSingleAS{OPERATION-PACKAGE:package} ::= - TCMessage{{AllOperations {package}}, {AllOperations {package}}} - -TCConsumerAS{OPERATION-PACKAGE:package} ::= - TCMessage{{ConsumerPerforms {package}}, {ConsumerPerforms {package}}} - -TCSupplierAS{OPERATION-PACKAGE:package} ::= - TCMessage{{SupplierPerforms {package}}, {SupplierPerforms {package}}} - -AllPackagesAS{APPLICATION-CONTEXT:ac} ::= - TCSingleAS - {combine{{ac.&associationContract.&OperationsOf | - ac.&associationContract.&InitiatorConsumerOf | - ac.&associationContract.&InitiatorSupplierOf}, - {...}, --was illegaly empty, needs to be changed - { -- Information Object of class OPERATION-PACKAGE to be defined --}}} - -ConnectionAS{APPLICATION-CONTEXT:ac} ::= CHOICE { - bind Bind{ac.&associationContract.&connection.&bind}, - unbind Unbind{ac.&associationContract.&connection.&unbind} -} - -END - --- Generated by Asnp, the ASN.1 pretty-printer of France Telecom R&D - diff --git a/asn1/tcap/TCAP-Remote-Operations-Information-Objects.asn b/asn1/tcap/TCAP-Remote-Operations-Information-Objects.asn deleted file mode 100644 index 54b0efe3f1..0000000000 --- a/asn1/tcap/TCAP-Remote-Operations-Information-Objects.asn +++ /dev/null @@ -1,129 +0,0 @@ -TCAP-Remote-Operations-Information-Objects {iso(1) -memberbody(2) usa(840) t1-114(10013) modules(0) informationObjects(1) version4(4) } - -DEFINITIONS ::= - -BEGIN - ---Exports Everything - -IMPORTS - emptyBind, emptyUnbind - FROM Remote-Operations-Useful-Definitions {joint-iso-ccitt remote-operations(4) useful-definitions(7) version1(0) }; - -OPERATION ::= CLASS { - &ArgumentType OPTIONAL, - &argumentTypeOptional BOOLEAN OPTIONAL, - &returnResult BOOLEAN DEFAULT TRUE, - &ResultType OPTIONAL, - &resultTypeOptional BOOLEAN OPTIONAL, - &Errors ERROR OPTIONAL, - &Linked OPERATION OPTIONAL, - &synchronous BOOLEAN DEFAULT FALSE, - &alwaysReturns BOOLEAN DEFAULT TRUE, - &InvokePriority Priority OPTIONAL, - &ResultPriority Priority OPTIONAL, - &invokeLast BOOLEAN DEFAULT FALSE, - &operationCode OperationCode UNIQUE OPTIONAL - } -WITH SYNTAX { - [ARGUMENT &ArgumentType - [OPTIONAL &argumentTypeOptional]] - [RESULT &ResultType - [OPTIONAL &resultTypeOptional]] - [RETURN RESULT &returnResult] - [ERRORS &Errors] - [LINKED &Linked] - [SYNCHRONOUS &synchronous] - [ALWAYS RETURNS &alwaysReturns] - [INVOKE PRIORITY &InvokePriority] - [RESULT PRIORITY &ResultPriority] - [LAST &invokeLast] - [CODE &operationCode] - } - -ERROR ::= CLASS { - &ParameterType OPTIONAL, - ¶meterTypeOptional BOOLEAN OPTIONAL, - &ErrorPriority Priority OPTIONAL, - &errorCode ErrorCode UNIQUE OPTIONAL - } -WITH SYNTAX { - [PARAMETER &ParameterType - [OPTIONAL ¶meterTypeOptional]] - [PRIORITY &ErrorPriority] - [CODE &errorCode] - } - -OPERATION-PACKAGE ::= CLASS { - &Both OPERATION OPTIONAL, - &Consumer OPERATION OPTIONAL, - &Supplier OPERATION OPTIONAL, - &id OBJECT IDENTIFIER UNIQUE OPTIONAL - } -WITH SYNTAX { - [OPERATIONS &Both] - [CONSUMER INVOKES &Supplier] - [SUPPLIER INVOKES &Consumer] - [ID &id] -} - -CONNECTION-PACKAGE ::= CLASS { - &bind OPERATION DEFAULT emptyBind, - &unbind OPERATION DEFAULT emptyUnbind, - &responderCanUnbind BOOLEAN DEFAULT FALSE, - &unbindCanFail BOOLEAN DEFAULT FALSE, - &id OBJECT IDENTIFIER UNIQUE OPTIONAL - } -WITH SYNTAX { - [BIND &bind] - [UNBIND &unbind] - [RESPONDER UNBIND &responderCanUnbind] - [FAILURE TO UNBIND &unbindCanFail] - [ID &id] - } - -CONTRACT ::= CLASS { - &connection CONNECTION-PACKAGE OPTIONAL, - &OperationsOf OPERATION-PACKAGE OPTIONAL, - &InitiatorConsumerOf OPERATION-PACKAGE OPTIONAL, - &InitiatorSupplierOf OPERATION-PACKAGE OPTIONAL, - &id OBJECT IDENTIFIER UNIQUE OPTIONAL -} - -WITH SYNTAX { - [CONNECTION &connection] - [OPERATIONS OF &OperationsOf] - [INITIATOR CONSUMER OF &InitiatorConsumerOf] - [RESPONDER CONSUMER OF &InitiatorSupplierOf] - [ID &id] - } - -ROS-OBJECT-CLASS ::= CLASS { - &Is ROS-OBJECT-CLASS OPTIONAL, - &Initiates CONTRACT OPTIONAL, - &Responds CONTRACT OPTIONAL, - &InitiatesAndResponds CONTRACT OPTIONAL, - &id OBJECT IDENTIFIER UNIQUE - } -WITH SYNTAX { - [IS &Is] - [BOTH &InitiatesAndResponds] - [INITIATES &Initiates] - [RESPONDS &Responds] - ID &id - } - -OperationCode ::= CHOICE{ - national [PRIVATE 16] IMPLICIT INTEGER (-32768..32767), - private [PRIVATE 17] IMPLICIT INTEGER - } - -ErrorCode ::= CHOICE { - national [PRIVATE 19] INTEGER (-128..127), - private [PRIVATE 20] INTEGER -} - -Priority ::= INTEGER (0..MAX) - -END --end of Information Object Specifications diff --git a/asn1/tcap/TCAPMessages.asn b/asn1/tcap/TCAPMessages.asn deleted file mode 100644 index cccec042a7..0000000000 --- a/asn1/tcap/TCAPMessages.asn +++ /dev/null @@ -1,96 +0,0 @@ --- Generated by Asnp, the pretty-printer of France Telecom R&D (http://asn1.elibel.tm.fr/asnp/) -TCAPMessages {itu-t recommendation q 773 modules(2) messages(1) version3(3)} -DEFINITIONS IMPLICIT TAGS ::= -BEGIN - --- EXPORTS everything --- Transaction Portion fields. -IMPORTS - ROS{}, InvokeId - FROM Remote-Operations-Generic-ROS-PDUs {joint-iso-itu-t - remote-operations(4) generic-ROS-PDUs(6) version1(0)} - OPERATION - FROM Remote-Operations-Information-Objects {joint-iso-itu-t - remote-operations(4) informationObjects(5) version1(0)}; - -TCMessage{OPERATION:Invokable, OPERATION:Returnable} ::= CHOICE { - unidirectional [APPLICATION 1] Unidirectional{{Invokable}, {Returnable}}, - begin [APPLICATION 2] Begin{{Invokable}, {Returnable}}, - end [APPLICATION 4] End{{Invokable}, {Returnable}}, - continue [APPLICATION 5] Continue{{Invokable}, {Returnable}}, - abort [APPLICATION 7] Abort -} - -Unidirectional{OPERATION:Invokable, OPERATION:Returnable} ::= SEQUENCE { - dialoguePortion DialoguePortion OPTIONAL, - components ComponentPortion{{Invokable}, {Returnable}} -} - -Begin{OPERATION:Invokable, OPERATION:Returnable} ::= SEQUENCE { - otid OrigTransactionID, - dialoguePortion DialoguePortion OPTIONAL, - components ComponentPortion{{Invokable}, {Returnable}} OPTIONAL -} - -End{OPERATION:Invokable, OPERATION:Returnable} ::= SEQUENCE { - dtid DestTransactionID, - dialoguePortion DialoguePortion OPTIONAL, - components ComponentPortion{{Invokable}, {Returnable}} OPTIONAL -} - -Continue{OPERATION:Invokable, OPERATION:Returnable} ::= SEQUENCE { - otid OrigTransactionID, - dtid DestTransactionID, - dialoguePortion DialoguePortion OPTIONAL, - components ComponentPortion{{Invokable}, {Returnable}} OPTIONAL -} - -Abort ::= SEQUENCE { - dtid DestTransactionID, - reason CHOICE {p-abortCause P-AbortCause, - u-abortCause DialoguePortion} OPTIONAL -} - --- NOTE - When the Abort Message is generated by the Transaction sublayer, a p-Abort Cause may be --- present. The u-abortCause may be generated by the component sublayer in which case it is an ABRT --- APDU, or by the TC-User in which case it could be either an ABRT APDU or data in some user-defined --- abstract syntax. -DialoguePortion ::= [APPLICATION 11] EXPLICIT EXTERNAL - --- The dialogue portion carries the dialogue control PDUs as value of the external data type. The direct --- reference should be set to {itu-t recommendation q 773 as(1) dialogue-as(1) version1(1)} if structured --- dialogue is used and to {itu-t recommendation q 773 as(1) unidialogue-as(2) version1(1)} if unstructured --- dialogue is used. -OrigTransactionID ::= [APPLICATION 8] OCTET STRING(SIZE (1..4)) - -DestTransactionID ::= [APPLICATION 9] OCTET STRING(SIZE (1..4)) - -P-AbortCause ::= [APPLICATION 10] INTEGER { - unrecognizedMessageType(0), unrecognizedTransactionID(1), - badlyFormattedTransactionPortion(2), incorrectTransactionPortion(3), - resourceLimitation(4)}(0..127) - --- COMPONENT PORTION. The last field in the transaction portion of the TCAP message is the --- component portion. The component portion may be absent. -ComponentPortion{OPERATION:Invokable, OPERATION:Returnable} ::= - [APPLICATION 12] - SEQUENCE SIZE (1..MAX) OF Component{{Invokable}, {Returnable}} - --- Component Portion fields --- Recommendation X.880 defines four Application Protocol Data Units (APDUs) for invoking --- operations, returning results or error, and for the rejection of invalid PDUs. --- TCAP adds returnResultNotLast to allow for the segmentation of a result. -Component{OPERATION:Invokable, OPERATION:Returnable} ::= CHOICE { - basicROS ROS{{TCInvokeIdSet}, {Invokable}, {Returnable}}, - returnResultNotLast - [7] returnResult < ROS{{TCInvokeIdSet}, {Invokable}, {Returnable}} -} - -TCInvokeIdSet ::= InvokeId(WITH COMPONENTS { - present (-128..127) - }) - -END -- TCAPMessages - --- Generated by Asnp, the ASN.1 pretty-printer of France Telecom R&D - diff --git a/asn1/tcap/TCAPPackage.asn b/asn1/tcap/TCAPPackage.asn deleted file mode 100644 index 2c3d005d66..0000000000 --- a/asn1/tcap/TCAPPackage.asn +++ /dev/null @@ -1,242 +0,0 @@ -TCAPPackage {iso(1) memberbody(2) usa(840) t1-114(10013) modules(0) tcapPackage(0) version4(4)} - -DEFINITIONS ::= --- iso(1) memberbody(2) --- usa(840) T1.114(10013) - -BEGIN - -- defining a module called TCAPPackage which contains type - -- definitions for the contents of any generic TCAP message - ---exports everything - -IMPORTS OPERATION, ERROR FROM - TCAP-Remote-Operations-Information-Objects{iso(1) memberbody(2) usa(840) t1-114(10013) modules(0) information-objects(1) version4(4)}; - -PackageType ::= CHOICE { unidirectional [PRIVATE 1] IMPLICIT UniTransactionPDU, - queryWithPerm [PRIVATE 2] IMPLICIT TransactionPDU, - queryWithoutPerm [PRIVATE 3] IMPLICIT TransactionPDU, - response [PRIVATE 4] IMPLICIT TransactionPDU, - conversationWithPerm [PRIVATE 5] IMPLICIT TransactionPDU, - conversationWithoutPerm [PRIVATE 6] IMPLICIT TransactionPDU, - abort [PRIVATE 22] IMPLICIT Abort - } - -UniTransactionPDU ::= SEQUENCE { - identifier TransactionID, - dialoguePortion DialoguePortion OPTIONAL, - componentPortion ComponentSequence - } - -TransactionPDU ::= SEQUENCE { - identifier TransactionID, - dialoguePortion DialoguePortion OPTIONAL, - componentPortion ComponentSequence OPTIONAL - } ---TransactionPDU should include either a Dialogue Portion, a Component Sequence or both - -TransactionID ::= [PRIVATE 7] IMPLICIT OCTET STRING --- 0 octets for the Unidirectional, 4 octets for Query, Response & Abort --- 8 octets for Conversation in the order Originating then Responding TID - -Abort ::= SEQUENCE { - identifier TransactionID, - dialogPortion DialoguePortion OPTIONAL, - causeInformation CHOICE { - abortCause P-Abort-cause, - userInformation UserAbortInformation --OPTIONAL - } - } --- When the Abort package is generated by the Transaction sublayer, --- the P-Abort-cause must be present - -P-Abort-cause ::= [PRIVATE 23] IMPLICIT INTEGER{ - unrecognizedPackageType (1), - incorrectTransactionPortion (2), - badlyStructuredTransactionPortion (3), - unassignedRespondingTransactionID (4), - permissionToReleaseProblem (5), -- for further study - resourceUnavailable (6), - unrecognizedDialoguePortionID (7), - badlyStructuredDialoguePortion (8), - missingDialoguePortion (9), - inconsistentDialoguePortion (10) - } - -DialoguePortion ::= [PRIVATE 25] IMPLICIT SEQUENCE { - version ProtocolVersion OPTIONAL, - applicationContext CHOICE { - integerApplicationId IntegerApplicationContext, - objectApplicationId ObjectIDApplicationContext - } OPTIONAL, - userInformation UserInformation OPTIONAL, - securityContext CHOICE { - integerSecurityId [0] IMPLICIT INTEGER, - objectSecurityId [1] IMPLICIT OBJECT IDENTIFIER - } OPTIONAL, - - confidentiality [2] IMPLICIT Confidentiality OPTIONAL -} - -ProtocolVersion ::=[PRIVATE 26] IMPLICIT OCTET STRING (SIZE (1)) ---0000 0000 not used ---0000 0001 T1.114-1996 ---0000 0010 T1.114-2000 ---other reserved ---These values can be combined using the bit-wise logical or operation --- to indicate support for more than one version, e.g. the value 0000 0011 --- means that both 1996 and 2000 versions are supported - -IntegerApplicationContext ::= [PRIVATE 27] IMPLICIT INTEGER - -ObjectIDApplicationContext ::= [PRIVATE 28] IMPLICIT OBJECT IDENTIFIER - -UserInformation ::= [PRIVATE 29] IMPLICIT SEQUENCE OF EXTERNAL - -Confidentiality ::= SEQUENCE { - confidentialityId CHOICE { - integerConfidentialityId [0] IMPLICIT INTEGER, - objectConfidentialityId [1] IMPLICIT OBJECT IDENTIFIER - } OPTIONAL --- The extension marker indicates the possible presence of items --- in the confidentiality set that are used by the confidentiality --- algorithm. -} - -UserAbortInformation ::= [PRIVATE 24] EXTERNAL - -ComponentSequence ::= [PRIVATE 8] IMPLICIT SEQUENCE OF ComponentPDU --- Component Portion specification starts below - -ComponentPDU{ InvokeId: InvokeIdSet, OPERATION: Invocable, OPERATION: Returnable } ::= - CHOICE { - invokeLast [PRIVATE 9] IMPLICIT Invoke {{InvokeIdSet}, {Invocable}} - (CONSTRAINED BY { --invocable.&invokeLast must be TRUE -- } - ! RejectProblem : general-incorrectComponentPortion), - returnResultLast [PRIVATE 10] IMPLICIT ReturnResult{{Returnable}}, - returnError [PRIVATE 11] IMPLICIT ReturnError{{Errors{{Returnable}}}}, - reject [PRIVATE 12] IMPLICIT Reject, - invokeNotLast [PRIVATE 13] IMPLICIT Invoke{{InvokeIdSet}, {Invocable}} - (CONSTRAINED BY { --invocable.&invokeLast must be FALSE -- } - ! RejectProblem : general-incorrectComponentPortion), - returnResultNotLast [PRIVATE 14] IMPLICIT ReturnResult {{Returnable}} - } - (CONSTRAINED BY { -- must conform to the above definition -- } - ! RejectProblem : general-unrecognisedComponentType) - -Invoke{ InvokeID: InvokeIdSet, OPERATION: Operations } ::= SEQUENCE { - componentIDs [PRIVATE 15] IMPLICIT OCTET STRING (SIZE(0..2)) - -- The invoke ID precedes the correlation id. There may be no - -- identifier,only an invoke ID, or both invoke and correlation - --ID’s. - (CONSTRAINED BY { -- must be unambiguous -- } - ! RejectProblem : invoke-duplicateInvocation ) - (CONSTRAINED BY { -- correlation ID must identify an - -- outstanding operation -- } - ! RejectProblem : invoke-unrecognisedCorrelationId ) - OPTIONAL, - operationCode OPERATION.&operationCode - ((Operations) - ! RejectProblem : invoke-unrecognisedOperation), - parameter - OPERATION.&ParameterType - ({Operations}{@opcode} - ! RejectProblem : invoke-mistypedArgument ) OPTIONAL - } - (CONSTRAINED BY { -- must conform to the above definition -- } - ! RejectProblem : general-incorrectComponentPortion ) - (CONSTRAINED BY { -- must have consistent encoding -- } - ! RejectProblem : general-badlyStructuredCompPortion ) - (CONSTRAINED BY { -- must conform to T1.114.3 encoding rules -- } - ! RejectProblem : general-incorrectComponentCoding ) - -ReturnResult{ OPERATION: Operations } ::= SEQUENCE { - componentID [PRIVATE 15] IMPLICIT OCTET STRING (SIZE(1)) - (CONSTRAINED BY { --must be that of an outstanding operation--} - ! RejectProblem : returnResult-unrecognisedCorrelationId) - (CONSTRAINED BY { -- which returns a result -- } - ! RejectProblem : returnResult-unexpectedReturnResult), - parameter OPERATION.&ResultType - ({Operations}{@opcode} - ! RejectProblem : returnResult-incorrectParameter) - OPTIONAL - } - (CONSTRAINED BY { -- must conform to the above definition -- } - ! RejectProblem : general-incorrectComponentPortion ) - (CONSTRAINED BY { -- must have consistent encoding -- } - ! RejectProblem : general-badlyStructuredCompPortion ) - (CONSTRAINED BY { -- must conform to T1.114.3 encoding rules -- } - ! RejectProblem : general-incorrectComponentCoding ) - -ReturnError{ ERROR: Errors } ::= SEQUENCE { - componentID [PRIVATE 15] IMPLICIT OCTET STRING (SIZE(1)) - (CONSTRAINED BY { --must be that of an outstanding operation--} - ! RejectProblem : returnError-unrecognisedCorrelationId) - (CONSTRAINED BY { --which returns an error-- } - ! RejectProblem : returnError-unexpectedReturnError), - errorCode ERROR.&errorCode - ({Errors} - ! RejectProblem : returnError-unrecognisedError) - (CONSTRAINED BY { -- must be in the &Errors field of the - --associated operation -- } - ! RejectProblem : returnError-unexpectedError), - parameter - ERROR.&ParameterType - ({Errors}{@errorcode} - ! RejectProblem : returnError-incorrectParameter) OPTIONAL - } - (CONSTRAINED BY { -- must conform to the above definition -- } - ! RejectProblem : general-incorrectComponentPortion ) - (CONSTRAINED BY { -- must have consistent encoding -- } - ! RejectProblem : general-badlyStructuredCompPortion ) - (CONSTRAINED BY { -- must conform to T1.114.3 encoding rules -- } - ! RejectProblem : general-incorrectComponentCoding ) - -Reject ::= SEQUENCE { - componentID [PRIVATE 15] IMPLICIT OCTET STRING (SIZE(0..1)), - rejectProblem [PRIVATE 21] IMPLICIT Problem, - parameter CHOICE { - paramSequence [PRIVATE 16] IMPLICIT SEQUENCE { }, - paramSet [PRIVATE 18] IMPLICIT SET { } - } --The choice between paramSequence and paramSet is implementation - --dependent, however paramSequence is preferred. -} - (CONSTRAINED BY { -- must conform to the above definition -- } - ! RejectProblem : general-incorrectComponentPortion ) - (CONSTRAINED BY { -- must have consistent encoding -- } - ! RejectProblem : general-badlyStructuredCompPortion ) - (CONSTRAINED BY { -- must conform to T1.114.3 encoding rules -- } - ! RejectProblem : general-incorrectComponentCoding ) - --- PROBLEMS, the specification of Problems follows -Problem ::= INTEGER { - general-unrecognisedComponentType (257), - general-incorrectComponentPortion (258), - general-badlyStructuredCompPortion (259), - general-incorrectComponentCoding (260), - invoke-duplicateInvocation (513), - invoke-unrecognisedOperation (514), - invoke-incorrectParameter (515), - invoke-unrecognisedCorrelationID (516), - returnResult-unrecognisedCorrelationID (769), - returnResult-unexpectedReturnResult (770), - returnResult-incorrectParameter (771), - returnError-unrecognisedCorrelationID (1025), - returnError-unexpectedReturnError (1026), - returnError-unrecognisedError (1027), - returnError-unexpectedError (1028), - returnError-incorrectParameter (1029), - -- Applications using T1.114-1988 report Transaction portion - -- problems using a Reject component with a problem code in - -- the range 1281-1286. - -- It is preferred that other applications report - -- these problems using the Abort package type - transaction-unrecognizedPackageType (1281), - transaction-incorrectTransPortion (1282), - transaction-badlyStructuredTransPortion (1283), - transaction-unassignedRespondingTransID (1284), - transaction-permissionToReleaseProblem (1285), - transaction-resourceUnavailable (1286) - } - -END -- end of the TCAPPackage Module
\ No newline at end of file diff --git a/asn1/tcap/UnidialoguePDUs.asn b/asn1/tcap/UnidialoguePDUs.asn deleted file mode 100644 index 4f7c6c3556..0000000000 --- a/asn1/tcap/UnidialoguePDUs.asn +++ /dev/null @@ -1,25 +0,0 @@ --- Generated by Asnp, the pretty-printer of France Telecom R&D (http://asn1.elibel.tm.fr/asnp/) -UnidialoguePDUs {itu-t recommendation q 773 modules(2) unidialoguePDUs(3) - version1(1)} DEFINITIONS ::= -BEGIN - -EXPORTS uniDialogue-as-id, UniDialoguePDU; - --- Abstract syntax name for unstructured dialogue APDUs -uniDialogue-as-id OBJECT IDENTIFIER ::= - {itu-t recommendation q 773 as(1) unidialogue-as(2) version1(1)} - -UniDialoguePDU ::= CHOICE {unidialoguePDU AUDT-apdu -} - -AUDT-apdu ::= [APPLICATION 0] IMPLICIT SEQUENCE { - protocol-version - [0] IMPLICIT BIT STRING {version1(0)} DEFAULT {version1}, - application-context-name [1] OBJECT IDENTIFIER, - user-information [30] IMPLICIT SEQUENCE OF EXTERNAL OPTIONAL -} - -END -- UNIDialoguePDU - --- Generated by Asnp, the ASN.1 pretty-printer of France Telecom R&D - diff --git a/asn1/tcap/ansi_tcap.cnf b/asn1/tcap/ansi_tcap.cnf deleted file mode 100644 index 3c4c01e029..0000000000 --- a/asn1/tcap/ansi_tcap.cnf +++ /dev/null @@ -1,141 +0,0 @@ -# tcap.cnf -# $Id$ -# tcap conformation file - -#--- OperationCode --- - -#.FN_PARS -OperationCode VAL_PTR = &ansi_tcap_private.d.OperationCode -OperationCode/national VAL_PTR = &ansi_tcap_private.d.OperationCode_national -OperationCode/private FN_VARIANT = _str VAL_PTR = &ansi_tcap_private.d.OperationCode_private -#.FN_FTR OperationCode - ansi_tcap_private.d.OperationCode_item = actx->created_item; -#.END - -#--- INVOKE --- -#.FIELD_ATTR -Invoke/parameter TYPE = FT_BYTES DISPLAY = BASE_HEX - -#.FN_BODY Invoke/parameter -tvbuff_t *parameter_tvb; - - offset = dissect_ber_octet_string(TRUE, actx, tree, tvb, offset, hf_index, - ¶meter_tvb); - if(!parameter_tvb) - return offset; - - find_tcap_subdisector(parameter_tvb, actx, tree); - -#.FN_HDR Invoke - ansi_tcap_private.d.pdu = 1; - -#--- RETURN RESULT --- - -#.FIELD_ATTR -ReturnResult/parameter TYPE = FT_BYTES DISPLAY = BASE_HEX - -#.FN_BODY ReturnResult/parameter -tvbuff_t *parameter_tvb; - - - offset = dissect_ber_octet_string(TRUE, actx, tree, tvb, offset, hf_index, - ¶meter_tvb); - if(!parameter_tvb) - return offset; - - find_tcap_subdisector(parameter_tvb, actx, tree); - -#.FN_HDR ReturnResult - ansi_tcap_private.d.pdu = 2; - - -#--- RETURN ERROR --- - -#.FIELD_ATTR -ReturnError/parameter TYPE = FT_BYTES DISPLAY = BASE_HEX - -#.FN_BODY ReturnError/parameter -tvbuff_t *parameter_tvb; - - offset = dissect_ber_octet_string(TRUE, actx, tree, tvb, offset, hf_index, - ¶meter_tvb); - if(!parameter_tvb) - return offset; - - find_tcap_subdisector(parameter_tvb, actx, tree); - -#.FN_HDR ReturnError - ansi_tcap_private.d.pdu = 3; - -#--- ObjectIDApplicationContext -- -#.FN_BODY ObjectIDApplicationContext FN_VARIANT = _str VAL_PTR = &oid_str - - static const char * oid_str; - - %(DEFAULT_BODY)s - ansi_tcap_private.objectApplicationId_oid= (void*) oid_str; - ansi_tcap_private.oid_is_present=TRUE; - -#.FN_HDR PackageType/unidirectional -gp_tcapsrt_info->ope=TC_ANSI_ALL; -if (check_col(actx->pinfo->cinfo, COL_INFO)) - col_add_str(actx->pinfo->cinfo, COL_INFO, "unidirectional "); - -#.FN_HDR PackageType/queryWithPerm -gp_tcapsrt_info->ope=TC_ANSI_ALL; -if (check_col(actx->pinfo->cinfo, COL_INFO)) - col_add_str(actx->pinfo->cinfo, COL_INFO, "queryWithPerm "); - -#.FN_HDR PackageType/queryWithoutPerm -gp_tcapsrt_info->ope=TC_ANSI_ALL; -if (check_col(actx->pinfo->cinfo, COL_INFO)) - col_add_str(actx->pinfo->cinfo, COL_INFO, "queryWithoutPerm "); - -#.FN_HDR PackageType/response -gp_tcapsrt_info->ope=TC_ANSI_ALL; -if (check_col(actx->pinfo->cinfo, COL_INFO)) - col_add_str(actx->pinfo->cinfo, COL_INFO, "response "); - -#.FN_HDR PackageType/conversationWithPerm -gp_tcapsrt_info->ope=TC_ANSI_ALL; -if (check_col(actx->pinfo->cinfo, COL_INFO)) - col_add_str(actx->pinfo->cinfo, COL_INFO, "conversationWithPerm "); - -#.FN_HDR PackageType/conversationWithoutPerm -gp_tcapsrt_info->ope=TC_ANSI_ALL; -if (check_col(actx->pinfo->cinfo, COL_INFO)) - col_add_str(actx->pinfo->cinfo, COL_INFO, "conversationWithoutPerm "); - -#.FN_HDR PackageType/abort -gp_tcapsrt_info->ope=TC_ANSI_ABORT; -if (check_col(actx->pinfo->cinfo, COL_INFO)) - col_add_str(actx->pinfo->cinfo, COL_INFO, "Abort "); - -#.FN_BODY TransactionID/_untag VAL_PTR = &next_tvb - -tvbuff_t *next_tvb; -guint8 len; - -%(DEFAULT_BODY)s - -if(next_tvb) { - if(tvb_length(next_tvb) !=0) - ansi_tcap_private.TransactionID_str = tvb_bytes_to_str(next_tvb, 0,tvb_length(next_tvb)); - len = tvb_length_remaining(next_tvb, 0); - switch(len) { - case 1: - gp_tcapsrt_info->src_tid=tvb_get_guint8(next_tvb, 0); - break; - case 2: - gp_tcapsrt_info->src_tid=tvb_get_ntohs(next_tvb, 0); - break; - case 4: - gp_tcapsrt_info->src_tid=tvb_get_ntohl(next_tvb, 0); - break; - default: - gp_tcapsrt_info->src_tid=0; - break; - } -} - -#.END diff --git a/asn1/tcap/packet-ansi_tcap-template.c b/asn1/tcap/packet-ansi_tcap-template.c deleted file mode 100644 index 1025bf6e81..0000000000 --- a/asn1/tcap/packet-ansi_tcap-template.c +++ /dev/null @@ -1,495 +0,0 @@ -/* packet-ansi_tcap-template.c - * Routines for ANSI TCAP - * Copyright 2007 Anders Broman <anders.broman@ericsson.com> - * Built from the gsm-map dissector Copyright 2004 - 2005, Anders Broman <anders.broman@ericsson.com> - * - * $Id$ - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * References: T1.114 - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include <glib.h> -#include <epan/packet.h> -#include <epan/prefs.h> -#include <epan/conversation.h> -#include <epan/oids.h> -#include <epan/emem.h> -#include <epan/asn1.h> - -#include <stdio.h> -#include <string.h> -#include "packet-ber.h" -#include "packet-tcap.h" -#include "packet-ansi_tcap.h" -#include "epan/tcap-persistentdata.h" - -#define PNAME "ANSI Transaction Capabilities Application Part" -#define PSNAME "ANSI_TCAP" -#define PFNAME "ansi_tcap" - -/* Initialize the protocol and registered fields */ -int proto_ansi_tcap = -1; - -int hf_ansi_tcapsrt_SessionId=-1; -int hf_ansi_tcapsrt_Duplicate=-1; -int hf_ansi_tcapsrt_BeginSession=-1; -int hf_ansi_tcapsrt_EndSession=-1; -int hf_ansi_tcapsrt_SessionTime=-1; - -#include "packet-ansi_tcap-hf.c" - -/* Initialize the subtree pointers */ -static gint ett_tcap = -1; -static gint ett_param = -1; - -static gint ett_otid = -1; -static gint ett_dtid = -1; -gint ett_ansi_tcap_stat = -1; - -static struct tcapsrt_info_t * gp_tcapsrt_info; -static gboolean tcap_subdissector_used=FALSE; -static dissector_handle_t requested_subdissector_handle = NULL; - -static struct tcaphash_context_t * gp_tcap_context=NULL; - -#include "packet-ansi_tcap-ett.c" - -#define MAX_SSN 254 -static range_t *global_ssn_range; -static range_t *ssn_range; - -gboolean g_ansi_tcap_HandleSRT=FALSE; -extern gboolean gtcap_PersistentSRT; -extern gboolean gtcap_DisplaySRT; -extern guint gtcap_RepetitionTimeout; -extern guint gtcap_LostTimeout; - -/* static dissector_handle_t tcap_handle = NULL; */ -static dissector_table_t ber_oid_dissector_table=NULL; -static const char * cur_oid; -static const char * tcapext_oid; -static proto_tree * tcap_top_tree=NULL; -static proto_tree * tcap_stat_tree=NULL; -static proto_item * tcap_stat_item=NULL; - -static dissector_handle_t data_handle; -static dissector_handle_t ansi_map_handle; - - -struct ansi_tcap_private_t ansi_tcap_private; - -static void ansi_tcap_ctx_init(struct ansi_tcap_private_t *a_tcap_ctx) { - memset(a_tcap_ctx, '\0', sizeof(*a_tcap_ctx)); - a_tcap_ctx->signature = ANSI_TCAP_CTX_SIGNATURE; - a_tcap_ctx->oid_is_present = FALSE; - a_tcap_ctx->TransactionID_str = NULL; -} - -static void dissect_ansi_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree); -/* -static dissector_table_t sccp_ssn_table; - -static GHashTable* ansi_sub_dissectors = NULL; -static GHashTable* itu_sub_dissectors = NULL; - - extern void add_ansi_tcap_subdissector(guint32 ssn, dissector_handle_t dissector) { - g_hash_table_insert(ansi_sub_dissectors,GUINT_TO_POINTER(ssn),dissector); - dissector_add("sccp.ssn",ssn,tcap_handle); -} - -extern void delete_ansi_tcap_subdissector(guint32 ssn, dissector_handle_t dissector _U_) { - g_hash_table_remove(ansi_sub_dissectors,GUINT_TO_POINTER(ssn)); - dissector_delete("sccp.ssn",ssn,tcap_handle); -} - -dissector_handle_t get_ansi_tcap_subdissector(guint32 ssn) { - return g_hash_table_lookup(ansi_sub_dissectors,GUINT_TO_POINTER(ssn)); -} -*/ - -/* Transaction tracking */ -/* Transaction table */ -struct ansi_tcap_invokedata_t { - gint OperationCode; - /* - 0 : national, - 1 : private - */ - gint32 OperationCode_private; - gint32 OperationCode_national; -}; - -static GHashTable *TransactionId_table=NULL; - -static void -TransactionId_table_cleanup(gpointer key , gpointer value, gpointer user_data _U_){ - - struct ansi_tcap_invokedata_t *ansi_tcap_saved_invokedata = value; - gchar *TransactionId_str = key; - - if ( TransactionId_str ){ - g_free(TransactionId_str); - } - if (ansi_tcap_saved_invokedata){ - g_free(ansi_tcap_saved_invokedata); - } - -} - -void -ansi_tcap_init_transaction_table(void){ - - /* Destroy any existing memory chunks / hashes. */ - if (TransactionId_table){ - g_hash_table_foreach(TransactionId_table, TransactionId_table_cleanup, NULL); - g_hash_table_destroy(TransactionId_table); - TransactionId_table = NULL; - } - - TransactionId_table = g_hash_table_new(g_str_hash, g_str_equal); - -} - -static void -ansi_tcap_init_protocol(void) -{ - ansi_tcap_init_transaction_table(); -} - -/* Store Invoke information needed for the corresponding reply */ -static void -save_invoke_data(packet_info *pinfo, proto_tree *tree _U_, tvbuff_t *tvb _U_){ - struct ansi_tcap_invokedata_t *ansi_tcap_saved_invokedata; - address* src = &(pinfo->src); - address* dst = &(pinfo->dst); - guint8 *src_str; - guint8 *dst_str; - char *buf; - - buf=ep_alloc(1024); - - src_str = address_to_str(src); - dst_str = address_to_str(dst); - - - if ((!pinfo->fd->flags.visited)&&(ansi_tcap_private.TransactionID_str)){ - /* Only do this once XXX I hope its the right thing to do */ - strcpy(buf, ansi_tcap_private.TransactionID_str); - /* The hash string needs to contain src and dest to distiguish differnt flows */ - strcat(buf,src_str); - strcat(buf,dst_str); - strcat(buf,"\0"); - - /* If the entry allready exists don't owervrite it */ - ansi_tcap_saved_invokedata = g_hash_table_lookup(TransactionId_table,buf); - if(ansi_tcap_saved_invokedata) - return; - - ansi_tcap_saved_invokedata = g_malloc(sizeof(struct ansi_tcap_invokedata_t)); - ansi_tcap_saved_invokedata->OperationCode = ansi_tcap_private.d.OperationCode; - ansi_tcap_saved_invokedata->OperationCode_national = ansi_tcap_private.d.OperationCode_national; - ansi_tcap_saved_invokedata->OperationCode_private = ansi_tcap_private.d.OperationCode_private; - - g_hash_table_insert(TransactionId_table, - g_strdup(buf), - ansi_tcap_saved_invokedata); - /* - g_warning("Tcap Invoke Hash string %s",buf); - */ - } -} - -static gboolean -find_saved_invokedata(packet_info *pinfo, proto_tree *tree _U_, tvbuff_t *tvb _U_){ - struct ansi_tcap_invokedata_t *ansi_tcap_saved_invokedata; - address* src = &(pinfo->src); - address* dst = &(pinfo->dst); - guint8 *src_str; - guint8 *dst_str; - char *buf; - - buf=ep_alloc(1024); - src_str = address_to_str(src); - dst_str = address_to_str(dst); - - /* The hash string needs to contain src and dest to distiguish differnt flows */ - src_str = address_to_str(src); - dst_str = address_to_str(dst); - strcpy(buf, ansi_tcap_private.TransactionID_str); - /* Reverse order to invoke */ - strcat(buf,dst_str); - strcat(buf,src_str); - strcat(buf,"\0"); - ansi_tcap_saved_invokedata = g_hash_table_lookup(TransactionId_table, buf); - if(ansi_tcap_saved_invokedata){ - ansi_tcap_private.d.OperationCode = ansi_tcap_saved_invokedata->OperationCode; - ansi_tcap_private.d.OperationCode_national = ansi_tcap_saved_invokedata->OperationCode_national; - ansi_tcap_private.d.OperationCode_private = ansi_tcap_saved_invokedata->OperationCode_private; - return TRUE; - } - return FALSE; -} - -/* As currently ANSI MAP is the only possible sub dissector this function - * must be improved to handle general cases. - * - * - * - * TODO: - * 1)Handle national codes - * Design option - * - Create a ansi.tcap.national dissector table and have dissectors for - * national codes register there and let ansi tcap call them. - * 2)Handle Private codes properly - * Design question - * Unclear how to differentiate between different private "code sets". - * Use SCCP SSN table as before? or a ansi.tcap.private dissector table? - * - */ -static gboolean -find_tcap_subdisector(tvbuff_t *tvb, asn1_ctx_t *actx, proto_tree *tree){ - proto_item *item; - - /* If "DialoguePortion objectApplicationId ObjectIDApplicationContext - * points to the subdissector this code can be used. - * - if(ansi_tcap_private.d.oid_is_present){ - call_ber_oid_callback(ansi_tcap_private.objectApplicationId_oid, tvb, 0, actx-pinfo, tree); - return TRUE; - } - */ - if(ansi_tcap_private.d.pdu == 1){ - /* Save Invoke data for this transaction */ - save_invoke_data(actx->pinfo, tree, tvb); - }else{ - /* Get saved data for this transaction */ - if(find_saved_invokedata(actx->pinfo, tree, tvb)){ - if(ansi_tcap_private.d.OperationCode == 0){ - /* national */ - item = proto_tree_add_int(tree, hf_ansi_tcap_national, tvb, 0, 0, ansi_tcap_private.d.OperationCode_national); - }else{ - item = proto_tree_add_int(tree, hf_ansi_tcap_private, tvb, 0, 0, ansi_tcap_private.d.OperationCode_private); - } - PROTO_ITEM_SET_GENERATED(item); - ansi_tcap_private.d.OperationCode_item = item; - } - } - if(ansi_tcap_private.d.OperationCode == 0){ - /* national */ - item = proto_tree_add_text(tree, tvb, 0, -1, - "Dissector for ANSI TCAP NATIONAL code:%u not implemented. Contact Wireshark developers if you want this supported", - ansi_tcap_private.d.OperationCode_national); - PROTO_ITEM_SET_GENERATED(item); - return FALSE; - }else if(ansi_tcap_private.d.OperationCode == 1){ - /* private */ - if((ansi_tcap_private.d.OperationCode_private & 0x0900) != 0x0900){ - item = proto_tree_add_text(tree, tvb, 0, -1, - "Dissector for ANSI TCAP PRIVATE code:%u not implemented. Contact Wireshark developers if you want this supported", - ansi_tcap_private.d.OperationCode_private); - PROTO_ITEM_SET_GENERATED(item); - return FALSE; - } - } - /* This is abit of a hack as it assumes the private codes with a "family" of 0x09 is ANSI MAP - * Se TODO above. - * N.S0005-0 v 1.0 TCAP Formats and Procedures 5-16 Application Services - * 6.3.2 Component Portion - * The Operation Code is partitioned into an Operation Family followed by a - * Specifier associated with each Operation Family member. For TIA/EIA-41 the - * Operation Family is coded as decimal 9. Bit H of the Operation Family is always - * coded as 0. - */ - call_dissector(ansi_map_handle, tvb, actx->pinfo, tcap_top_tree); - - return TRUE; -} - -#include "packet-ansi_tcap-fn.c" - - - - -static void -dissect_ansi_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) -{ - proto_item *item=NULL; - proto_tree *tree=NULL; -#if 0 - proto_item *stat_item=NULL; - proto_tree *stat_tree=NULL; - gint offset = 0; - struct tcaphash_context_t * p_tcap_context; - dissector_handle_t subdissector_handle; -#endif - asn1_ctx_t asn1_ctx; - - asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); - ansi_tcap_ctx_init(&ansi_tcap_private); - - tcap_top_tree = parent_tree; - if (check_col(pinfo->cinfo, COL_PROTOCOL)) - { - col_set_str(pinfo->cinfo, COL_PROTOCOL, "ANSI TCAP"); - } - - /* create display subtree for the protocol */ - if(parent_tree){ - item = proto_tree_add_item(parent_tree, proto_ansi_tcap, tvb, 0, -1, FALSE); - tree = proto_item_add_subtree(item, ett_tcap); - tcap_stat_item=item; - tcap_stat_tree=tree; - } - cur_oid = NULL; - tcapext_oid = NULL; - - pinfo->private_data = &ansi_tcap_private; - gp_tcapsrt_info=tcapsrt_razinfo(); - tcap_subdissector_used=FALSE; - gp_tcap_context=NULL; - dissect_ansi_tcap_PackageType(FALSE, tvb, 0, &asn1_ctx, tree, -1); - -#if 0 /* Skipp this part for now it will be rewritten */ - - if (g_ansi_tcap_HandleSRT && !tcap_subdissector_used ) { - if (gtcap_DisplaySRT && tree) { - stat_item = proto_tree_add_text(tree, tvb, 0, 0, "Stat"); - PROTO_ITEM_SET_GENERATED(stat_item); - stat_tree = proto_item_add_subtree(stat_item, ett_ansi_tcap_stat); - } - p_tcap_context=tcapsrt_call_matching(tvb, pinfo, stat_tree, gp_tcapsrt_info); - ansi_tcap_private.context=p_tcap_context; - - /* If the current message is TCAP only, - * save the Application contexte name for the next messages - */ - if ( p_tcap_context && cur_oid && !p_tcap_context->oid_present ) { - /* Save the application context and the sub dissector */ - ber_oid_dissector_table = find_dissector_table("ber.oid"); - strncpy(p_tcap_context->oid,cur_oid, LENGTH_OID); - if ( (subdissector_handle = dissector_get_string_handle(ber_oid_dissector_table, cur_oid)) ) { - p_tcap_context->subdissector_handle=subdissector_handle; - p_tcap_context->oid_present=TRUE; - } - } - if (g_ansi_tcap_HandleSRT && p_tcap_context && p_tcap_context->callback) { - /* Callback fonction for the upper layer */ - (p_tcap_context->callback)(tvb, pinfo, stat_tree, p_tcap_context); - } - } -#endif -} - - -void -proto_reg_handoff_ansi_tcap(void) -{ - - data_handle = find_dissector("data"); - ansi_map_handle = find_dissector("ansi_map"); - ber_oid_dissector_table = find_dissector_table("ber.oid"); -} - - - -void -proto_register_ansi_tcap(void) -{ - -/* Setup list of header fields See Section 1.6.1 for details*/ - static hf_register_info hf[] = { - /* Tcap Service Response Time */ - { &hf_ansi_tcapsrt_SessionId, - { "Session Id", - "ansi_tcap.srt.session_id", - FT_UINT32, BASE_DEC, NULL, 0x0, - "", HFILL } - }, - { &hf_ansi_tcapsrt_BeginSession, - { "Begin Session", - "ansi_tcap.srt.begin", - FT_FRAMENUM, BASE_NONE, NULL, 0x0, - "SRT Begin of Session", HFILL } - }, - { &hf_ansi_tcapsrt_EndSession, - { "End Session", - "ansi_tcap.srt.end", - FT_FRAMENUM, BASE_NONE, NULL, 0x0, - "SRT End of Session", HFILL } - }, - { &hf_ansi_tcapsrt_SessionTime, - { "Session duration", - "ansi_tcap.srt.sessiontime", - FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0, - "Duration of the TCAP session", HFILL } - }, - { &hf_ansi_tcapsrt_Duplicate, - { "Request Duplicate", - "ansi_tcap.srt.duplicate", - FT_UINT32, BASE_DEC, NULL, 0x0, - "", HFILL } - }, -#include "packet-ansi_tcap-hfarr.c" - }; - -/* Setup protocol subtree array */ - static gint *ett[] = { - &ett_tcap, - &ett_param, - &ett_otid, - &ett_dtid, - &ett_ansi_tcap_stat, - #include "packet-ansi_tcap-ettarr.c" - }; - - /*static enum_val_t tcap_options[] = { - { "itu", "ITU", ITU_TCAP_STANDARD }, - { "ansi", "ANSI", ANSI_TCAP_STANDARD }, - { NULL, NULL, 0 } - };*/ - - -/* Register the protocol name and description */ - proto_ansi_tcap = proto_register_protocol(PNAME, PSNAME, PFNAME); - register_dissector("ansi_tcap", dissect_ansi_tcap, proto_ansi_tcap); - -/* Required function calls to register the header fields and subtrees used */ - proto_register_field_array(proto_ansi_tcap, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); - - - register_init_routine(&ansi_tcap_init_protocol); -} - - - - - - - - - - - - - diff --git a/asn1/tcap/packet-ansi_tcap-template.h b/asn1/tcap/packet-ansi_tcap-template.h deleted file mode 100644 index 7ee09a57e2..0000000000 --- a/asn1/tcap/packet-ansi_tcap-template.h +++ /dev/null @@ -1,65 +0,0 @@ -/* packet-ansi-tcap.h - * - * $Id$ - * - * Copyright 2007 Anders Broman <anders.broman@ericsson.com> - * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - - -#ifndef PACKET_ANSI_TCAP_H -#define PACKET_ANSI_TCAP_H - -#define ANSI_TCAP_CTX_SIGNATURE 0x41544341 /* "ATCA" */ - -struct ansi_tcap_private_t { - guint32 signature; - gboolean oid_is_present; /* Is the Application Context Version present */ - void * objectApplicationId_oid; - guint32 session_id; - void * context; - gchar *TransactionID_str; - struct { /* "dynamic" data */ - gint pdu; - /* - 1 : invoke, - 2 : returnResult, - 3 : returnError, - 4 : reject - */ - gint OperationCode; - /* - 0 : national, - 1 : private - */ - gint32 OperationCode_national; - gint32 OperationCode_private; - proto_item *OperationCode_item; - } d; - -}; - -/*extern void add_ansi_tcap_subdissector(guint32 ssn, dissector_handle_t dissector);*/ - - -/*extern void delete_ansi_tcap_subdissector(guint32 ssn, dissector_handle_t dissector);*/ - - -#endif /* PACKET_ANSI_TCAP_H */ |