From Harald Welte:
[obnox/wireshark/wip.git] / epan / column_info.h
1 /* column_info.h
2  * Definitions for column structures and routines
3  *
4  * $Id$
5  *
6  * Wireshark - Network traffic analyzer
7  * By Gerald Combs <gerald@wireshark.org>
8  * Copyright 1998 Gerald Combs
9  *
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.
14  *
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.
19  *
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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
23  */
24
25 #ifndef __COLUMN_INFO_H__
26 #define __COLUMN_INFO_H__
27
28 #include <glib.h>
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif /* __cplusplus */
33
34 /** @file
35  * Column info.
36  */
37
38 #define COL_MAX_LEN 256
39 #define COL_MAX_INFO_LEN 4096
40
41 /** Column expression */
42 typedef struct {
43   const gchar **col_expr;     /**< Filter expression */
44   gchar      **col_expr_val;  /**< Value for filter expression */
45 } col_expr_t;
46
47 /** Column info */
48 typedef struct _column_info {
49   gint                num_cols;             /**< Number of columns */
50   gint               *col_fmt;              /**< Format of column */
51   gboolean          **fmt_matx;             /**< Specifies which formats apply to a column */
52   gint               *col_first;            /**< First column number with a given format */
53   gint               *col_last;             /**< Last column number with a given format */
54   gchar             **col_title;            /**< Column titles */
55   gchar             **col_custom_field;     /**< Custom column field */
56   gint               *col_custom_occurrence;/**< Custom column field occurrence */
57   gint               *col_custom_field_id;  /**< Custom column field id */
58   struct _dfilter_t **col_custom_dfilter;   /**< Compiled custom column field */
59   const gchar       **col_data;             /**< Column data */
60   gchar             **col_buf;              /**< Buffer into which to copy data for column */
61   int                *col_fence;            /**< Stuff in column buffer before this index is immutable */
62   col_expr_t          col_expr;             /**< Column expressions and values */
63   gboolean            writable;             /**< writable or not @todo Are we still writing to the columns? */
64   gboolean            columns_changed;      /**< Have the columns been changed in the prefs? */
65 } column_info;
66
67 /**
68  * All of the possible columns in summary listing.
69  *
70  * NOTE1: The entries MUST remain in this order, or else you need to reorder
71  *        the slist[] and dlist[] arrays in column.c to match!
72  *
73  * NOTE2: Please add the COL_XYZ entry in the appropriate spot, such that the
74  *        dlist[] array remains in alphabetical order!
75  */
76 enum {
77   COL_8021Q_VLAN_ID,  /**< 0) 802.1Q vlan ID */
78   COL_ABS_DATE_TIME,  /**< 1) Absolute date and time */
79   COL_ABS_TIME,       /**< 2) Absolute time */
80   COL_CIRCUIT_ID,     /**< 3) Circuit ID */
81   COL_DSTIDX,         /**< 4) !! DEPRECATED !! - Dst port idx - Cisco MDS-specific */
82   COL_SRCIDX,         /**< 5) !! DEPRECATED !! - Src port idx - Cisco MDS-specific */
83   COL_VSAN,           /**< 6) VSAN - Cisco MDS-specific */
84   COL_CUMULATIVE_BYTES, /**< 7) Cumulative number of bytes */
85   COL_CUSTOM,         /**< 8) Custom column (any filter name's contents) */
86   COL_DCE_CALL,       /**< 9) DCE/RPC connection oriented call id OR datagram sequence number */
87   COL_DCE_CTX,        /**< 10) !! DEPRECATED !! - DCE/RPC connection oriented context id */
88   COL_DELTA_TIME,     /**< 11) Delta time */
89   COL_DELTA_CONV_TIME,/**< 12) Delta time to last frame in conversation */
90   COL_DELTA_TIME_DIS, /**< 13) Delta time displayed*/
91   COL_RES_DST,        /**< 14) Resolved dest */
92   COL_UNRES_DST,      /**< 15) Unresolved dest */
93   COL_RES_DST_PORT,   /**< 16) Resolved dest port */
94   COL_UNRES_DST_PORT, /**< 17) Unresolved dest port */
95   COL_DEF_DST,        /**< 18) Destination address */
96   COL_DEF_DST_PORT,   /**< 19) Destination port */
97   COL_EXPERT,         /**< 20) Expert Info */
98   COL_IF_DIR,         /**< 21) FW-1 monitor interface/direction */
99   COL_OXID,           /**< 22) !! DEPRECATED !! - Fibre Channel OXID */
100   COL_RXID,           /**< 23) !! DEPRECATED !! - Fibre Channel RXID */
101   COL_FR_DLCI,        /**< 24) !! DEPRECATED !! - Frame Relay DLCI */
102   COL_FREQ_CHAN,      /**< 25) IEEE 802.11 (and WiMax?) - Channel */
103   COL_BSSGP_TLLI,     /**< 26) !! DEPRECATED !! - GPRS BSSGP IE TLLI */
104   COL_HPUX_DEVID,     /**< 27) !! DEPRECATED !! - HP-UX Nettl Device ID */
105   COL_HPUX_SUBSYS,    /**< 28) !! DEPRECATED !! - HP-UX Nettl Subsystem */
106   COL_DEF_DL_DST,     /**< 29) Data link layer dest address */
107   COL_DEF_DL_SRC,     /**< 30) Data link layer source address */
108   COL_RES_DL_DST,     /**< 31) Resolved DL dest */
109   COL_UNRES_DL_DST,   /**< 32) Unresolved DL dest */
110   COL_RES_DL_SRC,     /**< 33) Resolved DL source */
111   COL_UNRES_DL_SRC,   /**< 34) Unresolved DL source */
112   COL_RSSI,           /**< 35) IEEE 802.11 - received signal strength */
113   COL_TX_RATE,        /**< 36) IEEE 802.11 - TX rate in Mbps */
114   COL_DSCP_VALUE,     /**< 37) IP DSCP Value */
115   COL_INFO,           /**< 38) Description */
116   COL_COS_VALUE,      /**< 39) !! DEPRECATED !! - L2 COS Value */
117   COL_RES_NET_DST,    /**< 40) Resolved net dest */
118   COL_UNRES_NET_DST,  /**< 41) Unresolved net dest */
119   COL_RES_NET_SRC,    /**< 42) Resolved net source */
120   COL_UNRES_NET_SRC,  /**< 43) Unresolved net source */
121   COL_DEF_NET_DST,    /**< 44) Network layer dest address */
122   COL_DEF_NET_SRC,    /**< 45) Network layer source address */
123   COL_NUMBER,         /**< 46) Packet list item number */
124   COL_PACKET_LENGTH,  /**< 47) Packet length in bytes */
125   COL_PROTOCOL,       /**< 48) Protocol */
126   COL_REL_TIME,       /**< 49) Relative time */
127   COL_REL_CONV_TIME,  /**< 50) !! DEPRECATED !! - Relative time to beginning of conversation */
128   COL_DEF_SRC,        /**< 51) Source address */
129   COL_DEF_SRC_PORT,   /**< 52) Source port */
130   COL_RES_SRC,        /**< 53) Resolved source */
131   COL_UNRES_SRC,      /**< 54) Unresolved source */
132   COL_RES_SRC_PORT,   /**< 55) Resolved source port */
133   COL_UNRES_SRC_PORT, /**< 56) Unresolved source port */
134   COL_TEI,            /**< 57) Q.921 TEI */
135   COL_UTC_DATE_TIME,  /**< 58) UTC date and time */
136   COL_UTC_TIME,       /**< 59) UTC time */
137   COL_CLS_TIME,       /**< 60) Command line-specified time (default relative) */
138   NUM_COL_FMTS        /**< 61) Should always be last */
139 };
140
141 #ifdef __cplusplus
142 }
143 #endif /* __cplusplus */
144
145 #endif /* __COLUMN_INFO_H__ */