HACK: pinfo->private_data points to smb_info again
[wireshark-wip.git] / epan / dissectors / packet-dvb-ipdc.c
blobcb74b69c2cdd07d0c81d897d7489416235c8e648
1 /* packet-dvb-ipdc.c
2 * Routines for ETSI IP Datacast ESG Bootstrap parsing
3 * Copyright 2009 by Holger Hans Peter Freyther <zecke@selfish.org>
5 * $Id$
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 #include "config.h"
28 #include <glib.h>
30 #include <epan/packet.h>
32 void proto_register_dvb_ipdc(void);
33 void proto_reg_handoff_dvb_ipdc(void);
35 /* Initialize the protocol and registered fields */
36 static int proto_ipdc = -1;
38 /* static int hf_ipdc_esg_bootstrap_xml = -1; */
40 /* Initialize the subtree pointers */
41 static gint ett_ipdc = -1;
44 enum {
45 DVB_IPDC_SUB_FLUTE,
46 DVB_IPDC_SUB_MAX
49 static dissector_handle_t sub_handles[DVB_IPDC_SUB_MAX];
51 #define UDP_PORT_IPDC_ESG_BOOTSTRAP 9214
54 /* Code to actually dissect the packets */
55 static void
56 dissect_ipdc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
58 tvbuff_t *next_tvb;
59 proto_tree *esg_tree = NULL;
61 col_set_str(pinfo->cinfo, COL_PROTOCOL, "IPDC");
62 col_clear(pinfo->cinfo, COL_INFO);
64 /* call into flute */
65 if (tree) {
66 proto_item *ti;
68 ti = proto_tree_add_protocol_format(tree, proto_ipdc, tvb, 0, -1,
69 "ESG Bootstrap");
70 esg_tree = proto_item_add_subtree(ti, ett_ipdc);
73 next_tvb = tvb_new_subset_remaining(tvb, 0);
74 call_dissector(sub_handles[DVB_IPDC_SUB_FLUTE], next_tvb, pinfo, esg_tree);
77 void
78 proto_register_dvb_ipdc(void)
80 #if 0
81 static hf_register_info hf[] = {
82 {&hf_ipdc_esg_bootstrap_xml,
83 {"ESG Provider Discovery", "ipdc.bootstrap",
84 FT_STRING, BASE_NONE, NULL, 0x0, "List of ESG Providers", HFILL}}
86 #endif
88 static gint *ett[] = {
89 &ett_ipdc,
92 proto_ipdc = proto_register_protocol("ETSI IPDC Bootstrap",
93 "ESG Bootstrap", "dvb_ipdc");
94 #if 0
95 proto_register_field_array(proto_ipdc, hf, array_length(hf));
96 #endif
97 proto_register_subtree_array(ett, array_length(ett));
99 register_dissector("dvb_ipdc", dissect_ipdc, proto_ipdc);
102 void
103 proto_reg_handoff_dvb_ipdc(void)
105 dissector_handle_t ipdc_handle;
107 sub_handles[DVB_IPDC_SUB_FLUTE] = find_dissector("alc");
109 ipdc_handle = create_dissector_handle(dissect_ipdc, proto_ipdc);
110 dissector_add_uint("udp.port", UDP_PORT_IPDC_ESG_BOOTSTRAP, ipdc_handle);
114 * Editor modelines - http://www.wireshark.org/tools/modelines.html
116 * Local variables:
117 * c-basic-offset: 4
118 * tab-width: 8
119 * indent-tabs-mode: nil
120 * End:
122 * vi: set shiftwidth=4 tabstop=8 expandtab:
123 * :indentSize=4:tabSize=8:noTabs=true: