diff options
-rw-r--r-- | column.c | 9 | ||||
-rw-r--r-- | packet.c | 4 | ||||
-rw-r--r-- | packet.h | 3 |
3 files changed, 11 insertions, 5 deletions
@@ -1,7 +1,7 @@ /* column.c * Routines for handling column preferences * - * $Id: column.c,v 1.16 1999/07/13 03:08:03 gram Exp $ + * $Id: column.c,v 1.17 1999/07/22 16:03:51 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -76,7 +76,7 @@ col_format_to_string(gint fmt) { "%hs", "%rhs", "%uhs", "%ns", "%rns", "%uns", "%d", "%rd", "%ud", "%hd", "%rhd", "%uhd", "%nd", "%rnd", "%und", "%S", "%rS", "%uS", "%D", "%rD", "%uD", "%p", - "%i" }; + "%i", "%L" }; if (fmt < 0 || fmt > NUM_COL_FMTS) return NULL; @@ -102,7 +102,7 @@ col_format_desc(gint fmt) { "Source port", "Src port (resolved)", "Src port (unresolved)", "Destination port", "Dest port (resolved)", "Dest port (unresolved)", - "Protocol", "Information" }; + "Protocol", "Information", "Packet length (bytes)" }; if (fmt < 0 || fmt > NUM_COL_FMTS) return NULL; @@ -246,6 +246,9 @@ get_column_format_from_str(gchar *str) { case 'T': time_off = TIME_DEL; break; + case 'L': + return COL_PACKET_LENGTH; + break; } cptr++; } @@ -1,7 +1,7 @@ /* packet.c * Routines for packet disassembly * - * $Id: packet.c,v 1.31 1999/07/15 15:32:43 gram Exp $ + * $Id: packet.c,v 1.32 1999/07/22 16:03:51 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -641,6 +641,8 @@ dissect_packet(const u_char *pd, frame_data *fd, proto_tree *tree) col_add_rel_time(fd, COL_REL_TIME); if (check_col(fd, COL_DELTA_TIME)) col_add_delta_time(fd, COL_DELTA_TIME); + if (check_col(fd, COL_PACKET_LENGTH)) + col_add_fstr(fd, COL_PACKET_LENGTH, "%d", fd->pkt_len); if (tree) { ti = proto_tree_add_item_format(tree, proto_frame, 0, fd->cap_len, @@ -1,7 +1,7 @@ /* packet.h * Definitions for packet disassembly structures and routines * - * $Id: packet.h,v 1.71 1999/07/12 21:39:28 gram Exp $ + * $Id: packet.h,v 1.72 1999/07/22 16:03:52 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -499,6 +499,7 @@ enum { 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 */ }; |