diff options
Diffstat (limited to 'epan')
-rw-r--r-- | epan/Makefile.am | 3 | ||||
-rw-r--r-- | epan/column_info.h | 92 | ||||
-rw-r--r-- | epan/packet.h | 60 |
3 files changed, 96 insertions, 59 deletions
diff --git a/epan/Makefile.am b/epan/Makefile.am index 6c824fdc3f..66a91aa914 100644 --- a/epan/Makefile.am +++ b/epan/Makefile.am @@ -2,7 +2,7 @@ # Automake file for the EPAN library # (Ethereal Protocol ANalyzer Library) # -# $Id: Makefile.am,v 1.19 2001/04/01 03:18:41 hagbard Exp $ +# $Id: Makefile.am,v 1.20 2001/04/01 03:42:00 hagbard Exp $ # # Ethereal - Network traffic analyzer # By Gerald Combs <gerald@zing.org> @@ -39,6 +39,7 @@ libethereal_a_SOURCES = \ atalk-utils.h \ bitswap.c \ bitswap.h \ + column_info.h \ conversation.c \ conversation.h \ epan.c \ diff --git a/epan/column_info.h b/epan/column_info.h new file mode 100644 index 0000000000..48ad0383d1 --- /dev/null +++ b/epan/column_info.h @@ -0,0 +1,92 @@ +/* column.h + * Definitions for column structures and routines + * + * $Id: column_info.h,v 1.1 2001/04/01 03:42:00 hagbard Exp $ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs <gerald@zing.org> + * Copyright 1998 Gerald Combs + * + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + + +#ifndef __COLUMN_INFO_H__ +#define __COLUMN_INFO_H__ + +#include <glib.h> + +#define COL_MAX_LEN 256 +#define COL_MAX_INFO_LEN 4096 + +typedef struct _column_info { + gint num_cols; /* Number of columns */ + gint *col_fmt; /* Format of column */ + gboolean **fmt_matx; /* Specifies which formats apply to a column */ + gint *col_width; /* Column widths to use during a "-S" capture */ + gchar **col_title; /* Column titles */ + gchar **col_data; /* Column data */ + gchar **col_buf; /* Buffer into which to copy data for column */ + gboolean writable; /* Are we stil writing to the columns? */ +} column_info; + +/* + * All of the possible columns in summary listing. + * + * NOTE: The SRC and DST entries MUST remain in this order, or else you + * need to fix the offset #defines before get_column_format! + */ +enum { + COL_NUMBER, /* Packet list item number */ + COL_CLS_TIME, /* Command line-specified time (default relative) */ + COL_REL_TIME, /* Relative time */ + COL_ABS_TIME, /* Absolute time */ + COL_ABS_DATE_TIME, /* Absolute date and time */ + COL_DELTA_TIME, /* Delta time */ + COL_DEF_SRC, /* Source address */ + COL_RES_SRC, /* Resolved source */ + COL_UNRES_SRC, /* Unresolved source */ + COL_DEF_DL_SRC, /* Data link layer source address */ + COL_RES_DL_SRC, /* Resolved DL source */ + COL_UNRES_DL_SRC, /* Unresolved DL source */ + COL_DEF_NET_SRC, /* Network layer source address */ + COL_RES_NET_SRC, /* Resolved net source */ + COL_UNRES_NET_SRC, /* Unresolved net source */ + COL_DEF_DST, /* Destination address */ + COL_RES_DST, /* Resolved dest */ + COL_UNRES_DST, /* Unresolved dest */ + COL_DEF_DL_DST, /* Data link layer dest address */ + COL_RES_DL_DST, /* Resolved DL dest */ + COL_UNRES_DL_DST, /* Unresolved DL dest */ + COL_DEF_NET_DST, /* Network layer dest address */ + COL_RES_NET_DST, /* Resolved net dest */ + COL_UNRES_NET_DST, /* Unresolved net dest */ + COL_DEF_SRC_PORT, /* Source port */ + COL_RES_SRC_PORT, /* Resolved source port */ + COL_UNRES_SRC_PORT, /* Unresolved source port */ + COL_DEF_DST_PORT, /* Destination port */ + COL_RES_DST_PORT, /* Resolved dest port */ + COL_UNRES_DST_PORT, /* Unresolved dest port */ + COL_PROTOCOL, /* Protocol */ + COL_INFO, /* Description */ + COL_PACKET_LENGTH, /* Packet length in bytes */ + NUM_COL_FMTS /* Should always be last */ +}; + +#endif /* __COLUMN_INFO_H__ */ + + + diff --git a/epan/packet.h b/epan/packet.h index 54335f7b52..4a1f2da311 100644 --- a/epan/packet.h +++ b/epan/packet.h @@ -1,7 +1,7 @@ /* packet.h * Definitions for packet disassembly structures and routines * - * $Id: packet.h,v 1.26 2001/04/01 03:18:41 hagbard Exp $ + * $Id: packet.h,v 1.27 2001/04/01 03:42:00 hagbard Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -33,6 +33,7 @@ #include "pint.h" #include "to_str.h" #include "value_string.h" +#include "column_info.h" #define hi_nibble(b) (((b) & 0xf0) >> 4) #define lo_nibble(b) ((b) & 0x0f) @@ -57,20 +58,6 @@ /* To pass one of two strings, singular or plural */ #define plurality(d,s,p) ((d) == 1 ? (s) : (p)) -typedef struct _column_info { - gint num_cols; /* Number of columns */ - gint *col_fmt; /* Format of column */ - gboolean **fmt_matx; /* Specifies which formats apply to a column */ - gint *col_width; /* Column widths to use during a "-S" capture */ - gchar **col_title; /* Column titles */ - gchar **col_data; /* Column data */ - gchar **col_buf; /* Buffer into which to copy data for column */ - gboolean writable; /* Are we stil writing to the columns? */ -} column_info; - -#define COL_MAX_LEN 256 -#define COL_MAX_INFO_LEN 4096 - /* Allocate all the data structures for constructing column data, given the number of columns. */ void col_init(column_info *, gint); @@ -380,47 +367,4 @@ extern const value_string etype_vals[]; /* ipproto.c */ extern const char *ipprotostr(int proto); -/* - * All of the possible columns in summary listing. - * - * NOTE: The SRC and DST entries MUST remain in this order, or else you - * need to fix the offset #defines before get_column_format! - */ -enum { - COL_NUMBER, /* Packet list item number */ - COL_CLS_TIME, /* Command line-specified time (default relative) */ - COL_REL_TIME, /* Relative time */ - COL_ABS_TIME, /* Absolute time */ - COL_ABS_DATE_TIME, /* Absolute date and time */ - COL_DELTA_TIME, /* Delta time */ - COL_DEF_SRC, /* Source address */ - COL_RES_SRC, /* Resolved source */ - COL_UNRES_SRC, /* Unresolved source */ - COL_DEF_DL_SRC, /* Data link layer source address */ - COL_RES_DL_SRC, /* Resolved DL source */ - COL_UNRES_DL_SRC, /* Unresolved DL source */ - COL_DEF_NET_SRC, /* Network layer source address */ - COL_RES_NET_SRC, /* Resolved net source */ - COL_UNRES_NET_SRC, /* Unresolved net source */ - COL_DEF_DST, /* Destination address */ - COL_RES_DST, /* Resolved dest */ - COL_UNRES_DST, /* Unresolved dest */ - COL_DEF_DL_DST, /* Data link layer dest address */ - COL_RES_DL_DST, /* Resolved DL dest */ - COL_UNRES_DL_DST, /* Unresolved DL dest */ - COL_DEF_NET_DST, /* Network layer dest address */ - COL_RES_NET_DST, /* Resolved net dest */ - COL_UNRES_NET_DST, /* Unresolved net dest */ - COL_DEF_SRC_PORT, /* Source port */ - COL_RES_SRC_PORT, /* Resolved source port */ - COL_UNRES_SRC_PORT, /* Unresolved source port */ - COL_DEF_DST_PORT, /* Destination port */ - COL_RES_DST_PORT, /* Resolved dest port */ - COL_UNRES_DST_PORT, /* Unresolved dest port */ - COL_PROTOCOL, /* Protocol */ - COL_INFO, /* Description */ - COL_PACKET_LENGTH, /* Packet length in bytes */ - NUM_COL_FMTS /* Should always be last */ -}; - #endif /* packet.h */ |