diff options
author | Tomas Kukosa <tomas.kukosa@siemens.com> | 2007-11-02 12:18:01 +0000 |
---|---|---|
committer | Tomas Kukosa <tomas.kukosa@siemens.com> | 2007-11-02 12:18:01 +0000 |
commit | 686ea4b77376b71de2db70bdf01b676aaa6d39b9 (patch) | |
tree | 9e77b52a23c0ce28d6c76123da9c0170012eb20d /asn1/h283 | |
parent | 475ec209ceed8be8ee260ba0004e65ea1f7977f6 (diff) |
new H.282 (RDC) and H.283 (LCT) dissectors
svn path=/trunk/; revision=23339
Diffstat (limited to 'asn1/h283')
-rw-r--r-- | asn1/h283/LCT-PROTOCOL.asn | 79 | ||||
-rw-r--r-- | asn1/h283/Makefile.am | 26 | ||||
-rw-r--r-- | asn1/h283/Makefile.common | 46 | ||||
-rw-r--r-- | asn1/h283/Makefile.nmake | 29 | ||||
-rw-r--r-- | asn1/h283/h283.cnf | 117 | ||||
-rw-r--r-- | asn1/h283/packet-h283-template.c | 119 |
6 files changed, 416 insertions, 0 deletions
diff --git a/asn1/h283/LCT-PROTOCOL.asn b/asn1/h283/LCT-PROTOCOL.asn new file mode 100644 index 0000000000..b4c53edf31 --- /dev/null +++ b/asn1/h283/LCT-PROTOCOL.asn @@ -0,0 +1,79 @@ +-- http://www.itu.int/ITU-T/asn1/database/itu-t/h/h283/1999/LCT-PROTOCOL.asn + +-- Module LCT-PROTOCOL (H.283:05/1999) +LCT-PROTOCOL {itu-t recommendation h 283 version(0) 1} DEFINITIONS AUTOMATIC +TAGS ::= +BEGIN + +H221NonStandard ::= SEQUENCE { + t35CountryCode INTEGER(0..255), -- country, as per Recommendation T.35 + t35Extension INTEGER(0..255), -- assigned nationally + manufacturerCode INTEGER(0..65535) +} -- assigned nationally + +NonStandardIdentifier ::= CHOICE { + object OBJECT IDENTIFIER, + h221NonStandard H221NonStandard, + ... +} + +NonStandardParameter ::= SEQUENCE { + nonStandardIdentifier NonStandardIdentifier, + data OCTET STRING +} + +LCTPDU ::= SEQUENCE { + srcAddr MTAddress, + dstAddr MTAddress, + timestamp INTEGER(0..4294967295), -- milliseconds + seqNumber INTEGER(0..65535), + pduType CHOICE {ack NULL, + rdcData RDCData}, + nonStandardParameters SEQUENCE OF NonStandardParameter OPTIONAL, + ... +} + +MTAddress ::= SEQUENCE { + mAddress INTEGER(0..65535), + tAddress INTEGER(0..65535) +} + +RDCData ::= SEQUENCE { + reliable BOOLEAN, + dataType CHOICE {lctMessage LCTMessage, + rdcPDU OCTET STRING}, -- Common RDC PDU + ... +} + +LCTMessage ::= CHOICE { + lctRequest LCTRequest, + lctResponse LCTResponse, + lctIndication LCTIndication, + nonStandardMessage NonStandardMessage, + ... +} + +LCTRequest ::= CHOICE {announceReq NULL, + deviceListReq NULL, + ... +} + +LCTResponse ::= CHOICE { + announceResp NULL, + deviceListResp OCTET STRING, -- Common RDC + ... +} + +LCTIndication ::= CHOICE {deviceChange NULL, + ... +} + +NonStandardMessage ::= SEQUENCE { + nonStandardParameters SEQUENCE OF NonStandardParameter OPTIONAL, + ... +} + +END + +-- Generated by Asnp, the ASN.1 pretty-printer of France Telecom R&D + diff --git a/asn1/h283/Makefile.am b/asn1/h283/Makefile.am new file mode 100644 index 0000000000..462af31e88 --- /dev/null +++ b/asn1/h283/Makefile.am @@ -0,0 +1,26 @@ +# $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.preinc +include Makefile.common +include ../Makefile.inc + diff --git a/asn1/h283/Makefile.common b/asn1/h283/Makefile.common new file mode 100644 index 0000000000..2795ca0896 --- /dev/null +++ b/asn1/h283/Makefile.common @@ -0,0 +1,46 @@ +# $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 = h283 + +DISSECTOR_FILES = \ + packet-$(PROTOCOL_NAME).c + +# NEED_PACKET_PROTO_H = + +EXT_ASN_FILE_LIST = + +ASN_FILE_LIST = \ + LCT-PROTOCOL.asn + +EXTRA_DIST = \ + $(ASN_FILE_LIST) \ + packet-$(PROTOCOL_NAME)-template.c \ + $(PROTOCOL_NAME).cnf + +SRC_FILES = \ + $(EXTRA_DIST) \ + $(EXT_ASN_FILE_LIST) + +A2W_FLAGS = + +EXTRA_CNF = diff --git a/asn1/h283/Makefile.nmake b/asn1/h283/Makefile.nmake new file mode 100644 index 0000000000..5a32997c60 --- /dev/null +++ b/asn1/h283/Makefile.nmake @@ -0,0 +1,29 @@ +## 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 +include ../Makefile.preinc.nmake +include Makefile.common +include ../Makefile.inc.nmake + diff --git a/asn1/h283/h283.cnf b/asn1/h283/h283.cnf new file mode 100644 index 0000000000..eed494a537 --- /dev/null +++ b/asn1/h283/h283.cnf @@ -0,0 +1,117 @@ +# h283.cnf +# H.283 conformation file +# 2007 Tomas Kukosa + +# $Id$ + +#.OPT +PER +ALIGNED +#.END + +#.PDU_NEW +LCTPDU +#.END + +#.FN_PARS LCTPDU/pduType + VAL_PTR = &pdu_type +#.FN_HDR + gint32 pdu_type = -1; + const gchar *p = NULL; +#.FN_FTR + p = match_strval(pdu_type, VALS(h283_T_pduType_vals)); + if (!info_is_set && p && check_col(actx->pinfo->cinfo, COL_INFO)) { + col_set_str(actx->pinfo->cinfo, COL_INFO, p); + info_is_set = TRUE; + } +#.END + +#.FN_PARS RDCData/dataType + VAL_PTR = &data_type +#.FN_HDR + gint32 data_type = -1; + const gchar *p = NULL; +#.FN_FTR + p = match_strval(data_type, VALS(h283_T_dataType_vals)); + if (!info_is_set && p && check_col(actx->pinfo->cinfo, COL_INFO)) { + col_add_fstr(actx->pinfo->cinfo, COL_INFO, "RDCData/%s", p); + info_is_set = TRUE; + } +#.END + +#.FN_PARS LCTMessage + VAL_PTR = &msg_type +#.FN_HDR + gint32 msg_type = -1; + const gchar *p = NULL; +#.FN_FTR + p = match_strval(msg_type, VALS(h283_LCTMessage_vals)); + if (!info_is_set && p && check_col(actx->pinfo->cinfo, COL_INFO)) { + col_add_fstr(actx->pinfo->cinfo, COL_INFO, "LCTMessage/%s", p); + info_is_set = TRUE; + } +#.END + +#.FN_PARS LCTRequest + VAL_PTR = &msg_type +#.FN_HDR + gint32 msg_type = -1; + const gchar *p = NULL; +#.FN_FTR + p = match_strval(msg_type, VALS(h283_LCTRequest_vals)); + if (!info_is_set && p && check_col(actx->pinfo->cinfo, COL_INFO)) { + col_add_fstr(actx->pinfo->cinfo, COL_INFO, "LCTRequest/%s", p); + info_is_set = TRUE; + } +#.END + +#.FN_PARS LCTResponse + VAL_PTR = &msg_type +#.FN_HDR + gint32 msg_type = -1; + const gchar *p = NULL; +#.FN_FTR + p = match_strval(msg_type, VALS(h283_LCTResponse_vals)); + if (!info_is_set && p && check_col(actx->pinfo->cinfo, COL_INFO)) { + col_add_fstr(actx->pinfo->cinfo, COL_INFO, "LCTResponse/%s", p); + info_is_set = TRUE; + } +#.END + +#.FN_PARS LCTIndication + VAL_PTR = &msg_type +#.FN_HDR + gint32 msg_type = -1; + const gchar *p = NULL; +#.FN_FTR + p = match_strval(msg_type, VALS(h283_LCTIndication_vals)); + if (!info_is_set && p && check_col(actx->pinfo->cinfo, COL_INFO)) { + col_add_fstr(actx->pinfo->cinfo, COL_INFO, "LCTIndication/%s", p); + info_is_set = TRUE; + } +#.END + +#.FN_BODY RDCData/dataType/rdcPDU VAL_PTR = &next_tvb + tvbuff_t *next_tvb = NULL; + +%(DEFAULT_BODY)s + if (next_tvb && tvb_length(next_tvb)) { + call_dissector((rdc_pdu_handle)?rdc_pdu_handle:data_handle, next_tvb, %(ACTX)s->pinfo, proto_tree_get_root(tree)); + } + info_is_set = TRUE; +#.END + +#.FN_BODY LCTResponse/deviceListResp VAL_PTR = &next_tvb + tvbuff_t *next_tvb = NULL; + +%(DEFAULT_BODY)s + if (next_tvb && tvb_length(next_tvb)) { + call_dissector((rdc_device_list_handle)?rdc_device_list_handle:data_handle, next_tvb, %(ACTX)s->pinfo, tree); + } +#.END + +#.TYPE_ATTR +RDCData/dataType/rdcPDU TYPE = FT_UINT32 DISPLAY = BASE_DEC +LCTResponse/deviceListResp TYPE = FT_UINT32 DISPLAY = BASE_DEC +#.END + diff --git a/asn1/h283/packet-h283-template.c b/asn1/h283/packet-h283-template.c new file mode 100644 index 0000000000..c47ad76836 --- /dev/null +++ b/asn1/h283/packet-h283-template.c @@ -0,0 +1,119 @@ +/* packet-h283.c + * Routines for H.283 packet dissection + * 2007 Tomas Kukosa + * + * $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. + */ + +#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/asn1.h> + +#include <stdio.h> +#include <string.h> + +#include "packet-per.h" + +#define PNAME "H.283 Logical Channel Transport" +#define PSNAME "LCT" +#define PFNAME "lct" + +/* Initialize the protocol and registered fields */ +int proto_h283 = -1; +#include "packet-h283-hf.c" + +/* Initialize the subtree pointers */ +static int ett_h283 = -1; +#include "packet-h283-ett.c" + +/* Dissectors */ +static dissector_handle_t h283_udp_handle = NULL; + +/* Subdissectors */ +static dissector_handle_t rdc_pdu_handle = NULL; +static dissector_handle_t rdc_device_list_handle = NULL; +static dissector_handle_t data_handle = NULL; + +static gboolean info_is_set; + +#include "packet-h283-fn.c" + +static int +dissect_h283_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +{ + proto_item *ti = NULL; + proto_tree *h283_tree = NULL; + + if (check_col(pinfo->cinfo, COL_PROTOCOL)) + col_set_str(pinfo->cinfo, COL_PROTOCOL, PSNAME); + + info_is_set = FALSE; + + ti = proto_tree_add_item(tree, proto_h283, tvb, 0, -1, FALSE); + h283_tree = proto_item_add_subtree(ti, ett_h283); + + return dissect_LCTPDU_PDU(tvb, pinfo, h283_tree); +} + +/*--- proto_register_h283 ----------------------------------------------*/ +void proto_register_h283(void) { + + /* List of fields */ + static hf_register_info hf[] = { +#include "packet-h283-hfarr.c" + }; + + /* List of subtrees */ + static gint *ett[] = { + &ett_h283, +#include "packet-h283-ettarr.c" + }; + + /* Register protocol */ + proto_h283 = proto_register_protocol(PNAME, PSNAME, PFNAME); + + /* Register fields and subtrees */ + proto_register_field_array(proto_h283, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); + + register_dissector(PFNAME, dissect_h283_udp, proto_h283); + h283_udp_handle = find_dissector(PFNAME); + +} + +/*--- proto_reg_handoff_h283 -------------------------------------------*/ +void proto_reg_handoff_h283(void) +{ + + dissector_add_handle("udp.port", h283_udp_handle); + + rdc_pdu_handle = find_dissector("rdc"); + rdc_device_list_handle = find_dissector("rdc.device_list"); + data_handle = find_dissector("data"); +} + |