#include "ipv6-utils.h"
#include "osi-utils.h"
#include "value_string.h"
-#include "globals.h"
#include <epan/strutil.h>
-#include <epan/epan.h>
/* Allocate all the data structures for constructing column data, given
the number of columns. */
va_end(ap);
}
-void
-col_custom_set_fstr(const gchar *field_name, const gchar *format, ...)
-{
- va_list ap;
- int i;
-
- if (!check_col(&cfile.cinfo, COL_CUSTOM))
- return;
-
- va_start(ap, format);
- for (i = cfile.cinfo.col_first[COL_CUSTOM];
- i <= cfile.cinfo.col_last[COL_CUSTOM]; i++) {
- if (strcmp(cfile.cinfo.col_title[i], field_name) == 0 &&
- cfile.cinfo.fmt_matx[i][COL_CUSTOM]) {
- cfile.cinfo.col_data[i] = cfile.cinfo.col_buf[i];
- g_vsnprintf(cfile.cinfo.col_buf[i], COL_MAX_LEN, format, ap);
- strncpy(cfile.cinfo.col_expr[i], field_name, COL_MAX_LEN);
- strncpy(cfile.cinfo.col_expr_val[i], cfile.cinfo.col_buf[i], COL_MAX_LEN);
- }
- }
- va_end(ap);
-}
-
-void
-col_custom_prime_edt(epan_dissect_t *edt)
-{
- int i;
- dfilter_t *dfilter_code;
-
- for (i = cfile.cinfo.col_first[COL_CUSTOM];
- i <= cfile.cinfo.col_last[COL_CUSTOM]; i++) {
- if (cfile.cinfo.fmt_matx[i][COL_CUSTOM]) {
- if(dfilter_compile(cfile.cinfo.col_title[i], &dfilter_code))
- epan_dissect_prime_dfilter(edt, dfilter_code);
- }
- }
-}
-
-gboolean
-have_custom_cols(void)
-{
- /* The same as check_col(), but without the check to see if the column
- * is writable. */
- if (cfile.cinfo.col_first[COL_CUSTOM] >= 0)
- return TRUE;
- else
- return FALSE;
-}
-
static void
col_do_append_sep_va_fstr(column_info *cinfo, gint el, const gchar *separator,
const gchar *format, va_list ap)
case COL_FREQ_CHAN: /* done by radio dissectors */
break;
- case COL_CUSTOM: /* done by col_custom_set_fstr() called from proto.c */
- break;
-
case NUM_COL_FMTS: /* keep compiler happy - shouldn't get here */
g_assert_not_reached();
break;
#include "gnuc_format_check.h"
#include "column_info.h"
#include "packet_info.h"
-#include <epan/epan.h>
#ifdef __cplusplus
extern "C" {
extern void col_add_fstr(column_info *cinfo, gint col, const gchar *format, ...)
GNUC_FORMAT_CHECK(printf, 3, 4);
-/* For internal Wireshark use only. Not to be called from dissectors. */
-void col_custom_set_fstr(const gchar *field_name, const gchar *format, ...)
- GNUC_FORMAT_CHECK(printf, 2, 3);
-
-/* For internal Wireshark use only. Not to be called from dissectors. */
-void col_custom_prime_edt(epan_dissect_t *edt);
-
-gboolean have_custom_cols(void);
-
/** Append the given text to a column element, the text will be copied.
*
* @param cinfo the current packet row
"%C",
"%l",
"%a",
- "%F",
- "%Cus"
+ "%F"
};
if (fmt < 0 || fmt >= NUM_COL_FMTS)
"Frame Relay DLCI", /* COL_FR_DLCI */
"GPRS BSSGP TLLI", /* COL_BSSGP_TLLI */
"Expert Info Severity", /* COL_EXPERT */
- "Frequency/Channel", /* COL_FREQ_CHAN */
- "Custom" /* COL_CUSTOM */
+ "Frequency/Channel" /* COL_FREQ_CHAN */
};
const gchar *
case COL_FREQ_CHAN:
fmt_list[COL_FREQ_CHAN] = TRUE;
break;
- case COL_CUSTOM:
- fmt_list[COL_CUSTOM] = TRUE;
- break;
default:
break;
}
COL_BSSGP_TLLI, /* GPRS BSSGP IE TLLI */
COL_EXPERT, /* Expert Info */
COL_FREQ_CHAN, /* IEEE 802.11 (and WiMax?) - Channel */
- COL_CUSTOM, /* Custom column (any filter name's contents) */
NUM_COL_FMTS /* Should always be last */
};
#include "emem.h"
#include "charsets.h"
#include "asm_utils.h"
-#include "column-utils.h"
#ifdef NEED_G_ASCII_STRCASECMP_H
#include "g_ascii_strcasecmp.h"
static void
proto_tree_set_ipxnet(field_info *fi, guint32 value)
{
- col_custom_set_fstr(fi->hfinfo->abbrev, "%u", value);
fvalue_set_uinteger(&fi->value, value);
}
static void
proto_tree_set_string(field_info *fi, const char* value)
{
- if (value) {
- col_custom_set_fstr(fi->hfinfo->abbrev, "%s", value);
+ if (value)
fvalue_set(&fi->value, (gpointer) value, FALSE);
- } else {
- col_custom_set_fstr(fi->hfinfo->abbrev, "[ Null ]");
+ else
fvalue_set(&fi->value, (gpointer) "[ Null ]", FALSE);
- }
}
static void
static void
proto_tree_set_ether(field_info *fi, const guint8* value)
{
- col_custom_set_fstr(fi->hfinfo->abbrev, "%s", value);
fvalue_set(&fi->value, (gpointer) value, FALSE);
}
integer >>= hfinfo->bitshift;
}
}
- col_custom_set_fstr(hfinfo->abbrev, "%u", value);
fvalue_set_uinteger(&fi->value, integer);
}
integer >>= hfinfo->bitshift;
}
}
-
- col_custom_set_fstr(hfinfo->abbrev, "%u", value);
fvalue_set_sinteger(&fi->value, integer);
}
#include <epan/timestamp.h>
#include <epan/dfilter/dfilter-macro.h>
#include "file_util.h"
-#include <epan/column-utils.h>
+
+
#ifdef HAVE_LIBPCAP
gboolean auto_scroll_live;
we have tap listeners;
- we have custom columns;
-
allocate a protocol tree root node, so that we'll construct
a protocol tree against which a filter expression can be
evaluated. */
if ((dfcode != NULL && refilter) || color_filters_used()
- || num_tap_filters != 0 || have_custom_cols())
+ || num_tap_filters != 0)
create_proto_tree = TRUE;
/* Dissect the frame. */
if (color_filters_used()) {
color_filters_prime_edt(edt);
}
-
- col_custom_prime_edt(edt);
-
tap_queue_init(edt);
epan_dissect_run(edt, pseudo_header, buf, fdata, &cf->cinfo);
tap_push_tapped_queue(edt);