2 * Routines for decoding isis lsp packets and their CLVs
4 * $Id: packet-isis-lsp.c,v 1.3 2000/01/24 03:33:32 guy Exp $
5 * Stuart Stanley <stuarts@mxmail.net>
7 * Ethereal - Network traffic analyzer
8 * By Gerald Combs <gerald@zing.org>
9 * Copyright 1998 Gerald Combs
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
33 #ifdef HAVE_SYS_TYPES_H
34 # include <sys/types.h>
41 #ifdef HAVE_NET_INET_H
46 #include "packet-isis.h"
47 #include "packet-isis-clv.h"
48 #include "packet-isis-lsp.h"
52 static int proto_isis_lsp = -1;
53 static int hf_isis_lsp_pdu_length = -1;
54 static int hf_isis_lsp_remaining_life = -1;
55 static int hf_isis_lsp_sequence_number = -1;
56 static int hf_isis_lsp_checksum = -1;
57 static int hf_isis_lsp_clv_ipv4_int_addr = -1;
59 static gint ett_isis_lsp = -1;
60 static gint ett_isis_lsp_clv_area_addr = -1;
61 static gint ett_isis_lsp_clv_is_neighbors = -1;
62 static gint ett_isis_lsp_clv_unknown = -1;
63 static gint ett_isis_lsp_clv_partition_dis = -1;
64 static gint ett_isis_lsp_clv_prefix_neighbors = -1;
65 static gint ett_isis_lsp_clv_nlpid = -1;
66 static gint ett_isis_lsp_clv_auth = -1;
67 static gint ett_isis_lsp_clv_ipv4_int_addr = -1;
68 static gint ett_isis_lsp_clv_ip_reachability = -1;
70 static const char *isis_lsp_attached_bits[] = {
71 "error", "expense", "delay", "default" };
73 static const value_string isis_lsp_istype_vals[] = {
74 { ISIS_LSP_TYPE_UNUSED0, "Unused 0x0 (invalid)"},
75 { ISIS_LSP_TYPE_LEVEL_1, "Level 1 IS"},
76 { ISIS_LSP_TYPE_UNUSED2, "Unused 0x2 (invalid)"},
77 { ISIS_LSP_TYPE_LEVEL_2, "Level 2 IS"},
81 * Predclare dissectors for use in clv dissection.
83 static void dissect_lsp_area_address_clv(const u_char *pd, int offset,
84 guint length, frame_data *fd, proto_tree *tree);
85 static void dissect_lsp_l1_is_neighbors_clv(const u_char *pd, int offset,
86 guint length, frame_data *fd, proto_tree *tree);
87 static void dissect_lsp_l1_es_neighbors_clv(const u_char *pd, int offset,
88 guint length, frame_data *fd, proto_tree *tree);
89 static void dissect_lsp_l2_is_neighbors_clv(const u_char *pd, int offset,
90 guint length, frame_data *fd, proto_tree *tree);
91 static void dissect_lsp_partition_dis_clv(const u_char *pd, int offset,
92 guint length, frame_data *fd, proto_tree *tree);
93 static void dissect_lsp_prefix_neighbors_clv(const u_char *pd, int offset,
94 guint length, frame_data *fd, proto_tree *tree);
95 static void dissect_lsp_ip_reachability_clv(const u_char *pd, int offset,
96 guint length, frame_data *fd, proto_tree *tree);
97 static void dissect_lsp_nlpid_clv(const u_char *pd, int offset,
98 guint length, frame_data *fd, proto_tree *tree);
99 static void dissect_lsp_ip_int_addr_clv(const u_char *pd, int offset,
100 guint length, frame_data *fd, proto_tree *tree);
101 static void dissect_lsp_l1_auth_clv(const u_char *pd, int offset,
102 guint length, frame_data *fd, proto_tree *tree);
103 static void dissect_lsp_l2_auth_clv(const u_char *pd, int offset,
104 guint length, frame_data *fd, proto_tree *tree);
106 static const isis_clv_handle_t clv_l1_lsp_opts[] = {
108 ISIS_CLV_L1_LSP_AREA_ADDRESS,
110 &ett_isis_lsp_clv_area_addr,
111 dissect_lsp_area_address_clv
114 ISIS_CLV_L1_LSP_IS_NEIGHBORS,
116 &ett_isis_lsp_clv_is_neighbors,
117 dissect_lsp_l1_is_neighbors_clv
120 ISIS_CLV_L1_LSP_ES_NEIGHBORS,
122 &ett_isis_lsp_clv_is_neighbors,
123 dissect_lsp_l1_es_neighbors_clv
126 ISIS_CLV_L1_LSP_IP_INT_REACHABLE,
127 "IP Internal reachability",
128 &ett_isis_lsp_clv_ip_reachability,
129 dissect_lsp_ip_reachability_clv
132 ISIS_CLV_L1_LSP_NLPID,
134 &ett_isis_lsp_clv_nlpid,
135 dissect_lsp_nlpid_clv
138 ISIS_CLV_L1_LSP_IP_INTERFACE_ADDR,
139 "IP Interface address(es)",
140 &ett_isis_lsp_clv_ipv4_int_addr,
141 dissect_lsp_ip_int_addr_clv
144 ISIS_CLV_L1_LSP_AUTHENTICATION_NS,
145 "Authentication(non-spec)",
146 &ett_isis_lsp_clv_auth,
147 dissect_lsp_l1_auth_clv
150 ISIS_CLV_L1_LSP_AUTHENTICATION,
152 &ett_isis_lsp_clv_auth,
153 dissect_lsp_l1_auth_clv
163 static const isis_clv_handle_t clv_l2_lsp_opts[] = {
165 ISIS_CLV_L1_LSP_AREA_ADDRESS,
167 &ett_isis_lsp_clv_area_addr,
168 dissect_lsp_area_address_clv
171 ISIS_CLV_L2_LSP_IS_NEIGHBORS,
173 &ett_isis_lsp_clv_is_neighbors,
174 dissect_lsp_l2_is_neighbors_clv
177 ISIS_CLV_L2_LSP_PARTITION_DIS,
178 "Parition Designated Level 2 IS",
179 &ett_isis_lsp_clv_partition_dis,
180 dissect_lsp_partition_dis_clv
183 ISIS_CLV_L2_LSP_PREFIX_NEIGHBORS,
185 &ett_isis_lsp_clv_prefix_neighbors,
186 dissect_lsp_prefix_neighbors_clv
189 ISIS_CLV_L2_LSP_IP_INT_REACHABLE,
190 "IP Internal reachability",
191 &ett_isis_lsp_clv_ip_reachability,
192 dissect_lsp_ip_reachability_clv
195 ISIS_CLV_L2_LSP_NLPID,
197 &ett_isis_lsp_clv_nlpid,
198 dissect_lsp_nlpid_clv
201 ISIS_CLV_L2_LSP_IP_EXT_REACHABLE,
202 "IP external reachability",
203 &ett_isis_lsp_clv_ip_reachability,
204 dissect_lsp_ip_reachability_clv
207 ISIS_CLV_L2_LSP_IP_INTERFACE_ADDR,
208 "IP Interface address(es)",
209 &ett_isis_lsp_clv_ipv4_int_addr,
210 dissect_lsp_ip_int_addr_clv
213 ISIS_CLV_L2_LSP_AUTHENTICATION_NS,
214 "Authentication(non spec)",
215 &ett_isis_lsp_clv_auth,
216 dissect_lsp_l2_auth_clv
219 ISIS_CLV_L2_LSP_AUTHENTICATION,
221 &ett_isis_lsp_clv_auth,
222 dissect_lsp_l2_auth_clv
234 * Name: dissect_metric()
237 * Display a metric prefix portion. ISIS has the concept of multple
238 * metric per prefix (default, delay, expense, and error). This
239 * routine assists other dissectors by adding a single one of
240 * these to the display tree..
242 * The 8th(msbit) bit in the metric octet is the "supported" bit. The
243 * "default" support is required, so we support a "force_supported"
244 * flag that tells us that it MUST be zero (zero==supported,
245 * so it really should be a "not supported" in the boolean sense)
246 * and to display a protocol failure accordingly. Notably,
247 * Cisco IOS 12(6) blows this!
248 * The 7th bit must be zero (reserved).
251 * u_char * : packet data
252 * int : offset into packet data where we are.
253 * guint : length of clv we are decoding
254 * frame_data * : frame data (complete frame)
255 * proto_tree * : protocol display tree to fill out. May be NULL
256 * int : force supported. True is the supported bit MUST be zero.
259 * void, but we will add to proto tree if !NULL.
262 dissect_metric(proto_tree *tree, int offset, guint8 value,
263 char *pstr, int force_supported ) {
268 s = ISIS_LSP_CLV_METRIC_SUPPORTED(value);
269 proto_tree_add_text ( tree, offset, 1,
270 "%s Metric: %s%s %s%d:%d", pstr,
271 s ? "Not supported" : "Supported",
272 (s && force_supported) ? "(but is required to be)":"",
273 ISIS_LSP_CLV_METRIC_RESERVED(value) ? "(reserved bit != 0)":"",
274 ISIS_LSP_CLV_METRIC_VALUE(value), value );
279 * Name: dissect_lsp_ip_reachabillityclv()
282 * Decode an IP reachability CLV. This can be either internal or
283 * external (the clv format does not change and which type we are
284 * displaying is put there by the dispatcher). All of these
285 * are a metric block followed by an IP addr and mask.
288 * u_char * : packet data
289 * int : current offset into packet data
290 * guint : length of this clv
291 * frame_data * : frame data
292 * proto_tree * : proto tree to build on (may be null)
295 * void, will modify proto_tree if not null.
298 dissect_lsp_ip_reachability_clv(const u_char *pd, int offset,
299 guint length, frame_data *fd, proto_tree *tree) {
301 proto_tree *ntree = NULL;
304 while ( length > 0 ) {
306 isis_dissect_unknown(offset, length, tree, fd,
307 "short IP reachability (%d vs 12)", length );
311 * Gotta build a sub-tree for all our pieces
314 memcpy(&src, &pd[offset+4], 4);
315 memcpy(&mask, &pd[offset+8], 4);
316 ti = proto_tree_add_text ( tree, offset, 12,
317 "IP prefix: %s (%s) : %s",
318 get_hostname(src), ip_to_str((guint8*)&src),
319 ip_to_str((guint8*)&mask) );
320 ntree = proto_item_add_subtree(ti,
321 ett_isis_lsp_clv_ip_reachability);
322 dissect_metric ( ntree, offset, pd[offset], "Default",
324 dissect_metric ( ntree, offset + 1, pd[offset+1],
326 dissect_metric ( ntree, offset + 2, pd[offset+2],
328 dissect_metric ( ntree, offset + 3, pd[offset+3],
336 * Name: dissect_lsp_nlpid_clv()
339 * Decode for a lsp packets NLPID clv. Calls into the
343 * u_char * : packet data
344 * int : current offset into packet data
345 * guint : length of this clv
346 * frame_data * : frame data
347 * proto_tree * : proto tree to build on (may be null)
350 * void, will modify proto_tree if not null.
353 dissect_lsp_nlpid_clv(const u_char *pd, int offset,
354 guint length, frame_data *fd, proto_tree *tree) {
355 isis_dissect_nlpid_clv(pd, offset, length, fd, tree );
359 * Name: dissect_lsp_ip_int_addr_clv()
362 * Decode for a lsp packets ip interface addr clv. Calls into the
366 * u_char * : packet data
367 * int : current offset into packet data
368 * guint : length of this clv
369 * frame_data * : frame data
370 * proto_tree * : proto tree to build on (may be null)
373 * void, will modify proto_tree if not null.
376 dissect_lsp_ip_int_addr_clv(const u_char *pd, int offset,
377 guint length, frame_data *fd, proto_tree *tree) {
378 isis_dissect_ip_int_clv(pd, offset, length, fd, tree,
379 hf_isis_lsp_clv_ipv4_int_addr );
383 * Name: dissect_lsp_L1_auth_clv()
386 * Decode for a lsp packets authenticaion clv. Calls into the
387 * clv common one. An auth inside a L1 LSP is a per area password
390 * u_char * : packet data
391 * int : current offset into packet data
392 * guint : length of this clv
393 * frame_data * : frame data
394 * proto_tree * : proto tree to build on (may be null)
397 * void, will modify proto_tree if not null.
400 dissect_lsp_l1_auth_clv(const u_char *pd, int offset,
401 guint length, frame_data *fd, proto_tree *tree) {
402 isis_dissect_authentication_clv(pd, offset, length, fd, tree,
403 "Per area authentication" );
407 * Name: dissect_lsp_L2_auth_clv()
410 * Decode for a lsp packets authenticaion clv. Calls into the
411 * clv common one. An auth inside a L2 LSP is a per domain password
414 * u_char * : packet data
415 * int : current offset into packet data
416 * guint : length of this clv
417 * frame_data * : frame data
418 * proto_tree * : proto tree to build on (may be null)
421 * void, will modify proto_tree if not null.
424 dissect_lsp_l2_auth_clv(const u_char *pd, int offset,
425 guint length, frame_data *fd, proto_tree *tree) {
426 isis_dissect_authentication_clv(pd, offset, length, fd, tree,
427 "Per domain authentication" );
431 * Name: dissect_lsp_area_address_clv()
434 * Decode for a lsp packet's area address clv. Call into clv common
438 * u_char * : packet data
439 * int : offset into packet data where we are.
440 * guint : length of clv we are decoding
441 * frame_data * : frame data (complete frame)
442 * proto_tree * : protocol display tree to fill out. May be NULL
445 * void, but we will add to proto tree if !NULL.
448 dissect_lsp_area_address_clv(const u_char *pd, int offset,
449 guint length, frame_data *fd, proto_tree *tree) {
450 isis_dissect_area_address_clv(pd, offset, length, fd, tree );
454 * Name: dissect_lsp_eis_neighbors_clv_inner()
457 * Real work horse for showing neighbors. This means we decode the
458 * first octet as either virtual/!virtual (if show_virtual param is
459 * set), or as a must == 0 reserved value.
461 * Once past that, we decode n neighbor elements. Each neighbor
462 * is comprised of a metric block (is dissect_metric) and the
466 * u_char * : packet data
467 * int : offset into packet data where we are.
468 * guint : length of clv we are decoding
469 * frame_data * : frame data (complete frame)
470 * proto_tree * : protocol display tree to fill out. May be NULL
471 * int : set to decode first octet as virtual vs reserved == 0
472 * int : set to indicate EIS instead of IS (6 octet per addr instead of 7)
475 * void, but we will add to proto tree if !NULL.
478 dissect_lsp_eis_neighbors_clv_inner(const u_char *pd, int offset,
479 guint length, frame_data *fd, proto_tree *tree,
480 int show_virtual, int is_eis) {
482 proto_tree *ntree = NULL;
490 if ( show_virtual ) {
491 /* virtual path flag */
492 proto_tree_add_text ( tree, offset, 1,
493 &pd[offset] ? "IsNotVirtual" : "IsVirtual" );
495 proto_tree_add_text ( tree, offset, 1,
496 "Reserved value 0x%02x, must == 0",
505 while ( length > 0 ) {
507 isis_dissect_unknown(offset, length, tree, fd,
508 "short E/IS reachability (%d vs %d)", length,
513 * Gotta build a sub-tree for all our pieces
517 ti = proto_tree_add_text ( tree, offset, 11,
518 "ES Neighbor: %02x%02x.%02x%02x.%02x%02x",
519 pd[offset+4], pd[offset+5],
520 pd[offset+6], pd[offset+7],
521 pd[offset+8], pd[offset+9] );
523 ti = proto_tree_add_text ( tree, offset, 11,
524 "IS Neighbor: %02x%02x.%02x%02x.%02x%02x-%02x",
525 pd[offset+4], pd[offset+5],
526 pd[offset+6], pd[offset+7],
527 pd[offset+8], pd[offset+9],
530 ntree = proto_item_add_subtree(ti,
531 ett_isis_lsp_clv_is_neighbors);
532 dissect_metric ( ntree, offset, pd[offset], "Default",
534 dissect_metric ( ntree, offset + 1, pd[offset+1],
536 dissect_metric ( ntree, offset + 2, pd[offset+2],
538 dissect_metric ( ntree, offset + 3, pd[offset+3],
547 * Name: dissect_lsp_l1_is_neighbors_clv()
550 * Dispatch a l1 intermediate system neighbor by calling
551 * the inner function with show virtual set to TRUE and is es set to FALSE.
554 * u_char * : packet data
555 * int : offset into packet data where we are.
556 * guint : length of clv we are decoding
557 * frame_data * : frame data (complete frame)
558 * proto_tree * : protocol display tree to fill out. May be NULL
561 * void, but we will add to proto tree if !NULL.
564 dissect_lsp_l1_is_neighbors_clv(const u_char *pd, int offset,
565 guint length, frame_data *fd, proto_tree *tree) {
566 dissect_lsp_eis_neighbors_clv_inner( pd, offset, length, fd, tree,TRUE,
571 * Name: dissect_lsp_l1_es_neighbors_clv()
574 * Dispatch a l1 end or intermediate system neighbor by calling
575 * the inner function with show virtual set to TRUE and es set to TRUE.
578 * u_char * : packet data
579 * int : offset into packet data where we are.
580 * guint : length of clv we are decoding
581 * frame_data * : frame data (complete frame)
582 * proto_tree * : protocol display tree to fill out. May be NULL
585 * void, but we will add to proto tree if !NULL.
588 dissect_lsp_l1_es_neighbors_clv(const u_char *pd, int offset,
589 guint length, frame_data *fd, proto_tree *tree) {
590 dissect_lsp_eis_neighbors_clv_inner( pd, offset, length, fd, tree,
595 * Name: dissect_lsp_l2_is_neighbors_clv()
598 * Dispatch a l2 intermediate system neighbor by calling
599 * the inner function with show virtual set to FALSE, and is es set
603 * u_char * : packet data
604 * int : offset into packet data where we are.
605 * guint : length of clv we are decoding
606 * frame_data * : frame data (complete frame)
607 * proto_tree * : protocol display tree to fill out. May be NULL
610 * void, but we will add to proto tree if !NULL.
613 dissect_lsp_l2_is_neighbors_clv(const u_char *pd, int offset,
614 guint length, frame_data *fd, proto_tree *tree) {
615 dissect_lsp_eis_neighbors_clv_inner(pd,offset, length, fd, tree, FALSE,
620 * Name: dissect_lsp_partition_dis_clv()
623 * This CLV is used to indicate which system is the designated
624 * IS for partition repair. This means just putting out the 6 octet
628 * u_char * : packet data
629 * int : offset into packet data where we are.
630 * guint : length of clv we are decoding
631 * frame_data * : frame data (complete frame)
632 * proto_tree * : protocol display tree to fill out. May be NULL
635 * void, but we will add to proto tree if !NULL.
638 dissect_lsp_partition_dis_clv(const u_char *pd, int offset,
639 guint length, frame_data *fd, proto_tree *tree) {
642 isis_dissect_unknown(offset, length, tree, fd,
643 "short lsp parition DIS(%d vs 6)", length );
647 * Gotta build a sub-tree for all our pieces
650 proto_tree_add_text ( tree, offset+4, 6,
651 "Partition designated L2 IS: %02x%02x.%02x%02x.%02x%02x",
652 pd[offset], pd[offset+1], pd[offset+2],
653 pd[offset+3], pd[offset+4], pd[offset+5]);
658 isis_dissect_unknown(offset, length, tree, fd,
659 "Long lsp parition DIS, %d left over", length );
665 * Name: dissect_lsp_prefix_neighbors_clv()
668 * The prefix CLV describes what other (OSI) networks we can reach
669 * and what their cost is. It is built from a metric block
670 * (see dissect_metric) followed by n addresses.
673 * u_char * : packet data
674 * int : offset into packet data where we are.
675 * guint : length of clv we are decoding
676 * frame_data * : frame data (complete frame)
677 * proto_tree * : protocol display tree to fill out. May be NULL
680 * void, but we will add to proto tree if !NULL.
683 dissect_lsp_prefix_neighbors_clv(const u_char *pd, int offset,
684 guint length, frame_data *fd, proto_tree *tree) {
689 isis_dissect_unknown(offset, length, tree, fd,
690 "Short lsp prefix neighbors (%d vs 4)", length );
694 dissect_metric ( tree, offset, pd[offset], "Default", TRUE );
695 dissect_metric ( tree, offset + 1, pd[offset+1],
697 dissect_metric ( tree, offset + 2, pd[offset+2],
699 dissect_metric ( tree, offset + 3, pd[offset+3],
704 while ( length > 0 ) {
708 isis_dissect_unknown(offset, length, tree, fd,
709 "Zero payload space after length in prefix neighbor" );
712 if ( mylen > length) {
713 isis_dissect_unknown(offset, length, tree, fd,
714 "Interal length of prefix neighbor too long (%d vs %d)",
720 * Lets turn the area address into "standard" 0000.0000.etc
723 sbuf = isis_address_to_string ( pd, offset + 1, mylen );
724 /* and spit it out */
726 proto_tree_add_text ( tree, offset, mylen + 1,
727 "Area address (%d): %s", mylen, sbuf );
730 length -= mylen; /* length already adjusted for len fld*/
735 * Name: isis_lsp_decode_lsp_id()
738 * Display a LSP id into the display tree.
741 * char * : title string
742 * proto_tree * : tree to display into. REQUIRED
743 * int : offset into packet data where we are.
744 * isis_lsp_id_t * : id to display.
747 * void, but we will add to proto tree
750 isis_lsp_decode_lsp_id(char *tstr, proto_tree *tree, int offset,
751 isis_lsp_id_t *id ) {
752 proto_tree_add_text(tree, offset, 8,
753 "%s: %02x%02x.%02x%02x.%02x%02x.%02x-%02x", tstr,
765 * Name: isis_dissect_isis_lsp()
768 * Print out the LSP part of the main header and then call the CLV
769 * de-mangler with the right list of valid CLVs.
772 * u_char * : packet data
773 * int : offset into packet data where we are.
774 * guint : length of clv we are decoding
775 * frame_data * : frame data (complete frame)
776 * proto_tree * : protocol display tree to fill out. May be NULL
779 * void, but we will add to proto tree if !NULL.
782 isis_dissect_isis_lsp(int lsp_type, int header_length,
783 const u_char *pd, int offset, frame_data *fd, proto_tree *tree){
786 proto_tree *lsp_tree = NULL;
789 int inx, q, some, value, len;
793 if (!BYTES_ARE_IN_FRAME(offset, hlen)) {
794 isis_dissect_unknown(offset, hlen, tree, fd,
795 "not enough capture data for header (%d vs %d)",
800 ilp = (isis_lsp_t *) &pd[offset];
803 ti = proto_tree_add_item(tree, proto_isis_lsp,
804 offset, END_OF_FRAME, NULL);
805 lsp_tree = proto_item_add_subtree(ti, ett_isis_lsp);
806 proto_tree_add_item(lsp_tree, hf_isis_lsp_pdu_length,
807 offset, 2, pntohs(&ilp->isis_lsp_pdu_length));
808 proto_tree_add_item(lsp_tree, hf_isis_lsp_remaining_life,
809 offset + 2, 2, pntohs(&ilp->isis_lsp_remaining_life));
810 isis_lsp_decode_lsp_id("LSP ID", lsp_tree, offset + 4,
812 proto_tree_add_item(lsp_tree, hf_isis_lsp_sequence_number,
814 pntohl(&ilp->isis_lsp_sequence_number));
816 /* XXX -> we could validate the cksum here! */
817 proto_tree_add_item(lsp_tree, hf_isis_lsp_checksum,
818 offset + 16, 2, pntohs(&ilp->isis_lsp_checksum));
821 * We need to build our type block values.
825 value = ISIS_LSP_ATT(ilp->isis_lsp_type_block);
827 for ( q = (1<<ISIS_LSP_ATT_SHIFT); q > 0; q = q >> 1 ){
832 strcat ( sbuf, isis_lsp_attached_bits[inx] );
837 strcat ( sbuf, "<none set!>" );
839 proto_tree_add_text(lsp_tree, offset + 18, 1,
840 "Type block(0x%02x): P:%d, Supported metric(s): %s, OL:%d, istype:%s",
841 ilp->isis_lsp_type_block,
842 ISIS_LSP_PARTITION(ilp->isis_lsp_type_block) ? 1 : 0,
844 ISIS_LSP_HIPPITY(ilp->isis_lsp_type_block) ? 1 : 0,
845 val_to_str(ISIS_LSP_IS_TYPE(ilp->isis_lsp_type_block),
846 isis_lsp_istype_vals, "Unknown (0x%x)")
852 len = pntohs(&ilp->isis_lsp_pdu_length);
853 len -= header_length;
855 isis_dissect_unknown(offset, header_length, tree, fd,
856 "packet header length %d went beyond packet",
861 * Now, we need to decode our CLVs. We need to pass in
862 * our list of valid ones!
864 if (lsp_type == ISIS_TYPE_L1_LSP){
865 isis_dissect_clvs ( clv_l1_lsp_opts, len, pd, offset, fd,
866 lsp_tree, ett_isis_lsp_clv_unknown );
868 isis_dissect_clvs ( clv_l2_lsp_opts, len, pd, offset, fd,
869 lsp_tree, ett_isis_lsp_clv_unknown );
873 * Name: proto_register_isis_lsp()
876 * Register our protocol sub-sets with protocol manager.
877 * NOTE: this procedure is autolinked by the makefile process that
881 * u_char * : packet data
882 * int : offset into packet data where we are.
883 * guint : length of clv we are decoding
884 * frame_data * : frame data (complete frame)
885 * proto_tree * : protocol display tree to fill out. May be NULL
888 * void, but we will add to proto tree if !NULL.
891 proto_register_isis_lsp(void) {
892 static hf_register_info hf[] = {
893 { &hf_isis_lsp_pdu_length,
894 { "PDU length", "isis_lsp.pdu_length", FT_UINT16,
895 BASE_DEC, NULL, 0x0, "" }},
897 { &hf_isis_lsp_remaining_life,
898 { "Remaining life", "isis_lsp.remaining_life", FT_UINT16,
899 BASE_DEC, NULL, 0x0, "" }},
901 { &hf_isis_lsp_sequence_number,
902 { "Sequence number", "isis_lsp.sequence_number",
903 FT_UINT32, BASE_HEX, NULL, 0x0, "" }},
905 { &hf_isis_lsp_checksum,
906 { "Checksum", "isis_lsp.checksum",FT_UINT16,
907 BASE_HEX, NULL, 0x0, "" }},
909 { &hf_isis_lsp_clv_ipv4_int_addr,
910 { "IPv4 interface address: ", "", FT_IPv4,
911 BASE_NONE, NULL, 0x0, "" }},
913 static gint *ett[] = {
915 &ett_isis_lsp_clv_area_addr,
916 &ett_isis_lsp_clv_is_neighbors,
917 &ett_isis_lsp_clv_unknown,
918 &ett_isis_lsp_clv_partition_dis,
919 &ett_isis_lsp_clv_prefix_neighbors,
920 &ett_isis_lsp_clv_auth,
921 &ett_isis_lsp_clv_nlpid,
922 &ett_isis_lsp_clv_ipv4_int_addr,
923 &ett_isis_lsp_clv_ip_reachability,
926 proto_isis_lsp = proto_register_protocol("ISIS lsp", "ISIS-lsp");
927 proto_register_field_array(proto_isis_lsp, hf, array_length(hf));
928 proto_register_subtree_array(ett, array_length(ett));