diff options
author | Stephen Fisher <steve@stephen-fisher.com> | 2008-02-12 08:09:22 +0000 |
---|---|---|
committer | Stephen Fisher <steve@stephen-fisher.com> | 2008-02-12 08:09:22 +0000 |
commit | 5e893a8b1c6707a8526e9a60168e5dbebe567b05 (patch) | |
tree | e23190decbf760601116e1506ba3bee7956afb1e /epan | |
parent | 0a85a9e4c6016b0cd68b590990a927f4bb4d4fce (diff) | |
download | wireshark-5e893a8b1c6707a8526e9a60168e5dbebe567b05.tar.gz |
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
Diffstat (limited to 'epan')
-rw-r--r-- | epan/column-utils.c | 54 | ||||
-rw-r--r-- | epan/column-utils.h | 10 | ||||
-rw-r--r-- | epan/column.c | 9 | ||||
-rw-r--r-- | epan/column_info.h | 1 | ||||
-rw-r--r-- | epan/proto.c | 13 |
5 files changed, 4 insertions, 83 deletions
diff --git a/epan/column-utils.c b/epan/column-utils.c index 0aaf4b62cb..814bef3d64 100644 --- a/epan/column-utils.c +++ b/epan/column-utils.c @@ -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; diff --git a/epan/column-utils.h b/epan/column-utils.h index 7d9b8fe7d6..946df43680 100644 --- a/epan/column-utils.h +++ b/epan/column-utils.h @@ -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 diff --git a/epan/column.c b/epan/column.c index 45cf19e78f..7afaded3e3 100644 --- a/epan/column.c +++ b/epan/column.c @@ -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; } diff --git a/epan/column_info.h b/epan/column_info.h index e71c874529..a355797b99 100644 --- a/epan/column_info.h +++ b/epan/column_info.h @@ -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 */ }; diff --git a/epan/proto.c b/epan/proto.c index e0317e33de..d477d644f6 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -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); } |