2 * Routines for H.323 packet dissection
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 #include <epan/packet.h>
32 #include <epan/oids.h>
33 #include <epan/asn1.h>
38 #include "packet-per.h"
39 #include "packet-h225.h"
40 #include "packet-h323.h"
43 #define PSNAME "H.323"
47 /* Generic Extensible Framework */
48 gef_ctx_t* gef_ctx_alloc(gef_ctx_t *parent, const gchar *type) {
51 gefx = ep_alloc0(sizeof(gef_ctx_t));
52 gefx->signature = GEF_CTX_SIGNATURE;
53 gefx->parent = parent;
58 gboolean gef_ctx_check_signature(gef_ctx_t *gefx) {
59 return gefx && (gefx->signature == GEF_CTX_SIGNATURE);
62 gef_ctx_t* gef_ctx_get(void *ptr) {
63 gef_ctx_t *gefx = (gef_ctx_t*)ptr;
64 asn1_ctx_t *actx = (asn1_ctx_t*)ptr;
66 if (!asn1_ctx_check_signature(actx))
70 gefx = actx->private_data;
72 if (!gef_ctx_check_signature(gefx))
78 void gef_ctx_update_key(gef_ctx_t *gefx) {
79 const gchar *parent_key;
82 parent_key = (gefx->parent) ? gefx->parent->key : NULL;
83 gefx->key = ep_strdup_printf(
84 "%s%s" /* parent prefix */
85 "%s%s%s" /* type, id */
87 (parent_key) ? parent_key : "", (parent_key) ? "/" : "",
88 (gefx->type) ? gefx->type : "", (gefx->type && (gefx->id || gefx->subid)) ? "/" : "", (gefx->id) ? gefx->id : "",
89 (gefx->subid) ? "-" : "", (gefx->subid) ? gefx->subid : ""
93 /* Initialize the protocol and registered fields */
95 #include "packet-h323-hf.c"
97 /* Initialize the subtree pointers */
98 #include "packet-h323-ett.c"
100 #include "packet-h323-fn.c"
102 /*--- proto_register_h323 ----------------------------------------------*/
103 void proto_register_h323(void) {
106 static hf_register_info hf[] = {
107 #include "packet-h323-hfarr.c"
110 /* List of subtrees */
111 static gint *ett[] = {
112 #include "packet-h323-ettarr.c"
115 /* Register protocol */
116 proto_h323 = proto_register_protocol(PNAME, PSNAME, PFNAME);
118 /* Register fields and subtrees */
119 proto_register_field_array(proto_h323, hf, array_length(hf));
120 proto_register_subtree_array(ett, array_length(ett));
125 /*--- proto_reg_handoff_h323 -------------------------------------------*/
126 void proto_reg_handoff_h323(void)
128 dissector_handle_t q931_handle;
130 q931_handle = find_dissector("q931");
132 /* H.323, Annex M1, Tunnelling of signalling protocols (QSIG) in H.323 */
133 dissector_add_string("h225.tp", "1.3.12.9", q931_handle);
135 /* H.323, Annex M4, Tunnelling of narrow-band signalling syntax (NSS) for H.323 */
136 dissector_add_string("h225.gef.content", "GenericData/1000/1",
137 new_create_dissector_handle(dissect_RasTunnelledSignallingMessage_PDU, proto_h323));
139 /* H.323, Annex R, Robustness methods for H.323 entities */
140 dissector_add_string("h225.gef.content", "GenericData/1/1",
141 new_create_dissector_handle(dissect_RobustnessData_PDU, proto_h323));