From Mike Duigou:
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 20 Jun 2005 20:14:22 +0000 (20:14 +0000)
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 20 Jun 2005 20:14:22 +0000 (20:14 +0000)
 In order to get filtering of conversations and
> endpoints to work from the endpoints and conversations windows I found
> it necessary to add a new AT_URI address type and a SAT_JXTA. This also
> necessitated a change to to_str.c to avoid a buffer overflow problem.
> Please review these changes carefully.
>
> Also includes some changes to the jxta dissector to fix filtering on
> generated fields and some changes to the types used for ints/unsigned ints.
>
> Fixes a bug with the processing of messages containing namespaces.

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

gtk/conversations_jxta.c
gtk/conversations_table.c
gtk/hostlist_jxta.c
gtk/hostlist_table.c
gtk/sat.h

index c8835a73b420c779116c0e59d2250e4099224d50..cc550aec5126d232dccbc104a1e4f2493537c575 100644 (file)
@@ -53,7 +53,7 @@ jxta_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_,
                0, 
                1, 
                jxtahdr->size, 
-               SAT_NONE
+               SAT_JXTA
                PT_NONE);
 
 
@@ -93,4 +93,3 @@ register_tap_listener_jxta_conversation(void)
 
     register_conversation_table(TRUE, "JXTA", "jxta", NULL /*filter*/, jxta_conversation_packet);
 }
-
index 624ebfbdaad84a86c3ddf6a6e3235babec72ad0d..acf82cf01cb80dd17851732a5056e1fe80f75593 100644 (file)
@@ -114,7 +114,10 @@ ct_get_filter_name(address *addr, int specific_addr_type, int port_type, int nam
                                return "fddi.src";
                        case SAT_TOKENRING:
                                return "tr.src";
+                        default:
+                            ;
                        }
+                        break;
                case AT_IPv4:
                        return "ip.src";
                case AT_IPv6:
@@ -123,9 +126,18 @@ ct_get_filter_name(address *addr, int specific_addr_type, int port_type, int nam
                        return "ipx.src";
                case AT_FC:
                        return "fc.s_id";
+               case AT_URI:
+                       switch(specific_addr_type){
+                       case SAT_JXTA:
+                               return "jxta.message.src";
+                        default:
+                            ;
+                       }
+                        break;
                default:
                        ;
                }
