diff options
Diffstat (limited to 'epan/dissectors/asn1/h323')
-rw-r--r-- | epan/dissectors/asn1/h323/CMakeLists.txt | 53 | ||||
-rw-r--r-- | epan/dissectors/asn1/h323/Makefile.am | 23 | ||||
-rw-r--r-- | epan/dissectors/asn1/h323/Makefile.common | 46 | ||||
-rw-r--r-- | epan/dissectors/asn1/h323/Makefile.nmake | 26 | ||||
-rw-r--r-- | epan/dissectors/asn1/h323/RAS-PROTOCOL-TUNNEL.asn | 25 | ||||
-rw-r--r-- | epan/dissectors/asn1/h323/ROBUSTNESS-DATA.asn | 87 | ||||
-rw-r--r-- | epan/dissectors/asn1/h323/h323.cnf | 15 | ||||
-rw-r--r-- | epan/dissectors/asn1/h323/packet-h323-template.c | 137 | ||||
-rw-r--r-- | epan/dissectors/asn1/h323/packet-h323-template.h | 64 |
9 files changed, 476 insertions, 0 deletions
diff --git a/epan/dissectors/asn1/h323/CMakeLists.txt b/epan/dissectors/asn1/h323/CMakeLists.txt new file mode 100644 index 0000000000..e12af18283 --- /dev/null +++ b/epan/dissectors/asn1/h323/CMakeLists.txt @@ -0,0 +1,53 @@ +# 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 h323 ) + +set( PROTO_OPT ) + +set( EXT_ASN_FILE_LIST +) + +set( ASN_FILE_LIST + RAS-PROTOCOL-TUNNEL.asn + ROBUSTNESS-DATA.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 ) + +set( EXTRA_CNF + "${CMAKE_CURRENT_BINARY_DIR}/../h225/h225-exp.cnf" +) + +ASN2WRS() + diff --git a/epan/dissectors/asn1/h323/Makefile.am b/epan/dissectors/asn1/h323/Makefile.am new file mode 100644 index 0000000000..72d28e600b --- /dev/null +++ b/epan/dissectors/asn1/h323/Makefile.am @@ -0,0 +1,23 @@ +# 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/epan/dissectors/asn1/h323/Makefile.common b/epan/dissectors/asn1/h323/Makefile.common new file mode 100644 index 0000000000..0c15035254 --- /dev/null +++ b/epan/dissectors/asn1/h323/Makefile.common @@ -0,0 +1,46 @@ +# 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 = h323 + +EXT_ASN_FILE_LIST = + +ASN_FILE_LIST = \ + RAS-PROTOCOL-TUNNEL.asn \ + ROBUSTNESS-DATA.asn + +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 = + +EXTRA_CNF = \ + $(builddir)/../h225/h225-exp.cnf + +$(builddir)/../h225/h225-exp.cnf: + (cd $(builddir)/../h225 && $(MAKE_CNF_EXPORT)) + diff --git a/epan/dissectors/asn1/h323/Makefile.nmake b/epan/dissectors/asn1/h323/Makefile.nmake new file mode 100644 index 0000000000..d296638ddd --- /dev/null +++ b/epan/dissectors/asn1/h323/Makefile.nmake @@ -0,0 +1,26 @@ +## 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/epan/dissectors/asn1/h323/RAS-PROTOCOL-TUNNEL.asn b/epan/dissectors/asn1/h323/RAS-PROTOCOL-TUNNEL.asn new file mode 100644 index 0000000000..6b26c59b49 --- /dev/null +++ b/epan/dissectors/asn1/h323/RAS-PROTOCOL-TUNNEL.asn @@ -0,0 +1,25 @@ +-- RAS-PROTOCOL-TUNNEL.asn +-- +-- Taken from ITU ASN.1 database +-- http://www.itu.int/ITU-T/asn1/database/itu-t/h/h323/2006/RAS-PROTOCOL-TUNNEL.asn +-- + +-- Module RAS-PROTOCOL-TUNNEL (H.323:06/2006) +RAS-PROTOCOL-TUNNEL DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS TunnelledProtocol, NonStandardParameter + FROM H323-MESSAGES; + +RasTunnelledSignallingMessage ::= SEQUENCE { + tunnelledProtocolID TunnelledProtocol, -- tunnelled signalling protocol ID + messageContent SEQUENCE OF OCTET STRING, -- sequence of entire message(s) + tunnellingRequired NULL OPTIONAL, + nonStandardData NonStandardParameter OPTIONAL, + ... +} + +END + +-- Generated by Asnp, the ASN.1 pretty-printer of France Telecom R&D + diff --git a/epan/dissectors/asn1/h323/ROBUSTNESS-DATA.asn b/epan/dissectors/asn1/h323/ROBUSTNESS-DATA.asn new file mode 100644 index 0000000000..00e76f05a5 --- /dev/null +++ b/epan/dissectors/asn1/h323/ROBUSTNESS-DATA.asn @@ -0,0 +1,87 @@ +-- ROBUSTNESS-DATA.asn +-- +-- ITU-T Rec. H.323 (06/2006) +-- +-- Annex R - Robustness methods for H.323 entities +-- R.11 GenericData usage +-- + +ROBUSTNESS-DATA DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS + TransportAddress, AlternateTransportAddresses, + GloballyUniqueID, TimeToLive + FROM H323-MESSAGES; + +RobustnessData ::= SEQUENCE { + versionID INTEGER(1..256), + robustnessData + CHOICE { + rrqData Rrq-RD, + rcfData Rcf-RD, + setupData Setup-RD, + connectData Connect-RD, + statusData Status-RD, + statusInquiryData StatusInquiry-RD, + ... + }, + ... +} + +BackupCallSignalAddresses ::= SEQUENCE OF + CHOICE { + tcp TransportAddress, + alternateTransport AlternateTransportAddresses, + ... + } + +GloballyUniqueIdentifier ::= GloballyUniqueID + +Rrq-RD ::= SEQUENCE { + backupCallSignalAddresses BackupCallSignalAddresses, + hasSharedRepository NULL OPTIONAL, + ... +} + +Rcf-RD ::= SEQUENCE { + hasSharedRepository NULL OPTIONAL, + ..., + irrFrequency INTEGER(1..65535) OPTIONAL -- in seconds; + -- not present + -- if GK does not + -- want IRRs for + -- recovered calls +} + +Setup-RD ::= SEQUENCE { + backupCallSignalAddresses BackupCallSignalAddresses, + hasSharedRepository NULL OPTIONAL, + endpointGuid GloballyUniqueIdentifier OPTIONAL, + ... +} + +Connect-RD ::= SEQUENCE { + backupCallSignalAddresses BackupCallSignalAddresses, + hasSharedRepository NULL OPTIONAL, + endpointGuid GloballyUniqueIdentifier OPTIONAL, + ... +} + +Status-RD ::= SEQUENCE { + h245Address TransportAddress OPTIONAL, + fastStart SEQUENCE OF OCTET STRING OPTIONAL, + ..., + resetH245 NULL OPTIONAL +} + +StatusInquiry-RD ::= SEQUENCE { + h245Address TransportAddress OPTIONAL, + timeToLive TimeToLive OPTIONAL, + includeFastStart NULL OPTIONAL, + ... +} + +robustnessId GenericIdentifier ::= standard:1 + +END diff --git a/epan/dissectors/asn1/h323/h323.cnf b/epan/dissectors/asn1/h323/h323.cnf new file mode 100644 index 0000000000..51d33734b0 --- /dev/null +++ b/epan/dissectors/asn1/h323/h323.cnf @@ -0,0 +1,15 @@ +# h323.cnf +# H.323 conformation file +# 2007 Tomas Kukosa + +#.IMPORT ../h225/h225-exp.cnf + +#.OPT +PER +ALIGNED +#.END + +#.PDU +RasTunnelledSignallingMessage +RobustnessData +#.END diff --git a/epan/dissectors/asn1/h323/packet-h323-template.c b/epan/dissectors/asn1/h323/packet-h323-template.c new file mode 100644 index 0000000000..4068c7dc16 --- /dev/null +++ b/epan/dissectors/asn1/h323/packet-h323-template.c @@ -0,0 +1,137 @@ +/* packet-h323.c + * Routines for H.323 packet dissection + * 2007 Tomas Kukosa + * + * 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/oids.h> +#include <epan/asn1.h> + +#include "packet-per.h" +#include "packet-h225.h" +#include "packet-h323.h" + +#define PNAME "H.323" +#define PSNAME "H.323" +#define PFNAME "h323" + +void proto_register_h323(void); +void proto_reg_handoff_h323(void); + +/* Generic Extensible Framework */ +gef_ctx_t* gef_ctx_alloc(gef_ctx_t *parent, const gchar *type) { + gef_ctx_t *gefx; + + gefx = wmem_new0(wmem_packet_scope(), gef_ctx_t); + gefx->signature = GEF_CTX_SIGNATURE; + gefx->parent = parent; + gefx->type = type; + return gefx; +} + +gboolean gef_ctx_check_signature(gef_ctx_t *gefx) { + return gefx && (gefx->signature == GEF_CTX_SIGNATURE); +} + +gef_ctx_t* gef_ctx_get(void *ptr) { + gef_ctx_t *gefx = (gef_ctx_t*)ptr; + asn1_ctx_t *actx = (asn1_ctx_t*)ptr; + + if (!asn1_ctx_check_signature(actx)) + actx = NULL; + + if (actx) + gefx = (gef_ctx_t *)actx->private_data; + + if (!gef_ctx_check_signature(gefx)) + gefx = NULL; + + return gefx; +} + +void gef_ctx_update_key(gef_ctx_t *gefx) { + const gchar *parent_key; + + if (!gefx) return; + parent_key = (gefx->parent) ? gefx->parent->key : NULL; + gefx->key = wmem_strdup_printf(wmem_packet_scope(), + "%s%s" /* parent prefix */ + "%s%s%s" /* type, id */ + "%s%s" /* subid */, + (parent_key) ? parent_key : "", (parent_key) ? "/" : "", + (gefx->type) ? gefx->type : "", (gefx->type && (gefx->id || gefx->subid)) ? "/" : "", (gefx->id) ? gefx->id : "", + (gefx->subid) ? "-" : "", (gefx->subid) ? gefx->subid : "" + ); +} + +/* Initialize the protocol and registered fields */ +static int proto_h323 = -1; +#include "packet-h323-hf.c" + +/* Initialize the subtree pointers */ +#include "packet-h323-ett.c" + +#include "packet-h323-fn.c" + +/*--- proto_register_h323 ----------------------------------------------*/ +void proto_register_h323(void) { + + /* List of fields */ + static hf_register_info hf[] = { +#include "packet-h323-hfarr.c" + }; + + /* List of subtrees */ + static gint *ett[] = { +#include "packet-h323-ettarr.c" + }; + + /* Register protocol */ + proto_h323 = proto_register_protocol(PNAME, PSNAME, PFNAME); + + /* Register fields and subtrees */ + proto_register_field_array(proto_h323, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); + +} + + +/*--- proto_reg_handoff_h323 -------------------------------------------*/ +void proto_reg_handoff_h323(void) +{ + dissector_handle_t q931_handle; + + q931_handle = find_dissector("q931"); + + /* H.323, Annex M1, Tunnelling of signalling protocols (QSIG) in H.323 */ + dissector_add_string("h225.tp", "1.3.12.9", q931_handle); + + /* H.323, Annex M4, Tunnelling of narrow-band signalling syntax (NSS) for H.323 */ + dissector_add_string("h225.gef.content", "GenericData/1000/1", + create_dissector_handle(dissect_RasTunnelledSignallingMessage_PDU, proto_h323)); + + /* H.323, Annex R, Robustness methods for H.323 entities */ + dissector_add_string("h225.gef.content", "GenericData/1/1", + create_dissector_handle(dissect_RobustnessData_PDU, proto_h323)); +} + diff --git a/epan/dissectors/asn1/h323/packet-h323-template.h b/epan/dissectors/asn1/h323/packet-h323-template.h new file mode 100644 index 0000000000..1d2750fb27 --- /dev/null +++ b/epan/dissectors/asn1/h323/packet-h323-template.h @@ -0,0 +1,64 @@ +/* packet-h323.h + * Routines for H.235 packet dissection + * 2007 Tomas Kukosa + * + * 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_H323_H +#define PACKET_H323_H + +/* Generic Extensible Framework */ + +#define GEF_CTX_SIGNATURE 0x47454658 /* "GEFX" */ + +typedef struct _gef_ctx_t { + guint32 signature; + struct _gef_ctx_t *parent; + /* + H323-MESSAGES + FeatureDescriptor/<id> + <id> + GenericData/<id> + <id> + MULTIMEDIA-SYSTEM-CONTROL + GenericInformation/<id>[-<subid>] + <id> + GenericMessage/<id>[-<subid>] + <id> + GenericCapability/<id> + collapsing/<id> + nonCollapsing/<id> + nonCollapsingRaw + EncryptionSync + <id> + */ + const gchar *type; + const gchar *id; + const gchar *subid; + const gchar *key; +} gef_ctx_t; + +extern gef_ctx_t* gef_ctx_alloc(gef_ctx_t *parent, const gchar *type); +extern gboolean gef_ctx_check_signature(gef_ctx_t *gefx); +extern gef_ctx_t* gef_ctx_get(void *ptr); +extern void gef_ctx_update_key(gef_ctx_t *gefx); + +#endif /* PACKET_H323_H */ + |