Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
packet-xml.h
1/* packet-xml.h
2 * wireshark's xml dissector .
3 *
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <[email protected]>
6 * Copyright 1998 Gerald Combs
7 *
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
10#ifndef __PACKET_XML_H__
11#define __PACKET_XML_H__
12
13#include "ws_symbol_export.h"
14
15typedef struct _xml_ns_t {
16 /* the name of this namespace */
17 char* name;
18
19 /* its fully qualified name */
20 const char* fqn;
21
22 /* the contents of the whole element from <> to </> */
23 int hf_tag;
24
25 /* chunks of cdata from <> to </> excluding sub tags */
26 int hf_cdata;
27
28 /* the subtree for its sub items */
29 int ett;
30
31 wmem_map_t* attributes;
32 /* key: the attribute name
33 value: hf_id of what's between quotes */
34
35 /* the namespace's namespaces */
36 wmem_map_t* elements;
37 /* key: the element name
38 value: the child namespace */
39
40 GPtrArray* element_names;
41 /* imported directly from the parser and used while building the namespace */
42
43} xml_ns_t;
44
45#define XML_FRAME_ROOT 0
46#define XML_FRAME_TAG 1
47#define XML_FRAME_XMPLI 2
48#define XML_FRAME_DTD_DOCTYPE 3
49#define XML_FRAME_ATTRIB 4
50#define XML_FRAME_CDATA 5
51
52typedef struct _xml_frame_t {
53 int type;
54 struct _xml_frame_t* parent;
55 struct _xml_frame_t* first_child;
56 struct _xml_frame_t* last_child;
57 struct _xml_frame_t* prev_sibling;
58 struct _xml_frame_t* next_sibling;
59 const char *name;
60 const char *name_orig_case;
61 tvbuff_t *value;
62 proto_tree* tree;
63 proto_item* item;
64 proto_item* last_item;
65 xml_ns_t* ns;
66 int start_offset;
67 int length;
68 packet_info* pinfo;
69 wmem_map_t *decryption_keys;
71
72WS_DLL_PUBLIC
73xml_frame_t *xml_get_tag(xml_frame_t *frame, const char *name);
74WS_DLL_PUBLIC
75xml_frame_t *xml_get_attrib(xml_frame_t *frame, const char *name);
76WS_DLL_PUBLIC
77xml_frame_t *xml_get_cdata(xml_frame_t *frame);
78
79#endif /* __PACKET_XML_H__ */
80
81/*
82 * Editor modelines - https://www.wireshark.org/tools/modelines.html
83 *
84 * Local variables:
85 * c-basic-offset: 4
86 * tab-width: 8
87 * indent-tabs-mode: nil
88 * End:
89 *
90 * vi: set shiftwidth=4 tabstop=8 expandtab:
91 * :indentSize=4:tabSize=8:noTabs=true:
92 */
Definition packet_info.h:43
Definition proto.h:903
Definition wmem_map.c:44
Definition packet-xml.h:52
Definition packet-xml.h:15
Definition tvbuff-int.h:35