+                break;
        case FN_DST_ADDRESS:
                switch(addr->type){
                case AT_ETHER:
@@ -136,7 +148,10 @@ ct_get_filter_name(address *addr, int specific_addr_type, int port_type, int nam
                                return "fddi.dst";
                        case SAT_TOKENRING:
                                return "tr.dst";
+                        default:
+                            ;
                        }
+                        break;
                case AT_IPv4:
                        return "ip.dst";
                case AT_IPv6:
@@ -145,9 +160,18 @@ ct_get_filter_name(address *addr, int specific_addr_type, int port_type, int nam
                        return "ipx.dst";
                case AT_FC:
                        return "fc.d_id";
+               case AT_URI:
+                       switch(specific_addr_type){
+                       case SAT_JXTA:
+                               return "jxta.message.dst";
+                        default:
+                            ;
+                       }
+                        break;
                default:
                        ;
                }
+                break;
        case FN_ANY_ADDRESS:
                switch(addr->type){
                case AT_ETHER:
@@ -158,7 +182,10 @@ ct_get_filter_name(address *addr, int specific_addr_type, int port_type, int nam
                                return "fddi.addr";
                        case SAT_TOKENRING:
                                return "tr.addr";
+                        default:
+                            break;
                        }
+                        break;
                case AT_IPv4:
                        return "ip.addr";
                case AT_IPv6:
@@ -167,15 +194,26 @@ ct_get_filter_name(address *addr, int specific_addr_type, int port_type, int nam
                        return "ipx.addr";
                case AT_FC:
                        return "fc.id";
+               case AT_URI:
+                       switch(specific_addr_type){
+                       case SAT_JXTA:
+                               return "jxta.message.address";
+                        default:
+                            ;
+                       }
+                        break;
                default:
                        ;
                }
+                break;
        case FN_SRC_PORT:
                switch(port_type){
                case PT_TCP:
                        return "tcp.srcport";
                case PT_UDP:
                        return "udp.srcport";
+                default:
+                        ;
                }
                break;
        case FN_DST_PORT:
@@ -184,6 +222,8 @@ ct_get_filter_name(address *addr, int specific_addr_type, int port_type, int nam
                        return "tcp.dstport";
                case PT_UDP:
                        return "udp.dstport";
+                default:
+                        ;
                }
                break;
        case FN_ANY_PORT:
@@ -192,6 +232,8 @@ ct_get_filter_name(address *addr, int specific_addr_type, int port_type, int nam
                        return "tcp.port";
                case PT_UDP:
                        return "udp.port";
+                default:
+                        ;
                }
                break;
        }
index dd18b245678ede737705bd2aa0d30f528b6bd254..10017a36a4efcd0da789571ed6f4bf5a91aebf05 100644 (file)
@@ -49,8 +49,8 @@ jxta_hostlist_packet(void *pit, packet_info *pinfo _U_, epan_dissect_t *edt _U_,
        /* Take two "add" passes per packet, adding for each direction, ensures that all
        packets are counted properly (even if address is sending to itself) 
        XXX - this could probably be done more efficiently inside hostlist_table */
-       add_hostlist_table_data(hosts, &jxtahdr->src_address, 0, TRUE, 1, jxtahdr->size, SAT_NONE, PT_NONE);
-       add_hostlist_table_data(hosts, &jxtahdr->dest_address, 0, FALSE, 1, jxtahdr->size, SAT_NONE, PT_NONE);
+       add_hostlist_table_data(hosts, &jxtahdr->src_address, 0, TRUE, 1, jxtahdr->size, SAT_JXTA, PT_NONE);
+       add_hostlist_table_data(hosts, &jxtahdr->dest_address, 0, FALSE, 1, jxtahdr->size, SAT_JXTA, PT_NONE);
        return 1;
 }
 
index c47f175637ee58cf94dde343765170dd5ba919a3..bcc68ee8f78ec67a71a4dffdc461c48f6288890d 100644 (file)
@@ -86,7 +86,7 @@ hostlist_port_to_str(int port_type, guint32 port)
 #define FN_ANY_ADDRESS         0
 #define FN_ANY_PORT            1
 
-/* given an address (to distinguis between ipv4 and ipv6 for tcp/udp
+/* given an address (to distinguish between ipv4 and ipv6 for tcp/udp
    a port_type and a name_type (FN_...)
    return a string for the filter name
 
@@ -108,7 +108,10 @@ hostlist_get_filter_name(address *addr, int specific_addr_type, int port_type, i
                                return "fddi.addr";
                        case SAT_TOKENRING:
                                return "tr.addr";
+                        default :
+                                ;
                        }
+                        break;
                case AT_IPv4:
                        return "ip.addr";
                case AT_IPv6:
@@ -117,6 +120,14 @@ hostlist_get_filter_name(address *addr, int specific_addr_type, int port_type, i
                        return "ipx.addr";
                case AT_FC:
                        return "fc.id";
+               case AT_URI:
+                       switch(specific_addr_type){
+                       case SAT_JXTA:
+                               return "jxta.message.address";
+                        default:
+                            ;
+                       }
+                        break;
                default:
                        ;
                }
index 5cd108b9e4ce09c209ec08d578f573c0875b0d52..6a1043affbd750008b348a2f306fbedbaeb6b77d 100644 (file)
--- a/gtk/sat.h
+++ b/gtk/sat.h
@@ -1,6 +1,6 @@
 /* sat.h
  * 2003 Ronnie Sahlberg
- * Sub-address types for MAC addresses
+ * Sub-address types for MAC/URI addresses
  *
  * $Id$
  *
 /** Address type */
 typedef enum {
     SAT_NONE,       /**< no address type */
-    SAT_ETHER,      /**< Ethernet */
-    SAT_FDDI,       /**< FDDI */
-    SAT_TOKENRING   /**< Token Ring */
+    SAT_ETHER,      /**< MAC : Ethernet */
+    SAT_FDDI,       /**< MAC : FDDI */
+    SAT_TOKENRING,  /**< MAC : Token Ring */
+    SAT_JXTA        /**< URI : JXTA */
 } SAT_E;
 
 #endif /* __GTK_SAT_H__ */