From Pontus Fuchs via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7728
authoreapache <eapache@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 15 Sep 2012 20:16:14 +0000 (20:16 +0000)
committereapache <eapache@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 15 Sep 2012 20:16:14 +0000 (20:16 +0000)
Make right-click + apply-as-filter work in the packet list for non-ethernet
frames (such as ieee 802.11 frames).

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@44921 f5534014-38df-0310-8fa8-9805f1628bb7

AUTHORS
epan/address.h
epan/column-utils.c
epan/dissectors/packet-ieee80211.c
epan/dissectors/packet-mgcp.c
epan/dissectors/packet-radius.c
epan/dissectors/packet-rpc.c
plugins/wimax/packet-wmx.c

diff --git a/AUTHORS b/AUTHORS
index 23cbc883b84585a21fa00d73bb2bb06c4c6c4bad..9553ec05d4916cf0cdbca84368120a7c3b9fdd49 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -3674,6 +3674,7 @@ Bodo Petermann            <bp245[AT]hotmail.com>
 Martin Kupec           <martin.kupec[AT]kupson.cz>
 Litao Gao              <ltgao[AT]juniper.net>
 Niels Widger           <niels[AT]qacafe.com>
+Pontus Fuchs           <pontus.fuchs[AT]gmail.com>
 
 Dan Lasley <dlasley[AT]promus.com> gave permission for his
 dumpit() hex-dump routine to be used.
index 9c87a9dfcbe3d70ffcaf6c68b66d226eb9478174..2cd4a2b2590523b4148e60c7a515c415a5d45c36 100644 (file)
@@ -60,14 +60,28 @@ typedef enum {
   AT_AX25              /* AX.25 */
 } address_type;
 
+typedef enum {
+  AT_SUB_NONE,         /* no sub type */
+  AT_SUB_IEEE80211,    /* 802.11 */
+} address_stype;
+
 typedef struct _address {
   address_type  type;          /* type of address */
+  address_stype subtype;
   int           len;           /* length of address, in bytes */
   const void   *data;          /* pointer to address data */
 } address;
 
 #define        SET_ADDRESS(addr, addr_type, addr_len, addr_data) { \
        (addr)->type = (addr_type); \
+       (addr)->subtype = AT_SUB_NONE; \
+       (addr)->len = (addr_len); \
+       (addr)->data = (addr_data); \
+       }
+
+#define SET_ADDRESS_SUB(addr, addr_type, addr_subtype, addr_len, addr_data) { \
+       (addr)->type = (addr_type); \
+       (addr)->subtype = addr_subtype; \
        (addr)->len = (addr_len); \
        (addr)->data = (addr_data); \
        }
