aboutsummaryrefslogtreecommitdiffstats
path: root/column.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2003-01-27 20:45:42 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2003-01-27 20:45:42 +0000
commitcf5b6891fc79fafde579cd2a4dccad501c7b0eee (patch)
treecdee140cef6adaf1eae55a2ef5da70892b2412a2 /column.c
parentb500fbcf1183ea4754ec5bcf180414c190f4c36f (diff)
Make the list of column format descriptions "static", and size it based
on the number of column formats - and fix that list by adding a missing comma between "Circuit ID" and "Src PortIdx". Add to "col_format_desc()" a check that the argument is valid. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7008 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'column.c')
-rw-r--r--column.c66
1 files changed, 45 insertions, 21 deletions
diff --git a/column.c b/column.c
index 92bbad0788..cc4a8e11a7 100644
--- a/column.c
+++ b/column.c
@@ -1,7 +1,7 @@
/* column.c
* Routines for handling column preferences
*
- * $Id: column.c,v 1.41 2003/01/22 06:26:33 guy Exp $
+ * $Id: column.c,v 1.42 2003/01/27 20:45:42 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -62,28 +62,52 @@ col_format_to_string(gint fmt) {
/* Given a format number (as defined in packet.h), returns its
description */
+static gchar *dlist[NUM_COL_FMTS] = {
+ "Number",
+ "Time (command line specified)",
+ "Relative time",
+ "Absolute time",
+ "Absolute date and time",
+ "Delta time",
+ "Source address",
+ "Src addr (resolved)",
+ "Src addr (unresolved)",
+ "Hardware src addr",
+ "Hw src addr (resolved)",
+ "Hw src addr (unresolved)",
+ "Network src addr",
+ "Net src addr (resolved)",
+ "Net src addr (unresolved)",
+ "Destination address",
+ "Dest addr (resolved)",
+ "Dest addr (unresolved)",
+ "Hardware dest addr",
+ "Hw dest addr (resolved)",
+ "Hw dest addr (unresolved)",
+ "Network dest addr",
+ "Net dest addr (resolved)",
+ "Net dest addr (unresolved)",
+ "Source port",
+ "Src port (resolved)",
+ "Src port (unresolved)",
+ "Destination port",
+ "Dest port (resolved)",
+ "Dest port (unresolved)",
+ "Protocol",
+ "Information",
+ "Packet length (bytes)" ,
+ "OXID",
+ "RXID",
+ "FW-1 monitor if/direction",
+ "Circuit ID",
+ "Src PortIdx",
+ "Dst PortIdx",
+ "VSAN",
+};
+
gchar *
col_format_desc(gint fmt) {
- gchar *dlist[] = { "Number", "Time (command line specified)",
- "Relative time", "Absolute time",
- "Absolute date and time", "Delta time",
- "Source address", "Src addr (resolved)",
- "Src addr (unresolved)", "Hardware src addr",
- "Hw src addr (resolved)", "Hw src addr (unresolved)",
- "Network src addr", "Net src addr (resolved)",
- "Net src addr (unresolved)", "Destination address",
- "Dest addr (resolved)", "Dest addr (unresolved)",
- "Hardware dest addr", "Hw dest addr (resolved)",
- "Hw dest addr (unresolved)", "Network dest addr",
- "Net dest addr (resolved)", "Net dest addr (unresolved)",
- "Source port", "Src port (resolved)",
- "Src port (unresolved)", "Destination port",
- "Dest port (resolved)", "Dest port (unresolved)",
- "Protocol", "Information", "Packet length (bytes)" ,
- "OXID", "RXID", "FW-1 monitor if/direction",
- "Circuit ID"
- "Src PortIdx", "Dst PortIdx", "VSAN",};
-
+ g_assert((fmt >= 0) && (fmt < NUM_COL_FMTS));
return(dlist[fmt]);
}