From 0f8572cb514ecd0aa8214aaf40fb98f1dd26209a Mon Sep 17 00:00:00 2001 From: Jakub Zawadzki Date: Sun, 22 Dec 2013 10:41:27 +0000 Subject: [PATCH] Avoid including definition of column_info structure in dissectors. Move COL_* enum to XXX Later we can rename epan/column-info.h to column-int.h (or smth like this) svn path=/trunk/; revision=54352 --- cfile.h | 1 + epan/column-info.h | 79 ++------------------------------------------ epan/column-utils.h | 80 ++++++++++++++++++++++++++++++++++++++++++++- epan/column.c | 4 +-- epan/epan.h | 6 ++-- epan/frame_data.h | 1 - epan/packet.h | 1 - epan/packet_info.h | 2 +- epan/wslua/wslua.h | 1 + ui/ui_util.h | 1 + 10 files changed, 90 insertions(+), 86 deletions(-) diff --git a/cfile.h b/cfile.h index b68ab371b9..5f4516f146 100644 --- a/cfile.h +++ b/cfile.h @@ -26,6 +26,7 @@ #define __CFILE_H__ #include +#include #include #include #include diff --git a/epan/column-info.h b/epan/column-info.h index 0689d404b1..8f1e4f4bf9 100644 --- a/epan/column-info.h +++ b/epan/column-info.h @@ -26,6 +26,7 @@ #define __COLUMN_INFO_H__ #include +#include #ifdef __cplusplus extern "C" { @@ -45,7 +46,7 @@ typedef struct { } col_expr_t; /** Column info */ -typedef struct _column_info { +struct epan_column_info { const struct epan_session *epan; gint num_cols; /**< Number of columns */ gint *col_fmt; /**< Format of column */ @@ -62,82 +63,6 @@ typedef struct _column_info { int *col_fence; /**< Stuff in column buffer before this index is immutable */ col_expr_t col_expr; /**< Column expressions and values */ gboolean writable; /**< writable or not @todo Are we still writing to the columns? */ -} column_info; - -/** - * All of the possible columns in summary listing. - * - * NOTE1: The entries MUST remain in this order, or else you need to reorder - * the slist[] and dlist[] arrays in column.c to match! - * - * NOTE2: Please add the COL_XYZ entry in the appropriate spot, such that the - * dlist[] array remains in alphabetical order! - */ -enum { - COL_8021Q_VLAN_ID, /**< 0) 802.1Q vlan ID */ - COL_ABS_YMD_TIME, /**< 1) Absolute date, as YYYY-MM-DD, and time */ - COL_ABS_YDOY_TIME, /**< 2) Absolute date, as YYYY/DOY, and time */ - COL_ABS_TIME, /**< 3) Absolute time */ - COL_CIRCUIT_ID, /**< 4) Circuit ID */ - COL_DSTIDX, /**< 5) !! DEPRECATED !! - Dst port idx - Cisco MDS-specific */ - COL_SRCIDX, /**< 6) !! DEPRECATED !! - Src port idx - Cisco MDS-specific */ - COL_VSAN, /**< 7) VSAN - Cisco MDS-specific */ - COL_CUMULATIVE_BYTES, /**< 8) Cumulative number of bytes */ - COL_CUSTOM, /**< 9) Custom column (any filter name's contents) */ - COL_DCE_CALL, /**< 10) DCE/RPC connection oriented call id OR datagram sequence number */ - COL_DCE_CTX, /**< 11) !! DEPRECATED !! - DCE/RPC connection oriented context id */ - COL_DELTA_TIME, /**< 12) Delta time */ - COL_DELTA_CONV_TIME,/**< 13) Delta time to last frame in conversation */ - COL_DELTA_TIME_DIS, /**< 14) Delta time displayed*/ - COL_RES_DST, /**< 15) Resolved dest */ - COL_UNRES_DST, /**< 16) Unresolved dest */ - COL_RES_DST_PORT, /**< 17) Resolved dest port */ - COL_UNRES_DST_PORT, /**< 18) Unresolved dest port */ - COL_DEF_DST, /**< 19) Destination address */ - COL_DEF_DST_PORT, /**< 20) Destination port */ - COL_EXPERT, /**< 21) Expert Info */ - COL_IF_DIR, /**< 22) FW-1 monitor interface/direction */ - COL_OXID, /**< 23) !! DEPRECATED !! - Fibre Channel OXID */ - COL_RXID, /**< 24) !! DEPRECATED !! - Fibre Channel RXID */ - COL_FR_DLCI, /**< 25) !! DEPRECATED !! - Frame Relay DLCI */ - COL_FREQ_CHAN, /**< 26) IEEE 802.11 (and WiMax?) - Channel */ - COL_BSSGP_TLLI, /**< 27) !! DEPRECATED !! - GPRS BSSGP IE TLLI */ - COL_HPUX_DEVID, /**< 28) !! DEPRECATED !! - HP-UX Nettl Device ID */ - COL_HPUX_SUBSYS, /**< 29) !! DEPRECATED !! - HP-UX Nettl Subsystem */ - COL_DEF_DL_DST, /**< 30) Data link layer dest address */ - COL_DEF_DL_SRC, /**< 31) Data link layer source address */ - COL_RES_DL_DST, /**< 32) Resolved DL dest */ - COL_UNRES_DL_DST, /**< 33) Unresolved DL dest */ - COL_RES_DL_SRC, /**< 34) Resolved DL source */ - COL_UNRES_DL_SRC, /**< 35) Unresolved DL source */ - COL_RSSI, /**< 36) IEEE 802.11 - received signal strength */ - COL_TX_RATE, /**< 37) IEEE 802.11 - TX rate in Mbps */ - COL_DSCP_VALUE, /**< 38) IP DSCP Value */ - COL_INFO, /**< 39) Description */ - COL_COS_VALUE, /**< 40) !! DEPRECATED !! - L2 COS Value */ - COL_RES_NET_DST, /**< 41) Resolved net dest */ - COL_UNRES_NET_DST, /**< 42) Unresolved net dest */ - COL_RES_NET_SRC, /**< 43) Resolved net source */ - COL_UNRES_NET_SRC, /**< 44) Unresolved net source */ - COL_DEF_NET_DST, /**< 45) Network layer dest address */ - COL_DEF_NET_SRC, /**< 46) Network layer source address */ - COL_NUMBER, /**< 47) Packet list item number */ - COL_PACKET_LENGTH, /**< 48) Packet length in bytes */ - COL_PROTOCOL, /**< 49) Protocol */ - COL_REL_TIME, /**< 50) Relative time */ - COL_REL_CONV_TIME, /**< 51) !! DEPRECATED !! - Relative time to beginning of conversation */ - COL_DEF_SRC, /**< 52) Source address */ - COL_DEF_SRC_PORT, /**< 53) Source port */ - COL_RES_SRC, /**< 54) Resolved source */ - COL_UNRES_SRC, /**< 55) Unresolved source */ - COL_RES_SRC_PORT, /**< 56) Resolved source port */ - COL_UNRES_SRC_PORT, /**< 57) Unresolved source port */ - COL_TEI, /**< 58) Q.921 TEI */ - COL_UTC_YMD_TIME, /**< 59) UTC date, as YYYY-MM-DD, and time */ - COL_UTC_YDOY_TIME, /**< 60) UTC date, as YYYY/DOY, and time */ - COL_UTC_TIME, /**< 61) UTC time */ - COL_CLS_TIME, /**< 62) Command line-specified time (default relative) */ - NUM_COL_FMTS /**< 63) Should always be last */ }; #ifdef __cplusplus diff --git a/epan/column-utils.h b/epan/column-utils.h index bc760bea1c..08b5313a5f 100644 --- a/epan/column-utils.h +++ b/epan/column-utils.h @@ -27,7 +27,6 @@ #include -#include "column-info.h" #include "packet_info.h" #include "ws_symbol_export.h" @@ -41,6 +40,85 @@ struct epan_dissect; * Helper routines for column utility structures and routines. */ +struct epan_column_info; +typedef struct epan_column_info column_info; + +/** + * All of the possible columns in summary listing. + * + * NOTE1: The entries MUST remain in this order, or else you need to reorder + * the slist[] and dlist[] arrays in column.c to match! + * + * NOTE2: Please add the COL_XYZ entry in the appropriate spot, such that the + * dlist[] array remains in alphabetical order! + */ +enum { + COL_8021Q_VLAN_ID, /**< 0) 802.1Q vlan ID */ + COL_ABS_YMD_TIME, /**< 1) Absolute date, as YYYY-MM-DD, and time */ + COL_ABS_YDOY_TIME, /**< 2) Absolute date, as YYYY/DOY, and time */ + COL_ABS_TIME, /**< 3) Absolute time */ + COL_CIRCUIT_ID, /**< 4) Circuit ID */ + COL_DSTIDX, /**< 5) !! DEPRECATED !! - Dst port idx - Cisco MDS-specific */ + COL_SRCIDX, /**< 6) !! DEPRECATED !! - Src port idx - Cisco MDS-specific */ + COL_VSAN, /**< 7) VSAN - Cisco MDS-specific */ + COL_CUMULATIVE_BYTES, /**< 8) Cumulative number of bytes */ + COL_CUSTOM, /**< 9) Custom column (any filter name's contents) */ + COL_DCE_CALL, /**< 10) DCE/RPC connection oriented call id OR datagram sequence number */ + COL_DCE_CTX, /**< 11) !! DEPRECATED !! - DCE/RPC connection oriented context id */ + COL_DELTA_TIME, /**< 12) Delta time */ + COL_DELTA_CONV_TIME,/**< 13) Delta time to last frame in conversation */ + COL_DELTA_TIME_DIS, /**< 14) Delta time displayed*/ + COL_RES_DST, /**< 15) Resolved dest */ + COL_UNRES_DST, /**< 16) Unresolved dest */ + COL_RES_DST_PORT, /**< 17) Resolved dest port */ + COL_UNRES_DST_PORT, /**< 18) Unresolved dest port */ + COL_DEF_DST, /**< 19) Destination address */ + COL_DEF_DST_PORT, /**< 20) Destination port */ + COL_EXPERT, /**< 21) Expert Info */ + COL_IF_DIR, /**< 22) FW-1 monitor interface/direction */ + COL_OXID, /**< 23) !! DEPRECATED !! - Fibre Channel OXID */ + COL_RXID, /**< 24) !! DEPRECATED !! - Fibre Channel RXID */ + COL_FR_DLCI, /**< 25) !! DEPRECATED !! - Frame Relay DLCI */ + COL_FREQ_CHAN, /**< 26) IEEE 802.11 (and WiMax?) - Channel */ + COL_BSSGP_TLLI, /**< 27) !! DEPRECATED !! - GPRS BSSGP IE TLLI */ + COL_HPUX_DEVID, /**< 28) !! DEPRECATED !! - HP-UX Nettl Device ID */ + COL_HPUX_SUBSYS, /**< 29) !! DEPRECATED !! - HP-UX Nettl Subsystem */ + COL_DEF_DL_DST, /**< 30) Data link layer dest address */ + COL_DEF_DL_SRC, /**< 31) Data link layer source address */ + COL_RES_DL_DST, /**< 32) Resolved DL dest */ + COL_UNRES_DL_DST, /**< 33) Unresolved DL dest */ + COL_RES_DL_SRC, /**< 34) Resolved DL source */ + COL_UNRES_DL_SRC, /**< 35) Unresolved DL source */ + COL_RSSI, /**< 36) IEEE 802.11 - received signal strength */ + COL_TX_RATE, /**< 37) IEEE 802.11 - TX rate in Mbps */ + COL_DSCP_VALUE, /**< 38) IP DSCP Value */ + COL_INFO, /**< 39) Description */ + COL_COS_VALUE, /**< 40) !! DEPRECATED !! - L2 COS Value */ + COL_RES_NET_DST, /**< 41) Resolved net dest */ + COL_UNRES_NET_DST, /**< 42) Unresolved net dest */ + COL_RES_NET_SRC, /**< 43) Resolved net source */ + COL_UNRES_NET_SRC, /**< 44) Unresolved net source */ + COL_DEF_NET_DST, /**< 45) Network layer dest address */ + COL_DEF_NET_SRC, /**< 46) Network layer source address */ + COL_NUMBER, /**< 47) Packet list item number */ + COL_PACKET_LENGTH, /**< 48) Packet length in bytes */ + COL_PROTOCOL, /**< 49) Protocol */ + COL_REL_TIME, /**< 50) Relative time */ + COL_REL_CONV_TIME, /**< 51) !! DEPRECATED !! - Relative time to beginning of conversation */ + COL_DEF_SRC, /**< 52) Source address */ + COL_DEF_SRC_PORT, /**< 53) Source port */ + COL_RES_SRC, /**< 54) Resolved source */ + COL_UNRES_SRC, /**< 55) Unresolved source */ + COL_RES_SRC_PORT, /**< 56) Resolved source port */ + COL_UNRES_SRC_PORT, /**< 57) Unresolved source port */ + COL_TEI, /**< 58) Q.921 TEI */ + COL_UTC_YMD_TIME, /**< 59) UTC date, as YYYY-MM-DD, and time */ + COL_UTC_YDOY_TIME, /**< 60) UTC date, as YYYY/DOY, and time */ + COL_UTC_TIME, /**< 61) UTC time */ + COL_CLS_TIME, /**< 62) Command line-specified time (default relative) */ + NUM_COL_FMTS /**< 63) Should always be last */ +}; + /** Allocate all the data structures for constructing column data, given * the number of columns. * diff --git a/epan/column.c b/epan/column.c index 53e64ecc88..e12d29e384 100644 --- a/epan/column.c +++ b/epan/column.c @@ -39,7 +39,7 @@ #include #include -/* Given a format number (as defined in column-info.h), returns its equivalent +/* Given a format number (as defined in column-utils.h), returns its equivalent string */ const gchar * col_format_to_string(const gint fmt) { @@ -115,7 +115,7 @@ col_format_to_string(const gint fmt) { return(slist[fmt]); } -/* Given a format number (as defined in column-info.h), returns its +/* Given a format number (as defined in column-utils.h), returns its description */ const gchar * col_format_desc(const gint fmt) { diff --git a/epan/epan.h b/epan/epan.h index ca3432b550..093f7f8562 100644 --- a/epan/epan.h +++ b/epan/epan.h @@ -30,13 +30,13 @@ extern "C" { #include #include "frame_data.h" -#include "column-info.h" #include "register.h" #include "ws_symbol_export.h" typedef struct epan_dissect epan_dissect_t; struct epan_dfilter; +struct epan_column_info; /** @mainpage Wireshark EPAN the packet analyzing engine. Source code can be found in the epan directory @@ -170,12 +170,12 @@ epan_dissect_fake_protocols(epan_dissect_t *edt, const gboolean fake_protocols); WS_DLL_PUBLIC void epan_dissect_run(epan_dissect_t *edt, struct wtap_pkthdr *phdr, - tvbuff_t *tvb, frame_data *fd, column_info *cinfo); + tvbuff_t *tvb, frame_data *fd, struct epan_column_info *cinfo); WS_DLL_PUBLIC void epan_dissect_run_with_taps(epan_dissect_t *edt, struct wtap_pkthdr *phdr, - tvbuff_t *tvb, frame_data *fd, column_info *cinfo); + tvbuff_t *tvb, frame_data *fd, struct epan_column_info *cinfo); /** Prime a proto_tree using the fields/protocols used in a dfilter. */ WS_DLL_PUBLIC diff --git a/epan/frame_data.h b/epan/frame_data.h index d5e0caea9b..141079b257 100644 --- a/epan/frame_data.h +++ b/epan/frame_data.h @@ -25,7 +25,6 @@ #ifndef __FRAME_DATA_H__ #define __FRAME_DATA_H__ -#include #include #include #include "ws_symbol_export.h" diff --git a/epan/packet.h b/epan/packet.h index a0fd4ed8de..b18529a078 100644 --- a/epan/packet.h +++ b/epan/packet.h @@ -28,7 +28,6 @@ #include "proto.h" #include "tvbuff.h" #include "value_string.h" -#include "column-info.h" #include "frame_data.h" #include "packet_info.h" #include "column-utils.h" diff --git a/epan/packet_info.h b/epan/packet_info.h index 4fae937d7f..0dcabd9189 100644 --- a/epan/packet_info.h +++ b/epan/packet_info.h @@ -50,7 +50,7 @@ typedef struct _packet_info { const char *current_proto; /**< name of protocol currently being dissected */ - column_info *cinfo; /**< Column formatting information */ + struct epan_column_info *cinfo; /**< Column formatting information */ frame_data *fd; union wtap_pseudo_header *pseudo_header; struct wtap_pkthdr *phdr; diff --git a/epan/wslua/wslua.h b/epan/wslua/wslua.h index 0421f2bfe9..50ea18044e 100644 --- a/epan/wslua/wslua.h +++ b/epan/wslua/wslua.h @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include diff --git a/ui/ui_util.h b/ui/ui_util.h index 95a79ee11a..4c909d5f86 100644 --- a/ui/ui_util.h +++ b/ui/ui_util.h @@ -28,6 +28,7 @@ #define __UI_UTIL_H__ #include "epan/packet_info.h" +#include "epan/column-utils.h" #ifdef __cplusplus extern "C" { -- 2.34.1