/* packet-isis-lsp.c
* Routines for decoding isis lsp packets and their CLVs
*
- * $Id: packet-isis-lsp.c,v 1.23 2001/12/26 21:37:21 guy Exp $
+ * $Id: packet-isis-lsp.c,v 1.33 2002/08/04 09:08:03 jmayer Exp $
* Stuart Stanley <stuarts@mxmail.net>
*
* Ethereal - Network traffic analyzer
# include "config.h"
#endif
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
#include <stdio.h>
#include <string.h>
#include <glib.h>
-#ifdef HAVE_NET_INET_H
-#include <net/inet.h>
-#endif
-
#include "epan/ipv4.h"
-#include "packet.h"
+#include <epan/packet.h>
#include "packet-osi.h"
#include "packet-ipv6.h"
#include "packet-isis.h"
#include "packet-isis-clv.h"
#include "packet-isis-lsp.h"
-#include "resolv.h"
+#include <epan/resolv.h>
/* lsp packets */
static int hf_isis_lsp_pdu_length = -1;
* Predclare dissectors for use in clv dissection.
*/
static void dissect_lsp_prefix_neighbors_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length);
+ proto_tree *tree, int offset, int id_length, int length);
static void dissect_lsp_partition_dis_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length);
+ proto_tree *tree, int offset, int id_length, int length);
static void dissect_lsp_mt_is_reachability_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length);
+ proto_tree *tree, int offset, int id_length, int length);
static void dissect_lsp_ext_is_reachability_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length);
+ proto_tree *tree, int offset, int id_length, int length);
static void dissect_lsp_l2_is_neighbors_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length);
+ proto_tree *tree, int offset, int id_length, int length);
static void dissect_lsp_l1_es_neighbors_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length);
+ proto_tree *tree, int offset, int id_length, int length);
static void dissect_lsp_l1_is_neighbors_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length);
+ proto_tree *tree, int offset, int id_length, int length);
static void dissect_lsp_area_address_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length);
+ proto_tree *tree, int offset, int id_length, int length);
static void dissect_lsp_l2_auth_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length);
+ proto_tree *tree, int offset, int id_length, int length);
static void dissect_lsp_l1_auth_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length);
+ proto_tree *tree, int offset, int id_length, int length);
static void dissect_lsp_ipv6_int_addr_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length);
+ proto_tree *tree, int offset, int id_length, int length);
static void dissect_lsp_ip_int_addr_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length);
+ proto_tree *tree, int offset, int id_length, int length);
static void dissect_lsp_te_router_id_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length);
+ proto_tree *tree, int offset, int id_length, int length);
static void dissect_lsp_hostname_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length);
+ proto_tree *tree, int offset, int id_length, int length);
static void dissect_lsp_mt_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length);
+ proto_tree *tree, int offset, int id_length, int length);
static void dissect_lsp_nlpid_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length);
+ proto_tree *tree, int offset, int id_length, int length);
static void dissect_lsp_ipv6_reachability_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length);
+ proto_tree *tree, int offset, int id_length, int length);
static void dissect_lsp_ext_ip_reachability_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length);
+ proto_tree *tree, int offset, int id_length, int length);
static void dissect_lsp_ip_reachability_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length);
+ proto_tree *tree, int offset, int id_length, int length);
*
* Input:
* tvbuff_t * : tvbuffer for packet data
- * packet_info * : info for current packet
* proto_tree * : protocol display tree to fill out. May be NULL
* int : offset into packet data where we are.
* guint8 : value of the metric.
* void, but we will add to proto tree if !NULL.
*/
static void
-dissect_metric(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
- int offset, guint8 value, char *pstr, int force_supported )
+dissect_metric(tvbuff_t *tvb, proto_tree *tree, int offset, guint8 value,
+ char *pstr, int force_supported )
{
int s;
*
* Input:
* tvbuff_t * : tvbuffer for packet data
- * packet_info * : info for current packet
* proto_tree * : proto tree to build on (may be null)
* int : current offset into packet data
* int : length of IDs in packet.
* void, will modify proto_tree if not null.
*/
static void
-dissect_lsp_ip_reachability_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length)
+dissect_lsp_ip_reachability_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
+ int id_length _U_, int length)
{
proto_item *ti;
proto_tree *ntree = NULL;
while ( length > 0 ) {
if (length<12) {
- isis_dissect_unknown(tvb, pinfo, tree, offset,
+ isis_dissect_unknown(tvb, tree, offset,
"short IP reachability (%d vs 12)", length );
return;
}
*
* Input:
* tvbuff_t * : tvbuffer for packet data
- * packet_info * : info for current packet
* proto_tree * : proto tree to build on (may be null)
* int : current offset into packet data
* int : length of IDs in packet.
* void, will modify proto_tree if not null.
*/
static void
-dissect_lsp_ext_ip_reachability_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length)
+dissect_lsp_ext_ip_reachability_clv(tvbuff_t *tvb, proto_tree *tree,
+ int offset, int id_length _U_, int length)
{
proto_item *pi = NULL;
proto_tree *subtree = NULL;
bit_length = ctrl_info & 0x3f;
byte_length = (bit_length + 7) / 8;
tvb_memcpy (tvb, prefix, offset+5, byte_length);
- pi = proto_tree_add_text (tree, tvb, offset, 0,
+ pi = proto_tree_add_text (tree, tvb, offset, -1,
"IPv4 prefix: %s/%d",
ip_to_str (prefix),
bit_length );
*
* Input:
* tvbuff_t * : tvbuffer for packet data
- * packet_info * : info for current packet
* proto_tree * : proto tree to build on (may be null)
* int : current offset into packet data
* int : length of IDs in packet.
* void, will modify proto_tree if not null.
*/
static void
-dissect_lsp_ipv6_reachability_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length)
+dissect_lsp_ipv6_reachability_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
+ int id_length _U_, int length)
{
proto_item *ti;
proto_tree *ntree = NULL;
bit_length = tvb_get_guint8(tvb, offset+5);
byte_length = (bit_length + 7) / 8;
tvb_memcpy (tvb, prefix.s6_addr, offset+6, byte_length);
- ti = proto_tree_add_text (tree, tvb, offset, 0,
+ ti = proto_tree_add_text (tree, tvb, offset, -1,
"IP prefix: %s /%d",
ip6_to_str (&prefix),
bit_length );
*
* Input:
* tvbuff_t * : tvbuffer for packet data
- * packet_info * : info for current packet
* proto_tree * : proto tree to build on (may be null)
* int : current offset into packet data
* int : length of IDs in packet.
* void, will modify proto_tree if not null.
*/
static void
-dissect_lsp_nlpid_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length)
+dissect_lsp_nlpid_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
+ int id_length _U_, int length)
{
- isis_dissect_nlpid_clv(tvb, pinfo, tree, offset, length);
+ isis_dissect_nlpid_clv(tvb, tree, offset, length);
}
/*
* clv common one.
*
* Input:
- * u_char * : packet data
+ * tvbuff_t * : tvbuffer for packet data
+ * proto_tree * : proto tree to build on (may be null)
* int : current offset into packet data
* guint : length of this clv
* int : length of IDs in packet.
- * frame_data * : frame data
- * proto_tree * : proto tree to build on (may be null)
*
* Output:
* void, will modify proto_tree if not null.
*/
static void
-dissect_lsp_mt_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length)
+dissect_lsp_mt_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
+ int id_length _U_, int length)
{
- isis_dissect_mt_clv(tvb, pinfo, tree, offset, length,
- hf_isis_lsp_clv_mt );
+ isis_dissect_mt_clv(tvb, tree, offset, length, hf_isis_lsp_clv_mt );
}
/*
*
* Input:
* tvbuff_t * : tvbuffer for packet data
- * packet_info * : info for current packet
* proto_tree * : proto tree to build on (may be null)
* int : current offset into packet data
* int : length of IDs in packet.
* void, will modify proto_tree if not null.
*/
static void
-dissect_lsp_hostname_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length)
+dissect_lsp_hostname_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
+ int id_length _U_, int length)
{
- isis_dissect_hostname_clv(tvb, pinfo, tree, offset, length);
+ isis_dissect_hostname_clv(tvb, tree, offset, length);
}
*
* Input:
* tvbuff_t * : tvbuffer for packet data
- * packet_info * : info for current packet
* proto_tree * : proto tree to build on (may be null)
* int : current offset into packet data
* int : length of IDs in packet.
* void, will modify proto_tree if not null.
*/
static void
-dissect_lsp_te_router_id_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length)
+dissect_lsp_te_router_id_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
+ int id_length _U_, int length)
{
- isis_dissect_te_router_id_clv(tvb, pinfo, tree, offset, length,
+ isis_dissect_te_router_id_clv(tvb, tree, offset, length,
hf_isis_lsp_clv_te_router_id );
}
*
* Input:
* tvbuff_t * : tvbuffer for packet data
- * packet_info * : info for current packet
* proto_tree * : proto tree to build on (may be null)
* int : current offset into packet data
* int : length of IDs in packet.
* void, will modify proto_tree if not null.
*/
static void
-dissect_lsp_ip_int_addr_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length)
+dissect_lsp_ip_int_addr_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
+ int id_length _U_, int length)
{
- isis_dissect_ip_int_clv(tvb, pinfo, tree, offset, length,
+ isis_dissect_ip_int_clv(tvb, tree, offset, length,
hf_isis_lsp_clv_ipv4_int_addr );
}
*
* Input:
* tvbuff_t * : tvbuffer for packet data
- * packet_info * : info for current packet
* proto_tree * : proto tree to build on (may be null)
* int : current offset into packet data
* int : length of IDs in packet.
* void, will modify proto_tree if not null.
*/
static void
-dissect_lsp_ipv6_int_addr_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length)
+dissect_lsp_ipv6_int_addr_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
+ int id_length _U_, int length)
{
- isis_dissect_ipv6_int_clv(tvb, pinfo, tree, offset, length,
+ isis_dissect_ipv6_int_clv(tvb, tree, offset, length,
hf_isis_lsp_clv_ipv6_int_addr );
}
*
* Input:
* tvbuff_t * : tvbuffer for packet data
- * packet_info * : info for current packet
* proto_tree * : proto tree to build on (may be null)
* int : current offset into packet data
* int : length of IDs in packet.
* void, will modify proto_tree if not null.
*/
static void
-dissect_lsp_l1_auth_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length)
+dissect_lsp_l1_auth_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
+ int id_length _U_, int length)
{
- isis_dissect_authentication_clv(tvb, pinfo, tree, offset, length,
+ isis_dissect_authentication_clv(tvb, tree, offset, length,
"Per area authentication" );
}
*
* Input:
* tvbuff_t * : tvbuffer for packet data
- * packet_info * : info for current packet
* proto_tree * : proto tree to build on (may be null)
* int : current offset into packet data
* int : length of IDs in packet.
* void, will modify proto_tree if not null.
*/
static void
-dissect_lsp_l2_auth_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length)
+dissect_lsp_l2_auth_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
+ int id_length _U_, int length)
{
- isis_dissect_authentication_clv(tvb, pinfo, tree, offset, length,
+ isis_dissect_authentication_clv(tvb, tree, offset, length,
"Per domain authentication" );
}
*
* Input:
* tvbuff_t * : tvbuffer for packet data
- * packet_info * : info for current packet
* proto_tree * : protocol display tree to fill out. May be NULL
* int : offset into packet data where we are.
* int : length of IDs in packet.
* void, but we will add to proto tree if !NULL.
*/
static void
-dissect_lsp_area_address_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length)
+dissect_lsp_area_address_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
+ int id_length _U_, int length)
{
- isis_dissect_area_address_clv(tvb, pinfo, tree, offset, length);
+ isis_dissect_area_address_clv(tvb, tree, offset, length);
}
/*
*
* Input:
* tvbuff_t * : tvbuffer for packet data
- * packet_info * : info for current packet
* proto_tree * : protocol display tree to fill out. May be NULL
* int : offset into packet data where we are.
* int : length of IDs in packet.
* void, but we will add to proto tree if !NULL.
*/
static void
-dissect_lsp_eis_neighbors_clv_inner(tvbuff_t *tvb, packet_info *pinfo,
- proto_tree *tree, int offset,
- int length, int id_length, int show_virtual, int is_eis)
+dissect_lsp_eis_neighbors_clv_inner(tvbuff_t *tvb, proto_tree *tree,
+ int offset, int length, int id_length, int show_virtual, int is_eis)
{
proto_item *ti;
proto_tree *ntree = NULL;
if ( show_virtual ) {
/* virtual path flag */
proto_tree_add_text ( tree, tvb, offset, 1,
- tvb_get_guint8(tvb, offset) ? "IsNotVirtual" : "IsVirtual" );
+ tvb_get_guint8(tvb, offset) ? "IsVirtual" : "IsNotVirtual" );
} else {
proto_tree_add_text ( tree, tvb, offset, 1,
"Reserved value 0x%02x, must == 0",
while ( length > 0 ) {
if (length<tlen) {
- isis_dissect_unknown(tvb, pinfo, tree, offset,
+ isis_dissect_unknown(tvb, tree, offset,
"short E/IS reachability (%d vs %d)", length,
tlen );
return;
*
* Input:
* tvbuff_t * : tvbuffer for packet data
- * packet_info * : info for current packet
* proto_tree * : protocol display tree to fill out. May be NULL
* int : offset into packet data where we are.
* int : length of IDs in packet.
* void, but we will add to proto tree if !NULL.
*/
static void
-dissect_lsp_l1_is_neighbors_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
+dissect_lsp_l1_is_neighbors_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
int id_length, int length)
{
- dissect_lsp_eis_neighbors_clv_inner(tvb, pinfo, tree, offset,
+ dissect_lsp_eis_neighbors_clv_inner(tvb, tree, offset,
length, id_length, TRUE, FALSE);
}
*
* Input:
* tvbuff_t * : tvbuffer for packet data
- * packet_info * : info for current packet
* proto_tree * : protocol display tree to fill out. May be NULL
* int : offset into packet data where we are.
* int : length of IDs in packet.
* void, but we will add to proto tree if !NULL.
*/
static void
-dissect_lsp_l1_es_neighbors_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
+dissect_lsp_l1_es_neighbors_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
int id_length, int length)
{
- dissect_lsp_eis_neighbors_clv_inner(tvb, pinfo, tree, offset,
+ dissect_lsp_eis_neighbors_clv_inner(tvb, tree, offset,
length, id_length, TRUE, TRUE);
}
*
* Input:
* tvbuff_t * : tvbuffer for packet data
- * packet_info * : info for current packet
* proto_tree * : protocol display tree to fill out. May be NULL
* int : offset into packet data where we are.
* int : length of IDs in packet.
* void, but we will add to proto tree if !NULL.
*/
static void
-dissect_lsp_l2_is_neighbors_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
+dissect_lsp_l2_is_neighbors_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
int id_length, int length)
{
- dissect_lsp_eis_neighbors_clv_inner(tvb, pinfo, tree, offset,
+ dissect_lsp_eis_neighbors_clv_inner(tvb, tree, offset,
length, id_length, FALSE, FALSE);
}
*
* Input:
* tvbuff_t * : tvbuffer for packet data
- * packet_info * : info for current packet
* proto_tree * : protocol display tree to fill out.
* int : offset into packet data where we are (beginning of the sub_clv value).
*
* void
*/
static void
-dissect_subclv_admin_group (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) {
+dissect_subclv_admin_group (tvbuff_t *tvb, proto_tree *tree, int offset) {
proto_item *ti;
proto_tree *ntree;
guint32 clv_value;
* for dissect the maximum link bandwidth sub-CLV (code 9).
*
* Input:
- * u_char * : packet data
- * int : offset into packet data where we are (beginning of the sub_clv value).
+ * tvbuff_t * : tvbuffer for packet data
* proto_tree * : protocol display tree to fill out.
+ * int : offset into packet data where we are (beginning of the sub_clv value).
*
* Output:
* void
*/
static void
-dissect_subclv_max_bw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
+dissect_subclv_max_bw(tvbuff_t *tvb, proto_tree *tree, int offset)
{
- guint32 ui;
gfloat bw;
- ui = tvb_get_ntohl(tvb, offset);
- memcpy (&bw, &ui, 4);
+ bw = tvb_get_ntohieee_float(tvb, offset);
proto_tree_add_text (tree, tvb, offset-2, 6,
"Maximum link bandwidth : %.2f Mbps", bw*8/1000000 );
}
* for dissect the reservable link bandwidth sub-CLV (code 10).
*
* Input:
- * u_char * : packet data
- * int : offset into packet data where we are (beginning of the sub_clv value).
+ * tvbuff_t * : tvbuffer for packet data
* proto_tree * : protocol display tree to fill out.
+ * int : offset into packet data where we are (beginning of the sub_clv value).
*
* Output:
* void
*/
static void
-dissect_subclv_rsv_bw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
+dissect_subclv_rsv_bw(tvbuff_t *tvb, proto_tree *tree, int offset)
{
- guint32 ui;
gfloat bw;
- ui = tvb_get_ntohl(tvb, offset);
- memcpy (&bw, &ui, 4);
+ bw = tvb_get_ntohieee_float(tvb, offset);
proto_tree_add_text (tree, tvb, offset-2, 6,
"Reservable link bandwidth: %.2f Mbps", bw*8/1000000 );
}
* for dissect the unreserved bandwidth sub-CLV (code 11).
*
* Input:
- * u_char * : packet data
- * int : offset into packet data where we are (beginning of the sub_clv value).
+ * tvbuff_t * : tvbuffer for packet data
* proto_tree * : protocol display tree to fill out.
+ * int : offset into packet data where we are (beginning of the sub_clv value).
*
* Output:
* void
*/
static void
-dissect_subclv_unrsv_bw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
+dissect_subclv_unrsv_bw(tvbuff_t *tvb, proto_tree *tree, int offset)
{
proto_item *ti;
proto_tree *ntree;
- guint32 ui;
gfloat bw;
int i;
ntree = proto_item_add_subtree (ti, ett_isis_lsp_subclv_unrsv_bw);
for (i = 0 ; i < 8 ; i++) {
- ui = tvb_get_ntohl(tvb, offset);;
- memcpy (&bw, &ui, 4);
+ bw = tvb_get_ntohieee_float(tvb, offset+4*i);
proto_tree_add_text (ntree, tvb, offset+4*i, 4,
"priority level %d: %.2f Mbps", i, bw*8/1000000 );
}
*
* Input:
* tvbuff_t * : tvbuffer for packet data
- * packet_info * : info for current packet
* proto_tree * : protocol display tree to fill out. May be NULL
* int : offset into packet data where we are.
* int : length of IDs in packet.
* void, but we will add to proto tree if !NULL.
*/
static void
-dissect_lsp_ext_is_reachability_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length)
+dissect_lsp_ext_is_reachability_clv(tvbuff_t *tvb, proto_tree *tree,
+ int offset, int id_length _U_, int length)
{
proto_item *ti;
proto_tree *ntree = NULL;
if (!tree) return;
while (length > 0) {
- ti = proto_tree_add_text (tree, tvb, offset, 0,
+ ti = proto_tree_add_text (tree, tvb, offset, -1,
"IS neighbor: %s",
print_system_id (tvb_get_ptr(tvb, offset, 7), 7) );
ntree = proto_item_add_subtree (ti,
clv_len = tvb_get_guint8(tvb, offset+12+i);
switch (clv_code) {
case 3 :
- dissect_subclv_admin_group(tvb, pinfo, ntree, offset+13+i);
+ dissect_subclv_admin_group(tvb, ntree, offset+13+i);
break;
case 6 :
proto_tree_add_text (ntree, tvb, offset+11+i, 6,
"IPv4 neighbor address: %s", ip_to_str (tvb_get_ptr(tvb, offset+13+i, 4)) );
break;
case 9 :
- dissect_subclv_max_bw (tvb, pinfo, ntree, offset+13+i);
+ dissect_subclv_max_bw (tvb, ntree, offset+13+i);
break;
case 10:
- dissect_subclv_rsv_bw (tvb, pinfo, ntree, offset+13+i);
+ dissect_subclv_rsv_bw (tvb, ntree, offset+13+i);
break;
case 11:
- dissect_subclv_unrsv_bw (tvb, pinfo, ntree, offset+13+i);
+ dissect_subclv_unrsv_bw (tvb, ntree, offset+13+i);
break;
case 18:
proto_tree_add_text (ntree, tvb, offset+11+i, 5,
-static void dissect_lsp_mt_is_reachability_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length)
+static void
+dissect_lsp_mt_is_reachability_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
+ int id_length _U_, int length)
{
proto_item *ti;
proto_tree *ntree = NULL;
mt_desc,
mt_block&0xfff );
- ti = proto_tree_add_text (tree, tvb, offset+2, 0,
+ ti = proto_tree_add_text (tree, tvb, offset+2, -1,
"IS neighbor: %s",
print_system_id(tvb_get_ptr(tvb, offset+2, 7), 7) );
*
* Input:
* tvbuff_t * : tvbuffer for packet data
- * packet_info * : info for current packet
* proto_tree * : protocol display tree to fill out. May be NULL
* int : offset into packet data where we are.
* int : length of IDs in packet.
* void, but we will add to proto tree if !NULL.
*/
static void
-dissect_lsp_partition_dis_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
+dissect_lsp_partition_dis_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
int id_length, int length)
{
if ( length < id_length ) {
- isis_dissect_unknown(tvb, pinfo, tree, offset,
- "short lsp parition DIS(%d vs %d)", length,
+ isis_dissect_unknown(tvb, tree, offset,
+ "short lsp partition DIS(%d vs %d)", length,
id_length );
return;
}
length -= id_length;
offset += id_length;
if ( length > 0 ){
- isis_dissect_unknown(tvb, pinfo, tree, offset,
- "Long lsp parition DIS, %d left over", length );
+ isis_dissect_unknown(tvb, tree, offset,
+ "Long lsp partition DIS, %d left over", length );
return;
}
}
*
* Input:
* tvbuff_t * : tvbuffer for packet data
- * packet_info * : info for current packet
* proto_tree * : protocol display tree to fill out. May be NULL
* int : offset into packet data where we are.
* int : length of IDs in packet.
* void, but we will add to proto tree if !NULL.
*/
static void
-dissect_lsp_prefix_neighbors_clv(tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree, int offset,
- int id_length, int length)
+dissect_lsp_prefix_neighbors_clv(tvbuff_t *tvb, proto_tree *tree, int offset,
+ int id_length _U_, int length)
{
char *sbuf;
int mylen;
if ( length < 4 ) {
- isis_dissect_unknown(tvb, pinfo, tree, offset,
+ isis_dissect_unknown(tvb, tree, offset,
"Short lsp prefix neighbors (%d vs 4)", length );
return;
}
if ( tree ) {
- dissect_metric (tvb, pinfo, tree, offset,
+ dissect_metric (tvb, tree, offset,
tvb_get_guint8(tvb, offset), "Default", TRUE );
- dissect_metric (tvb, pinfo, tree, offset+1,
+ dissect_metric (tvb, tree, offset+1,
tvb_get_guint8(tvb, offset+1), "Delay", FALSE );
- dissect_metric (tvb, pinfo, tree, offset+2,
+ dissect_metric (tvb, tree, offset+2,
tvb_get_guint8(tvb, offset+2), "Expense", FALSE );
- dissect_metric (tvb, pinfo, tree, offset+3,
+ dissect_metric (tvb, tree, offset+3,
tvb_get_guint8(tvb, offset+3), "Error", FALSE );
}
offset += 4;
mylen = tvb_get_guint8(tvb, offset);
length--;
if (length<=0) {
- isis_dissect_unknown(tvb, pinfo, tree, offset,
+ isis_dissect_unknown(tvb, tree, offset,
"Zero payload space after length in prefix neighbor" );
return;
}
if ( mylen > length) {
- isis_dissect_unknown(tvb, pinfo, tree, offset,
+ isis_dissect_unknown(tvb, tree, offset,
"Interal length of prefix neighbor too long (%d vs %d)",
mylen, length );
return;
*
* Input:
* tvbuff_t * : tvbuffer for packet data
- * packet_info * : info for current packet
* proto_tree * : tree to display into. REQUIRED
* int : offset into packet data where we are.
* char * : title string
* void, but we will add to proto tree
*/
void
-isis_lsp_decode_lsp_id(tvbuff_t *tvb, packet_info *pinfo,
- proto_tree *tree, int offset, char *tstr, int id_length)
+isis_lsp_decode_lsp_id(tvbuff_t *tvb, proto_tree *tree, int offset,
+ char *tstr, int id_length)
{
proto_tree_add_text(tree, tvb, offset, id_length + 2,
"%s: %s.%02x-%02x", tstr,
*
* Input:
* tvbuff_t * : tvbuffer for packet data
- * packet_info * : info for current packet
* proto_tree * : protocol display tree to add to. May be NULL.
* int offset : our offset into packet data.
* int : LSP type, a la packet-isis.h ISIS_TYPE_* values
* void, but we will add to proto tree if !NULL.
*/
void
-isis_dissect_isis_lsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
- int offset, int lsp_type, int header_length, int id_length)
+isis_dissect_isis_lsp(tvbuff_t *tvb, proto_tree *tree, int offset,
+ int lsp_type, int header_length, int id_length)
{
proto_item *ti;
proto_tree *lsp_tree = NULL;
int inx, q, some, value, len;
if (tree) {
- ti = proto_tree_add_text(tree, tvb, offset,
- tvb_length_remaining(tvb, offset), PROTO_STRING_LSP);
+ ti = proto_tree_add_text(tree, tvb, offset, -1,
+ PROTO_STRING_LSP);
lsp_tree = proto_item_add_subtree(ti, ett_isis_lsp);
}
offset += 2;
if (tree) {
- isis_lsp_decode_lsp_id(tvb, pinfo, lsp_tree, offset,
+ isis_lsp_decode_lsp_id(tvb, lsp_tree, offset,
"LSP ID", id_length);
}
offset += id_length + 2;
len = pdu_length - header_length;
if (len < 0) {
- isis_dissect_unknown(tvb, pinfo, tree, offset,
+ isis_dissect_unknown(tvb, tree, offset,
"packet header length %d went beyond packet",
header_length );
return;
* our list of valid ones!
*/
if (lsp_type == ISIS_TYPE_L1_LSP){
- isis_dissect_clvs(tvb, pinfo, lsp_tree, offset,
+ isis_dissect_clvs(tvb, lsp_tree, offset,
clv_l1_lsp_opts, len, id_length,
ett_isis_lsp_clv_unknown );
} else {
- isis_dissect_clvs(tvb, pinfo, lsp_tree, offset,
+ isis_dissect_clvs(tvb, lsp_tree, offset,
clv_l2_lsp_opts, len, id_length,
ett_isis_lsp_clv_unknown );
}
{ &hf_isis_lsp_clv_te_router_id,
{ "Traffic Engineering Router ID", "isis.lsp.clv_te_router_id", FT_IPv4,
BASE_NONE, NULL, 0x0, "", HFILL }},
+
+ { &hf_isis_lsp_clv_mt,
+ { "MT-ID ", "isis.lsp.clv_mt",
+ FT_UINT16, BASE_HEX, NULL, 0x0, "", HFILL }},
};
static gint *ett[] = {
&ett_isis_lsp,