2 * Routines for NetWare Link Services Protocol
4 * Based on ISIS dissector by Stuart Stanley <stuarts@mxmail.net>
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * SPDX-License-Identifier: GPL-2.0-or-later
15 #include <epan/packet.h>
16 #include <epan/expert.h>
17 #include <epan/to_str.h>
19 #include <epan/unit_strings.h>
21 #include <wsutil/array.h>
22 #include "packet-ipx.h"
24 void proto_register_nlsp(void);
25 void proto_reg_handoff_nlsp(void);
27 static dissector_handle_t nlsp_handle
;
29 /* NLSP base header */
30 static int proto_nlsp
;
32 static int hf_nlsp_irpd
;
33 static int hf_nlsp_header_length
;
34 static int hf_nlsp_minor_version
;
35 static int hf_nlsp_nr
;
36 static int hf_nlsp_type
;
37 static int hf_nlsp_major_version
;
38 static int hf_nlsp_packet_length
;
39 static int hf_nlsp_hello_state
;
40 static int hf_nlsp_hello_multicast
;
41 static int hf_nlsp_hello_circuit_type
;
42 static int hf_nlsp_hello_holding_timer
;
43 static int hf_nlsp_hello_priority
;
44 static int hf_nlsp_lsp_sequence_number
;
45 static int hf_nlsp_lsp_checksum
;
46 static int hf_nlsp_lsp_p
;
47 static int hf_nlsp_lsp_attached_flag
;
48 static int hf_nlsp_lsp_lspdbol
;
49 static int hf_nlsp_lsp_router_type
;
50 static int hf_nlsp_lsp_link_info_clv_flags_cost_present
;
51 static int hf_nlsp_lsp_link_info_clv_flags_cost_metric
;
52 static int hf_nlsp_lsp_link_info_clv_flags_cost
;
54 /* Generated from convert_proto_tree_add_text.pl */
55 static int hf_nlsp_psnp_lsp_checksum
;
56 static int hf_nlsp_csnp_start_lsp_id_source_id
;
57 static int hf_nlsp_svcs_info_node_number
;
58 static int hf_nlsp_ext_routes_rip_delay
;
59 static int hf_nlsp_psnp_source_id_system_id
;
60 static int hf_nlsp_svcs_info_socket
;
61 static int hf_nlsp_hello_sending_router_system_id
;
62 static int hf_nlsp_csnp_start_lsp_id_lsp_number
;
63 static int hf_nlsp_lsp_id_system_id
;
64 static int hf_nlsp_psnp_lsp_id_pseudonode_id
;
65 static int hf_nlsp_csnp_end_lsp_id_lsp_number
;
66 static int hf_nlsp_remaining_lifetime
;
67 static int hf_nlsp_csnp_remaining_lifetime
;
68 static int hf_nlsp_psnp_lsp_id_source_id
;
69 static int hf_nlsp_ext_routes_hops
;
70 static int hf_nlsp_hello_local_mtu_mtu_size
;
71 static int hf_nlsp_link_info_throughput
;
72 static int hf_nlsp_link_info_media_type
;
73 static int hf_nlsp_mgt_info_name
;
74 static int hf_nlsp_mgt_info_node_number
;
75 static int hf_nlsp_csnp_end_lsp_id_source_id
;
76 static int hf_nlsp_csnp_lsp_id_pseudonode_id
;
77 static int hf_nlsp_psnp_lsp_sequence_number
;
78 static int hf_nlsp_link_info_mtu_size
;
79 static int hf_nlsp_lsp_id_lsp_number
;
80 static int hf_nlsp_unknown_code
;
81 static int hf_nlsp_mgt_info_ipx_version_number
;
82 static int hf_nlsp_link_info_router_pseudonode_id
;
83 static int hf_nlsp_psnp_source_id_pseudonode_id
;
84 static int hf_nlsp_csnp_lsp_id_lsp_number
;
85 static int hf_nlsp_csnp_source_id_pseudonode_id
;
86 static int hf_nlsp_csnp_end_lsp_id_pseudonode_id
;
87 static int hf_nlsp_csnp_lsp_sequence_number
;
88 static int hf_nlsp_link_info_router_system_id
;
89 static int hf_nlsp_svcs_info_type
;
90 static int hf_nlsp_csnp_lsp_checksum
;
91 static int hf_nlsp_hello_local_wan_circuit_id
;
92 static int hf_nlsp_svcs_info_service_name
;
93 static int hf_nlsp_mgt_info_name_length
;
94 static int hf_nlsp_neighbor
;
95 static int hf_nlsp_area_address_network_number
;
96 static int hf_nlsp_link_info_delay
;
97 static int hf_nlsp_csnp_start_lsp_id_pseudonode_id
;
98 static int hf_nlsp_svcs_info_network_number
;
99 static int hf_nlsp_csnp_source_id_system_id
;
100 static int hf_nlsp_mgt_info_network_number
;
101 static int hf_nlsp_hello_designated_router_pseudonode_id
;
102 static int hf_nlsp_lsp_id_pseudonode_id
;
103 static int hf_nlsp_csnp_lsp_id_source_id
;
104 static int hf_nlsp_psnp_remaining_lifetime
;
105 static int hf_nlsp_area_address_mask
;
106 static int hf_nlsp_hello_designated_router_system_id
;
107 static int hf_nlsp_svcs_info_hops_to_reach_the_service
;
108 static int hf_nlsp_psnp_lsp_id_lsp_number
;
109 static int hf_nlsp_ext_routes_network_number
;
111 static expert_field ei_nlsp_short_packet
;
112 static expert_field ei_nlsp_long_packet
;
113 static expert_field ei_nlsp_major_version
;
114 static expert_field ei_nlsp_type
;
117 static int ett_nlsp_hello_clv_area_addr
;
118 static int ett_nlsp_hello_clv_neighbors
;
119 static int ett_nlsp_hello_local_mtu
;
120 static int ett_nlsp_hello_clv_unknown
;
121 static int ett_nlsp_lsp_info
;
122 static int ett_nlsp_lsp_clv_area_addr
;
123 static int ett_nlsp_lsp_clv_mgt_info
;
124 static int ett_nlsp_lsp_clv_link_info
;
125 static int ett_nlsp_lsp_clv_svcs_info
;
126 static int ett_nlsp_lsp_clv_ext_routes
;
127 static int ett_nlsp_lsp_clv_unknown
;
128 static int ett_nlsp_csnp_lsp_entries
;
129 static int ett_nlsp_csnp_lsp_entry
;
130 static int ett_nlsp_csnp_clv_unknown
;
131 static int ett_nlsp_psnp_lsp_entries
;
132 static int ett_nlsp_psnp_lsp_entry
;
133 static int ett_nlsp_psnp_clv_unknown
;
135 #define PACKET_TYPE_MASK 0x1f
140 * http://www.cisco.com/univercd/cc/td/doc/cisintwk/ito_doc/nlsp.htm
142 * for some information about Hello packets.
145 #define NLSP_TYPE_L1_HELLO 15
146 #define NLSP_TYPE_WAN_HELLO 17
147 #define NLSP_TYPE_L1_LSP 18
148 #define NLSP_TYPE_L1_CSNP 24
149 #define NLSP_TYPE_L1_PSNP 26
151 static const value_string nlsp_packet_type_vals
[] = {
152 { NLSP_TYPE_L1_HELLO
, "L1 Hello"},
153 { NLSP_TYPE_WAN_HELLO
, "WAN Hello"},
154 { NLSP_TYPE_L1_LSP
, "L1 LSP"},
155 { NLSP_TYPE_L1_CSNP
, "L1 CSNP"},
156 { NLSP_TYPE_L1_PSNP
, "L1 PSNP"},
160 static const value_string nlsp_attached_flag_vals
[] = {
161 { 0, "Other routing areas cannot be reached through this router"},
162 { 1, "Other routing areas can be reached through this router"},
166 static const value_string nlsp_router_type_vals
[] = {
167 { 1, "Level 1 Router"},
168 { 3, "Level 1 and Level 2 Router"},
172 static const true_false_string tfs_internal_external
= { "Internal", "External" };
175 * Our sub-packet dismantle structure for CLV's
178 int optcode
; /* code for option */
179 const char *tree_text
; /* text for fold out */
180 int *tree_id
; /* id for add_item */
181 void (*dissect
)(tvbuff_t
*tvb
, packet_info
* pinfo
, proto_tree
*tree
,
182 int offset
, int length
);
186 * Name: nlsp_dissect_clvs()
189 * Dispatch routine to shred all the CLVs in a packet. We just
190 * walk through the clv entries in the packet. For each one, we
191 * search the passed in valid clv's for this protocol (opts) for
192 * a matching code. If found, we add to the display tree and
193 * then call the dissector. If it is not, we just post an
194 * "unknown" clv entry using the passed in unknown clv tree id.
195 * XXX: The "unknown tree id" is an 'ett' index for use
196 * when creating a subtree;
197 * Since the 'unknown' subtree was not actually used in the
198 * code below, what was the intention for this ?
199 * For now: code related to creating an 'unknown' subtrree
203 * tvbuff_t * : tvbuffer for packet data
204 * proto_tree * : protocol display tree to fill out. May be NULL
205 * int : offset into packet data where we are.
206 * nlsp_clv_handle_t * : NULL dissector terminated array of codes
207 * and handlers (along with tree text and tree id's).
208 * int : length of CLV area.
209 * int : unknown clv tree id
212 * void, but we will add to proto tree if !NULL.
215 nlsp_dissect_clvs(tvbuff_t
*tvb
, packet_info
* pinfo
, proto_tree
*tree
, int offset
,
216 const nlsp_clv_handle_t
*opts
, int len
, int unknown_tree_id _U_
)
221 proto_tree
*clv_tree
;
224 code
= tvb_get_uint8(tvb
, offset
);
230 length
= tvb_get_uint8(tvb
, offset
);
236 if ( len
< length
) {
237 proto_tree_add_expert_format(tree
, pinfo
, &ei_nlsp_short_packet
, tvb
, offset
, -1,
238 "Short CLV header (%d vs %d)", length
, len
);
242 while ((opts
[q
].dissect
!= NULL
)&&( opts
[q
].optcode
!= code
)){
245 if ( opts
[q
].dissect
) {
246 /* adjust by 2 for code/len octets */
247 clv_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
- 2,
248 length
+ 2, *opts
[q
].tree_id
, NULL
, "%s (%u)",
249 opts
[q
].tree_text
, length
);
250 opts
[q
].dissect(tvb
, pinfo
, clv_tree
, offset
,
254 ti
= proto_tree_add_uint_format_value(tree
, hf_nlsp_unknown_code
, tvb
, offset
- 2,
255 1, code
, "%u (%u)", code
, length
);
256 proto_item_set_len(ti
, length
+ 2);
264 * Name: dissect_area_address_clv()
267 * Decode an area address clv.
270 * tvbuff_t * : tvbuffer for packet data
271 * proto_tree * : protocol display tree to fill out. May be NULL
272 * int : offset into packet data where we are.
273 * int : length of clv we are decoding
276 * void, but we will add to proto tree if !NULL.
279 dissect_area_address_clv(tvbuff_t
*tvb
, packet_info
* pinfo
, proto_tree
*tree
, int offset
,
284 proto_tree_add_expert_format(tree
, pinfo
, &ei_nlsp_short_packet
, tvb
, offset
, -1,
285 "Short area address entry");
288 proto_tree_add_item(tree
, hf_nlsp_area_address_network_number
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
294 proto_tree_add_expert_format(tree
, pinfo
, &ei_nlsp_short_packet
, tvb
, offset
, -1,
295 "Short area address entry");
298 proto_tree_add_item(tree
, hf_nlsp_area_address_mask
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
306 * Name: dissect_neighbor_clv()
309 * Decode an neighbor clv.
312 * tvbuff_t * : tvbuffer for packet data
313 * proto_tree * : protocol display tree to fill out. May be NULL
314 * int : offset into packet data where we are.
315 * int : length of clv we are decoding
318 * void, but we will add to proto tree if !NULL.
321 dissect_neighbor_clv(tvbuff_t
*tvb
, packet_info
* pinfo
, proto_tree
*tree
, int offset
,
326 proto_tree_add_expert_format(tree
, pinfo
, &ei_nlsp_short_packet
,
327 tvb
, offset
, -1, "Short neighbor entry");
330 proto_tree_add_item(tree
, hf_nlsp_neighbor
, tvb
, offset
, 6, ENC_NA
);
337 * Name: dissect_hello_local_mtu_clv()
340 * Decode for a hello packet's local MTU clv.
343 * tvbuff_t * : tvbuffer for packet data
344 * proto_tree * : protocol display tree to fill out. May be NULL
345 * int : offset into packet data where we are.
346 * int : length of clv we are decoding
349 * void, but we will add to proto tree if !NULL.
352 dissect_hello_local_mtu_clv(tvbuff_t
*tvb
, packet_info
* pinfo
, proto_tree
*tree
, int offset
,
356 proto_tree_add_expert_format(tree
, pinfo
, &ei_nlsp_short_packet
, tvb
, offset
, -1,
357 "Short link info entry");
360 proto_tree_add_item(tree
, hf_nlsp_hello_local_mtu_mtu_size
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
363 static const nlsp_clv_handle_t clv_hello_opts
[] = {
367 &ett_nlsp_hello_clv_area_addr
,
368 dissect_area_address_clv
373 &ett_nlsp_hello_clv_neighbors
,
379 &ett_nlsp_hello_local_mtu
,
380 dissect_hello_local_mtu_clv
392 * Name: nlsp_dissect_nlsp_hello()
395 * This procedure rips apart NLSP hellos.
398 * tvbuff_t * : tvbuffer for packet data
399 * proto_tree * : protocol display tree to add to. May be NULL.
400 * int offset : our offset into packet data.
401 * int : hello type, a la NLSP_TYPE_* values
402 * int : header length of packet.
405 * void, will modify proto_tree if not NULL.
407 #define NLSP_HELLO_CTYPE_MASK 0x03
408 #define NLSP_HELLO_STATE_MASK 0xC0
409 #define NLSP_HELLO_MULTICAST_MASK 0x10
411 static const value_string nlsp_hello_state_vals
[] = {
413 { 1, "Initializing" },
418 #define NLSP_HELLO_TYPE_RESERVED 0
419 #define NLSP_HELLO_TYPE_LEVEL_1 1
420 #define NLSP_HELLO_TYPE_LEVEL_2 2
421 #define NLSP_HELLO_TYPE_LEVEL_12 3
423 static const value_string nlsp_hello_circuit_type_vals
[] = {
424 { NLSP_HELLO_TYPE_RESERVED
, "Reserved 0 (discard PDU)"},
425 { NLSP_HELLO_TYPE_LEVEL_1
, "Level 1 only"},
426 { NLSP_HELLO_TYPE_LEVEL_2
, "Level 2 only"},
427 { NLSP_HELLO_TYPE_LEVEL_12
, "Level 1 and 2"},
431 #define NLSP_HELLO_PRIORITY_MASK 0x7f
434 nlsp_dissect_nlsp_hello(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
435 int offset
, int hello_type
, int header_length
)
437 uint16_t packet_length
;
440 if (hello_type
== NLSP_TYPE_WAN_HELLO
) {
441 proto_tree_add_item(tree
, hf_nlsp_hello_state
, tvb
,
442 offset
, 1, ENC_BIG_ENDIAN
);
444 proto_tree_add_item(tree
, hf_nlsp_hello_multicast
, tvb
,
445 offset
, 1, ENC_BIG_ENDIAN
);
447 proto_tree_add_item(tree
, hf_nlsp_hello_circuit_type
, tvb
,
448 offset
, 1, ENC_BIG_ENDIAN
);
451 proto_tree_add_item(tree
, hf_nlsp_hello_sending_router_system_id
, tvb
, offset
, 6, ENC_NA
);
453 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ", System ID: %s",
454 tvb_ether_to_str(pinfo
->pool
, tvb
, offset
));
458 proto_tree_add_item(tree
, hf_nlsp_hello_holding_timer
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
461 packet_length
= tvb_get_ntohs(tvb
, offset
);
462 proto_tree_add_uint(tree
, hf_nlsp_packet_length
, tvb
, offset
, 2, packet_length
);
465 proto_tree_add_item(tree
, hf_nlsp_hello_priority
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
468 if (hello_type
== NLSP_TYPE_WAN_HELLO
) {
469 proto_tree_add_item(tree
, hf_nlsp_hello_local_wan_circuit_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
472 proto_tree_add_item(tree
, hf_nlsp_hello_designated_router_system_id
, tvb
, offset
, 6, ENC_NA
);
473 proto_tree_add_item(tree
, hf_nlsp_hello_designated_router_pseudonode_id
, tvb
, offset
+6, 1, ENC_BIG_ENDIAN
);
477 len
= packet_length
- header_length
;
479 proto_tree_add_expert_format(tree
, pinfo
, &ei_nlsp_long_packet
, tvb
, offset
, -1,
480 "packet header length %d went beyond packet",
486 * Now, we need to decode our CLVs. We need to pass in
487 * our list of valid ones!
489 nlsp_dissect_clvs(tvb
, pinfo
, tree
, offset
,
490 clv_hello_opts
, len
, ett_nlsp_hello_clv_unknown
);
494 * Name: dissect_lsp_mgt_info_clv()
497 * Decode for a lsp packet's management information clv.
500 * tvbuff_t * : tvbuffer for packet data
501 * proto_tree * : protocol display tree to fill out. May be NULL
502 * int : offset into packet data where we are.
503 * int : length of clv we are decoding
506 * void, but we will add to proto tree if !NULL.
509 dissect_lsp_mgt_info_clv(tvbuff_t
*tvb
, packet_info
* pinfo
, proto_tree
*tree
, int offset
,
515 proto_tree_add_expert_format(tree
, pinfo
, &ei_nlsp_short_packet
, tvb
, offset
, -1,
516 "Short management info entry");
519 proto_tree_add_item(tree
, hf_nlsp_mgt_info_network_number
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
524 proto_tree_add_expert_format(tree
, pinfo
, &ei_nlsp_short_packet
, tvb
, offset
, -1,
525 "Short management info entry");
528 proto_tree_add_item(tree
, hf_nlsp_mgt_info_node_number
, tvb
, offset
, 6, ENC_NA
);
533 proto_tree_add_expert_format(tree
, pinfo
, &ei_nlsp_short_packet
, tvb
, offset
, -1,
534 "Short management info entry");
538 proto_tree_add_item(tree
, hf_nlsp_mgt_info_ipx_version_number
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
543 proto_tree_add_expert_format(tree
, pinfo
, &ei_nlsp_short_packet
, tvb
, offset
, -1,
544 "Short management info entry");
547 name_length
= tvb_get_uint8(tvb
, offset
);
548 proto_tree_add_item(tree
, hf_nlsp_mgt_info_name_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
552 if (name_length
!= 0) {
553 if (length
< name_length
) {
554 proto_tree_add_expert_format(tree
, pinfo
, &ei_nlsp_short_packet
, tvb
, offset
, -1,
555 "Short management info entry");
558 proto_tree_add_item(tree
, hf_nlsp_mgt_info_name
, tvb
, offset
, name_length
, ENC_NA
|ENC_ASCII
);
563 * Name: dissect_lsp_link_info_clv()
566 * Decode for a lsp packet's link information clv.
569 * tvbuff_t * : tvbuffer for packet data
570 * proto_tree * : protocol display tree to fill out. May be NULL
571 * int : offset into packet data where we are.
572 * int : length of clv we are decoding
575 * void, but we will add to proto tree if !NULL.
577 static const value_string media_type_vals
[] = {
578 { 0x0000, "Generic LAN" },
579 { 0x8000, "Generic WAN" },
580 { 0x0001, "Localtalk" },
581 { 0x0002, "Ethernet II" },
582 { 0x0003, "IEEE 802.3 with IEEE 802.2 without SNAP" },
583 { 0x0005, "IEEE 802.3 with IPX header and no 802.2 header" },
584 { 0x000A, "IEEE 802.3 with IEEE 802.2 and SNAP" },
585 { 0x0004, "IEEE 802.5 with IEEE 802.2 without SNAP" },
586 { 0x000B, "IEEE 802.5 with IEEE 802.2 and SNAP" },
587 { 0x0006, "IEEE 802.4" },
588 { 0x0007, "IBM PC Network II" },
589 { 0x0008, "Gateway G/Net" },
590 { 0x0009, "Proteon ProNET" },
591 { 0x000C, "Racore LANPAC" },
593 { 0x000E, "ARCnet" },
594 { 0x000F, "IBM PC Network II with 802.2 without SNAP" },
595 { 0x0010, "IBM PC Network II with 802.2 and SNAP" },
596 { 0x0011, "Corvus OmniNet at 4 Mbps" },
597 { 0x0012, "Harris Adacom" },
598 { 0x0013, "IP tunnel" },
599 { 0x8013, "IP Relay" },
600 { 0x0014, "FDDI with 802.2 without SNAP" },
601 { 0x0015, "Commtex IVDLAN" },
602 { 0x0016, "Dataco OSI" },
603 { 0x0017, "FDDI with 802.2 and SNAP" },
604 { 0x0018, "IBM SDLC tunnel" },
605 { 0x0019, "PC Office frame" },
606 { 0x001A, "Hypercommunications WAIDNET" },
608 { 0x801D, "Proxim RangeLAN" },
610 { 0x801F, "Frame Relay" },
611 { 0x0020, "Integrated Workstations BUS-NET" },
612 { 0x8021, "Novell SNA Links" },
617 dissect_lsp_link_info_clv(tvbuff_t
*tvb
, packet_info
* pinfo
, proto_tree
*tree
, int offset
,
623 proto_tree_add_expert_format(tree
, pinfo
, &ei_nlsp_short_packet
, tvb
, offset
, -1,
624 "Short link info entry");
628 flags_cost
= tvb_get_uint8(tvb
, offset
);
629 proto_tree_add_item(tree
, hf_nlsp_lsp_link_info_clv_flags_cost_present
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
630 if (!(flags_cost
& 0x80)) {
632 * 0x80 clear => cost present.
634 proto_tree_add_item(tree
, hf_nlsp_lsp_link_info_clv_flags_cost_metric
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
635 proto_tree_add_item(tree
, hf_nlsp_lsp_link_info_clv_flags_cost
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
642 proto_tree_add_expert_format(tree
, pinfo
, &ei_nlsp_short_packet
, tvb
, offset
, -1,
643 "Short link info entry");
646 offset
+= 3; /* Reserved */
650 proto_tree_add_expert_format(tree
, pinfo
, &ei_nlsp_short_packet
, tvb
, offset
, -1,
651 "Short link info entry");
655 proto_tree_add_item(tree
, hf_nlsp_link_info_router_system_id
, tvb
, offset
, 6, ENC_NA
);
656 proto_tree_add_item(tree
, hf_nlsp_link_info_router_pseudonode_id
, tvb
, offset
+6, 1, ENC_BIG_ENDIAN
);
661 proto_tree_add_expert_format(tree
, pinfo
, &ei_nlsp_short_packet
, tvb
, offset
, -1,
662 "Short link info entry");
665 proto_tree_add_item(tree
, hf_nlsp_link_info_mtu_size
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
670 proto_tree_add_expert_format(tree
, pinfo
, &ei_nlsp_short_packet
, tvb
, offset
, -1,
671 "Short link info entry");
674 proto_tree_add_item(tree
, hf_nlsp_link_info_delay
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
679 proto_tree_add_expert_format(tree
, pinfo
, &ei_nlsp_short_packet
, tvb
, offset
, -1,
680 "Short link info entry");
683 proto_tree_add_item(tree
, hf_nlsp_link_info_throughput
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
688 proto_tree_add_expert_format(tree
, pinfo
, &ei_nlsp_short_packet
, tvb
, offset
, -1,
689 "Short link info entry");
692 proto_tree_add_item(tree
, hf_nlsp_link_info_media_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
696 * Name: dissect_lsp_svcs_info_clv()
699 * Decode for a lsp packet's services information clv.
702 * tvbuff_t * : tvbuffer for packet data
703 * proto_tree * : protocol display tree to fill out. May be NULL
704 * int : offset into packet data where we are.
705 * int : length of clv we are decoding
708 * void, but we will add to proto tree if !NULL.
711 dissect_lsp_svcs_info_clv(tvbuff_t
*tvb
, packet_info
* pinfo
, proto_tree
*tree
, int offset
,
715 proto_tree_add_expert_format(tree
, pinfo
, &ei_nlsp_short_packet
, tvb
, offset
, -1,
716 "Short services info entry");
720 proto_tree_add_item(tree
, hf_nlsp_svcs_info_hops_to_reach_the_service
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
725 proto_tree_add_expert_format(tree
, pinfo
, &ei_nlsp_short_packet
, tvb
, offset
, -1,
726 "Short services info entry");
730 proto_tree_add_item(tree
, hf_nlsp_svcs_info_network_number
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
735 proto_tree_add_expert_format(tree
, pinfo
, &ei_nlsp_short_packet
, tvb
, offset
, -1,
736 "Short services info entry");
740 proto_tree_add_item(tree
, hf_nlsp_svcs_info_node_number
, tvb
, offset
, 6, ENC_NA
);
745 proto_tree_add_expert_format(tree
, pinfo
, &ei_nlsp_short_packet
, tvb
, offset
, -1,
746 "Short services info entry");
750 proto_tree_add_item(tree
, hf_nlsp_svcs_info_socket
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
755 proto_tree_add_expert_format(tree
, pinfo
, &ei_nlsp_short_packet
, tvb
, offset
, -1,
756 "Short services info entry");
760 proto_tree_add_item(tree
, hf_nlsp_svcs_info_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
765 proto_tree_add_item(tree
, hf_nlsp_svcs_info_service_name
, tvb
, offset
, length
, ENC_NA
|ENC_ASCII
);
771 * Name: dissect_lsp_ext_routes_clv()
774 * Decode for a lsp packet's external routes clv.
777 * tvbuff_t * : tvbuffer for packet data
778 * proto_tree * : protocol display tree to fill out. May be NULL
779 * int : offset into packet data where we are.
780 * int : length of clv we are decoding
783 * void, but we will add to proto tree if !NULL.
786 dissect_lsp_ext_routes_clv(tvbuff_t
*tvb
, packet_info
* pinfo
, proto_tree
*tree
, int offset
,
790 proto_tree_add_item(tree
, hf_nlsp_ext_routes_hops
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
795 proto_tree_add_expert_format(tree
, pinfo
, &ei_nlsp_short_packet
, tvb
, offset
, -1,
796 "Short external routes entry");
800 proto_tree_add_item(tree
, hf_nlsp_ext_routes_network_number
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
805 proto_tree_add_expert_format(tree
, pinfo
, &ei_nlsp_short_packet
, tvb
, offset
, -1,
806 "Short external routes entry");
810 proto_tree_add_item(tree
, hf_nlsp_ext_routes_rip_delay
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
816 static const nlsp_clv_handle_t clv_l1_lsp_opts
[] = {
820 &ett_nlsp_lsp_clv_area_addr
,
821 dissect_area_address_clv
825 "Management information",
826 &ett_nlsp_lsp_clv_mgt_info
,
827 dissect_lsp_mgt_info_clv
832 &ett_nlsp_lsp_clv_link_info
,
833 dissect_lsp_link_info_clv
837 "Services information",
838 &ett_nlsp_lsp_clv_svcs_info
,
839 dissect_lsp_svcs_info_clv
844 &ett_nlsp_lsp_clv_ext_routes
,
845 dissect_lsp_ext_routes_clv
857 * Name: nlsp_dissect_nlsp_lsp()
860 * Print out the LSP part of the main header and then call the CLV
861 * de-mangler with the right list of valid CLVs.
864 * tvbuff_t * : tvbuffer for packet data
865 * proto_tree * : protocol display tree to add to. May be NULL.
866 * int offset : our offset into packet data.
867 * int : header length of packet.
870 * void, but we will add to proto tree if !NULL.
872 /* P | ATT | OVERFLOW | ROUTER TYPE FIELD description */
873 #define NLSP_LSP_PARTITION_MASK 0x80
874 #define NLSP_LSP_PARTITION_SHIFT 7
875 #define NLSP_LSP_PARTITION(info) (((info) & NLSP_LSP_PARTITION_MASK) >> NLSP_LSP_PARTITION_SHIFT)
877 #define NLSP_LSP_ATT_MASK 0x78
878 #define NLSP_LSP_ATT_SHIFT 3
879 #define NLSP_LSP_ATT(info) (((info) & NLSP_LSP_ATT_MASK) >> NLSP_LSP_ATT_SHIFT)
881 #define NLSP_LSP_OVERFLOW_MASK 0x04
882 #define NLSP_LSP_OVERFLOW_SHIFT 2
883 #define NLSP_LSP_OVERFLOW(info) (((info) & NLSP_LSP_OVERFLOW_MASK) >> NLSP_LSP_OVERFLOW_SHIFT)
885 #define NLSP_LSP_ROUTER_TYPE_MASK 0x03
886 #define NLSP_LSP_ROUTER_TYPE(info) ((info) & NLSP_LSP_ROUTER_TYPE_MASK)
889 nlsp_dissect_nlsp_lsp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
890 int offset
, int header_length
)
892 uint16_t packet_length
;
893 uint16_t remaining_lifetime
;
894 uint32_t sequence_number
;
897 packet_length
= tvb_get_ntohs(tvb
, offset
);
898 proto_tree_add_uint(tree
, hf_nlsp_packet_length
, tvb
,
899 offset
, 2, packet_length
);
902 remaining_lifetime
= tvb_get_ntohs(tvb
, offset
);
903 proto_tree_add_uint(tree
, hf_nlsp_remaining_lifetime
, tvb
, offset
, 2, remaining_lifetime
);
906 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ", LSP ID: %s",
907 tvb_ether_to_str(pinfo
->pool
, tvb
, offset
));
909 proto_tree_add_item(tree
, hf_nlsp_lsp_id_system_id
, tvb
, offset
, 6, ENC_NA
);
912 /* XXX - append the pseudonode ID */
913 proto_tree_add_item(tree
, hf_nlsp_lsp_id_pseudonode_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
916 proto_tree_add_item(tree
, hf_nlsp_lsp_id_lsp_number
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
919 sequence_number
= tvb_get_ntohl(tvb
, offset
);
920 col_append_fstr(pinfo
->cinfo
, COL_INFO
,
921 ", Sequence: 0x%08x, Lifetime: %us",
922 sequence_number
, remaining_lifetime
);
924 proto_tree_add_uint(tree
, hf_nlsp_lsp_sequence_number
, tvb
,
925 offset
, 4, sequence_number
);
928 /* XXX -> we could validate the cksum here! */
929 proto_tree_add_checksum(tree
, tvb
, offset
, hf_nlsp_lsp_checksum
, -1, NULL
, pinfo
, 0, ENC_BIG_ENDIAN
, PROTO_CHECKSUM_NO_FLAGS
);
933 proto_tree_add_item(tree
, hf_nlsp_lsp_p
, tvb
,
934 offset
, 1, ENC_BIG_ENDIAN
);
935 proto_tree_add_item(tree
, hf_nlsp_lsp_attached_flag
, tvb
,
936 offset
, 1, ENC_BIG_ENDIAN
);
937 proto_tree_add_item(tree
, hf_nlsp_lsp_lspdbol
, tvb
,
938 offset
, 1, ENC_BIG_ENDIAN
);
939 proto_tree_add_item(tree
, hf_nlsp_lsp_router_type
, tvb
,
940 offset
, 1, ENC_BIG_ENDIAN
);
944 len
= packet_length
- header_length
;
946 proto_tree_add_expert_format(tree
, pinfo
, &ei_nlsp_long_packet
, tvb
, offset
, -1,
947 "packet header length %d went beyond packet",
953 * Now, we need to decode our CLVs. We need to pass in
954 * our list of valid ones!
956 nlsp_dissect_clvs(tvb
, pinfo
, tree
, offset
,
957 clv_l1_lsp_opts
, len
, ett_nlsp_lsp_clv_unknown
);
961 * Name: dissect_snp_lsp_entries()
964 * All the snp packets use a common payload format. We have up
965 * to n entries (based on length), which are made of:
966 * 2 : remaining life time
968 * 4 : sequence number
972 * tvbuff_t * : tvbuffer for packet data
973 * proto_tree * : protocol display tree to fill out. May be NULL
974 * int : offset into packet data where we are.
975 * int : length of payload to decode.
978 * void, but we will add to proto tree if !NULL.
981 dissect_csnp_lsp_entries(tvbuff_t
*tvb
, packet_info
* pinfo
, proto_tree
*tree
, int offset
,
988 proto_tree_add_expert_format(tree
, pinfo
, &ei_nlsp_short_packet
, tvb
, offset
, -1,
989 "Short CSNP header entry");
993 subtree
= proto_tree_add_subtree_format(tree
, tvb
, offset
, 16,
994 ett_nlsp_csnp_lsp_entry
, NULL
, "LSP-ID: %s, Sequence: 0x%08x, Lifetime: %5us, Checksum: 0x%04x",
995 tvb_ether_to_str(pinfo
->pool
, tvb
, offset
+2), /* XXX - rest of system ID */
996 tvb_get_ntohl(tvb
, offset
+10),
997 tvb_get_ntohs(tvb
, offset
),
998 tvb_get_ntohs(tvb
, offset
+14));
1000 proto_tree_add_item(subtree
, hf_nlsp_csnp_lsp_id_source_id
, tvb
, offset
+2, 6, ENC_NA
);
1001 proto_tree_add_item(subtree
, hf_nlsp_csnp_lsp_id_pseudonode_id
, tvb
, offset
+8, 1, ENC_BIG_ENDIAN
);
1002 proto_tree_add_item(subtree
, hf_nlsp_csnp_lsp_id_lsp_number
, tvb
, offset
+9, 1, ENC_BIG_ENDIAN
);
1004 proto_tree_add_item(subtree
, hf_nlsp_csnp_lsp_sequence_number
, tvb
, offset
+10, 4, ENC_BIG_ENDIAN
);
1006 proto_tree_add_item(subtree
, hf_nlsp_csnp_remaining_lifetime
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1008 proto_tree_add_checksum(subtree
, tvb
, offset
+14, hf_nlsp_csnp_lsp_checksum
, -1, NULL
, pinfo
, 0, ENC_BIG_ENDIAN
, PROTO_CHECKSUM_NO_FLAGS
);
1016 dissect_psnp_lsp_entries(tvbuff_t
*tvb
, packet_info
* pinfo
, proto_tree
*tree
, int offset
,
1019 proto_tree
*subtree
;
1021 while (length
> 0) {
1023 proto_tree_add_expert_format(tree
, pinfo
, &ei_nlsp_short_packet
, tvb
, offset
, -1,
1024 "Short PSNP header entry");
1028 subtree
= proto_tree_add_subtree_format(tree
, tvb
, offset
, 16,
1029 ett_nlsp_psnp_lsp_entry
, NULL
, "LSP-ID: %s, Sequence: 0x%08x, Lifetime: %5us, Checksum: 0x%04x",
1030 tvb_ether_to_str(pinfo
->pool
, tvb
, offset
+2), /* XXX - rest of system ID */
1031 tvb_get_ntohl(tvb
, offset
+10),
1032 tvb_get_ntohs(tvb
, offset
),
1033 tvb_get_ntohs(tvb
, offset
+14));
1035 proto_tree_add_item(subtree
, hf_nlsp_psnp_lsp_id_source_id
, tvb
, offset
+2, 6, ENC_NA
);
1036 proto_tree_add_item(subtree
, hf_nlsp_psnp_lsp_id_pseudonode_id
, tvb
, offset
+8, 1, ENC_BIG_ENDIAN
);
1037 proto_tree_add_item(subtree
, hf_nlsp_psnp_lsp_id_lsp_number
, tvb
, offset
+9, 1, ENC_BIG_ENDIAN
);
1039 proto_tree_add_item(subtree
, hf_nlsp_psnp_lsp_sequence_number
, tvb
, offset
+10, 4, ENC_BIG_ENDIAN
);
1041 proto_tree_add_item(subtree
, hf_nlsp_psnp_remaining_lifetime
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1043 proto_tree_add_checksum(subtree
, tvb
, offset
+14, hf_nlsp_psnp_lsp_checksum
, -1, NULL
, pinfo
, 0, ENC_BIG_ENDIAN
, PROTO_CHECKSUM_NO_FLAGS
);
1050 static const nlsp_clv_handle_t clv_l1_csnp_opts
[] = {
1054 &ett_nlsp_csnp_lsp_entries
,
1055 dissect_csnp_lsp_entries
1067 * Name: nlsp_dissect_nlsp_csnp()
1070 * Tear apart a L1 CSNP header and then call into payload dissect
1071 * to pull apart the lsp id payload.
1074 * tvbuff_t * : tvbuffer for packet data
1075 * proto_tree * : protocol display tree to add to. May be NULL.
1076 * int offset : our offset into packet data.
1077 * int : header length of packet.
1080 * void, but we will add to proto tree if !NULL.
1083 nlsp_dissect_nlsp_csnp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
1084 int offset
, int header_length
)
1086 uint16_t packet_length
;
1089 packet_length
= tvb_get_ntohs(tvb
, offset
);
1090 proto_tree_add_uint(tree
, hf_nlsp_packet_length
, tvb
, offset
, 2, packet_length
);
1093 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ", Source ID: %s",
1094 tvb_ether_to_str(pinfo
->pool
, tvb
, offset
));
1095 proto_tree_add_item(tree
, hf_nlsp_csnp_source_id_system_id
, tvb
, offset
, 6, ENC_NA
);
1097 proto_tree_add_item(tree
, hf_nlsp_csnp_source_id_pseudonode_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1100 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ", Start LSP ID: %s",
1101 tvb_ether_to_str(pinfo
->pool
, tvb
, offset
));
1102 proto_tree_add_item(tree
, hf_nlsp_csnp_start_lsp_id_source_id
, tvb
, offset
, 6, ENC_NA
);
1104 /* XXX - append the pseudonode ID */
1105 proto_tree_add_item(tree
, hf_nlsp_csnp_start_lsp_id_pseudonode_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1108 proto_tree_add_item(tree
, hf_nlsp_csnp_start_lsp_id_lsp_number
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1111 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ", End LSP ID: %s",
1112 tvb_ether_to_str(pinfo
->pool
, tvb
, offset
));
1113 proto_tree_add_item(tree
, hf_nlsp_csnp_end_lsp_id_source_id
, tvb
, offset
, 6, ENC_NA
);
1115 /* XXX - append the pseudonode ID */
1116 proto_tree_add_item(tree
, hf_nlsp_csnp_end_lsp_id_pseudonode_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1118 proto_tree_add_item(tree
, hf_nlsp_csnp_end_lsp_id_lsp_number
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1121 len
= packet_length
- header_length
;
1125 /* Call into payload dissector */
1126 nlsp_dissect_clvs(tvb
, pinfo
, tree
, offset
,
1127 clv_l1_csnp_opts
, len
, ett_nlsp_csnp_clv_unknown
);
1130 static const nlsp_clv_handle_t clv_l1_psnp_opts
[] = {
1134 &ett_nlsp_psnp_lsp_entries
,
1135 dissect_psnp_lsp_entries
1147 * Name: nlsp_dissect_nlsp_psnp()
1150 * Tear apart a L1 PSNP header and then call into payload dissect
1151 * to pull apart the lsp id payload.
1154 * tvbuff_t * : tvbuffer for packet data
1155 * proto_tree * : protocol display tree to add to. May be NULL.
1156 * int offset : our offset into packet data.
1157 * int : header length of packet.
1160 * void, but we will add to proto tree if !NULL.
1163 nlsp_dissect_nlsp_psnp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
1164 int offset
, int header_length
)
1166 uint16_t packet_length
;
1169 packet_length
= tvb_get_ntohs(tvb
, offset
);
1170 proto_tree_add_uint(tree
, hf_nlsp_packet_length
, tvb
,
1171 offset
, 2, packet_length
);
1174 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ", Source ID: %s",
1175 tvb_ether_to_str(pinfo
->pool
, tvb
, offset
));
1176 proto_tree_add_item(tree
, hf_nlsp_psnp_source_id_system_id
, tvb
, offset
, 6, ENC_NA
);
1178 /* XXX - add the pseudonode ID */
1179 proto_tree_add_item(tree
, hf_nlsp_psnp_source_id_pseudonode_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1182 len
= packet_length
- header_length
;
1186 /* Call into payload dissector */
1187 nlsp_dissect_clvs(tvb
, pinfo
, tree
, offset
,
1188 clv_l1_psnp_opts
, len
, ett_nlsp_psnp_clv_unknown
);
1192 * Name: dissect_nlsp()
1195 * Main entry area for nlsp de-mangling. This will build the
1196 * main nlsp tree data and call the sub-protocols as needed.
1199 * tvbuff_t * : tvbuffer for packet data
1200 * packet_info * : info for current packet
1201 * proto_tree * : tree of display data. May be NULL.
1204 * void, but we will add to the proto_tree if it is not NULL.
1207 dissect_nlsp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
1209 proto_item
*ti
, *type_item
;
1210 proto_tree
*nlsp_tree
;
1212 uint8_t nlsp_major_version
;
1213 uint8_t nlsp_header_length
;
1214 uint8_t packet_type_flags
;
1215 uint8_t packet_type
;
1217 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "NLSP");
1218 col_clear(pinfo
->cinfo
, COL_INFO
);
1220 ti
= proto_tree_add_item(tree
, proto_nlsp
, tvb
, 0, -1, ENC_NA
);
1221 nlsp_tree
= proto_item_add_subtree(ti
, ett_nlsp
);
1223 proto_tree_add_item(nlsp_tree
, hf_nlsp_irpd
, tvb
, offset
, 1,
1227 nlsp_header_length
= tvb_get_uint8(tvb
, 1);
1228 proto_tree_add_uint(nlsp_tree
, hf_nlsp_header_length
, tvb
,
1229 offset
, 1, nlsp_header_length
);
1232 proto_tree_add_item(nlsp_tree
, hf_nlsp_minor_version
, tvb
,
1233 offset
, 1, ENC_BIG_ENDIAN
);
1236 offset
+= 1; /* Reserved */
1238 packet_type_flags
= tvb_get_uint8(tvb
, offset
);
1239 packet_type
= packet_type_flags
& PACKET_TYPE_MASK
;
1240 col_add_str(pinfo
->cinfo
, COL_INFO
,
1241 val_to_str(packet_type
, nlsp_packet_type_vals
, "Unknown (%u)"));
1242 if (packet_type
== NLSP_TYPE_L1_LSP
) {
1243 proto_tree_add_boolean(nlsp_tree
, hf_nlsp_nr
, tvb
, offset
, 1, packet_type_flags
);
1245 type_item
= proto_tree_add_uint(nlsp_tree
, hf_nlsp_type
, tvb
, offset
, 1, packet_type_flags
);
1248 nlsp_major_version
= tvb_get_uint8(tvb
, offset
);
1249 ti
= proto_tree_add_item(nlsp_tree
, hf_nlsp_major_version
, tvb
,
1250 offset
, 1, ENC_BIG_ENDIAN
);
1251 if (nlsp_major_version
!= 1){
1252 expert_add_info_format(pinfo
, ti
, &ei_nlsp_major_version
,
1253 "Unknown NLSP version (%d vs 1)",
1254 nlsp_major_version
);
1258 offset
+= 2; /* Reserved */
1260 switch (packet_type
) {
1262 case NLSP_TYPE_L1_HELLO
:
1263 case NLSP_TYPE_WAN_HELLO
:
1264 nlsp_dissect_nlsp_hello(tvb
, pinfo
, nlsp_tree
, offset
,
1265 packet_type
, nlsp_header_length
);
1268 case NLSP_TYPE_L1_LSP
:
1269 nlsp_dissect_nlsp_lsp(tvb
, pinfo
, nlsp_tree
, offset
,
1270 nlsp_header_length
);
1273 case NLSP_TYPE_L1_CSNP
:
1274 nlsp_dissect_nlsp_csnp(tvb
, pinfo
, nlsp_tree
, offset
,
1275 nlsp_header_length
);
1278 case NLSP_TYPE_L1_PSNP
:
1279 nlsp_dissect_nlsp_psnp(tvb
, pinfo
, nlsp_tree
, offset
,
1280 nlsp_header_length
);
1284 expert_add_info(pinfo
, type_item
, &ei_nlsp_type
);
1286 return tvb_captured_length(tvb
);
1290 * Name: proto_register_nlsp()
1293 * main register for NLSP protocol set. We register some display
1294 * formats and the protocol module variables.
1296 * NOTE: this procedure to autolinked by the makefile process that
1306 proto_register_nlsp(void)
1308 static hf_register_info hf
[] = {
1310 { "NetWare Link Services Protocol Discriminator", "nlsp.irpd",
1311 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
1315 { &hf_nlsp_header_length
,
1316 { "PDU Header Length", "nlsp.header_length",
1317 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1321 { &hf_nlsp_minor_version
,
1322 { "Minor Version", "nlsp.minor_version",
1323 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1328 { "Multi-homed Non-routing Server", "nlsp.nr",
1329 FT_BOOLEAN
, 8, NULL
, 0x80,
1334 { "Packet Type", "nlsp.type",
1335 FT_UINT8
, BASE_DEC
, VALS(nlsp_packet_type_vals
), PACKET_TYPE_MASK
,
1339 { &hf_nlsp_major_version
,
1340 { "Major Version", "nlsp.major_version",
1341 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1345 { &hf_nlsp_packet_length
,
1346 { "Packet Length", "nlsp.packet_length",
1347 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1351 { &hf_nlsp_hello_state
,
1352 { "State", "nlsp.hello.state",
1353 FT_UINT8
, BASE_DEC
, VALS(nlsp_hello_state_vals
), NLSP_HELLO_STATE_MASK
,
1357 { &hf_nlsp_hello_multicast
,
1358 { "Multicast Routing", "nlsp.hello.multicast",
1359 FT_BOOLEAN
, 8, TFS(&tfs_supported_not_supported
), NLSP_HELLO_MULTICAST_MASK
,
1360 "If set, this router supports multicast routing", HFILL
}
1363 { &hf_nlsp_hello_circuit_type
,
1364 { "Circuit Type", "nlsp.hello.circuit_type",
1365 FT_UINT8
, BASE_DEC
, VALS(nlsp_hello_circuit_type_vals
), NLSP_HELLO_CTYPE_MASK
,
1369 { &hf_nlsp_hello_holding_timer
,
1370 { "Holding Timer", "nlsp.hello.holding_timer",
1371 FT_UINT16
, BASE_DEC
|BASE_UNIT_STRING
, UNS(&units_seconds
), 0x0,
1375 { &hf_nlsp_hello_priority
,
1376 { "Priority", "nlsp.hello.priority",
1377 FT_UINT8
, BASE_DEC
, NULL
, NLSP_HELLO_PRIORITY_MASK
,
1381 { &hf_nlsp_lsp_sequence_number
,
1382 { "Sequence Number", "nlsp.sequence_number",
1383 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
1387 { &hf_nlsp_lsp_checksum
,
1388 { "Checksum", "nlsp.lsp.checksum",
1389 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
1394 { "Partition Repair", "nlsp.lsp.partition_repair",
1395 FT_BOOLEAN
, 8, TFS(&tfs_supported_not_supported
), NLSP_LSP_PARTITION_MASK
,
1396 "If set, this router supports the optional Partition Repair function", HFILL
}
1399 { &hf_nlsp_lsp_attached_flag
,
1400 { "Attached Flag", "nlsp.lsp.attached_flag",
1401 FT_UINT8
, BASE_DEC
, VALS(nlsp_attached_flag_vals
), NLSP_LSP_ATT_MASK
,
1405 { &hf_nlsp_lsp_lspdbol
,
1406 { "LSP Database Overloaded", "nlsp.lsp.lspdbol",
1407 FT_BOOLEAN
, 8, NULL
, NLSP_LSP_OVERFLOW_MASK
,
1411 { &hf_nlsp_lsp_router_type
,
1412 { "Router Type", "nlsp.lsp.router_type",
1413 FT_UINT8
, BASE_DEC
, VALS(nlsp_router_type_vals
), NLSP_LSP_ROUTER_TYPE_MASK
,
1417 { &hf_nlsp_lsp_link_info_clv_flags_cost_present
,
1418 { "Cost present", "nlsp.lsp.link_info_clv.flags.cost_present",
1419 FT_BOOLEAN
, 8, TFS(&tfs_no_yes
), 0x80,
1423 { &hf_nlsp_lsp_link_info_clv_flags_cost_metric
,
1424 { "Cost metric", "nlsp.lsp.link_info_clv.flags.cost_metric",
1425 FT_BOOLEAN
, 8, TFS(&tfs_internal_external
), 0x40,
1429 { &hf_nlsp_lsp_link_info_clv_flags_cost
,
1430 { "Cost", "nlsp.lsp.link_info_clv.flags.cost",
1431 FT_UINT8
, BASE_DEC
, NULL
, 0x3F,
1435 /* Generated from convert_proto_tree_add_text.pl */
1436 { &hf_nlsp_unknown_code
,
1437 { "Unknown code", "nlsp.unknown_code",
1438 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1441 { &hf_nlsp_area_address_network_number
,
1442 { "Area address network number", "nlsp.area_address.network_number",
1443 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
1446 { &hf_nlsp_area_address_mask
,
1447 { "Area address mask", "nlsp.area_address.mask",
1448 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
1451 { &hf_nlsp_neighbor
,
1452 { "Neighbor", "nlsp.neighbor",
1453 FT_ETHER
, BASE_NONE
, NULL
, 0x0,
1456 { &hf_nlsp_hello_local_mtu_mtu_size
,
1457 { "MTU Size", "nlsp.hello_local_mtu.mtu_size",
1458 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1461 { &hf_nlsp_hello_sending_router_system_id
,
1462 { "Sending Router System ID", "nlsp.hello.sending_router_system_id",
1463 FT_ETHER
, BASE_NONE
, NULL
, 0x0,
1466 { &hf_nlsp_hello_local_wan_circuit_id
,
1467 { "Local WAN Circuit ID", "nlsp.hello.local_wan_circuit_id",
1468 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1471 { &hf_nlsp_hello_designated_router_system_id
,
1472 { "Designated Router System ID", "nlsp.hello.designated_router_system_id",
1473 FT_ETHER
, BASE_NONE
, NULL
, 0x0,
1476 { &hf_nlsp_hello_designated_router_pseudonode_id
,
1477 { "Designated Router Pseudonode ID", "nlsp.hello.designated_router_pseudonode_id",
1478 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1481 { &hf_nlsp_mgt_info_network_number
,
1482 { "Network number", "nlsp.mgt_info.network_number",
1483 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
1486 { &hf_nlsp_mgt_info_node_number
,
1487 { "Node number", "nlsp.mgt_info.node_number",
1488 FT_ETHER
, BASE_NONE
, NULL
, 0x0,
1491 { &hf_nlsp_mgt_info_ipx_version_number
,
1492 { "IPX version number", "nlsp.mgt_info.ipx_version_number",
1493 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1496 { &hf_nlsp_mgt_info_name_length
,
1497 { "Name length", "nlsp.mgt_info.name_length",
1498 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1501 { &hf_nlsp_mgt_info_name
,
1502 { "Name", "nlsp.mgt_info.name",
1503 FT_STRING
, BASE_NONE
, NULL
, 0x0,
1506 { &hf_nlsp_link_info_router_system_id
,
1507 { "Router System ID", "nlsp.link_info.router_system_id",
1508 FT_ETHER
, BASE_NONE
, NULL
, 0x0,
1511 { &hf_nlsp_link_info_router_pseudonode_id
,
1512 { "Router Pseudonode ID", "nlsp.link_info.router_pseudonode_id",
1513 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1516 { &hf_nlsp_link_info_mtu_size
,
1517 { "MTU Size", "nlsp.link_info.mtu_size",
1518 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1521 { &hf_nlsp_link_info_delay
,
1522 { "Delay", "nlsp.link_info.delay",
1523 FT_UINT32
, BASE_DEC
|BASE_UNIT_STRING
, UNS(&units_microseconds
), 0x0,
1526 { &hf_nlsp_link_info_throughput
,
1527 { "Throughput", "nlsp.link_info.throughput",
1528 FT_UINT32
, BASE_DEC
|BASE_UNIT_STRING
, UNS(&units_bit_sec
), 0x0,
1531 { &hf_nlsp_link_info_media_type
,
1532 { "Media type", "nlsp.link_info.media_type",
1533 FT_UINT16
, BASE_DEC
, VALS(media_type_vals
), 0x0,
1536 { &hf_nlsp_svcs_info_hops_to_reach_the_service
,
1537 { "Hops to reach the service", "nlsp.svcs_info.hops_to_reach_the_service",
1538 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1541 { &hf_nlsp_svcs_info_network_number
,
1542 { "Network number", "nlsp.svcs_info.network_number",
1543 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
1546 { &hf_nlsp_svcs_info_node_number
,
1547 { "Node number", "nlsp.svcs_info.node_number",
1548 FT_ETHER
, BASE_NONE
, NULL
, 0x0,
1551 { &hf_nlsp_svcs_info_socket
,
1552 { "Socket", "nlsp.svcs_info.socket",
1553 FT_UINT16
, BASE_DEC
|BASE_EXT_STRING
, &ipx_socket_vals_ext
, 0x0,
1556 { &hf_nlsp_svcs_info_type
,
1557 { "Type", "nlsp.svcs_info.type",
1558 FT_UINT16
, BASE_DEC
|BASE_EXT_STRING
, &novell_server_vals_ext
, 0x0,
1561 { &hf_nlsp_svcs_info_service_name
,
1562 { "Service Name", "nlsp.svcs_info.service_name",
1563 FT_STRING
, BASE_NONE
, NULL
, 0x0,
1566 { &hf_nlsp_ext_routes_hops
,
1567 { "Hops", "nlsp.ext_routes.hops",
1568 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1571 { &hf_nlsp_ext_routes_network_number
,
1572 { "Network number", "nlsp.ext_routes.network_number",
1573 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
1576 { &hf_nlsp_ext_routes_rip_delay
,
1577 { "RIP delay", "nlsp.ext_routes.rip_delay",
1578 FT_UINT16
, BASE_DEC
|BASE_UNIT_STRING
, UNS(&units_tick_ticks
), 0x0,
1581 { &hf_nlsp_remaining_lifetime
,
1582 { "Remaining Lifetime", "nlsp.remaining_lifetime",
1583 FT_UINT16
, BASE_DEC
|BASE_UNIT_STRING
, UNS(&units_seconds
), 0x0,
1586 { &hf_nlsp_lsp_id_system_id
,
1587 { "LSP ID system ID", "nlsp.lsp_id_system_id",
1588 FT_ETHER
, BASE_NONE
, NULL
, 0x0,
1591 { &hf_nlsp_lsp_id_pseudonode_id
,
1592 { "LSP ID pseudonode ID", "nlsp.lsp_id_pseudonode_id",
1593 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1596 { &hf_nlsp_lsp_id_lsp_number
,
1597 { "LSP ID LSP number", "nlsp.lsp_id_lsp_number",
1598 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1601 { &hf_nlsp_csnp_lsp_id_source_id
,
1602 { "LSP ID source ID", "nlsp.csnp.lsp_id_source_id",
1603 FT_ETHER
, BASE_NONE
, NULL
, 0x0,
1606 { &hf_nlsp_csnp_lsp_id_pseudonode_id
,
1607 { "LSP ID pseudonode ID", "nlsp.csnp.lsp_id_pseudonode_id",
1608 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1611 { &hf_nlsp_csnp_lsp_id_lsp_number
,
1612 { "LSP ID LSP number", "nlsp.csnp.lsp_id_lsp_number",
1613 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1616 { &hf_nlsp_csnp_lsp_sequence_number
,
1617 { "LSP Sequence Number", "nlsp.csnp.lsp_sequence_number",
1618 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
1621 { &hf_nlsp_csnp_remaining_lifetime
,
1622 { "Remaining Lifetime", "nlsp.csnp.remaining_lifetime",
1623 FT_UINT16
, BASE_DEC
|BASE_UNIT_STRING
, UNS(&units_seconds
), 0x0,
1626 { &hf_nlsp_csnp_lsp_checksum
,
1627 { "LSP checksum", "nlsp.csnp.lsp_checksum",
1628 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
1631 { &hf_nlsp_psnp_lsp_id_source_id
,
1632 { "LSP ID source ID", "nlsp.psnp.lsp_id_source_id",
1633 FT_ETHER
, BASE_NONE
, NULL
, 0x0,
1636 { &hf_nlsp_psnp_lsp_id_pseudonode_id
,
1637 { "LSP ID pseudonode ID", "nlsp.psnp.lsp_id_pseudonode_id",
1638 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1641 { &hf_nlsp_psnp_lsp_id_lsp_number
,
1642 { "LSP ID LSP number", "nlsp.psnp.lsp_id_lsp_number",
1643 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1646 { &hf_nlsp_psnp_lsp_sequence_number
,
1647 { "LSP Sequence Number", "nlsp.psnp.lsp_sequence_number",
1648 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
1651 { &hf_nlsp_psnp_remaining_lifetime
,
1652 { "Remaining Lifetime", "nlsp.psnp.remaining_lifetime",
1653 FT_UINT16
, BASE_DEC
|BASE_UNIT_STRING
, UNS(&units_seconds
), 0x0,
1656 { &hf_nlsp_psnp_lsp_checksum
,
1657 { "LSP checksum", "nlsp.psnp.lsp_checksum",
1658 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
1661 { &hf_nlsp_csnp_source_id_system_id
,
1662 { "Source ID system ID", "nlsp.csnp.source_id_system_id",
1663 FT_ETHER
, BASE_NONE
, NULL
, 0x0,
1666 { &hf_nlsp_csnp_source_id_pseudonode_id
,
1667 { "Source ID pseudonode ID", "nlsp.csnp.source_id_pseudonode_id",
1668 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1671 { &hf_nlsp_csnp_start_lsp_id_source_id
,
1672 { "Start LSP ID source ID", "nlsp.csnp.start_lsp_id_source_id",
1673 FT_ETHER
, BASE_NONE
, NULL
, 0x0,
1676 { &hf_nlsp_csnp_start_lsp_id_pseudonode_id
,
1677 { "Start LSP ID pseudonode ID", "nlsp.csnp.start_lsp_id_pseudonode_id",
1678 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1681 { &hf_nlsp_csnp_start_lsp_id_lsp_number
,
1682 { "Start LSP ID LSP number", "nlsp.csnp.start_lsp_id_lsp_number",
1683 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1686 { &hf_nlsp_csnp_end_lsp_id_source_id
,
1687 { "End LSP ID source ID", "nlsp.csnp.end_lsp_id_source_id",
1688 FT_ETHER
, BASE_NONE
, NULL
, 0x0,
1691 { &hf_nlsp_csnp_end_lsp_id_pseudonode_id
,
1692 { "End LSP ID pseudonode ID", "nlsp.csnp.end_lsp_id_pseudonode_id",
1693 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1696 { &hf_nlsp_csnp_end_lsp_id_lsp_number
,
1697 { "End LSP ID LSP number", "nlsp.csnp.end_lsp_id_lsp_number",
1698 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1701 { &hf_nlsp_psnp_source_id_system_id
,
1702 { "Source ID system ID", "nlsp.psnp.source_id_system_id",
1703 FT_ETHER
, BASE_NONE
, NULL
, 0x0,
1706 { &hf_nlsp_psnp_source_id_pseudonode_id
,
1707 { "Source ID pseudonode ID", "nlsp.psnp.source_id_pseudonode_id",
1708 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1712 static int *ett
[] = {
1714 &ett_nlsp_hello_clv_area_addr
,
1715 &ett_nlsp_hello_clv_neighbors
,
1716 &ett_nlsp_hello_local_mtu
,
1717 &ett_nlsp_hello_clv_unknown
,
1719 &ett_nlsp_lsp_clv_area_addr
,
1720 &ett_nlsp_lsp_clv_mgt_info
,
1721 &ett_nlsp_lsp_clv_link_info
,
1722 &ett_nlsp_lsp_clv_svcs_info
,
1723 &ett_nlsp_lsp_clv_ext_routes
,
1724 &ett_nlsp_lsp_clv_unknown
,
1725 &ett_nlsp_csnp_lsp_entries
,
1726 &ett_nlsp_csnp_lsp_entry
,
1727 &ett_nlsp_csnp_clv_unknown
,
1728 &ett_nlsp_psnp_lsp_entries
,
1729 &ett_nlsp_psnp_lsp_entry
,
1730 &ett_nlsp_psnp_clv_unknown
,
1733 static ei_register_info ei
[] = {
1734 { &ei_nlsp_short_packet
, { "nlsp.short_packet", PI_MALFORMED
, PI_ERROR
, "Short packet", EXPFILL
}},
1735 { &ei_nlsp_long_packet
, { "nlsp.long_packet", PI_MALFORMED
, PI_ERROR
, "Long packet", EXPFILL
}},
1736 { &ei_nlsp_major_version
, { "nlsp.major_version.unknown", PI_PROTOCOL
, PI_WARN
, "Unknown NLSP version", EXPFILL
}},
1737 { &ei_nlsp_type
, { "nlsp.type.unknown", PI_PROTOCOL
, PI_WARN
, "Unknown NLSP packet type", EXPFILL
}},
1740 expert_module_t
* expert_nlsp
;
1742 proto_nlsp
= proto_register_protocol("NetWare Link Services Protocol",
1744 proto_register_field_array(proto_nlsp
, hf
, array_length(hf
));
1745 proto_register_subtree_array(ett
, array_length(ett
));
1746 expert_nlsp
= expert_register_protocol(proto_nlsp
);
1747 expert_register_field_array(expert_nlsp
, ei
, array_length(ei
));
1749 nlsp_handle
= register_dissector("nlsp", dissect_nlsp
, proto_nlsp
);
1753 proto_reg_handoff_nlsp(void)
1755 dissector_add_uint("ipx.socket", IPX_SOCKET_NLSP
, nlsp_handle
);
1759 * Editor modelines - https://www.wireshark.org/tools/modelines.html
1764 * indent-tabs-mode: t
1767 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
1768 * :indentSize=8:tabSize=8:noTabs=false: