114 lines
3.0 KiB
C
114 lines
3.0 KiB
C
![]() |
/* packet-h248.c
|
||
|
* Routines for H.248/MEGACO packet dissection
|
||
|
* Ronnie Sahlberg 2004
|
||
|
*
|
||
|
* $Id: packet-h248-template.c,v 1.2 2004/05/25 21:07:43 guy Exp $
|
||
|
*
|
||
|
* Ethereal - Network traffic analyzer
|
||
|
* By Gerald Combs <gerald@ethereal.com>
|
||
|
* 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/conversation.h>
|
||
|
|
||
|
#include <stdio.h>
|
||
|
#include <string.h>
|
||
|
|
||
|
#include "packet-ber.h"
|
||
|
#include "packet-h248.h"
|
||
|
|
||
|
#define PNAME "H.248 MEGACO"
|
||
|
#define PSNAME "H248"
|
||
|
#define PFNAME "h248"
|
||
|
|
||
|
/*XXX this define should be moved to packet-m3ua.h ? */
|
||
|
#define GATEWAY_CONTROL_PROTOCOL_USER_ID 14
|
||
|
|
||
|
/* Initialize the protocol and registered fields */
|
||
|
static int proto_h248 = -1;
|
||
|
#include "packet-h248-hf.c"
|
||
|
|
||
|
/* Initialize the subtree pointers */
|
||
|
static gint ett_h248 = -1;
|
||
|
#include "packet-h248-ett.c"
|
||
|
|
||
|
|
||
|
#include "packet-h248-fn.c"
|
||
|
|
||
|
|
||
|
|
||
|
static void
|
||
|
dissect_h248(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
||
|
{
|
||
|
proto_item *h248_item;
|
||
|
proto_tree *h248_tree = NULL;
|
||
|
|
||
|
/* Make entry in the Protocol column on summary display */
|
||
|
if (check_col(pinfo->cinfo, COL_PROTOCOL))
|
||
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "H.248");
|
||
|
|
||
|
if (tree) {
|
||
|
h248_item = proto_tree_add_item(tree, proto_h248, tvb, 0, -1, FALSE);
|
||
|
h248_tree = proto_item_add_subtree(h248_item, ett_h248);
|
||
|
}
|
||
|
|
||
|
dissect_h248_MegacoMessage(FALSE, tvb, 0, pinfo, h248_tree, -1);
|
||
|
|
||
|
}
|
||
|
|
||
|
/*--- proto_register_h248 ----------------------------------------------*/
|
||
|
void proto_register_h248(void) {
|
||
|
|
||
|
/* List of fields */
|
||
|
static hf_register_info hf[] = {
|
||
|
#include "packet-h248-hfarr.c"
|
||
|
};
|
||
|
|
||
|
/* List of subtrees */
|
||
|
static gint *ett[] = {
|
||
|
&ett_h248,
|
||
|
#include "packet-h248-ettarr.c"
|
||
|
};
|
||
|
|
||
|
/* Register protocol */
|
||
|
proto_h248 = proto_register_protocol(PNAME, PSNAME, PFNAME);
|
||
|
|
||
|
register_dissector("h248", dissect_h248, proto_h248);
|
||
|
|
||
|
/* Register fields and subtrees */
|
||
|
proto_register_field_array(proto_h248, hf, array_length(hf));
|
||
|
proto_register_subtree_array(ett, array_length(ett));
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
/*--- proto_reg_handoff_h248 -------------------------------------------*/
|
||
|
void proto_reg_handoff_h248(void) {
|
||
|
dissector_handle_t h248_handle;
|
||
|
|
||
|
h248_handle = find_dissector("h248");
|
||
|
|
||
|
dissector_add("m3ua.protocol_data_si", GATEWAY_CONTROL_PROTOCOL_USER_ID, h248_handle);
|
||
|
}
|
||
|
|