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>
18 #include "packet-ipx.h"
20 void proto_register_nlsp(void);
21 void proto_reg_handoff_nlsp(void);
23 /* NLSP base header */
24 static int proto_nlsp = -1;
26 static int hf_nlsp_irpd = -1;
27 static int hf_nlsp_header_length = -1;
28 static int hf_nlsp_minor_version = -1;
29 static int hf_nlsp_nr = -1;
30 static int hf_nlsp_type = -1;
31 static int hf_nlsp_major_version = -1;
32 static int hf_nlsp_packet_length = -1;
33 static int hf_nlsp_hello_state = -1;
34 static int hf_nlsp_hello_multicast = -1;
35 static int hf_nlsp_hello_circuit_type = -1;
36 static int hf_nlsp_hello_holding_timer = -1;
37 static int hf_nlsp_hello_priority = -1;
38 static int hf_nlsp_lsp_sequence_number = -1;
39 static int hf_nlsp_lsp_checksum = -1;
40 static int hf_nlsp_lsp_p = -1;
41 static int hf_nlsp_lsp_attached_flag = -1;
42 static int hf_nlsp_lsp_lspdbol = -1;
43 static int hf_nlsp_lsp_router_type = -1;
44 static int hf_nlsp_lsp_link_info_clv_flags_cost_present = -1;
45 static int hf_nlsp_lsp_link_info_clv_flags_cost_metric = -1;
46 static int hf_nlsp_lsp_link_info_clv_flags_cost = -1;
48 /* Generated from convert_proto_tree_add_text.pl */
49 static int hf_nlsp_psnp_lsp_checksum = -1;
50 static int hf_nlsp_csnp_start_lsp_id_source_id = -1;
51 static int hf_nlsp_svcs_info_node_number = -1;
52 static int hf_nlsp_ext_routes_rip_delay = -1;
53 static int hf_nlsp_psnp_source_id_system_id = -1;
54 static int hf_nlsp_svcs_info_socket = -1;
55 static int hf_nlsp_hello_sending_router_system_id = -1;
56 static int hf_nlsp_csnp_start_lsp_id_lsp_number = -1;
57 static int hf_nlsp_lsp_id_system_id = -1;
58 static int hf_nlsp_psnp_lsp_id_pseudonode_id = -1;
59 static int hf_nlsp_csnp_end_lsp_id_lsp_number = -1;
60 static int hf_nlsp_remaining_lifetime = -1;
61 static int hf_nlsp_csnp_remaining_lifetime = -1;
62 static int hf_nlsp_psnp_lsp_id_source_id = -1;
63 static int hf_nlsp_ext_routes_hops = -1;
64 static int hf_nlsp_hello_local_mtu_mtu_size = -1;
65 static int hf_nlsp_link_info_throughput = -1;
66 static int hf_nlsp_link_info_media_type = -1;
67 static int hf_nlsp_mgt_info_name = -1;
68 static int hf_nlsp_mgt_info_node_number = -1;
69 static int hf_nlsp_csnp_end_lsp_id_source_id = -1;
70 static int hf_nlsp_csnp_lsp_id_pseudonode_id = -1;
71 static int hf_nlsp_psnp_lsp_sequence_number = -1;
72 static int hf_nlsp_link_info_mtu_size = -1;
73 static int hf_nlsp_lsp_id_lsp_number = -1;
74 static int hf_nlsp_unknown_code = -1;
75 static int hf_nlsp_mgt_info_ipx_version_number = -1;
76 static int hf_nlsp_link_info_router_pseudonode_id = -1;
77 static int hf_nlsp_psnp_source_id_pseudonode_id = -1;
78 static int hf_nlsp_csnp_lsp_id_lsp_number = -1;
79 static int hf_nlsp_csnp_source_id_pseudonode_id = -1;
80 static int hf_nlsp_csnp_end_lsp_id_pseudonode_id = -1;
81 static int hf_nlsp_csnp_lsp_sequence_number = -1;
82 static int hf_nlsp_link_info_router_system_id = -1;
83 static int hf_nlsp_svcs_info_type = -1;
84 static int hf_nlsp_csnp_lsp_checksum = -1;
85 static int hf_nlsp_hello_local_wan_circuit_id = -1;
86 static int hf_nlsp_svcs_info_service_name = -1;
87 static int hf_nlsp_mgt_info_name_length = -1;
88 static int hf_nlsp_neighbor = -1;
89 static int hf_nlsp_area_address_network_number = -1;
90 static int hf_nlsp_link_info_delay = -1;
91 static int hf_nlsp_csnp_start_lsp_id_pseudonode_id = -1;
92 static int hf_nlsp_svcs_info_network_number = -1;
93 static int hf_nlsp_csnp_source_id_system_id = -1;
94 static int hf_nlsp_mgt_info_network_number = -1;
95 static int hf_nlsp_hello_designated_router_pseudonode_id = -1;
96 static int hf_nlsp_lsp_id_pseudonode_id = -1;
97 static int hf_nlsp_csnp_lsp_id_source_id = -1;
98 static int hf_nlsp_psnp_remaining_lifetime = -1;
99 static int hf_nlsp_area_address_mask = -1;
100 static int hf_nlsp_hello_designated_router_system_id = -1;
101 static int hf_nlsp_svcs_info_hops_to_reach_the_service = -1;
102 static int hf_nlsp_psnp_lsp_id_lsp_number = -1;
103 static int hf_nlsp_ext_routes_network_number = -1;
105 static expert_field ei_nlsp_short_packet = EI_INIT;
106 static expert_field ei_nlsp_long_packet = EI_INIT;
107 static expert_field ei_nlsp_major_version = EI_INIT;
108 static expert_field ei_nlsp_type = EI_INIT;
110 static gint ett_nlsp = -1;
111 static gint ett_nlsp_hello_clv_area_addr = -1;
112 static gint ett_nlsp_hello_clv_neighbors = -1;
113 static gint ett_nlsp_hello_local_mtu = -1;
114 static gint ett_nlsp_hello_clv_unknown = -1;
115 static gint ett_nlsp_lsp_info = -1;
116 static gint ett_nlsp_lsp_clv_area_addr = -1;
117 static gint ett_nlsp_lsp_clv_mgt_info = -1;
118 static gint ett_nlsp_lsp_clv_link_info = -1;
119 static gint ett_nlsp_lsp_clv_svcs_info = -1;
120 static gint ett_nlsp_lsp_clv_ext_routes = -1;
121 static gint ett_nlsp_lsp_clv_unknown = -1;
122 static gint ett_nlsp_csnp_lsp_entries = -1;
123 static gint ett_nlsp_csnp_lsp_entry = -1;
124 static gint ett_nlsp_csnp_clv_unknown = -1;
125 static gint ett_nlsp_psnp_lsp_entries = -1;
126 static gint ett_nlsp_psnp_lsp_entry = -1;
127 static gint ett_nlsp_psnp_clv_unknown = -1;
129 #define PACKET_TYPE_MASK 0x1f
134 * http://www.cisco.com/univercd/cc/td/doc/cisintwk/ito_doc/nlsp.htm
136 * for some information about Hello packets.
139 #define NLSP_TYPE_L1_HELLO 15
140 #define NLSP_TYPE_WAN_HELLO 17
141 #define NLSP_TYPE_L1_LSP 18
142 #define NLSP_TYPE_L1_CSNP 24
143 #define NLSP_TYPE_L1_PSNP 26
145 static const value_string nlsp_packet_type_vals[] = {
146 { NLSP_TYPE_L1_HELLO, "L1 Hello"},
147 { NLSP_TYPE_WAN_HELLO, "WAN Hello"},
148 { NLSP_TYPE_L1_LSP, "L1 LSP"},
149 { NLSP_TYPE_L1_CSNP, "L1 CSNP"},
150 { NLSP_TYPE_L1_PSNP, "L1 PSNP"},
154 static const value_string nlsp_attached_flag_vals[] = {
155 { 0, "Other routing areas cannot be reached through this router"},
156 { 1, "Other routing areas can be reached through this router"},
160 static const value_string nlsp_router_type_vals[] = {
161 { 1, "Level 1 Router"},
162 { 3, "Level 1 and Level 2 Router"},
166 static const true_false_string tfs_internal_external = { "Internal", "External" };
169 * Our sub-packet dismantle structure for CLV's
172 int optcode; /* code for option */
173 const char *tree_text; /* text for fold out */
174 gint *tree_id; /* id for add_item */
175 void (*dissect)(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree,
176 int offset, int length);
180 * Name: nlsp_dissect_clvs()
183 * Dispatch routine to shred all the CLVs in a packet. We just
184 * walk through the clv entries in the packet. For each one, we
185 * search the passed in valid clv's for this protocol (opts) for
186 * a matching code. If found, we add to the display tree and
187 * then call the dissector. If it is not, we just post an
188 * "unknown" clv entry using the passed in unknown clv tree id.
189 * XXX: The "unknown tree id" is an 'ett' index for use
190 * when creating a subtree;
191 * Since the 'unknown' subtree was not actually used in the
192 * code below, what was the intention for this ?
193 * For now: code related to creating an 'unknown' subtrree
197 * tvbuff_t * : tvbuffer for packet data
198 * proto_tree * : protocol display tree to fill out. May be NULL
199 * int : offset into packet data where we are.
200 * nlsp_clv_handle_t * : NULL dissector terminated array of codes
201 * and handlers (along with tree text and tree id's).
202 * int : length of CLV area.
203 * int : unknown clv tree id
206 * void, but we will add to proto tree if !NULL.
209 nlsp_dissect_clvs(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
210 const nlsp_clv_handle_t *opts, int len, int unknown_tree_id _U_)
215 proto_tree *clv_tree;
218 code = tvb_get_guint8(tvb, offset);
224 length = tvb_get_guint8(tvb, offset);
230 if ( len < length ) {
231 proto_tree_add_expert_format(tree, pinfo, &ei_nlsp_short_packet, tvb, offset, -1,
232 "Short CLV header (%d vs %d)", length, len );
236 while ((opts[q].dissect != NULL )&&( opts[q].optcode != code )){
239 if ( opts[q].dissect ) {
240 /* adjust by 2 for code/len octets */
241 clv_tree = proto_tree_add_subtree_format(tree, tvb, offset - 2,
242 length + 2, *opts[q].tree_id, NULL, "%s (%u)",
243 opts[q].tree_text, length );
244 opts[q].dissect(tvb, pinfo, clv_tree, offset,
248 ti = proto_tree_add_uint_format_value(tree, hf_nlsp_unknown_code, tvb, offset - 2,
249 1, code, "%u (%u)", code, length);
250 proto_item_set_len(ti, length + 2);
258 * Name: dissect_area_address_clv()
261 * Decode an area address clv.
264 * tvbuff_t * : tvbuffer for packet data
265 * proto_tree * : protocol display tree to fill out. May be NULL
266 * int : offset into packet data where we are.
267 * int : length of clv we are decoding
270 * void, but we will add to proto tree if !NULL.
273 dissect_area_address_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
278 proto_tree_add_expert_format(tree, pinfo, &ei_nlsp_short_packet, tvb, offset, -1,
279 "Short area address entry");
282 proto_tree_add_item(tree, hf_nlsp_area_address_network_number, tvb, offset, 4, ENC_BIG_ENDIAN);
288 proto_tree_add_expert_format(tree, pinfo, &ei_nlsp_short_packet, tvb, offset, -1,
289 "Short area address entry");
292 proto_tree_add_item(tree, hf_nlsp_area_address_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
300 * Name: dissect_neighbor_clv()
303 * Decode an neighbor clv.
306 * tvbuff_t * : tvbuffer for packet data
307 * proto_tree * : protocol display tree to fill out. May be NULL
308 * int : offset into packet data where we are.
309 * int : length of clv we are decoding
312 * void, but we will add to proto tree if !NULL.
315 dissect_neighbor_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
320 proto_tree_add_expert_format(tree, pinfo, &ei_nlsp_short_packet,
321 tvb, offset, -1, "Short neighbor entry");
324 proto_tree_add_item(tree, hf_nlsp_neighbor, tvb, offset, 6, ENC_NA);
331 * Name: dissect_hello_local_mtu_clv()
334 * Decode for a hello packet's local MTU clv.
337 * tvbuff_t * : tvbuffer for packet data
338 * proto_tree * : protocol display tree to fill out. May be NULL
339 * int : offset into packet data where we are.
340 * int : length of clv we are decoding
343 * void, but we will add to proto tree if !NULL.
346 dissect_hello_local_mtu_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
350 proto_tree_add_expert_format(tree, pinfo, &ei_nlsp_short_packet, tvb, offset, -1,
351 "Short link info entry");
354 proto_tree_add_item(tree, hf_nlsp_hello_local_mtu_mtu_size, tvb, offset, 4, ENC_BIG_ENDIAN);
357 static const nlsp_clv_handle_t clv_hello_opts[] = {
361 &ett_nlsp_hello_clv_area_addr,
362 dissect_area_address_clv
367 &ett_nlsp_hello_clv_neighbors,
373 &ett_nlsp_hello_local_mtu,
374 dissect_hello_local_mtu_clv
386 * Name: nlsp_dissect_nlsp_hello()
389 * This procedure rips apart NLSP hellos.
392 * tvbuff_t * : tvbuffer for packet data
393 * proto_tree * : protocol display tree to add to. May be NULL.
394 * int offset : our offset into packet data.
395 * int : hello type, a la NLSP_TYPE_* values
396 * int : header length of packet.
399 * void, will modify proto_tree if not NULL.
401 #define NLSP_HELLO_CTYPE_MASK 0x03
402 #define NLSP_HELLO_STATE_MASK 0xC0
403 #define NLSP_HELLO_MULTICAST_MASK 0x10
405 static const value_string nlsp_hello_state_vals[] = {
407 { 1, "Initializing" },
412 #define NLSP_HELLO_TYPE_RESERVED 0
413 #define NLSP_HELLO_TYPE_LEVEL_1 1
414 #define NLSP_HELLO_TYPE_LEVEL_2 2
415 #define NLSP_HELLO_TYPE_LEVEL_12 3
417 static const value_string nlsp_hello_circuit_type_vals[] = {
418 { NLSP_HELLO_TYPE_RESERVED, "Reserved 0 (discard PDU)"},
419 { NLSP_HELLO_TYPE_LEVEL_1, "Level 1 only"},
420 { NLSP_HELLO_TYPE_LEVEL_2, "Level 2 only"},
421 { NLSP_HELLO_TYPE_LEVEL_12, "Level 1 and 2"},
425 #define NLSP_HELLO_PRIORITY_MASK 0x7f
428 nlsp_dissect_nlsp_hello(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
429 int offset, int hello_type, int header_length)
431 guint16 packet_length;
434 if (hello_type == NLSP_TYPE_WAN_HELLO) {
435 proto_tree_add_item(tree, hf_nlsp_hello_state, tvb,
436 offset, 1, ENC_BIG_ENDIAN);
438 proto_tree_add_item(tree, hf_nlsp_hello_multicast, tvb,
439 offset, 1, ENC_BIG_ENDIAN);
441 proto_tree_add_item(tree, hf_nlsp_hello_circuit_type, tvb,
442 offset, 1, ENC_BIG_ENDIAN);
445 proto_tree_add_item(tree, hf_nlsp_hello_sending_router_system_id, tvb, offset, 6, ENC_NA);
447 col_append_fstr(pinfo->cinfo, COL_INFO, ", System ID: %s",
448 tvb_ether_to_str(tvb, offset));
452 proto_tree_add_item(tree, hf_nlsp_hello_holding_timer, tvb, offset, 2, ENC_BIG_ENDIAN);
455 packet_length = tvb_get_ntohs(tvb, offset);
456 proto_tree_add_uint(tree, hf_nlsp_packet_length, tvb, offset, 2, packet_length);
459 proto_tree_add_item(tree, hf_nlsp_hello_priority, tvb, offset, 1, ENC_BIG_ENDIAN);
462 if (hello_type == NLSP_TYPE_WAN_HELLO) {
463 proto_tree_add_item(tree, hf_nlsp_hello_local_wan_circuit_id, tvb, offset, 1, ENC_BIG_ENDIAN);
466 proto_tree_add_item(tree, hf_nlsp_hello_designated_router_system_id, tvb, offset, 6, ENC_NA);
467 proto_tree_add_item(tree, hf_nlsp_hello_designated_router_pseudonode_id, tvb, offset+6, 1, ENC_BIG_ENDIAN);
471 len = packet_length - header_length;
473 proto_tree_add_expert_format(tree, pinfo, &ei_nlsp_long_packet, tvb, offset, -1,
474 "packet header length %d went beyond packet",
480 * Now, we need to decode our CLVs. We need to pass in
481 * our list of valid ones!
483 nlsp_dissect_clvs(tvb, pinfo, tree, offset,
484 clv_hello_opts, len, ett_nlsp_hello_clv_unknown);
488 * Name: dissect_lsp_mgt_info_clv()
491 * Decode for a lsp packet's management information clv.
494 * tvbuff_t * : tvbuffer for packet data
495 * proto_tree * : protocol display tree to fill out. May be NULL
496 * int : offset into packet data where we are.
497 * int : length of clv we are decoding
500 * void, but we will add to proto tree if !NULL.
503 dissect_lsp_mgt_info_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
509 proto_tree_add_expert_format(tree, pinfo, &ei_nlsp_short_packet, tvb, offset, -1,
510 "Short management info entry");
513 proto_tree_add_item(tree, hf_nlsp_mgt_info_network_number, tvb, offset, 4, ENC_BIG_ENDIAN);
518 proto_tree_add_expert_format(tree, pinfo, &ei_nlsp_short_packet, tvb, offset, -1,
519 "Short management info entry");
522 proto_tree_add_item(tree, hf_nlsp_mgt_info_node_number, tvb, offset, 6, ENC_NA);
527 proto_tree_add_expert_format(tree, pinfo, &ei_nlsp_short_packet, tvb, offset, -1,
528 "Short management info entry");
532 proto_tree_add_item(tree, hf_nlsp_mgt_info_ipx_version_number, tvb, offset, 1, ENC_BIG_ENDIAN);
537 proto_tree_add_expert_format(tree, pinfo, &ei_nlsp_short_packet, tvb, offset, -1,
538 "Short management info entry");
541 name_length = tvb_get_guint8(tvb, offset);
542 proto_tree_add_item(tree, hf_nlsp_mgt_info_name_length, tvb, offset, 1, ENC_BIG_ENDIAN);
546 if (name_length != 0) {
547 if (length < name_length) {
548 proto_tree_add_expert_format(tree, pinfo, &ei_nlsp_short_packet, tvb, offset, -1,
549 "Short management info entry");
552 proto_tree_add_item(tree, hf_nlsp_mgt_info_name, tvb, offset, name_length, ENC_NA|ENC_ASCII);
557 * Name: dissect_lsp_link_info_clv()
560 * Decode for a lsp packet's link information clv.
563 * tvbuff_t * : tvbuffer for packet data
564 * proto_tree * : protocol display tree to fill out. May be NULL
565 * int : offset into packet data where we are.
566 * int : length of clv we are decoding
569 * void, but we will add to proto tree if !NULL.
571 static const value_string media_type_vals[] = {
572 { 0x0000, "Generic LAN" },
573 { 0x8000, "Generic WAN" },
574 { 0x0001, "Localtalk" },
575 { 0x0002, "Ethernet II" },
576 { 0x0003, "IEEE 802.3 with IEEE 802.2 without SNAP" },
577 { 0x0005, "IEEE 802.3 with IPX header and no 802.2 header" },
578 { 0x000A, "IEEE 802.3 with IEEE 802.2 and SNAP" },
579 { 0x0004, "IEEE 802.5 with IEEE 802.2 without SNAP" },
580 { 0x000B, "IEEE 802.5 with IEEE 802.2 and SNAP" },
581 { 0x0006, "IEEE 802.4" },
582 { 0x0007, "IBM PC Network II" },
583 { 0x0008, "Gateway G/Net" },
584 { 0x0009, "Proteon ProNET" },
585 { 0x000C, "Racore LANPAC" },
587 { 0x000E, "ARCnet" },
588 { 0x000F, "IBM PC Network II with 802.2 without SNAP" },
589 { 0x0010, "IBM PC Network II with 802.2 and SNAP" },
590 { 0x0011, "Corvus OmniNet at 4 Mbps" },
591 { 0x0012, "Harris Adacom" },
592 { 0x0013, "IP tunnel" },
593 { 0x8013, "IP Relay" },
594 { 0x0014, "FDDI with 802.2 without SNAP" },
595 { 0x0015, "Commtex IVDLAN" },
596 { 0x0016, "Dataco OSI" },
597 { 0x0017, "FDDI with 802.2 and SNAP" },
598 { 0x0018, "IBM SDLC tunnel" },
599 { 0x0019, "PC Office frame" },
600 { 0x001A, "Hypercommunications WAIDNET" },
602 { 0x801D, "Proxim RangeLAN" },
604 { 0x801F, "Frame Relay" },
605 { 0x0020, "Integrated Workstations BUS-NET" },
606 { 0x8021, "Novell SNA Links" },
611 dissect_lsp_link_info_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
617 proto_tree_add_expert_format(tree, pinfo, &ei_nlsp_short_packet, tvb, offset, -1,
618 "Short link info entry");
622 flags_cost = tvb_get_guint8(tvb, offset);
623 proto_tree_add_item(tree, hf_nlsp_lsp_link_info_clv_flags_cost_present, tvb, offset, 1, ENC_BIG_ENDIAN);
624 if (!(flags_cost & 0x80)) {
626 * 0x80 clear => cost present.
628 proto_tree_add_item(tree, hf_nlsp_lsp_link_info_clv_flags_cost_metric, tvb, offset, 1, ENC_BIG_ENDIAN);
629 proto_tree_add_item(tree, hf_nlsp_lsp_link_info_clv_flags_cost, tvb, offset, 1, ENC_BIG_ENDIAN);
636 proto_tree_add_expert_format(tree, pinfo, &ei_nlsp_short_packet, tvb, offset, -1,
637 "Short link info entry");
640 offset += 3; /* Reserved */
644 proto_tree_add_expert_format(tree, pinfo, &ei_nlsp_short_packet, tvb, offset, -1,
645 "Short link info entry");
649 proto_tree_add_item(tree, hf_nlsp_link_info_router_system_id, tvb, offset, 6, ENC_NA);
650 proto_tree_add_item(tree, hf_nlsp_link_info_router_pseudonode_id, tvb, offset+6, 1, ENC_BIG_ENDIAN);
655 proto_tree_add_expert_format(tree, pinfo, &ei_nlsp_short_packet, tvb, offset, -1,
656 "Short link info entry");
659 proto_tree_add_item(tree, hf_nlsp_link_info_mtu_size, tvb, offset, 4, ENC_BIG_ENDIAN);
664 proto_tree_add_expert_format(tree, pinfo, &ei_nlsp_short_packet, tvb, offset, -1,
665 "Short link info entry");
668 proto_tree_add_item(tree, hf_nlsp_link_info_delay, tvb, offset, 4, ENC_BIG_ENDIAN);
673 proto_tree_add_expert_format(tree, pinfo, &ei_nlsp_short_packet, tvb, offset, -1,
674 "Short link info entry");
677 proto_tree_add_item(tree, hf_nlsp_link_info_throughput, tvb, offset, 4, ENC_BIG_ENDIAN);
682 proto_tree_add_expert_format(tree, pinfo, &ei_nlsp_short_packet, tvb, offset, -1,
683 "Short link info entry");
686 proto_tree_add_item(tree, hf_nlsp_link_info_media_type, tvb, offset, 2, ENC_BIG_ENDIAN);
690 * Name: dissect_lsp_svcs_info_clv()
693 * Decode for a lsp packet's services information clv.
696 * tvbuff_t * : tvbuffer for packet data
697 * proto_tree * : protocol display tree to fill out. May be NULL
698 * int : offset into packet data where we are.
699 * int : length of clv we are decoding
702 * void, but we will add to proto tree if !NULL.
705 dissect_lsp_svcs_info_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
709 proto_tree_add_expert_format(tree, pinfo, &ei_nlsp_short_packet, tvb, offset, -1,
710 "Short services info entry");
714 proto_tree_add_item(tree, hf_nlsp_svcs_info_hops_to_reach_the_service, tvb, offset, 1, ENC_BIG_ENDIAN);
719 proto_tree_add_expert_format(tree, pinfo, &ei_nlsp_short_packet, tvb, offset, -1,
720 "Short services info entry");
724 proto_tree_add_item(tree, hf_nlsp_svcs_info_network_number, tvb, offset, 4, ENC_BIG_ENDIAN);
729 proto_tree_add_expert_format(tree, pinfo, &ei_nlsp_short_packet, tvb, offset, -1,
730 "Short services info entry");
734 proto_tree_add_item(tree, hf_nlsp_svcs_info_node_number, tvb, offset, 6, ENC_NA);
739 proto_tree_add_expert_format(tree, pinfo, &ei_nlsp_short_packet, tvb, offset, -1,
740 "Short services info entry");
744 proto_tree_add_item(tree, hf_nlsp_svcs_info_socket, tvb, offset, 2, ENC_BIG_ENDIAN);
749 proto_tree_add_expert_format(tree, pinfo, &ei_nlsp_short_packet, tvb, offset, -1,
750 "Short services info entry");
754 proto_tree_add_item(tree, hf_nlsp_svcs_info_type, tvb, offset, 2, ENC_BIG_ENDIAN);
759 proto_tree_add_item(tree, hf_nlsp_svcs_info_service_name, tvb, offset, length, ENC_NA|ENC_ASCII);
765 * Name: dissect_lsp_ext_routes_clv()
768 * Decode for a lsp packet's external routes clv.
771 * tvbuff_t * : tvbuffer for packet data
772 * proto_tree * : protocol display tree to fill out. May be NULL
773 * int : offset into packet data where we are.
774 * int : length of clv we are decoding
777 * void, but we will add to proto tree if !NULL.
780 dissect_lsp_ext_routes_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
784 proto_tree_add_item(tree, hf_nlsp_ext_routes_hops, tvb, offset, 1, ENC_BIG_ENDIAN);
789 proto_tree_add_expert_format(tree, pinfo, &ei_nlsp_short_packet, tvb, offset, -1,
790 "Short external routes entry");
794 proto_tree_add_item(tree, hf_nlsp_ext_routes_network_number, tvb, offset, 4, ENC_BIG_ENDIAN);
799 proto_tree_add_expert_format(tree, pinfo, &ei_nlsp_short_packet, tvb, offset, -1,
800 "Short external routes entry");
804 proto_tree_add_item(tree, hf_nlsp_ext_routes_rip_delay, tvb, offset, 2, ENC_BIG_ENDIAN);
810 static const nlsp_clv_handle_t clv_l1_lsp_opts[] = {
814 &ett_nlsp_lsp_clv_area_addr,
815 dissect_area_address_clv
819 "Management information",
820 &ett_nlsp_lsp_clv_mgt_info,
821 dissect_lsp_mgt_info_clv
826 &ett_nlsp_lsp_clv_link_info,
827 dissect_lsp_link_info_clv
831 "Services information",
832 &ett_nlsp_lsp_clv_svcs_info,
833 dissect_lsp_svcs_info_clv
838 &ett_nlsp_lsp_clv_ext_routes,
839 dissect_lsp_ext_routes_clv
851 * Name: nlsp_dissect_nlsp_lsp()
854 * Print out the LSP part of the main header and then call the CLV
855 * de-mangler with the right list of valid CLVs.
858 * tvbuff_t * : tvbuffer for packet data
859 * proto_tree * : protocol display tree to add to. May be NULL.
860 * int offset : our offset into packet data.
861 * int : header length of packet.
864 * void, but we will add to proto tree if !NULL.
866 /* P | ATT | OVERFLOW | ROUTER TYPE FIELD description */
867 #define NLSP_LSP_PARTITION_MASK 0x80
868 #define NLSP_LSP_PARTITION_SHIFT 7
869 #define NLSP_LSP_PARTITION(info) (((info) & NLSP_LSP_PARTITION_MASK) >> NLSP_LSP_PARTITION_SHIFT)
871 #define NLSP_LSP_ATT_MASK 0x78
872 #define NLSP_LSP_ATT_SHIFT 3
873 #define NLSP_LSP_ATT(info) (((info) & NLSP_LSP_ATT_MASK) >> NLSP_LSP_ATT_SHIFT)
875 #define NLSP_LSP_OVERFLOW_MASK 0x04
876 #define NLSP_LSP_OVERFLOW_SHIFT 2
877 #define NLSP_LSP_OVERFLOW(info) (((info) & NLSP_LSP_OVERFLOW_MASK) >> NLSP_LSP_OVERFLOW_SHIFT)
879 #define NLSP_LSP_ROUTER_TYPE_MASK 0x03
880 #define NLSP_LSP_ROUTER_TYPE(info) ((info) & NLSP_LSP_ROUTER_TYPE_MASK)
883 nlsp_dissect_nlsp_lsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
884 int offset, int header_length)
886 guint16 packet_length;
887 guint16 remaining_lifetime;
888 guint32 sequence_number;
891 packet_length = tvb_get_ntohs(tvb, offset);
892 proto_tree_add_uint(tree, hf_nlsp_packet_length, tvb,
893 offset, 2, packet_length);
896 remaining_lifetime = tvb_get_ntohs(tvb, offset);
897 proto_tree_add_uint(tree, hf_nlsp_remaining_lifetime, tvb, offset, 2, remaining_lifetime);
900 col_append_fstr(pinfo->cinfo, COL_INFO, ", LSP ID: %s",
901 tvb_ether_to_str(tvb, offset));
903 proto_tree_add_item(tree, hf_nlsp_lsp_id_system_id, tvb, offset, 6, ENC_NA);
906 /* XXX - append the pseudonode ID */
907 proto_tree_add_item(tree, hf_nlsp_lsp_id_pseudonode_id, tvb, offset, 1, ENC_BIG_ENDIAN);
910 proto_tree_add_item(tree, hf_nlsp_lsp_id_lsp_number, tvb, offset, 1, ENC_BIG_ENDIAN);
913 sequence_number = tvb_get_ntohl(tvb, offset);
914 col_append_fstr(pinfo->cinfo, COL_INFO,
915 ", Sequence: 0x%08x, Lifetime: %us",
916 sequence_number, remaining_lifetime);
918 proto_tree_add_uint(tree, hf_nlsp_lsp_sequence_number, tvb,
919 offset, 4, sequence_number);
922 /* XXX -> we could validate the cksum here! */
923 proto_tree_add_checksum(tree, tvb, offset, hf_nlsp_lsp_checksum, -1, NULL, pinfo, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS);
927 proto_tree_add_item(tree, hf_nlsp_lsp_p, tvb,
928 offset, 1, ENC_BIG_ENDIAN);
929 proto_tree_add_item(tree, hf_nlsp_lsp_attached_flag, tvb,
930 offset, 1, ENC_BIG_ENDIAN);
931 proto_tree_add_item(tree, hf_nlsp_lsp_lspdbol, tvb,
932 offset, 1, ENC_BIG_ENDIAN);
933 proto_tree_add_item(tree, hf_nlsp_lsp_router_type, tvb,
934 offset, 1, ENC_BIG_ENDIAN);
938 len = packet_length - header_length;
940 proto_tree_add_expert_format(tree, pinfo, &ei_nlsp_long_packet, tvb, offset, -1,
941 "packet header length %d went beyond packet",
947 * Now, we need to decode our CLVs. We need to pass in
948 * our list of valid ones!
950 nlsp_dissect_clvs(tvb, pinfo, tree, offset,
951 clv_l1_lsp_opts, len, ett_nlsp_lsp_clv_unknown);
955 * Name: dissect_snp_lsp_entries()
958 * All the snp packets use a common payload format. We have up
959 * to n entries (based on length), which are made of:
960 * 2 : remaining life time
962 * 4 : sequence number
966 * tvbuff_t * : tvbuffer for packet data
967 * proto_tree * : protocol display tree to fill out. May be NULL
968 * int : offset into packet data where we are.
969 * int : length of payload to decode.
972 * void, but we will add to proto tree if !NULL.
975 dissect_csnp_lsp_entries(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
982 proto_tree_add_expert_format(tree, pinfo, &ei_nlsp_short_packet, tvb, offset, -1,
983 "Short CSNP header entry");
987 subtree = proto_tree_add_subtree_format(tree, tvb, offset, 16,
988 ett_nlsp_csnp_lsp_entry, NULL, "LSP-ID: %s, Sequence: 0x%08x, Lifetime: %5us, Checksum: 0x%04x",
989 tvb_ether_to_str(tvb, offset+2), /* XXX - rest of system ID */
990 tvb_get_ntohl(tvb, offset+10),
991 tvb_get_ntohs(tvb, offset),
992 tvb_get_ntohs(tvb, offset+14));
994 proto_tree_add_item(subtree, hf_nlsp_csnp_lsp_id_source_id, tvb, offset+2, 6, ENC_NA);
995 proto_tree_add_item(subtree, hf_nlsp_csnp_lsp_id_pseudonode_id, tvb, offset+8, 1, ENC_BIG_ENDIAN);
996 proto_tree_add_item(subtree, hf_nlsp_csnp_lsp_id_lsp_number, tvb, offset+9, 1, ENC_BIG_ENDIAN);
998 proto_tree_add_item(subtree, hf_nlsp_csnp_lsp_sequence_number, tvb, offset+10, 4, ENC_BIG_ENDIAN);
1000 proto_tree_add_item(subtree, hf_nlsp_csnp_remaining_lifetime, tvb, offset, 2, ENC_BIG_ENDIAN);
1002 proto_tree_add_checksum(subtree, tvb, offset+14, hf_nlsp_csnp_lsp_checksum, -1, NULL, pinfo, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS);
1010 dissect_psnp_lsp_entries(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset,
1013 proto_tree *subtree;
1015 while (length > 0) {
1017 proto_tree_add_expert_format(tree, pinfo, &ei_nlsp_short_packet, tvb, offset, -1,
1018 "Short PSNP header entry");
1022 subtree = proto_tree_add_subtree_format(tree, tvb, offset, 16,
1023 ett_nlsp_psnp_lsp_entry, NULL, "LSP-ID: %s, Sequence: 0x%08x, Lifetime: %5us, Checksum: 0x%04x",
1024 tvb_ether_to_str(tvb, offset+2), /* XXX - rest of system ID */
1025 tvb_get_ntohl(tvb, offset+10),
1026 tvb_get_ntohs(tvb, offset),
1027 tvb_get_ntohs(tvb, offset+14));
1029 proto_tree_add_item(subtree, hf_nlsp_psnp_lsp_id_source_id, tvb, offset+2, 6, ENC_NA);
1030 proto_tree_add_item(subtree, hf_nlsp_psnp_lsp_id_pseudonode_id, tvb, offset+8, 1, ENC_BIG_ENDIAN);
1031 proto_tree_add_item(subtree, hf_nlsp_psnp_lsp_id_lsp_number, tvb, offset+9, 1, ENC_BIG_ENDIAN);
1033 proto_tree_add_item(subtree, hf_nlsp_psnp_lsp_sequence_number, tvb, offset+10, 4, ENC_BIG_ENDIAN);
1035 proto_tree_add_item(subtree, hf_nlsp_psnp_remaining_lifetime, tvb, offset, 2, ENC_BIG_ENDIAN);
1037 proto_tree_add_checksum(subtree, tvb, offset+14, hf_nlsp_psnp_lsp_checksum, -1, NULL, pinfo, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS);
1044 static const nlsp_clv_handle_t clv_l1_csnp_opts[] = {
1048 &ett_nlsp_csnp_lsp_entries,
1049 dissect_csnp_lsp_entries
1061 * Name: nlsp_dissect_nlsp_csnp()
1064 * Tear apart a L1 CSNP header and then call into payload dissect
1065 * to pull apart the lsp id payload.
1068 * tvbuff_t * : tvbuffer for packet data
1069 * proto_tree * : protocol display tree to add to. May be NULL.
1070 * int offset : our offset into packet data.
1071 * int : header length of packet.
1074 * void, but we will add to proto tree if !NULL.
1077 nlsp_dissect_nlsp_csnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1078 int offset, int header_length)
1080 guint16 packet_length;
1083 packet_length = tvb_get_ntohs(tvb, offset);
1084 proto_tree_add_uint(tree, hf_nlsp_packet_length, tvb, offset, 2, packet_length);
1087 col_append_fstr(pinfo->cinfo, COL_INFO, ", Source ID: %s",
1088 tvb_ether_to_str(tvb, offset));
1089 proto_tree_add_item(tree, hf_nlsp_csnp_source_id_system_id, tvb, offset, 6, ENC_NA);
1091 proto_tree_add_item(tree, hf_nlsp_csnp_source_id_pseudonode_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1094 col_append_fstr(pinfo->cinfo, COL_INFO, ", Start LSP ID: %s",
1095 tvb_ether_to_str(tvb, offset));
1096 proto_tree_add_item(tree, hf_nlsp_csnp_start_lsp_id_source_id, tvb, offset, 6, ENC_NA);
1098 /* XXX - append the pseudonode ID */
1099 proto_tree_add_item(tree, hf_nlsp_csnp_start_lsp_id_pseudonode_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1102 proto_tree_add_item(tree, hf_nlsp_csnp_start_lsp_id_lsp_number, tvb, offset, 1, ENC_BIG_ENDIAN);
1105 col_append_fstr(pinfo->cinfo, COL_INFO, ", End LSP ID: %s",
1106 tvb_ether_to_str(tvb, offset));
1107 proto_tree_add_item(tree, hf_nlsp_csnp_end_lsp_id_source_id, tvb, offset, 6, ENC_NA);
1109 /* XXX - append the pseudonode ID */
1110 proto_tree_add_item(tree, hf_nlsp_csnp_end_lsp_id_pseudonode_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1112 proto_tree_add_item(tree, hf_nlsp_csnp_end_lsp_id_lsp_number, tvb, offset, 1, ENC_BIG_ENDIAN);
1115 len = packet_length - header_length;
1119 /* Call into payload dissector */
1120 nlsp_dissect_clvs(tvb, pinfo, tree, offset,
1121 clv_l1_csnp_opts, len, ett_nlsp_csnp_clv_unknown);
1124 static const nlsp_clv_handle_t clv_l1_psnp_opts[] = {
1128 &ett_nlsp_psnp_lsp_entries,
1129 dissect_psnp_lsp_entries
1141 * Name: nlsp_dissect_nlsp_psnp()
1144 * Tear apart a L1 PSNP header and then call into payload dissect
1145 * to pull apart the lsp id payload.
1148 * tvbuff_t * : tvbuffer for packet data
1149 * proto_tree * : protocol display tree to add to. May be NULL.
1150 * int offset : our offset into packet data.
1151 * int : header length of packet.
1154 * void, but we will add to proto tree if !NULL.
1157 nlsp_dissect_nlsp_psnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1158 int offset, int header_length)
1160 guint16 packet_length;
1163 packet_length = tvb_get_ntohs(tvb, offset);
1164 proto_tree_add_uint(tree, hf_nlsp_packet_length, tvb,
1165 offset, 2, packet_length);
1168 col_append_fstr(pinfo->cinfo, COL_INFO, ", Source ID: %s",
1169 tvb_ether_to_str(tvb, offset));
1170 proto_tree_add_item(tree, hf_nlsp_psnp_source_id_system_id, tvb, offset, 6, ENC_NA);
1172 /* XXX - add the pseudonode ID */
1173 proto_tree_add_item(tree, hf_nlsp_psnp_source_id_pseudonode_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1176 len = packet_length - header_length;
1180 /* Call into payload dissector */
1181 nlsp_dissect_clvs(tvb, pinfo, tree, offset,
1182 clv_l1_psnp_opts, len, ett_nlsp_psnp_clv_unknown);
1186 * Name: dissect_nlsp()
1189 * Main entry area for nlsp de-mangling. This will build the
1190 * main nlsp tree data and call the sub-protocols as needed.
1193 * tvbuff_t * : tvbuffer for packet data
1194 * packet_info * : info for current packet
1195 * proto_tree * : tree of display data. May be NULL.
1198 * void, but we will add to the proto_tree if it is not NULL.
1201 dissect_nlsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
1203 proto_item *ti, *type_item;
1204 proto_tree *nlsp_tree;
1206 guint8 nlsp_major_version;
1207 guint8 nlsp_header_length;
1208 guint8 packet_type_flags;
1211 col_set_str(pinfo->cinfo, COL_PROTOCOL, "NLSP");
1212 col_clear(pinfo->cinfo, COL_INFO);
1214 ti = proto_tree_add_item(tree, proto_nlsp, tvb, 0, -1, ENC_NA);
1215 nlsp_tree = proto_item_add_subtree(ti, ett_nlsp);
1217 proto_tree_add_item(nlsp_tree, hf_nlsp_irpd, tvb, offset, 1,
1221 nlsp_header_length = tvb_get_guint8(tvb, 1);
1222 proto_tree_add_uint(nlsp_tree, hf_nlsp_header_length, tvb,
1223 offset, 1, nlsp_header_length );
1226 proto_tree_add_item(nlsp_tree, hf_nlsp_minor_version, tvb,
1227 offset, 1, ENC_BIG_ENDIAN );
1230 offset += 1; /* Reserved */
1232 packet_type_flags = tvb_get_guint8(tvb, offset);
1233 packet_type = packet_type_flags & PACKET_TYPE_MASK;
1234 col_add_str(pinfo->cinfo, COL_INFO,
1235 val_to_str(packet_type, nlsp_packet_type_vals, "Unknown (%u)"));
1236 if (packet_type == NLSP_TYPE_L1_LSP) {
1237 proto_tree_add_boolean(nlsp_tree, hf_nlsp_nr, tvb, offset, 1, packet_type_flags );
1239 type_item = proto_tree_add_uint(nlsp_tree, hf_nlsp_type, tvb, offset, 1, packet_type_flags );
1242 nlsp_major_version = tvb_get_guint8(tvb, offset);
1243 ti = proto_tree_add_item(nlsp_tree, hf_nlsp_major_version, tvb,
1244 offset, 1, ENC_BIG_ENDIAN );
1245 if (nlsp_major_version != 1){
1246 expert_add_info_format(pinfo, ti, &ei_nlsp_major_version,
1247 "Unknown NLSP version (%d vs 1)",
1248 nlsp_major_version);
1252 offset += 2; /* Reserved */
1254 switch (packet_type) {
1256 case NLSP_TYPE_L1_HELLO:
1257 case NLSP_TYPE_WAN_HELLO:
1258 nlsp_dissect_nlsp_hello(tvb, pinfo, nlsp_tree, offset,
1259 packet_type, nlsp_header_length);
1262 case NLSP_TYPE_L1_LSP:
1263 nlsp_dissect_nlsp_lsp(tvb, pinfo, nlsp_tree, offset,
1264 nlsp_header_length);
1267 case NLSP_TYPE_L1_CSNP:
1268 nlsp_dissect_nlsp_csnp(tvb, pinfo, nlsp_tree, offset,
1269 nlsp_header_length);
1272 case NLSP_TYPE_L1_PSNP:
1273 nlsp_dissect_nlsp_psnp(tvb, pinfo, nlsp_tree, offset,
1274 nlsp_header_length);
1278 expert_add_info(pinfo, type_item, &ei_nlsp_type);
1280 return tvb_captured_length(tvb);
1284 * Name: proto_register_nlsp()
1287 * main register for NLSP protocol set. We register some display
1288 * formats and the protocol module variables.
1290 * NOTE: this procedure to autolinked by the makefile process that
1300 proto_register_nlsp(void)
1302 static hf_register_info hf[] = {
1304 { "NetWare Link Services Protocol Discriminator", "nlsp.irpd",
1305 FT_UINT8, BASE_HEX, NULL, 0x0,
1309 { &hf_nlsp_header_length,
1310 { "PDU Header Length", "nlsp.header_length",
1311 FT_UINT8, BASE_DEC, NULL, 0x0,
1315 { &hf_nlsp_minor_version,
1316 { "Minor Version", "nlsp.minor_version",
1317 FT_UINT8, BASE_DEC, NULL, 0x0,
1322 { "Multi-homed Non-routing Server", "nlsp.nr",
1323 FT_BOOLEAN, 8, NULL, 0x80,
1328 { "Packet Type", "nlsp.type",
1329 FT_UINT8, BASE_DEC, VALS(nlsp_packet_type_vals), PACKET_TYPE_MASK,
1333 { &hf_nlsp_major_version,
1334 { "Major Version", "nlsp.major_version",
1335 FT_UINT8, BASE_DEC, NULL, 0x0,
1339 { &hf_nlsp_packet_length,
1340 { "Packet Length", "nlsp.packet_length",
1341 FT_UINT16, BASE_DEC, NULL, 0x0,
1345 { &hf_nlsp_hello_state,
1346 { "State", "nlsp.hello.state",
1347 FT_UINT8, BASE_DEC, VALS(nlsp_hello_state_vals), NLSP_HELLO_STATE_MASK,
1351 { &hf_nlsp_hello_multicast,
1352 { "Multicast Routing", "nlsp.hello.multicast",
1353 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), NLSP_HELLO_MULTICAST_MASK,
1354 "If set, this router supports multicast routing", HFILL }
1357 { &hf_nlsp_hello_circuit_type,
1358 { "Circuit Type", "nlsp.hello.circuit_type",
1359 FT_UINT8, BASE_DEC, VALS(nlsp_hello_circuit_type_vals), NLSP_HELLO_CTYPE_MASK,
1363 { &hf_nlsp_hello_holding_timer,
1364 { "Holding Timer", "nlsp.hello.holding_timer",
1365 FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0x0,
1369 { &hf_nlsp_hello_priority,
1370 { "Priority", "nlsp.hello.priority",
1371 FT_UINT8, BASE_DEC, NULL, NLSP_HELLO_PRIORITY_MASK,
1375 { &hf_nlsp_lsp_sequence_number,
1376 { "Sequence Number", "nlsp.sequence_number",
1377 FT_UINT32, BASE_HEX, NULL, 0x0,
1381 { &hf_nlsp_lsp_checksum,
1382 { "Checksum", "nlsp.lsp.checksum",
1383 FT_UINT16, BASE_HEX, NULL, 0x0,
1388 { "Partition Repair", "nlsp.lsp.partition_repair",
1389 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), NLSP_LSP_PARTITION_MASK,
1390 "If set, this router supports the optional Partition Repair function", HFILL }
1393 { &hf_nlsp_lsp_attached_flag,
1394 { "Attached Flag", "nlsp.lsp.attached_flag",
1395 FT_UINT8, BASE_DEC, VALS(nlsp_attached_flag_vals), NLSP_LSP_ATT_MASK,
1399 { &hf_nlsp_lsp_lspdbol,
1400 { "LSP Database Overloaded", "nlsp.lsp.lspdbol",
1401 FT_BOOLEAN, 8, NULL, NLSP_LSP_OVERFLOW_MASK,
1405 { &hf_nlsp_lsp_router_type,
1406 { "Router Type", "nlsp.lsp.router_type",
1407 FT_UINT8, BASE_DEC, VALS(nlsp_router_type_vals), NLSP_LSP_ROUTER_TYPE_MASK,
1411 { &hf_nlsp_lsp_link_info_clv_flags_cost_present,
1412 { "Cost present", "nlsp.lsp.link_info_clv.flags.cost_present",
1413 FT_BOOLEAN, 8, TFS(&tfs_no_yes), 0x80,
1417 { &hf_nlsp_lsp_link_info_clv_flags_cost_metric,
1418 { "Cost metric", "nlsp.lsp.link_info_clv.flags.cost_metric",
1419 FT_BOOLEAN, 8, TFS(&tfs_internal_external), 0x40,
1423 { &hf_nlsp_lsp_link_info_clv_flags_cost,
1424 { "Cost", "nlsp.lsp.link_info_clv.flags.cost",
1425 FT_UINT8, BASE_DEC, NULL, 0x3F,
1429 /* Generated from convert_proto_tree_add_text.pl */
1430 { &hf_nlsp_unknown_code,
1431 { "Unknown code", "nlsp.unknown_code",
1432 FT_UINT8, BASE_DEC, NULL, 0x0,
1435 { &hf_nlsp_area_address_network_number,
1436 { "Area address network number", "nlsp.area_address.network_number",
1437 FT_UINT32, BASE_HEX, NULL, 0x0,
1440 { &hf_nlsp_area_address_mask,
1441 { "Area address mask", "nlsp.area_address.mask",
1442 FT_UINT32, BASE_HEX, NULL, 0x0,
1445 { &hf_nlsp_neighbor,
1446 { "Neighbor", "nlsp.neighbor",
1447 FT_ETHER, BASE_NONE, NULL, 0x0,
1450 { &hf_nlsp_hello_local_mtu_mtu_size,
1451 { "MTU Size", "nlsp.hello_local_mtu.mtu_size",
1452 FT_UINT32, BASE_DEC, NULL, 0x0,
1455 { &hf_nlsp_hello_sending_router_system_id,
1456 { "Sending Router System ID", "nlsp.hello.sending_router_system_id",
1457 FT_ETHER, BASE_NONE, NULL, 0x0,
1460 { &hf_nlsp_hello_local_wan_circuit_id,
1461 { "Local WAN Circuit ID", "nlsp.hello.local_wan_circuit_id",
1462 FT_UINT8, BASE_DEC, NULL, 0x0,
1465 { &hf_nlsp_hello_designated_router_system_id,
1466 { "Designated Router System ID", "nlsp.hello.designated_router_system_id",
1467 FT_ETHER, BASE_NONE, NULL, 0x0,
1470 { &hf_nlsp_hello_designated_router_pseudonode_id,
1471 { "Designated Router Pseudonode ID", "nlsp.hello.designated_router_pseudonode_id",
1472 FT_UINT8, BASE_DEC, NULL, 0x0,
1475 { &hf_nlsp_mgt_info_network_number,
1476 { "Network number", "nlsp.mgt_info.network_number",
1477 FT_UINT32, BASE_HEX, NULL, 0x0,
1480 { &hf_nlsp_mgt_info_node_number,
1481 { "Node number", "nlsp.mgt_info.node_number",
1482 FT_ETHER, BASE_NONE, NULL, 0x0,
1485 { &hf_nlsp_mgt_info_ipx_version_number,
1486 { "IPX version number", "nlsp.mgt_info.ipx_version_number",
1487 FT_UINT8, BASE_DEC, NULL, 0x0,
1490 { &hf_nlsp_mgt_info_name_length,
1491 { "Name length", "nlsp.mgt_info.name_length",
1492 FT_UINT8, BASE_DEC, NULL, 0x0,
1495 { &hf_nlsp_mgt_info_name,
1496 { "Name", "nlsp.mgt_info.name",
1497 FT_STRING, BASE_NONE, NULL, 0x0,
1500 { &hf_nlsp_link_info_router_system_id,
1501 { "Router System ID", "nlsp.link_info.router_system_id",
1502 FT_ETHER, BASE_NONE, NULL, 0x0,
1505 { &hf_nlsp_link_info_router_pseudonode_id,
1506 { "Router Pseudonode ID", "nlsp.link_info.router_pseudonode_id",
1507 FT_UINT8, BASE_DEC, NULL, 0x0,
1510 { &hf_nlsp_link_info_mtu_size,
1511 { "MTU Size", "nlsp.link_info.mtu_size",
1512 FT_UINT32, BASE_DEC, NULL, 0x0,
1515 { &hf_nlsp_link_info_delay,
1516 { "Delay", "nlsp.link_info.delay",
1517 FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_microseconds, 0x0,
1520 { &hf_nlsp_link_info_throughput,
1521 { "Throughput", "nlsp.link_info.throughput",
1522 FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_bit_sec, 0x0,
1525 { &hf_nlsp_link_info_media_type,
1526 { "Media type", "nlsp.link_info.media_type",
1527 FT_UINT16, BASE_DEC, VALS(media_type_vals), 0x0,
1530 { &hf_nlsp_svcs_info_hops_to_reach_the_service,
1531 { "Hops to reach the service", "nlsp.svcs_info.hops_to_reach_the_service",
1532 FT_UINT8, BASE_DEC, NULL, 0x0,
1535 { &hf_nlsp_svcs_info_network_number,
1536 { "Network number", "nlsp.svcs_info.network_number",
1537 FT_UINT32, BASE_HEX, NULL, 0x0,
1540 { &hf_nlsp_svcs_info_node_number,
1541 { "Node number", "nlsp.svcs_info.node_number",
1542 FT_ETHER, BASE_NONE, NULL, 0x0,
1545 { &hf_nlsp_svcs_info_socket,
1546 { "Socket", "nlsp.svcs_info.socket",
1547 FT_UINT16, BASE_DEC|BASE_EXT_STRING, &ipx_socket_vals_ext, 0x0,
1550 { &hf_nlsp_svcs_info_type,
1551 { "Type", "nlsp.svcs_info.type",
1552 FT_UINT16, BASE_DEC|BASE_EXT_STRING, &novell_server_vals_ext, 0x0,
1555 { &hf_nlsp_svcs_info_service_name,
1556 { "Service Name", "nlsp.svcs_info.service_name",
1557 FT_STRING, BASE_NONE, NULL, 0x0,
1560 { &hf_nlsp_ext_routes_hops,
1561 { "Hops", "nlsp.ext_routes.hops",
1562 FT_UINT8, BASE_DEC, NULL, 0x0,
1565 { &hf_nlsp_ext_routes_network_number,
1566 { "Network number", "nlsp.ext_routes.network_number",
1567 FT_UINT32, BASE_HEX, NULL, 0x0,
1570 { &hf_nlsp_ext_routes_rip_delay,
1571 { "RIP delay", "nlsp.ext_routes.rip_delay",
1572 FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_tick_ticks, 0x0,
1575 { &hf_nlsp_remaining_lifetime,
1576 { "Remaining Lifetime", "nlsp.remaining_lifetime",
1577 FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0x0,
1580 { &hf_nlsp_lsp_id_system_id,
1581 { "LSP ID system ID", "nlsp.lsp_id_system_id",
1582 FT_ETHER, BASE_NONE, NULL, 0x0,
1585 { &hf_nlsp_lsp_id_pseudonode_id,
1586 { "LSP ID pseudonode ID", "nlsp.lsp_id_pseudonode_id",
1587 FT_UINT8, BASE_DEC, NULL, 0x0,
1590 { &hf_nlsp_lsp_id_lsp_number,
1591 { "LSP ID LSP number", "nlsp.lsp_id_lsp_number",
1592 FT_UINT8, BASE_DEC, NULL, 0x0,
1595 { &hf_nlsp_csnp_lsp_id_source_id,
1596 { "LSP ID source ID", "nlsp.csnp.lsp_id_source_id",
1597 FT_ETHER, BASE_NONE, NULL, 0x0,
1600 { &hf_nlsp_csnp_lsp_id_pseudonode_id,
1601 { "LSP ID pseudonode ID", "nlsp.csnp.lsp_id_pseudonode_id",
1602 FT_UINT8, BASE_DEC, NULL, 0x0,
1605 { &hf_nlsp_csnp_lsp_id_lsp_number,
1606 { "LSP ID LSP number", "nlsp.csnp.lsp_id_lsp_number",
1607 FT_UINT8, BASE_DEC, NULL, 0x0,
1610 { &hf_nlsp_csnp_lsp_sequence_number,
1611 { "LSP Sequence Number", "nlsp.csnp.lsp_sequence_number",
1612 FT_UINT32, BASE_HEX, NULL, 0x0,
1615 { &hf_nlsp_csnp_remaining_lifetime,
1616 { "Remaining Lifetime", "nlsp.csnp.remaining_lifetime",
1617 FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0x0,
1620 { &hf_nlsp_csnp_lsp_checksum,
1621 { "LSP checksum", "nlsp.csnp.lsp_checksum",
1622 FT_UINT16, BASE_HEX, NULL, 0x0,
1625 { &hf_nlsp_psnp_lsp_id_source_id,
1626 { "LSP ID source ID", "nlsp.psnp.lsp_id_source_id",
1627 FT_ETHER, BASE_NONE, NULL, 0x0,
1630 { &hf_nlsp_psnp_lsp_id_pseudonode_id,
1631 { "LSP ID pseudonode ID", "nlsp.psnp.lsp_id_pseudonode_id",
1632 FT_UINT8, BASE_DEC, NULL, 0x0,
1635 { &hf_nlsp_psnp_lsp_id_lsp_number,
1636 { "LSP ID LSP number", "nlsp.psnp.lsp_id_lsp_number",
1637 FT_UINT8, BASE_DEC, NULL, 0x0,
1640 { &hf_nlsp_psnp_lsp_sequence_number,
1641 { "LSP Sequence Number", "nlsp.psnp.lsp_sequence_number",
1642 FT_UINT32, BASE_HEX, NULL, 0x0,
1645 { &hf_nlsp_psnp_remaining_lifetime,
1646 { "Remaining Lifetime", "nlsp.psnp.remaining_lifetime",
1647 FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0x0,
1650 { &hf_nlsp_psnp_lsp_checksum,
1651 { "LSP checksum", "nlsp.psnp.lsp_checksum",
1652 FT_UINT16, BASE_HEX, NULL, 0x0,
1655 { &hf_nlsp_csnp_source_id_system_id,
1656 { "Source ID system ID", "nlsp.csnp.source_id_system_id",
1657 FT_ETHER, BASE_NONE, NULL, 0x0,
1660 { &hf_nlsp_csnp_source_id_pseudonode_id,
1661 { "Source ID pseudonode ID", "nlsp.csnp.source_id_pseudonode_id",
1662 FT_UINT8, BASE_DEC, NULL, 0x0,
1665 { &hf_nlsp_csnp_start_lsp_id_source_id,
1666 { "Start LSP ID source ID", "nlsp.csnp.start_lsp_id_source_id",
1667 FT_ETHER, BASE_NONE, NULL, 0x0,
1670 { &hf_nlsp_csnp_start_lsp_id_pseudonode_id,
1671 { "Start LSP ID pseudonode ID", "nlsp.csnp.start_lsp_id_pseudonode_id",
1672 FT_UINT8, BASE_DEC, NULL, 0x0,
1675 { &hf_nlsp_csnp_start_lsp_id_lsp_number,
1676 { "Start LSP ID LSP number", "nlsp.csnp.start_lsp_id_lsp_number",
1677 FT_UINT8, BASE_DEC, NULL, 0x0,
1680 { &hf_nlsp_csnp_end_lsp_id_source_id,
1681 { "End LSP ID source ID", "nlsp.csnp.end_lsp_id_source_id",
1682 FT_ETHER, BASE_NONE, NULL, 0x0,
1685 { &hf_nlsp_csnp_end_lsp_id_pseudonode_id,
1686 { "End LSP ID pseudonode ID", "nlsp.csnp.end_lsp_id_pseudonode_id",
1687 FT_UINT8, BASE_DEC, NULL, 0x0,
1690 { &hf_nlsp_csnp_end_lsp_id_lsp_number,
1691 { "End LSP ID LSP number", "nlsp.csnp.end_lsp_id_lsp_number",
1692 FT_UINT8, BASE_DEC, NULL, 0x0,
1695 { &hf_nlsp_psnp_source_id_system_id,
1696 { "Source ID system ID", "nlsp.psnp.source_id_system_id",
1697 FT_ETHER, BASE_NONE, NULL, 0x0,
1700 { &hf_nlsp_psnp_source_id_pseudonode_id,
1701 { "Source ID pseudonode ID", "nlsp.psnp.source_id_pseudonode_id",
1702 FT_UINT8, BASE_DEC, NULL, 0x0,
1706 static gint *ett[] = {
1708 &ett_nlsp_hello_clv_area_addr,
1709 &ett_nlsp_hello_clv_neighbors,
1710 &ett_nlsp_hello_local_mtu,
1711 &ett_nlsp_hello_clv_unknown,
1713 &ett_nlsp_lsp_clv_area_addr,
1714 &ett_nlsp_lsp_clv_mgt_info,
1715 &ett_nlsp_lsp_clv_link_info,
1716 &ett_nlsp_lsp_clv_svcs_info,
1717 &ett_nlsp_lsp_clv_ext_routes,
1718 &ett_nlsp_lsp_clv_unknown,
1719 &ett_nlsp_csnp_lsp_entries,
1720 &ett_nlsp_csnp_lsp_entry,
1721 &ett_nlsp_csnp_clv_unknown,
1722 &ett_nlsp_psnp_lsp_entries,
1723 &ett_nlsp_psnp_lsp_entry,
1724 &ett_nlsp_psnp_clv_unknown,
1727 static ei_register_info ei[] = {
1728 { &ei_nlsp_short_packet, { "nlsp.short_packet", PI_MALFORMED, PI_ERROR, "Short packet", EXPFILL }},
1729 { &ei_nlsp_long_packet, { "nlsp.long_packet", PI_MALFORMED, PI_ERROR, "Long packet", EXPFILL }},
1730 { &ei_nlsp_major_version, { "nlsp.major_version.unknown", PI_PROTOCOL, PI_WARN, "Unknown NLSP version", EXPFILL }},
1731 { &ei_nlsp_type, { "nlsp.type.unknown", PI_PROTOCOL, PI_WARN, "Unknown NLSP packet type", EXPFILL }},
1734 expert_module_t* expert_nlsp;
1736 proto_nlsp = proto_register_protocol("NetWare Link Services Protocol",
1738 proto_register_field_array(proto_nlsp, hf, array_length(hf));
1739 proto_register_subtree_array(ett, array_length(ett));
1740 expert_nlsp = expert_register_protocol(proto_nlsp);
1741 expert_register_field_array(expert_nlsp, ei, array_length(ei));
1745 proto_reg_handoff_nlsp(void)
1747 dissector_handle_t nlsp_handle;
1749 nlsp_handle = create_dissector_handle(dissect_nlsp, proto_nlsp);
1750 dissector_add_uint("ipx.socket", IPX_SOCKET_NLSP, nlsp_handle);
1754 * Editor modelines - http://www.wireshark.org/tools/modelines.html
1759 * indent-tabs-mode: t
1762 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
1763 * :indentSize=8:tabSize=8:noTabs=false: