Remove file_type_subtype member from packet_info.
[metze/wireshark/wip.git] / epan / packet_info.h
1 /* packet_info.h
2  * Definitions for packet info structures and routines
3  *
4  * Wireshark - Network traffic analyzer
5  * By Gerald Combs <gerald@wireshark.org>
6  * Copyright 1998 Gerald Combs
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22
23 #ifndef __PACKET_INFO_H__
24 #define __PACKET_INFO_H__
25
26 #include "frame_data.h"
27 #include "tvbuff.h"
28 #include "address.h"
29
30 /** @file
31  * Dissected packet data and metadata.
32  */
33
34 /** @defgroup packetinfo Packet Data and Metadata
35  *
36  * @{
37  */
38
39 /* Also defined in wiretap/wtap.h */
40 #define P2P_DIR_UNKNOWN -1
41 #define P2P_DIR_SENT    0
42 #define P2P_DIR_RECV    1
43
44 /* Link direction */
45 #define LINK_DIR_UNKNOWN    -1
46 #define P2P_DIR_UL  0
47 #define P2P_DIR_DL  1
48
49 typedef struct _packet_info {
50   const char *current_proto;        /**< name of protocol currently being dissected */
51   struct epan_column_info *cinfo;   /**< Column formatting information */
52   frame_data *fd;
53   union wtap_pseudo_header *pseudo_header;
54   struct wtap_pkthdr *phdr;         /**< Record metadata */
55   GSList *data_src;                 /**< Frame data sources */
56   address dl_src;                   /**< link-layer source address */
57   address dl_dst;                   /**< link-layer destination address */
58   address net_src;                  /**< network-layer source address */
59   address net_dst;                  /**< network-layer destination address */
60   address src;                      /**< source address (net if present, DL otherwise )*/
61   address dst;                      /**< destination address (net if present, DL otherwise )*/
62   circuit_type ctype;               /**< type of circuit, for protocols with a VC identifier */
63   guint32 circuit_id;               /**< circuit ID, for protocols with a VC identifier */
64   const char *noreassembly_reason;  /**< reason why reassembly wasn't done, if any */
65   gboolean fragmented;              /**< TRUE if the protocol is only a fragment */
66   struct {
67     guint32 in_error_pkt:1;         /**< TRUE if we're inside an {ICMP,CLNP,...} error packet */
68     guint32 in_gre_pkt:1;           /**< TRUE if we're encapsulated inside a GRE packet */
69   } flags;
70   port_type ptype;                  /**< type of the following two port numbers */
71   guint32 srcport;                  /**< source port */
72   guint32 destport;                 /**< destination port */
73   guint32 match_uint;               /**< matched uint for calling subdissector from table */
74   const char *match_string;         /**< matched string for calling subdissector from table */
75   guint16 can_desegment;            /**< >0 if this segment could be desegmented.
76                                          A dissector that can offer this API (e.g.
77                                          TCP) sets can_desegment=2, then
78                                          can_desegment is decremented by 1 each time
79                                          we pass to the next subdissector. Thus only
80                                          the dissector immediately above the
81                                          protocol which sets the flag can use it*/
82   guint16 saved_can_desegment;      /**< Value of can_desegment before current
83                                          dissector was called.  Supplied so that
84                                          dissectors for proxy protocols such as
85                                          SOCKS can restore it, allowing the
86                                          dissectors that they call to use the
87                                          TCP dissector's desegmentation (SOCKS
88                                          just retransmits TCP segments once it's
89                                          finished setting things up, so the TCP
90                                          desegmentor can desegment its payload). */
91   int desegment_offset;             /**< offset to stuff needing desegmentation */
92 #define DESEGMENT_ONE_MORE_SEGMENT 0x0fffffff
93 #define DESEGMENT_UNTIL_FIN        0x0ffffffe
94   guint32 desegment_len;            /**< requested desegmentation additional length
95                                        or
96                                        DESEGMENT_ONE_MORE_SEGMENT:
97                                          Desegment one more full segment
98                                          (warning! only partially implemented)
99                                        DESEGMENT_UNTIL_FIN:
100                                          Desgment all data for this tcp session
101                                          until the FIN segment.
102                                     */
103   guint16 want_pdu_tracking;    /**< >0 if the subdissector has specified
104                                    a value in 'bytes_until_next_pdu'.
105                                    When a dissector detects that the next PDU
106                                    will start beyond the start of the next
107                                    segment, it can set this value to 2
108                                    and 'bytes_until_next_pdu' to the number of
109                                    bytes beyond the next segment where the
110                                    next PDU starts.
111
112                                    If the protocol dissector below this
113                                    one is capable of PDU tracking it can
114                                    use this hint to detect PDUs that starts
115                                    unaligned to the segment boundaries.
116                                    The TCP dissector is using this hint from
117                                    (some) protocols to detect when a new PDU
118                                    starts in the middle of a tcp segment.
119
120                                    There is intelligence in the glue between
121                                    dissector layers to make sure that this
122                                    request is only passed down to the protocol
123                                    immediately below the current one and not
124                                    any further.
125                                 */
126   guint32 bytes_until_next_pdu;
127
128   int     p2p_dir;              /**< Packet was captured as an
129                                        outbound (P2P_DIR_SENT)
130                                        inbound (P2P_DIR_RECV)
131                                        unknown (P2P_DIR_UNKNOWN) */
132
133   /**< Extra data for handling of decryption of GSSAPI wrapped tvbuffs.
134      Caller sets decrypt_gssapi_tvb if this service is requested.
135      If gssapi_encrypted_tvb is NULL, then the rest of the tvb data following
136      the gssapi blob itself is decrypted othervise the gssapi_encrypted_tvb
137      tvb will be decrypted (DCERPC has the data before the gssapi blob)
138      If, on return, gssapi_data_encrypted is FALSE, the wrapped tvbuff
139      was signed (i.e., an encrypted signature was present, to check
140      whether the data was modified by a man in the middle) but not sealed
141      (i.e., the data itself wasn't encrypted).
142   */
143 #define DECRYPT_GSSAPI_NORMAL   1
144 #define DECRYPT_GSSAPI_DCE  2
145   guint16 decrypt_gssapi_tvb;
146   tvbuff_t *gssapi_wrap_tvb;
147   tvbuff_t *gssapi_encrypted_tvb;
148   tvbuff_t *gssapi_decrypted_tvb;
149   gboolean gssapi_data_encrypted;
150
151   void    *private_data;        /**< pointer to data passed from one dissector to another */
152   GHashTable *private_table;    /**< a hash table passed from one dissector to another */
153
154   wmem_list_t *layers;      /**< layers of each protocol */
155   guint8 curr_layer_num;       /**< The current "depth" or layer number in the current frame */
156   guint16 link_number;
157   guint8  annex_a_used;         /**< used in packet-mtp2.c
158                                  * defined in wtap.h
159                                  * MTP2_ANNEX_A_NOT_USED      0
160                                  * MTP2_ANNEX_A_USED          1
161                                  * MTP2_ANNEX_A_USED_UNKNOWN  2
162                                  */
163   guint16 profinet_type;        /**< the type of PROFINET packet (0: not a PROFINET packet) */
164
165   struct _sccp_msg_info_t* sccp_info;
166   guint16 clnp_srcref;          /**< clnp/cotp source reference (can't use srcport, this would confuse tpkt) */
167   guint16 clnp_dstref;          /**< clnp/cotp destination reference (can't use dstport, this would confuse tpkt) */
168
169   int link_dir;                 /**< 3GPP messages are sometime different UP link(UL) or Downlink(DL) */
170
171   GSList* proto_data;          /**< Per packet proto data */
172
173   GSList* dependent_frames;     /**< A list of frames which this one depends on */
174
175   GSList* frame_end_routines;
176
177   wmem_allocator_t *pool;      /**< Memory pool scoped to the pinfo struct */
178   struct epan_session *epan;
179   nstime_t     rel_ts;       /**< Relative timestamp (yes, it can be negative) */
180   const gchar  *pkt_comment; /**< NULL if not available */
181   const gchar *heur_list_name;    /**< name of heur list if this packet is being heuristically dissected */
182 } packet_info;
183
184 /** @} */
185
186 #endif /* __PACKET_INFO_H__ */
187
188 /*
189  * Editor modelines
190  *
191  * Local Variables:
192  * c-basic-offset: 2
193  * tab-width: 8
194  * indent-tabs-mode: nil
195  * End:
196  *
197  * ex: set shiftwidth=2 tabstop=8 expandtab:
198  * :indentSize=2:tabSize=8:noTabs=true:
199  */