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/conversation.h>
33 #include <epan/oids.h>
34 #include <epan/asn1.h>
39 #include "packet-per.h"
40 #include "packet-h225.h"
41 #include "packet-h323.h"
44 #define PSNAME "H.323"
48 /* Generic Extensible Framework */
49 gef_ctx_t* gef_ctx_alloc(gef_ctx_t *parent, const gchar *type) {
52 gefx = ep_alloc0(sizeof(gef_ctx_t));
53 gefx->signature = GEF_CTX_SIGNATURE;
54 gefx->parent = parent;
59 gboolean gef_ctx_check_signature(gef_ctx_t *gefx) {
60 return gefx && (gefx->signature == GEF_CTX_SIGNATURE);
63 gef_ctx_t* gef_ctx_get(void *ptr) {
64 gef_ctx_t *gefx = (gef_ctx_t*)ptr;
65 asn1_ctx_t *actx = (asn1_ctx_t*)ptr;
67 if (!asn1_ctx_check_signature(actx))
71 gefx = actx->private_data;
73 if (!gef_ctx_check_signature(gefx))
79 void gef_ctx_update_key(gef_ctx_t *gefx) {
80 const gchar *parent_key;
83 parent_key = (gefx->parent) ? gefx->parent->key : NULL;
84 gefx->key = ep_strdup_printf(
85 "%s%s" /* parent prefix */
86 "%s%s%s" /* type, id */
88 (parent_key) ? parent_key : "", (parent_key) ? "/" : "",
89 (gefx->type) ? gefx->type : "", (gefx->type && (gefx->id || gefx->subid)) ? "/" : "", (gefx->id) ? gefx->id : "",
90 (gefx->subid) ? "-" : "", (gefx->subid) ? gefx->subid : ""
94 /* Initialize the protocol and registered fields */
96 #include "packet-h323-hf.c"
98 /* Initialize the subtree pointers */
99 #include "packet-h323-ett.c"
101 #include "packet-h323-fn.c"
103 /*--- proto_register_h323 ----------------------------------------------*/
104 void proto_register_h323(void) {
107 static hf_register_info hf[] = {
108 #include "packet-h323-hfarr.c"
111 /* List of subtrees */
112 static gint *ett[] = {
113 #include "packet-h323-ettarr.c"
116 /* Register protocol */
117 proto_h323 = proto_register_protocol(PNAME, PSNAME, PFNAME);
119 /* Register fields and subtrees */
120 proto_register_field_array(proto_h323, hf, array_length(hf));
121 proto_register_subtree_array(ett, array_length(ett));
126 /*--- proto_reg_handoff_h323 -------------------------------------------*/
127 void proto_reg_handoff_h323(void)
129 dissector_handle_t q931_handle;
131 q931_handle = find_dissector("q931");
133 /* H.323, Annex M1, Tunnelling of signalling protocols (QSIG) in H.323 */
134 dissector_add_string("h225.tp", "1.3.12.9", q931_handle);
136 /* H.323, Annex M4, Tunnelling of narrow-band signalling syntax (NSS) for H.323 */
137 dissector_add_string("h225.gef.content", "GenericData/1000/1",
138 new_create_dissector_handle(dissect_RasTunnelledSignallingMessage_PDU, proto_h323));
140 /* H.323, Annex R, Robustness methods for H.323 entities */
141 dissector_add_string("h225.gef.content", "GenericData/1/1",
142 new_create_dissector_handle(dissect_RobustnessData_PDU, proto_h323));