2 * Definitions for packet info structures and routines
4 * $Id: packet_info.h,v 1.2 2001/05/27 01:48:25 guy Exp $
6 * Ethereal - Network traffic analyzer
7 * By Gerald Combs <gerald@zing.org>
8 * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 #ifndef __PACKET_INFO_H__
27 #define __PACKET_INFO_H__
29 #include "frame_data.h"
32 /* Types of addresses Ethereal knows about. */
34 AT_NONE, /* no link-layer address */
35 AT_ETHER, /* MAC (Ethernet, 802.x, FDDI) address */
40 AT_ATALK, /* Appletalk DDP */
41 AT_VINES, /* Banyan Vines */
42 AT_OSI, /* OSI NSAP */
43 AT_DLCI /* Frame Relay DLCI */
46 typedef struct _address {
47 address_type type; /* type of address */
48 int len; /* length of address, in bytes */
49 const guint8 *data; /* bytes that constitute address */
52 #define SET_ADDRESS(addr, addr_type, addr_len, addr_data) { \
53 (addr)->type = (addr_type); \
54 (addr)->len = (addr_len); \
55 (addr)->data = (addr_data); \
58 /* Types of port numbers Ethereal knows about. */
60 PT_NONE, /* no port number */
64 PT_NCP /* NCP connection */
67 #define P2P_DIR_UNKNOWN -1
68 #define P2P_DIR_SENT 0
69 #define P2P_DIR_RECV 1
71 typedef struct _packet_info {
72 const char *current_proto; /* name of protocol currently being dissected */
74 tvbuff_t *compat_top_tvb; /* only needed while converting Ethereal to use tvbuffs */
75 union wtap_pseudo_header *pseudo_header;
78 address dl_src; /* link-layer source address */
79 address dl_dst; /* link-layer destination address */
80 address net_src; /* network-layer source address */
81 address net_dst; /* network-layer destination address */
82 address src; /* source address (net if present, DL otherwise )*/
83 address dst; /* destination address (net if present, DL otherwise )*/
84 guint32 ethertype; /* Ethernet Type Code, if this is an Ethernet packet */
85 guint32 ipproto; /* IP protocol, if this is an IP packet */
86 guint32 ipxptype; /* IPX packet type, if this is an IPX packet */
87 gboolean fragmented; /* TRUE if the protocol is only a fragment */
88 port_type ptype; /* type of the following two port numbers */
89 guint32 srcport; /* source port */
90 guint32 destport; /* destination port */
102 } rx; /* fields specific for RX protocol */
103 } ps; /* protocol specific data */
106 void blank_packetinfo(void);
108 extern packet_info pi;
110 #endif /* __PACKET_INFO_H__ */