aboutsummaryrefslogtreecommitdiffstats
path: root/epan/column-info.h
diff options
context:
space:
mode:
Diffstat (limited to 'epan/column-info.h')
-rw-r--r--epan/column-info.h80
1 files changed, 76 insertions, 4 deletions
diff --git a/epan/column-info.h b/epan/column-info.h
index 5f611f3e93..ea05ee2bf5 100644
--- a/epan/column-info.h
+++ b/epan/column-info.h
@@ -1,5 +1,7 @@
/* column-info.h
- * Definitions for column structures and routines
+ * Definitions for internal column structures and routines
+ *
+ * For internal Wireshark use only. Don't include this header in dissectors!
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
@@ -22,9 +24,9 @@ extern "C" {
* Column info.
*/
-#define COL_MAX_LEN 2048
-#define COL_MAX_INFO_LEN 4096
-#define COL_CUSTOM_PRIME_REGEX " *([^ \\|]+) *(?:(?:\\|\\|)|(?:or)| *$){1}"
+typedef struct _proto_node proto_tree;
+
+#define COLUMN_FIELD_FILTER "_ws.col."
/** Column expression */
typedef struct {
@@ -32,6 +34,15 @@ typedef struct {
gchar **col_expr_val; /**< Value for filter expression */
} col_expr_t;
+/** Custom column filter expression information used in the GSList below.
+ * One for each expression in a multifield column.
+ */
+typedef struct {
+ char *dftext; /**< Filter expression */
+ struct epan_dfilter *dfilter; /**< Compiled filter expression */
+ int field_id; /**< ID for a single field expression, or 0 */
+} col_custom_t;
+
/** Individual column info */
typedef struct {
gint col_fmt; /**< Format of column */
@@ -45,6 +56,7 @@ typedef struct {
gchar *col_buf; /**< Buffer into which to copy data for column */
int col_fence; /**< Stuff in column buffer before this index is immutable */
gboolean writable; /**< writable or not */
+ int hf_id;
} col_item_t;
/** Column info */
@@ -59,6 +71,66 @@ struct epan_column_info {
GRegex *prime_regex; /**< Used to prime custom columns */
};
+/** Allocate all the data structures for constructing column data, given
+ * the number of columns.
+ */
+WS_DLL_PUBLIC void col_setup(column_info *cinfo, const gint num_cols);
+
+/** Cleanup all the data structures for constructing column data;
+ * undoes the alocations that col_setup() does.
+ */
+WS_DLL_PUBLIC void col_cleanup(column_info *cinfo);
+
+/** Initialize the data structures for constructing column data.
+ */
+extern void col_init(column_info *cinfo, const struct epan_session *epan);
+
+/** Fill in all columns of the given packet which are based on values from frame_data.
+ */
+WS_DLL_PUBLIC void col_fill_in_frame_data(const frame_data *fd, column_info *cinfo, const gint col, gboolean const fill_col_exprs);
+
+/** Fill in all (non-custom) columns of the given packet.
+ */
+WS_DLL_PUBLIC void col_fill_in(packet_info *pinfo, const gboolean fill_col_exprs, const gboolean fill_fd_colums);
+
+/** Fill in columns if we got an error reading the packet.
+ * We set most columns to "???", and set the Info column to an error
+ * message.
+ */
+WS_DLL_PUBLIC void col_fill_in_error(column_info *cinfo, frame_data *fdata, const gboolean fill_col_exprs, const gboolean fill_fd_colums);
+
+/** Check to see if our column data has changed, e.g. we have new request/response info.
+ */
+WS_DLL_PUBLIC gboolean col_data_changed(void);
+
+void col_custom_set_edt(struct epan_dissect *edt, column_info *cinfo);
+
+WS_DLL_PUBLIC
+void col_custom_prime_edt(struct epan_dissect *edt, column_info *cinfo);
+
+/** Get a filter expression for a custom column. This string must be g_free'd.
+ */
+WS_DLL_PUBLIC
+char* col_custom_get_filter(struct epan_dissect *edt, column_info *cinfo, const gint col);
+
+WS_DLL_PUBLIC
+gboolean have_custom_cols(column_info *cinfo);
+
+WS_DLL_PUBLIC
+gboolean have_field_extractors(void);
+
+WS_DLL_PUBLIC
+gboolean col_has_time_fmt(column_info *cinfo, const gint col);
+
+WS_DLL_PUBLIC
+gboolean col_based_on_frame_data(column_info *cinfo, const gint col);
+
+void
+col_register_protocol(void);
+
+extern
+void col_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */