aboutsummaryrefslogtreecommitdiffstats
path: root/packet-ieee80211.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-12-10 00:26:21 +0000
committerGuy Harris <guy@alum.mit.edu>2001-12-10 00:26:21 +0000
commit23319ff023bcb144347a1307b958359b5226c699 (patch)
treeb347f1669210e07039ec31051cbb2c5e82422e6b /packet-ieee80211.c
parenta81a607ed5e3d291940ab75dd82d28d72c222b48 (diff)
Move the pointer to the "column_info" structure in the "frame_data"
structure to the "packet_info" structure; only stuff that's permanently stored with each frame should be in the "frame_data" structure, and the "column_info" structure is not guaranteed to hold the column values for that frame at all times - it was only in the "frame_data" structure so that it could be passed to dissectors, and, as all dissectors are now passed a pointer to a "packet_info" structure, it could just as well be put in the "packet_info" structure. That saves memory, by shrinking the "frame_data" structure (there's one of those per frame), and also lets us clean up the code a bit. svn path=/trunk/; revision=4370
Diffstat (limited to 'packet-ieee80211.c')
-rw-r--r--packet-ieee80211.c37
1 files changed, 17 insertions, 20 deletions
diff --git a/packet-ieee80211.c b/packet-ieee80211.c
index 435309b704..d24fcdd90f 100644
--- a/packet-ieee80211.c
+++ b/packet-ieee80211.c
@@ -3,7 +3,7 @@
* Copyright 2000, Axis Communications AB
* Inquiries/bugreports should be sent to Johan.Jorgensen@axis.com
*
- * $Id: packet-ieee80211.c,v 1.45 2001/12/03 03:59:35 guy Exp $
+ * $Id: packet-ieee80211.c,v 1.46 2001/12/10 00:25:28 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -89,10 +89,6 @@
#define COOK_FLAGS(x) (((x) & 0xFF00) >> 8)
#define COOK_DS_STATUS(x) ((x) & 0x3)
#define COOK_WEP_KEY(x) (((x) & 0xC0) >> 6)
-#define COL_SHOW_INFO(fd,info) if (check_col(fd,COL_INFO)) \
- col_add_str(fd,COL_INFO,info);
-#define COL_SHOW_INFO_CONST(fd,info) if (check_col(fd,COL_INFO)) \
- col_set_str(fd,COL_INFO,info);
#define FLAG_TO_DS 0x01
#define FLAG_FROM_DS 0x02
@@ -1016,22 +1012,22 @@ dissect_ieee80211_mgt (guint16 fcf, tvbuff_t * tvb, packet_info * pinfo,
static void
set_src_addr_cols(packet_info *pinfo, const guint8 *addr, char *type)
{
- if (check_col(pinfo->fd, COL_RES_DL_SRC))
- col_add_fstr(pinfo->fd, COL_RES_DL_SRC, "%s (%s)",
+ if (check_col(pinfo->cinfo, COL_RES_DL_SRC))
+ col_add_fstr(pinfo->cinfo, COL_RES_DL_SRC, "%s (%s)",
get_ether_name(addr), type);
- if (check_col(pinfo->fd, COL_UNRES_DL_SRC))
- col_add_fstr(pinfo->fd, COL_UNRES_DL_SRC, "%s (%s)",
+ if (check_col(pinfo->cinfo, COL_UNRES_DL_SRC))
+ col_add_fstr(pinfo->cinfo, COL_UNRES_DL_SRC, "%s (%s)",
ether_to_str(addr), type);
}
static void
set_dst_addr_cols(packet_info *pinfo, const guint8 *addr, char *type)
{
- if (check_col(pinfo->fd, COL_RES_DL_DST))
- col_add_fstr(pinfo->fd, COL_RES_DL_DST, "%s (%s)",
+ if (check_col(pinfo->cinfo, COL_RES_DL_DST))
+ col_add_fstr(pinfo->cinfo, COL_RES_DL_DST, "%s (%s)",
get_ether_name(addr), type);
- if (check_col(pinfo->fd, COL_UNRES_DL_DST))
- col_add_fstr(pinfo->fd, COL_UNRES_DL_DST, "%s (%s)",
+ if (check_col(pinfo->cinfo, COL_UNRES_DL_DST))
+ col_add_fstr(pinfo->cinfo, COL_UNRES_DL_DST, "%s (%s)",
ether_to_str(addr), type);
}
@@ -1054,18 +1050,19 @@ dissect_ieee80211 (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
guint32 addr_type;
volatile gboolean is_802_2;
- if (check_col (pinfo->fd, COL_PROTOCOL))
- col_set_str (pinfo->fd, COL_PROTOCOL, "IEEE 802.11");
- if (check_col (pinfo->fd, COL_INFO))
- col_clear (pinfo->fd, COL_INFO);
+ if (check_col (pinfo->cinfo, COL_PROTOCOL))
+ col_set_str (pinfo->cinfo, COL_PROTOCOL, "IEEE 802.11");
+ if (check_col (pinfo->cinfo, COL_INFO))
+ col_clear (pinfo->cinfo, COL_INFO);
fcf = tvb_get_letohs (tvb, 0);
hdr_len = find_header_length (fcf);
frame_type_subtype = COMPOSE_FRAME_TYPE(fcf);
- COL_SHOW_INFO_CONST (pinfo->fd,
- val_to_str(frame_type_subtype, frame_type_subtype_vals,
- "Unrecognized (Reserved frame)"));
+ if (check_col (pinfo->cinfo, COL_INFO))
+ col_set_str (pinfo->cinfo, COL_INFO,
+ val_to_str(frame_type_subtype, frame_type_subtype_vals,
+ "Unrecognized (Reserved frame)"));
/* Add the FC to the current tree */
if (tree)