From Hariharan Ananthakrishnan:
authorgerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 13 Mar 2008 23:45:48 +0000 (23:45 +0000)
committergerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 13 Mar 2008 23:45:48 +0000 (23:45 +0000)
I have added two new display filters to support filtering based on LSP-ID and
hostname for ISIS protocol.

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

AUTHORS
epan/dissectors/packet-isis-clv.c
epan/dissectors/packet-isis-clv.h
epan/dissectors/packet-isis-lsp.c

diff --git a/AUTHORS b/AUTHORS
index e4db07988b39411407ae04352bc02330e2e24cfa..446c12ccb3628509599ab793a9286006ec614ec2 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -2723,6 +2723,10 @@ Holger Pfrommer          <hpfrommer [AT] hilscher.com> {
        Hilscher analyzer protocols dissection
 }
 
+Hariharan Ananthakrishnan <hariharan.a [AT] gmail.com> {
+       ISIS LSP-ID and hostname enhancements
+}
+
 and by:
 
 Pavel Roskin            <proski [AT] gnu.org>
index 7aceb4b4145f8b358e61b8b163aa75a271ad0a56..10655d89142764304222fc653cff8636bc21748a 100644 (file)
@@ -231,6 +231,7 @@ isis_dissect_ip_authentication_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
  *      proto_tree * : protocol display tree to fill out.  May be NULL
  *      int : offset into packet data where we are.
  *      int : length of clv we are decoding
+ *      int : tree id to use for proto tree.
  *
  * Output:
  *      void, but we will add to proto tree if !NULL.
@@ -239,7 +240,7 @@ isis_dissect_ip_authentication_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
 
 void
 isis_dissect_hostname_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
-       int length)
+       int length, int tree_id)
 {
         if ( !tree ) return;            /* nothing to do! */
 
@@ -247,9 +248,10 @@ isis_dissect_hostname_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
                 proto_tree_add_text ( tree, tvb, offset, length,
                         "Hostname: --none--" );
         } else {
-                proto_tree_add_text ( tree, tvb, offset, length,
-                        "Hostname: %.*s", length,
-                        tvb_get_ptr(tvb, offset, length) );
+               const char* value = tvb_get_ptr(tvb, offset, length);
+                proto_tree_add_string_format ( tree, tree_id,
+                       tvb, offset, length,
+                        value, "Hostname: %.*s", length, value);
         }
 }
 
index 05b43d2e09f25029c5647ea059b5c1b811b7c0fb..76bc907bd2eda3eb1d46c4860558eb3163e43cb5 100644 (file)
@@ -100,7 +100,7 @@ extern void isis_dissect_ip_int_clv(tvbuff_t *tvb, proto_tree *tree,
 extern void isis_dissect_mt_clv(tvbuff_t *tvb, proto_tree *tree,
         int offset, int length, int tree_id);
 extern void isis_dissect_hostname_clv(tvbuff_t *tvb, proto_tree *tree,
-        int offset, int length);
+        int offset, int length, int tree_id);
 extern void isis_dissect_authentication_clv(tvbuff_t *tvb, proto_tree *tree,
         int offset, int length);
 extern void isis_dissect_ip_authentication_clv(tvbuff_t *tvb, proto_tree *tree,
index d37425dd778eb33a66a6297fbc584e9998a58aa0..494e0b8dbd7442b624dded78e5d5ab0b006b0cc7 100644 (file)
@@ -46,6 +46,8 @@
 static int hf_isis_lsp_pdu_length = -1;
 static int hf_isis_lsp_remaining_life = -1;
 static int hf_isis_lsp_sequence_number = -1;
+static int hf_isis_lsp_lsp_id = -1;
+static int hf_isis_lsp_hostname = -1;
 static int hf_isis_lsp_checksum = -1;
 static int hf_isis_lsp_checksum_bad = -1;
 static int hf_isis_lsp_checksum_good = -1;
@@ -943,7 +945,8 @@ static void
 dissect_lsp_hostname_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
        int id_length _U_, int length)
 {
-        isis_dissect_hostname_clv(tvb, tree, offset, length);
+        isis_dissect_hostname_clv(tvb, tree, offset, length, 
+               hf_isis_lsp_hostname);
 }
 
 
@@ -1801,9 +1804,11 @@ isis_dissect_isis_lsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
        offset_checksum = offset;
 
        if (tree) {
-               proto_tree_add_text(lsp_tree, tvb, offset, id_length + 2,
-                                    "LSP-ID: %s",
-                                    print_system_id( tvb_get_ptr(tvb, offset, id_length+2), id_length+2 ) );                
+               char* value = print_system_id( tvb_get_ptr(tvb, offset, id_length+2), 
+                                   id_length+2);
+               proto_tree_add_string_format(lsp_tree, hf_isis_lsp_lsp_id, 
+                       tvb, offset, id_length + 2,
+                        value, "LSP-ID: %s", value);
        }
 
        if (check_col(pinfo->cinfo, COL_INFO)) {
@@ -1930,6 +1935,14 @@ isis_register_lsp(int proto_isis) {
                { "Remaining lifetime", "isis.lsp.remaining_life", FT_UINT16,
                  BASE_DEC, NULL, 0x0, "", HFILL }},
 
+               { &hf_isis_lsp_lsp_id,
+               { "LSP-ID", "isis.lsp.lsp_id", FT_STRING,
+                 BASE_NONE, NULL, 0x0, "", HFILL }},
+
+               { &hf_isis_lsp_hostname,
+               { "Hostname", "isis.lsp.hostname", FT_STRING,
+                 BASE_NONE, NULL, 0x0, "", HFILL }},
+
                { &hf_isis_lsp_sequence_number,
                { "Sequence number",           "isis.lsp.sequence_number",
                  FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }},