Revert commit 24308 until I can get it to compile on Windows/Linux/Solaris

(strangely, it compiled fine on my MacOS X machine).


svn path=/trunk/; revision=24309
This commit is contained in:
Stephen Fisher 2008-02-12 08:09:22 +00:00
parent 0a85a9e4c6
commit 5e893a8b1c
6 changed files with 7 additions and 90 deletions

View File

@ -40,10 +40,8 @@
#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. */
@ -268,55 +266,6 @@ col_add_fstr(column_info *cinfo, gint el, const gchar *format, ...) {
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)
@ -1449,9 +1398,6 @@ col_fill_in(packet_info *pinfo)
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;

View File

@ -30,7 +30,6 @@
#include "gnuc_format_check.h"
#include "column_info.h"
#include "packet_info.h"
#include <epan/epan.h>
#ifdef __cplusplus
extern "C" {
@ -143,15 +142,6 @@ extern void col_add_str(column_info *cinfo, gint col, const gchar *str);
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

View File

@ -105,8 +105,7 @@ col_format_to_string(gint fmt) {
"%C",
"%l",
"%a",
"%F",
"%Cus"
"%F"
};
if (fmt < 0 || fmt >= NUM_COL_FMTS)
@ -175,8 +174,7 @@ static const gchar *dlist[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 *
@ -301,9 +299,6 @@ get_column_format_matches(gboolean *fmt_list, gint format) {
case COL_FREQ_CHAN:
fmt_list[COL_FREQ_CHAN] = TRUE;
break;
case COL_CUSTOM:
fmt_list[COL_CUSTOM] = TRUE;
break;
default:
break;
}

View File

@ -115,7 +115,6 @@ enum {
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 */
};

View File

@ -45,7 +45,6 @@
#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"
@ -1641,7 +1640,6 @@ proto_tree_add_ipxnet_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint
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);
}
@ -2168,13 +2166,10 @@ proto_item_append_string(proto_item *pi, const char *str)
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
@ -2283,7 +2278,6 @@ proto_tree_add_ether_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint s
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);
}
@ -2640,7 +2634,6 @@ proto_tree_set_uint(field_info *fi, guint32 value)
integer >>= hfinfo->bitshift;
}
}
col_custom_set_fstr(hfinfo->abbrev, "%u", value);
fvalue_set_uinteger(&fi->value, integer);
}
@ -2805,8 +2798,6 @@ proto_tree_set_int(field_info *fi, gint32 value)
integer >>= hfinfo->bitshift;
}
}
col_custom_set_fstr(hfinfo->abbrev, "%u", value);
fvalue_set_sinteger(&fi->value, integer);
}

10
file.c
View File

@ -77,7 +77,8 @@
#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;
@ -938,13 +939,11 @@ add_packet_to_packet_list(frame_data *fdata, capture_file *cf,
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. */
@ -957,9 +956,6 @@ add_packet_to_packet_list(frame_data *fdata, capture_file *cf,
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);