aboutsummaryrefslogtreecommitdiffstats
path: root/packet-atalk.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>1998-10-20 05:31:03 +0000
committerGuy Harris <guy@alum.mit.edu>1998-10-20 05:31:03 +0000
commit0bb16cb9896ae50620085a0664942f44c9a16c6d (patch)
tree094fae93546e221f008e70f4eb6d582b1014a466 /packet-atalk.c
parent7867e7441dc1c34cbb08ab54d6c2839041c88471 (diff)
Add a "val_to_str()" routine that calls "match_strval()" and, if
it returns NULL, formats the value with the format passed in as an argument, and returns a pointer to that static buffer. Change several "match_strval()" calls to use "val_to_str()". In "dissect_ospf()", use "match_strval()" to look up the packet type, and use "Unknown" if it doesn't find a match. svn path=/trunk/; revision=66
Diffstat (limited to 'packet-atalk.c')
-rw-r--r--packet-atalk.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/packet-atalk.c b/packet-atalk.c
index c3589701ad..27f0da3ea2 100644
--- a/packet-atalk.c
+++ b/packet-atalk.c
@@ -82,19 +82,8 @@ dissect_ddp(const u_char *pd, int offset, frame_data *fd, GtkTree *tree) {
if (fd->win_info[COL_NUM]) {
strcpy(fd->win_info[COL_PROTOCOL], "DDP");
- switch (ddp.type) {
- case DDP_RTMPDATA:
- case DDP_RTMPREQ:
- case DDP_NBP:
- case DDP_ATP:
- case DDP_AEP:
- case DDP_ZIP:
- case DDP_ADSP:
- strcpy(fd->win_info[COL_INFO], match_strval(ddp.type,op_vals));
- break;
- default:
- sprintf(fd->win_info[COL_INFO], "Unknown DDP protocol (%02x)", ddp.type);
- }
+ strcpy(fd->win_info[COL_INFO],
+ val_to_str(ddp.type, op_vals, "Unknown DDP protocol (%02x)"));
sprintf(fd->win_info[COL_SOURCE],"%d.%d:%d",ddp.snet,ddp.snode,ddp.sport);
sprintf(fd->win_info[COL_DESTINATION], "%d.%d:%d",ddp.dnet,ddp.dnode,ddp.dport);