MSWSP: fix dissect_mswsp_smb()
[wireshark-wip.git] / epan / dissectors / packet-xml.h
blobbe9a2334c6cd812e198067e767aa3d3d81710562
1 /* packet-xml.h
2 * wireshark's xml dissector .
4 * $Id$
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 #ifndef __PACKET_XML_H__
25 #define __PACKET_XML_H__
27 #include "ws_symbol_export.h"
29 typedef struct _xml_ns_t {
30 /* the name of this namespace */
31 gchar* name;
33 /* its fully qualified name */
34 const gchar* fqn;
36 /* the contents of the whole element from <> to </> */
37 int hf_tag;
39 /* chunks of cdata from <> to </> excluding sub tags */
40 int hf_cdata;
42 /* the subtree for its sub items */
43 gint ett;
45 GHashTable* attributes;
46 /* key: the attribute name
47 value: hf_id of what's between quotes */
49 /* the namespace's namespaces */
50 GHashTable* elements;
51 /* key: the element name
52 value: the child namespace */
54 GPtrArray* element_names;
55 /* imported directly from the parser and used while building the namespace */
57 } xml_ns_t;
59 #define XML_FRAME_ROOT 0
60 #define XML_FRAME_TAG 1
61 #define XML_FRAME_XMPLI 2
62 #define XML_FRAME_DTD_DOCTYPE 3
63 #define XML_FRAME_ATTRIB 4
64 #define XML_FRAME_CDATA 5
66 typedef struct _xml_frame_t {
67 int type;
68 struct _xml_frame_t* parent;
69 struct _xml_frame_t* first_child;
70 struct _xml_frame_t* last_child;
71 struct _xml_frame_t* prev_sibling;
72 struct _xml_frame_t* next_sibling;
73 const gchar *name;
74 const gchar *name_orig_case;
75 tvbuff_t *value;
76 proto_tree* tree;
77 proto_item* item;
78 proto_item* last_item;
79 xml_ns_t* ns;
80 int start_offset;
81 } xml_frame_t;
83 WS_DLL_PUBLIC
84 xml_frame_t *xml_get_tag(xml_frame_t *frame, const gchar *name);
85 WS_DLL_PUBLIC
86 xml_frame_t *xml_get_attrib(xml_frame_t *frame, const gchar *name);
87 WS_DLL_PUBLIC
88 xml_frame_t *xml_get_cdata(xml_frame_t *frame);
90 #endif /* __PACKET_XML_H__ */