diff options
author | Guy Harris <guy@alum.mit.edu> | 2002-06-28 20:13:03 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2002-06-28 20:13:03 +0000 |
commit | 6ecde9ff1776e9aba419cbb9ea6595d920db011f (patch) | |
tree | b4e0f68839f66ef000a07bad44f8216f5e5780ff | |
parent | d5cc116c7ddbbd0dc0cf8fc7ef91ae68f469dd8c (diff) | |
download | wireshark-6ecde9ff1776e9aba419cbb9ea6595d920db011f.tar.gz wireshark-6ecde9ff1776e9aba419cbb9ea6595d920db011f.tar.bz2 wireshark-6ecde9ff1776e9aba419cbb9ea6595d920db011f.zip |
From Didier Gautheron: move port number from AppleTalk addresses to
separate column, and put in hidden fields for AppleTalk source and
destination addresses.
svn path=/trunk/; revision=5778
-rw-r--r-- | AUTHORS | 3 | ||||
-rw-r--r-- | epan/atalk-utils.c | 4 | ||||
-rw-r--r-- | epan/atalk-utils.h | 3 | ||||
-rw-r--r-- | epan/column-utils.c | 17 | ||||
-rw-r--r-- | epan/packet_info.h | 5 | ||||
-rw-r--r-- | packet-atalk.c | 39 |
6 files changed, 57 insertions, 14 deletions
@@ -1172,6 +1172,9 @@ Didier Gautheron <dgautheron[AT]magic.fr> { "frame.marked" field set on marked frames Don't show progress bar for quick "Find Frame" searches Add "Find Next" and "Find Previous" to repeat searches + Move port number from AppleTalk addresses to separate column + Put in hidden fields for AppleTalk source and destination + addresses } Phil Williams <csypbw[AT]comp.leeds.ac.uk> { diff --git a/epan/atalk-utils.c b/epan/atalk-utils.c index b6877da18a..b2a861587e 100644 --- a/epan/atalk-utils.c +++ b/epan/atalk-utils.c @@ -1,7 +1,7 @@ /* atalk-utils.c * Routines for Appletalk utilities (DDP, currently). * - * $Id: atalk-utils.c,v 1.1 2001/03/22 16:24:16 gram Exp $ + * $Id: atalk-utils.c,v 1.2 2002/06/28 20:13:03 guy Exp $ * * Simon Wilkinson <sxw@dcs.ed.ac.uk> * @@ -40,7 +40,7 @@ atalk_addr_to_str(const struct atalk_ddp_addr *addrp) cur = &str[0][0]; } - sprintf(cur, "%u.%u:%u", addrp->net, addrp->node, addrp->port); + sprintf(cur, "%u.%u", addrp->net, addrp->node ); return cur; } diff --git a/epan/atalk-utils.h b/epan/atalk-utils.h index 258d1f8392..23ad70730a 100644 --- a/epan/atalk-utils.h +++ b/epan/atalk-utils.h @@ -1,7 +1,7 @@ /* atalk-utils.h * Definitions for Appletalk utilities (DDP, currently). * - * $Id: atalk-utils.h,v 1.1 2001/03/22 16:24:16 gram Exp $ + * $Id: atalk-utils.h,v 1.2 2002/06/28 20:13:03 guy Exp $ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -30,7 +30,6 @@ struct atalk_ddp_addr { guint16 net; guint8 node; - guint8 port; }; /* diff --git a/epan/column-utils.c b/epan/column-utils.c index e8a407d47b..2c245027d5 100644 --- a/epan/column-utils.c +++ b/epan/column-utils.c @@ -1,7 +1,7 @@ /* column-utils.c * Routines for column utilities. * - * $Id: column-utils.c,v 1.13 2002/01/31 08:03:39 guy Exp $ + * $Id: column-utils.c,v 1.14 2002/06/28 20:13:03 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -464,7 +464,12 @@ col_set_addr(packet_info *pinfo, int col, address *addr, gboolean is_res, strncpy(pinfo->cinfo->col_buf[col], atalk_addr_to_str(&ddp_addr), COL_MAX_LEN); pinfo->cinfo->col_buf[col][COL_MAX_LEN - 1] = '\0'; + if (is_src) + strcpy(pinfo->cinfo->col_expr[col], "ddp.src"); + else + strcpy(pinfo->cinfo->col_expr[col], "ddp.dst"); pinfo->cinfo->col_data[col] = pinfo->cinfo->col_buf[col]; + strcpy(pinfo->cinfo->col_expr_val[col],pinfo->cinfo->col_buf[col]); break; case AT_VINES: @@ -527,6 +532,16 @@ col_set_port(packet_info *pinfo, int col, port_type ptype, guint32 port, pinfo->cinfo->col_expr_val[col][COL_MAX_LEN - 1] = '\0'; break; + case PT_DDP: + if (is_src) + strcpy(pinfo->cinfo->col_expr[col], "ddp.src.socket"); + else + strcpy(pinfo->cinfo->col_expr[col], "ddp.dst.socket"); + snprintf(pinfo->cinfo->col_buf[col], COL_MAX_LEN, "%u", port); + snprintf(pinfo->cinfo->col_expr_val[col], COL_MAX_LEN, "%u", port); + pinfo->cinfo->col_expr_val[col][COL_MAX_LEN - 1] = '\0'; + break; + default: break; } diff --git a/epan/packet_info.h b/epan/packet_info.h index 63be445b06..c6ac1d52fe 100644 --- a/epan/packet_info.h +++ b/epan/packet_info.h @@ -1,7 +1,7 @@ /* packet_info.h * Definitions for packet info structures and routines * - * $Id: packet_info.h,v 1.14 2002/06/04 07:03:55 guy Exp $ + * $Id: packet_info.h,v 1.15 2002/06/28 20:13:03 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -80,7 +80,8 @@ typedef enum { PT_SCTP, /* SCTP */ PT_TCP, /* TCP */ PT_UDP, /* UDP */ - PT_NCP /* NCP connection */ + PT_NCP, /* NCP connection */ + PT_DDP /* DDP AppleTalk connection */ } port_type; #define P2P_DIR_UNKNOWN -1 diff --git a/packet-atalk.c b/packet-atalk.c index 7ee9c8a4db..597613a864 100644 --- a/packet-atalk.c +++ b/packet-atalk.c @@ -2,7 +2,7 @@ * Routines for AppleTalk packet disassembly: LLAP, DDP, NBP, ATP, ASP, * RTMP. * - * $Id: packet-atalk.c,v 1.76 2002/06/25 02:56:59 tpot Exp $ + * $Id: packet-atalk.c,v 1.77 2002/06/28 20:13:01 guy Exp $ * * Simon Wilkinson <sxw@dcs.ed.ac.uk> * @@ -70,7 +70,9 @@ static int proto_ddp = -1; static int hf_ddp_hopcount = -1; static int hf_ddp_len = -1; static int hf_ddp_checksum = -1; +static int hf_ddp_dst = -1; static int hf_ddp_dst_net = -1; +static int hf_ddp_src = -1; static int hf_ddp_src_net = -1; static int hf_ddp_dst_node = -1; static int hf_ddp_src_node = -1; @@ -1248,22 +1250,29 @@ dissect_ddp_short(tvbuff_t *tvb, packet_info *pinfo, guint8 dnode, src.net = 0; src.node = snode; - src.port = sport; dst.net = 0; dst.node = dnode; - dst.port = dport; SET_ADDRESS(&pinfo->net_src, AT_ATALK, sizeof src, (guint8 *)&src); SET_ADDRESS(&pinfo->src, AT_ATALK, sizeof src, (guint8 *)&src); SET_ADDRESS(&pinfo->net_dst, AT_ATALK, sizeof dst, (guint8 *)&dst); SET_ADDRESS(&pinfo->dst, AT_ATALK, sizeof dst, (guint8 *)&dst); + pinfo->ptype = PT_DDP; + pinfo->destport = dport; + pinfo->srcport = sport; + if (check_col(pinfo->cinfo, COL_INFO)) { col_add_str(pinfo->cinfo, COL_INFO, val_to_str(type, op_vals, "Unknown DDP protocol (%02x)")); } - if (tree) + if (tree) { + proto_tree_add_string_hidden(ddp_tree, hf_ddp_src, tvb, + 4, 3, atalk_addr_to_str(&src)); + proto_tree_add_string_hidden(ddp_tree, hf_ddp_dst, tvb, + 6, 3, atalk_addr_to_str(&dst)); + proto_tree_add_uint(ddp_tree, hf_ddp_type, tvb, 4, 1, type); - + } new_tvb = tvb_new_subset(tvb, DDP_SHORT_HEADER_SIZE, -1, -1); if (!dissector_try_port(ddp_dissector_table, type, new_tvb, pinfo, tree)) @@ -1292,15 +1301,17 @@ dissect_ddp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) src.net = ddp.snet; src.node = ddp.snode; - src.port = ddp.sport; dst.net = ddp.dnet; dst.node = ddp.dnode; - dst.port = ddp.dport; SET_ADDRESS(&pinfo->net_src, AT_ATALK, sizeof src, (guint8 *)&src); SET_ADDRESS(&pinfo->src, AT_ATALK, sizeof src, (guint8 *)&src); SET_ADDRESS(&pinfo->net_dst, AT_ATALK, sizeof dst, (guint8 *)&dst); SET_ADDRESS(&pinfo->dst, AT_ATALK, sizeof dst, (guint8 *)&dst); + pinfo->ptype = PT_DDP; + pinfo->destport = ddp.dport; + pinfo->srcport = ddp.sport; + if (check_col(pinfo->cinfo, COL_INFO)) col_add_str(pinfo->cinfo, COL_INFO, val_to_str(ddp.type, op_vals, "Unknown DDP protocol (%02x)")); @@ -1309,6 +1320,12 @@ dissect_ddp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) ti = proto_tree_add_item(tree, proto_ddp, tvb, 0, DDP_HEADER_SIZE, FALSE); ddp_tree = proto_item_add_subtree(ti, ett_ddp); + + proto_tree_add_string_hidden(ddp_tree, hf_ddp_src, tvb, + 4, 3, atalk_addr_to_str(&src)); + proto_tree_add_string_hidden(ddp_tree, hf_ddp_dst, tvb, + 6, 3, atalk_addr_to_str(&dst)); + proto_tree_add_uint(ddp_tree, hf_ddp_hopcount, tvb, 0, 1, ddp_hops(ddp.hops_len)); proto_tree_add_uint(ddp_tree, hf_ddp_len, tvb, 0, 2, @@ -1485,10 +1502,18 @@ proto_register_atalk(void) { "Checksum", "ddp.checksum", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL }}, + { &hf_ddp_dst, + { "Destination address", "ddp.dst", FT_STRING, BASE_NONE, NULL, 0x0, + "", HFILL }}, + { &hf_ddp_dst_net, { "Destination Net", "ddp.dst.net", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL }}, + { &hf_ddp_src, + { "Source address", "ddp.src", FT_STRING, BASE_NONE, NULL, 0x0, + "", HFILL }}, + { &hf_ddp_src_net, { "Source Net", "ddp.src.net", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL }}, |