index cffe5c5a129bd3c3f54c775f14b2a87e92e9d18e..7ea52e136a9ede7cddfa5648688a29653cd80bbe 100644 (file)
@@ -1397,11 +1397,22 @@ col_set_addr(packet_info *pinfo, const int col, const address *addr, const gbool
     break;
 
   case AT_ETHER:
-    if (is_src)
-      pinfo->cinfo->col_expr.col_expr[col] = "eth.src";
-    else
-      pinfo->cinfo->col_expr.col_expr[col] = "eth.dst";
-    address_to_str_buf(addr, pinfo->cinfo->col_expr.col_expr_val[col], COL_MAX_LEN);
+    switch(addr->subtype) {
+    default:
+      if (is_src)
+        pinfo->cinfo->col_expr.col_expr[col] = "eth.src";
+      else
+        pinfo->cinfo->col_expr.col_expr[col] = "eth.dst";
+      address_to_str_buf(addr, pinfo->cinfo->col_expr.col_expr_val[col], COL_MAX_LEN);
+      break;
+    case AT_SUB_IEEE80211:
+      if (is_src)
+        pinfo->cinfo->col_expr.col_expr[col] = "wlan.sa";
+      else
+        pinfo->cinfo->col_expr.col_expr[col] = "wlan.da";
+      address_to_str_buf(addr, pinfo->cinfo->col_expr.col_expr_val[col], COL_MAX_LEN);
+      break;
+    }
     break;
 
   case AT_IPv4:
index c7a690d0bb3509e3d236471df126837b4374006f..40ac4cc21652745754dc336132a23ddec2af56ac 100644 (file)
@@ -10069,15 +10069,15 @@ dissect_ieee80211_common (tvbuff_t * tvb, packet_info * pinfo,
       src = tvb_get_ptr (tvb, 10, 6);
       dst = tvb_get_ptr (tvb, 4, 6);
 
-      SET_ADDRESS(&pinfo->dl_src, AT_ETHER, 6, src);
-      SET_ADDRESS(&pinfo->src, AT_ETHER, 6, src);
-      SET_ADDRESS(&pinfo->dl_dst, AT_ETHER, 6, dst);
-      SET_ADDRESS(&pinfo->dst, AT_ETHER, 6, dst);
+      SET_ADDRESS_SUB(&pinfo->dl_src, AT_ETHER, AT_SUB_IEEE80211, 6, src);
+      SET_ADDRESS_SUB(&pinfo->src, AT_ETHER, AT_SUB_IEEE80211, 6, src);
+      SET_ADDRESS_SUB(&pinfo->dl_dst, AT_ETHER, AT_SUB_IEEE80211, 6, dst);
+      SET_ADDRESS_SUB(&pinfo->dst, AT_ETHER, AT_SUB_IEEE80211, 6, dst);
 
       /* for tap */
-      SET_ADDRESS(&whdr->bssid, AT_ETHER, 6, tvb_get_ptr(tvb, 16,6));
-      SET_ADDRESS(&whdr->src, AT_ETHER, 6, src);
-      SET_ADDRESS(&whdr->dst, AT_ETHER, 6, dst);
+      SET_ADDRESS_SUB(&whdr->bssid, AT_ETHER, AT_SUB_IEEE80211, 6, tvb_get_ptr(tvb, 16,6));
+      SET_ADDRESS_SUB(&whdr->src, AT_ETHER, AT_SUB_IEEE80211, 6, src);
+      SET_ADDRESS_SUB(&whdr->dst, AT_ETHER, AT_SUB_IEEE80211, 6, dst);
       whdr->type = frame_type_subtype;
 
       seq_control = tvb_get_letohs(tvb, 22);
@@ -10449,16 +10449,16 @@ dissect_ieee80211_common (tvbuff_t * tvb, packet_info * pinfo,
           break;
       }
 
-      SET_ADDRESS(&pinfo->dl_src, AT_ETHER, 6, src);
-      SET_ADDRESS(&pinfo->src, AT_ETHER, 6, src);
-      SET_ADDRESS(&pinfo->dl_dst, AT_ETHER, 6, dst);
-      SET_ADDRESS(&pinfo->dst, AT_ETHER, 6, dst);
+      SET_ADDRESS_SUB(&pinfo->dl_src, AT_ETHER, AT_SUB_IEEE80211, 6, src);
+      SET_ADDRESS_SUB(&pinfo->src, AT_ETHER, AT_SUB_IEEE80211, 6, src);
+      SET_ADDRESS_SUB(&pinfo->dl_dst, AT_ETHER, AT_SUB_IEEE80211, 6, dst);
+      SET_ADDRESS_SUB(&pinfo->dst, AT_ETHER, AT_SUB_IEEE80211, 6, dst);
 
       /* for tap */
 
-      SET_ADDRESS(&whdr->bssid, AT_ETHER, 6, bssid);
-      SET_ADDRESS(&whdr->src, AT_ETHER, 6, src);
-      SET_ADDRESS(&whdr->dst, AT_ETHER, 6, dst);
+      SET_ADDRESS_SUB(&whdr->bssid, AT_ETHER, AT_SUB_IEEE80211, 6, bssid);
+      SET_ADDRESS_SUB(&whdr->src, AT_ETHER, AT_SUB_IEEE80211, 6, src);
+      SET_ADDRESS_SUB(&whdr->dst, AT_ETHER, AT_SUB_IEEE80211, 6, dst);
       whdr->type = frame_type_subtype;
 
       seq_control = tvb_get_letohs(tvb, 22);
index 9e5dd81f184f033f0b38f0b8e6d28892e830a9d0..b6eee032bbb4be7288540a65b96279959b1140c9 100644 (file)
@@ -1398,7 +1398,7 @@ static void dissect_mgcp_firstline(tvbuff_t *tvb, packet_info *pinfo, proto_tree
        const gchar *verb_description = "";
        char code_with_verb[64] = "";  /* To fit "<4-letter-code> (<longest-verb>)" */
 
-       static address null_address = { AT_NONE, 0, NULL };
+       static address null_address = { AT_NONE, AT_SUB_NONE, 0, NULL };
        tvb_previous_offset = 0;
        tvb_len = tvb_length(tvb);
        tvb_current_len = tvb_len;
index 1fdeea6af81dd7359cee5a639b9d8d62dc89fe86..2eaf33b749758e84f7301453d82e8c8ff0d4ee3c 100644 (file)
@@ -1360,7 +1360,7 @@ dissect_radius(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
        radius_call_info_key radius_call_key;
        radius_call_info_key *new_radius_call_key;
        radius_call_t *radius_call = NULL;
-       static address null_address = { AT_NONE, 0, NULL };
+       static address null_address = { AT_NONE, AT_SUB_NONE, 0, NULL };
 
        /* does this look like radius ? */
        if(!is_radius(tvb)){
index 25341c103bbc2903e50502a4c52bd331b8d29011..dceeb7625c4a3221aa820c32a42c042a39824019 100644 (file)
@@ -1549,7 +1549,7 @@ dissect_rpc_indir_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
     int offset, int args_id, guint32 prog, guint32 vers, guint32 proc)
 {
        conversation_t* conversation;
-       static address null_address = { AT_NONE, 0, NULL };
+       static address null_address = { AT_NONE, AT_SUB_NONE, 0, NULL };
        rpc_proc_info_key key;
        rpc_proc_info_value *value;
        rpc_call_info_value *rpc_call;
@@ -1699,7 +1699,7 @@ dissect_rpc_indir_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
     int offset, int result_id, int prog_id, int vers_id, int proc_id)
 {
        conversation_t* conversation;
-       static address null_address = { AT_NONE, 0, NULL };
+       static address null_address = { AT_NONE, AT_SUB_NONE, 0, NULL };
        rpc_call_info_value *rpc_call;
        char *procname=NULL;
        dissect_function_t *dissect_function = NULL;
@@ -1931,7 +1931,7 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
        rpc_proc_info_key       key;
        rpc_proc_info_value     *value = NULL;
        conversation_t* conversation;
-       static address null_address = { AT_NONE, 0, NULL };
+       static address null_address = { AT_NONE, AT_SUB_NONE, 0, NULL };
        nstime_t ns;
 
        dissect_function_t *dissect_function = NULL;
index 0085663b062a3cceb1bd5e79d72c49665f886986..10c34637c65e395d6a7a73b22d787db496530450 100644 (file)
@@ -66,7 +66,7 @@ extern        gboolean include_cor2_changes;
 
 gint    man_ofdma = 1;
 
-address bs_address = {0,0,0};
+address bs_address = {0,0,0,0};
 
 /* The following variables are local to the function, but serve as
    elements for the global ett_tlv[] array */