aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-prism.c
diff options
context:
space:
mode:
authorgerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>2007-08-17 19:34:14 +0000
committergerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>2007-08-17 19:34:14 +0000
commit5ab5054466f7d37f55457d14a4fc6321c8c76cff (patch)
tree3addde2c71e52234ae9f5be95d5cd098bf6c78a6 /epan/dissectors/packet-prism.c
parentc531b782b91f7090bff1265a31572287ebe034c5 (diff)
Instead of converting between 802.11 frequencies and channels umpteen
different ways, add a set of common conversion routines. Add a "Frequency/Channel" column and fill it in where we can. Fix RSSI column printing in PPI. Fix up whitespace along the way. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22538 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-prism.c')
-rw-r--r--epan/dissectors/packet-prism.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/epan/dissectors/packet-prism.c b/epan/dissectors/packet-prism.c
index 52673afeb3..1c37c85f27 100644
--- a/epan/dissectors/packet-prism.c
+++ b/epan/dissectors/packet-prism.c
@@ -139,7 +139,7 @@ capture_prism(const guchar *pd, int offset, int len, packet_counts *ld)
length = pntohl(pd+sizeof(guint32));
/* Handle the new type of capture format */
- if ((cookie == WLANCAP_MAGIC_COOKIE_V1) ||
+ if ((cookie == WLANCAP_MAGIC_COOKIE_V1) ||
(cookie == WLANCAP_MAGIC_COOKIE_V2)) {
if(!BYTES_ARE_IN_FRAME(offset, len, length)) {
ld->other++;
@@ -163,6 +163,7 @@ capture_prism(const guchar *pd, int offset, int len, packet_counts *ld)
/*
* yah, I know, macros, ugh, but it makes the code
* below more readable
+ * XXX - This should be rewritten to use ptvcursors, then.
*/
#define IFHELP(size, name, var, str) \
if(tree) { \
@@ -197,12 +198,12 @@ dissect_prism(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* handle the new capture type. */
msgcode = tvb_get_ntohl(tvb, offset);
- if ((msgcode == WLANCAP_MAGIC_COOKIE_V1) ||
+ if ((msgcode == WLANCAP_MAGIC_COOKIE_V1) ||
(msgcode == WLANCAP_MAGIC_COOKIE_V2)) {
call_dissector(wlancap_handle, tvb, pinfo, tree);
return;
}
-
+
tvb_memcpy(tvb, (guint8 *)&hdr, offset, sizeof(hdr));
if(check_col(pinfo->cinfo, COL_PROTOCOL))
@@ -231,6 +232,10 @@ dissect_prism(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
VALFIELD(hosttime, "Host Time");
VALFIELD(mactime, "MAC Time");
+ if (hdr.channel.status == 0) {
+ if (check_col(pinfo->cinfo, COL_FREQ_CHAN))
+ col_add_fstr(pinfo->cinfo, COL_FREQ_CHAN, "%u", hdr.channel.data);
+ }
VALFIELD(channel, "Channel");
if (hdr.rate.status == 0) {
if (check_col(pinfo->cinfo, COL_RSSI))