aboutsummaryrefslogtreecommitdiffstats
path: root/packet-arp.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>1998-11-17 04:29:13 +0000
committerGerald Combs <gerald@wireshark.org>1998-11-17 04:29:13 +0000
commit6ca358948b8c5aa99a4e0db8595f601ab834e76e (patch)
tree750ab11a6661c391b126d4ce990b7fc01cb98d46 /packet-arp.c
parent8d616b03429fe2185782f5153d7b187a44698b5d (diff)
* Added column formatting functionality.
* Added check_col(), add_col_str() and add_col_fmt() to replace references to ft->win_info. * Added column prefs handling code. svn path=/trunk/; revision=97
Diffstat (limited to 'packet-arp.c')
-rw-r--r--packet-arp.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/packet-arp.c b/packet-arp.c
index d6a9bf0498..9906f607d3 100644
--- a/packet-arp.c
+++ b/packet-arp.c
@@ -1,7 +1,7 @@
/* packet-arp.c
* Routines for ARP packet disassembly
*
- * $Id: packet-arp.c,v 1.9 1998/11/12 00:06:23 gram Exp $
+ * $Id: packet-arp.c,v 1.10 1998/11/17 04:28:49 gerald Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -207,31 +207,31 @@ dissect_arp(const u_char *pd, int offset, frame_data *fd, GtkTree *tree) {
tpa_offset = tha_offset + ar_hln;
tpa_str = arpproaddr_to_str((guint8 *) &pd[tpa_offset], ar_pln, ar_pro);
- if (fd->win_info[COL_NUM]) {
+ if (check_col(fd, COL_PROTOCOL)) {
+ if ((op_str = match_strval(ar_op, op_vals)))
+ col_add_str(fd, COL_PROTOCOL, op_str);
+ else
+ col_add_str(fd, COL_PROTOCOL, "ARP");
+ }
+
+ if (check_col(fd, COL_INFO)) {
switch (ar_op) {
case ARPOP_REQUEST:
- strcpy(fd->win_info[COL_PROTOCOL], "ARP");
- sprintf(fd->win_info[COL_INFO], "Who has %s? Tell %s",
+ col_add_fstr(fd, COL_INFO, "Who has %s? Tell %s",
tpa_str, spa_str);
break;
case ARPOP_REPLY:
- strcpy(fd->win_info[COL_PROTOCOL], "ARP");
- sprintf(fd->win_info[COL_INFO], "%s is at %s",
- spa_str, sha_str);
+ col_add_fstr(fd, COL_INFO, "%s is at %s", spa_str, sha_str);
break;
case ARPOP_RREQUEST:
- strcpy(fd->win_info[COL_PROTOCOL], "RARP");
- sprintf(fd->win_info[COL_INFO], "Who is %s? Tell %s",
+ col_add_fstr(fd, COL_INFO, "Who is %s? Tell %s",
tha_str, sha_str);
break;
case ARPOP_RREPLY:
- strcpy(fd->win_info[COL_PROTOCOL], "RARP");
- sprintf(fd->win_info[COL_INFO], "%s is at %s",
- sha_str, spa_str);
+ col_add_fstr(fd, COL_INFO, "%s is at %s", sha_str, spa_str);
break;
default:
- strcpy(fd->win_info[COL_PROTOCOL], "ARP");
- sprintf(fd->win_info[COL_INFO], "Unknown ARP opcode 0x%04x", ar_op);
+ col_add_fstr(fd, COL_INFO, "Unknown ARP opcode 0x%04x", ar_op);
break;
}
}