Add a new type of column for the circuit ID (Frame Relay DLCI, ISDN
[obnox/wireshark/wip.git] / column.c
index 4617a48eaebe4e8f6cb60d111965a38c9b0e0a2d..fe574c45cb13b4d4a0b5f4e3c7fef672858d88bb 100644 (file)
--- a/column.c
+++ b/column.c
@@ -1,7 +1,7 @@
 /* column.c
  * Routines for handling column preferences
  *
- * $Id: column.c,v 1.39 2002/12/10 00:12:57 guy Exp $
+ * $Id: column.c,v 1.40 2002/12/10 01:17:07 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -52,7 +52,7 @@ col_format_to_string(gint fmt) {
                      "%us","%hs", "%rhs", "%uhs", "%ns", "%rns", "%uns", "%d",
                      "%rd", "%ud", "%hd", "%rhd", "%uhd", "%nd", "%rnd",
                      "%und", "%S", "%rS", "%uS", "%D", "%rD", "%uD", "%p",
-                     "%i", "%L", "%XO", "%XR", "%I" };
+                     "%i", "%L", "%XO", "%XR", "%I", "%c" };
                      
   if (fmt < 0 || fmt > NUM_COL_FMTS)
     return NULL;
@@ -80,7 +80,8 @@ col_format_desc(gint fmt) {
                      "Src port (unresolved)", "Destination port",
                      "Dest port (resolved)", "Dest port (unresolved)",
                      "Protocol", "Information", "Packet length (bytes)" ,
-                     "OXID", "RXID", "FW-1 monitor if/direction" };
+                     "OXID", "RXID", "FW-1 monitor if/direction",
+                     "Circuit ID" };
 
   return(dlist[fmt]);
 }
@@ -147,6 +148,9 @@ get_column_format_matches(gboolean *fmt_list, gint format) {
     case COL_IF_DIR:
       fmt_list[COL_IF_DIR] = TRUE;
       break;
+    case COL_CIRCUIT_ID:
+      fmt_list[COL_CIRCUIT_ID] = TRUE;
+      break;
     default:
       break;
   }
@@ -230,6 +234,9 @@ get_column_longest_string(gint format)
     case COL_IF_DIR:
       return "i 00000000 I";
       break;
+    case COL_CIRCUIT_ID:
+      return "000000";
+      break;
     default: /* COL_INFO */
       return "Source port: kerberos-master  Destination port: kerberos-master";
       break;
@@ -262,6 +269,7 @@ get_column_resize_type(gint format) {
     case COL_PROTOCOL:
     case COL_PACKET_LENGTH:
     case COL_IF_DIR:
+    case COL_CIRCUIT_ID:
       /* We don't want these to resize during a live capture, as that
          gets in the way of trying to look at the data while it's being
         captured. */
@@ -391,15 +399,18 @@ get_column_format_from_str(gchar *str) {
       case 'L':
         return COL_PACKET_LENGTH;
         break;
-      case 'I':
-        return COL_IF_DIR;
-        break;
       case 'X':
         prev_code = COL_OXID;
         break;
       case 'O':
         return COL_OXID;
         break;
+      case 'I':
+        return COL_IF_DIR;
+        break;
+      case 'c':
+        return COL_CIRCUIT_ID;
+        break;
     }
     cptr++;
   }