]> The Tcpdump Group git mirrors - tcpdump/blob - print-lmp.c
Merge pull request #772 from Mister-X-/fix-status-codes
[tcpdump] / print-lmp.c
1 /*
2 * Redistribution and use in source and binary forms, with or without
3 * modification, are permitted provided that: (1) source code
4 * distributions retain the above copyright notice and this paragraph
5 * in its entirety, and (2) distributions including binary code include
6 * the above copyright notice and this paragraph in its entirety in
7 * the documentation or other materials provided with the distribution.
8 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND
9 * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
10 * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
11 * FOR A PARTICULAR PURPOSE.
12 *
13 * Original code by Hannes Gredler (hannes@gredler.at)
14 * Support for LMP service discovery extensions (defined by OIF UNI 1.0)
15 * added by Manu Pathak (mapathak@cisco.com), May 2005
16 */
17
18 /* \summary: Link Management Protocol (LMP) printer */
19
20 /* specification: RFC 4204 */
21 /* OIF UNI 1.0: https://web.archive.org/web/20160401194747/http://www.oiforum.com/public/documents/OIF-UNI-01.0.pdf */
22
23 #ifdef HAVE_CONFIG_H
24 #include <config.h>
25 #endif
26
27 #include "netdissect-stdinc.h"
28
29 #include "netdissect.h"
30 #include "extract.h"
31 #include "addrtoname.h"
32 #include "gmpls.h"
33
34
35 /*
36 * LMP common header
37 *
38 * 0 1 2 3
39 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
40 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
41 * | Vers | (Reserved) | Flags | Msg Type |
42 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
43 * | LMP Length | (Reserved) |
44 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
45 */
46
47 struct lmp_common_header {
48 nd_uint16_t version_res;
49 nd_uint8_t flags;
50 nd_uint8_t msg_type;
51 nd_uint16_t length;
52 nd_byte reserved[2];
53 };
54
55 #define LMP_VERSION 1
56 #define LMP_EXTRACT_VERSION(x) (((x)&0xf000)>>12)
57
58 static const struct tok lmp_header_flag_values[] = {
59 { 0x01, "Control Channel Down"},
60 { 0x02, "LMP restart"},
61 { 0, NULL}
62 };
63
64 static const struct tok lmp_obj_te_link_flag_values[] = {
65 { 0x01, "Fault Management Supported"},
66 { 0x02, "Link Verification Supported"},
67 { 0, NULL}
68 };
69
70 static const struct tok lmp_obj_data_link_flag_values[] = {
71 { 0x01, "Data Link Port"},
72 { 0x02, "Allocated for user traffic"},
73 { 0x04, "Failed link"},
74 { 0, NULL}
75 };
76
77 static const struct tok lmp_obj_channel_status_values[] = {
78 { 1, "Signal Okay"},
79 { 2, "Signal Degraded"},
80 { 3, "Signal Fail"},
81 { 0, NULL}
82 };
83
84 static const struct tok lmp_obj_begin_verify_flag_values[] = {
85 { 0x0001, "Verify all links"},
86 { 0x0002, "Data link type"},
87 { 0, NULL}
88 };
89
90 static const struct tok lmp_obj_begin_verify_error_values[] = {
91 { 0x01, "Link Verification Procedure Not supported"},
92 { 0x02, "Unwilling to verify"},
93 { 0x04, "Unsupported verification transport mechanism"},
94 { 0x08, "Link-Id configuration error"},
95 { 0x10, "Unknown object c-type"},
96 { 0, NULL}
97 };
98
99 static const struct tok lmp_obj_link_summary_error_values[] = {
100 { 0x01, "Unacceptable non-negotiable LINK-SUMMARY parameters"},
101 { 0x02, "Renegotiate LINK-SUMMARY parameters"},
102 { 0x04, "Invalid TE-LINK Object"},
103 { 0x08, "Invalid DATA-LINK Object"},
104 { 0x10, "Unknown TE-LINK Object c-type"},
105 { 0x20, "Unknown DATA-LINK Object c-type"},
106 { 0, NULL}
107 };
108
109 /* Service Config Supported Protocols Flags */
110 static const struct tok lmp_obj_service_config_sp_flag_values[] = {
111 { 0x01, "RSVP Supported"},
112 { 0x02, "LDP Supported"},
113 { 0, NULL}
114 };
115
116 /* Service Config Client Port Service Attribute Transparency Flags */
117 static const struct tok lmp_obj_service_config_cpsa_tp_flag_values[] = {
118 { 0x01, "Path/VC Overhead Transparency Supported"},
119 { 0x02, "Line/MS Overhead Transparency Supported"},
120 { 0x04, "Section/RS Overhead Transparency Supported"},
121 { 0, NULL}
122 };
123
124 /* Service Config Client Port Service Attribute Contiguous Concatenation Types Flags */
125 static const struct tok lmp_obj_service_config_cpsa_cct_flag_values[] = {
126 { 0x01, "Contiguous Concatenation Types Supported"},
127 { 0, NULL}
128 };
129
130 /* Service Config Network Service Attributes Transparency Flags */
131 static const struct tok lmp_obj_service_config_nsa_transparency_flag_values[] = {
132 { 0x01, "Standard SOH/RSOH Transparency Supported"},
133 { 0x02, "Standard LOH/MSOH Transparency Supported"},
134 { 0, NULL}
135 };
136
137 /* Service Config Network Service Attributes TCM Monitoring Flags */
138 static const struct tok lmp_obj_service_config_nsa_tcm_flag_values[] = {
139 { 0x01, "Transparent Tandem Connection Monitoring Supported"},
140 { 0, NULL}
141 };
142
143 /* Network Service Attributes Network Diversity Flags */
144 static const struct tok lmp_obj_service_config_nsa_network_diversity_flag_values[] = {
145 { 0x01, "Node Diversity Supported"},
146 { 0x02, "Link Diversity Supported"},
147 { 0x04, "SRLG Diversity Supported"},
148 { 0, NULL}
149 };
150
151 #define LMP_MSGTYPE_CONFIG 1
152 #define LMP_MSGTYPE_CONFIG_ACK 2
153 #define LMP_MSGTYPE_CONFIG_NACK 3
154 #define LMP_MSGTYPE_HELLO 4
155 #define LMP_MSGTYPE_VERIFY_BEGIN 5
156 #define LMP_MSGTYPE_VERIFY_BEGIN_ACK 6
157 #define LMP_MSGTYPE_VERIFY_BEGIN_NACK 7
158 #define LMP_MSGTYPE_VERIFY_END 8
159 #define LMP_MSGTYPE_VERIFY_END_ACK 9
160 #define LMP_MSGTYPE_TEST 10
161 #define LMP_MSGTYPE_TEST_STATUS_SUCCESS 11
162 #define LMP_MSGTYPE_TEST_STATUS_FAILURE 12
163 #define LMP_MSGTYPE_TEST_STATUS_ACK 13
164 #define LMP_MSGTYPE_LINK_SUMMARY 14
165 #define LMP_MSGTYPE_LINK_SUMMARY_ACK 15
166 #define LMP_MSGTYPE_LINK_SUMMARY_NACK 16
167 #define LMP_MSGTYPE_CHANNEL_STATUS 17
168 #define LMP_MSGTYPE_CHANNEL_STATUS_ACK 18
169 #define LMP_MSGTYPE_CHANNEL_STATUS_REQ 19
170 #define LMP_MSGTYPE_CHANNEL_STATUS_RESP 20
171 /* LMP Service Discovery message types defined by UNI 1.0 */
172 #define LMP_MSGTYPE_SERVICE_CONFIG 50
173 #define LMP_MSGTYPE_SERVICE_CONFIG_ACK 51
174 #define LMP_MSGTYPE_SERVICE_CONFIG_NACK 52
175
176 static const struct tok lmp_msg_type_values[] = {
177 { LMP_MSGTYPE_CONFIG, "Config"},
178 { LMP_MSGTYPE_CONFIG_ACK, "Config ACK"},
179 { LMP_MSGTYPE_CONFIG_NACK, "Config NACK"},
180 { LMP_MSGTYPE_HELLO, "Hello"},
181 { LMP_MSGTYPE_VERIFY_BEGIN, "Begin Verify"},
182 { LMP_MSGTYPE_VERIFY_BEGIN_ACK, "Begin Verify ACK"},
183 { LMP_MSGTYPE_VERIFY_BEGIN_NACK, "Begin Verify NACK"},
184 { LMP_MSGTYPE_VERIFY_END, "End Verify"},
185 { LMP_MSGTYPE_VERIFY_END_ACK, "End Verify ACK"},
186 { LMP_MSGTYPE_TEST, "Test"},
187 { LMP_MSGTYPE_TEST_STATUS_SUCCESS, "Test Status Success"},
188 { LMP_MSGTYPE_TEST_STATUS_FAILURE, "Test Status Failure"},
189 { LMP_MSGTYPE_TEST_STATUS_ACK, "Test Status ACK"},
190 { LMP_MSGTYPE_LINK_SUMMARY, "Link Summary"},
191 { LMP_MSGTYPE_LINK_SUMMARY_ACK, "Link Summary ACK"},
192 { LMP_MSGTYPE_LINK_SUMMARY_NACK, "Link Summary NACK"},
193 { LMP_MSGTYPE_CHANNEL_STATUS, "Channel Status"},
194 { LMP_MSGTYPE_CHANNEL_STATUS_ACK, "Channel Status ACK"},
195 { LMP_MSGTYPE_CHANNEL_STATUS_REQ, "Channel Status Request"},
196 { LMP_MSGTYPE_CHANNEL_STATUS_RESP, "Channel Status Response"},
197 { LMP_MSGTYPE_SERVICE_CONFIG, "Service Config"},
198 { LMP_MSGTYPE_SERVICE_CONFIG_ACK, "Service Config ACK"},
199 { LMP_MSGTYPE_SERVICE_CONFIG_NACK, "Service Config NACK"},
200 { 0, NULL}
201 };
202
203 /*
204 * LMP object header
205 *
206 * 0 1 2 3
207 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
208 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
209 * |N| C-Type | Class | Length |
210 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
211 * | |
212 * // (object contents) //
213 * | |
214 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
215 */
216
217 struct lmp_object_header {
218 nd_uint8_t ctype;
219 nd_uint8_t class_num;
220 nd_uint16_t length;
221 };
222
223 #define LMP_OBJ_CC_ID 1
224 #define LMP_OBJ_NODE_ID 2
225 #define LMP_OBJ_LINK_ID 3
226 #define LMP_OBJ_INTERFACE_ID 4
227 #define LMP_OBJ_MESSAGE_ID 5
228 #define LMP_OBJ_CONFIG 6
229 #define LMP_OBJ_HELLO 7
230 #define LMP_OBJ_VERIFY_BEGIN 8
231 #define LMP_OBJ_VERIFY_BEGIN_ACK 9
232 #define LMP_OBJ_VERIFY_ID 10
233 #define LMP_OBJ_TE_LINK 11
234 #define LMP_OBJ_DATA_LINK 12
235 #define LMP_OBJ_CHANNEL_STATUS 13
236 #define LMP_OBJ_CHANNEL_STATUS_REQ 14
237 #define LMP_OBJ_ERROR_CODE 20
238
239 #define LMP_OBJ_SERVICE_CONFIG 51 /* defined in UNI 1.0 */
240
241 static const struct tok lmp_obj_values[] = {
242 { LMP_OBJ_CC_ID, "Control Channel ID" },
243 { LMP_OBJ_NODE_ID, "Node ID" },
244 { LMP_OBJ_LINK_ID, "Link ID" },
245 { LMP_OBJ_INTERFACE_ID, "Interface ID" },
246 { LMP_OBJ_MESSAGE_ID, "Message ID" },
247 { LMP_OBJ_CONFIG, "Configuration" },
248 { LMP_OBJ_HELLO, "Hello" },
249 { LMP_OBJ_VERIFY_BEGIN, "Verify Begin" },
250 { LMP_OBJ_VERIFY_BEGIN_ACK, "Verify Begin ACK" },
251 { LMP_OBJ_VERIFY_ID, "Verify ID" },
252 { LMP_OBJ_TE_LINK, "TE Link" },
253 { LMP_OBJ_DATA_LINK, "Data Link" },
254 { LMP_OBJ_CHANNEL_STATUS, "Channel Status" },
255 { LMP_OBJ_CHANNEL_STATUS_REQ, "Channel Status Request" },
256 { LMP_OBJ_ERROR_CODE, "Error Code" },
257 { LMP_OBJ_SERVICE_CONFIG, "Service Config" },
258
259 { 0, NULL}
260 };
261
262 #define INT_SWITCHING_TYPE_SUBOBJ 1
263 #define WAVELENGTH_SUBOBJ 2
264
265 static const struct tok lmp_data_link_subobj[] = {
266 { INT_SWITCHING_TYPE_SUBOBJ, "Interface Switching Type" },
267 { WAVELENGTH_SUBOBJ , "Wavelength" },
268 { 0, NULL}
269 };
270
271 #define LMP_CTYPE_IPV4 1
272 #define LMP_CTYPE_IPV6 2
273
274 #define LMP_CTYPE_LOC 1
275 #define LMP_CTYPE_RMT 2
276 #define LMP_CTYPE_UNMD 3
277
278 #define LMP_CTYPE_IPV4_LOC 1
279 #define LMP_CTYPE_IPV4_RMT 2
280 #define LMP_CTYPE_IPV6_LOC 3
281 #define LMP_CTYPE_IPV6_RMT 4
282 #define LMP_CTYPE_UNMD_LOC 5
283 #define LMP_CTYPE_UNMD_RMT 6
284
285 #define LMP_CTYPE_1 1
286 #define LMP_CTYPE_2 2
287
288 #define LMP_CTYPE_HELLO_CONFIG 1
289 #define LMP_CTYPE_HELLO 1
290
291 #define LMP_CTYPE_BEGIN_VERIFY_ERROR 1
292 #define LMP_CTYPE_LINK_SUMMARY_ERROR 2
293
294 /* C-Types for Service Config Object */
295 #define LMP_CTYPE_SERVICE_CONFIG_SP 1
296 #define LMP_CTYPE_SERVICE_CONFIG_CPSA 2
297 #define LMP_CTYPE_SERVICE_CONFIG_TRANSPARENCY_TCM 3
298 #define LMP_CTYPE_SERVICE_CONFIG_NETWORK_DIVERSITY 4
299
300 /*
301 * Different link types allowed in the Client Port Service Attributes
302 * subobject defined for LMP Service Discovery in the UNI 1.0 spec
303 */
304 #define LMP_SD_SERVICE_CONFIG_CPSA_LINK_TYPE_SDH 5 /* UNI 1.0 Sec 9.4.2 */
305 #define LMP_SD_SERVICE_CONFIG_CPSA_LINK_TYPE_SONET 6 /* UNI 1.0 Sec 9.4.2 */
306
307 /*
308 * the ctypes are not globally unique so for
309 * translating it to strings we build a table based
310 * on objects offsetted by the ctype
311 */
312
313 static const struct tok lmp_ctype_values[] = {
314 { 256*LMP_OBJ_CC_ID+LMP_CTYPE_LOC, "Local" },
315 { 256*LMP_OBJ_CC_ID+LMP_CTYPE_RMT, "Remote" },
316 { 256*LMP_OBJ_NODE_ID+LMP_CTYPE_LOC, "Local" },
317 { 256*LMP_OBJ_NODE_ID+LMP_CTYPE_RMT, "Remote" },
318 { 256*LMP_OBJ_LINK_ID+LMP_CTYPE_IPV4_LOC, "IPv4 Local" },
319 { 256*LMP_OBJ_LINK_ID+LMP_CTYPE_IPV4_RMT, "IPv4 Remote" },
320 { 256*LMP_OBJ_LINK_ID+LMP_CTYPE_IPV6_LOC, "IPv6 Local" },
321 { 256*LMP_OBJ_LINK_ID+LMP_CTYPE_IPV6_RMT, "IPv6 Remote" },
322 { 256*LMP_OBJ_LINK_ID+LMP_CTYPE_UNMD_LOC, "Unnumbered Local" },
323 { 256*LMP_OBJ_LINK_ID+LMP_CTYPE_UNMD_RMT, "Unnumbered Remote" },
324 { 256*LMP_OBJ_INTERFACE_ID+LMP_CTYPE_IPV4_LOC, "IPv4 Local" },
325 { 256*LMP_OBJ_INTERFACE_ID+LMP_CTYPE_IPV4_RMT, "IPv4 Remote" },
326 { 256*LMP_OBJ_INTERFACE_ID+LMP_CTYPE_IPV6_LOC, "IPv6 Local" },
327 { 256*LMP_OBJ_INTERFACE_ID+LMP_CTYPE_IPV6_RMT, "IPv6 Remote" },
328 { 256*LMP_OBJ_INTERFACE_ID+LMP_CTYPE_UNMD_LOC, "Unnumbered Local" },
329 { 256*LMP_OBJ_INTERFACE_ID+LMP_CTYPE_UNMD_RMT, "Unnumbered Remote" },
330 { 256*LMP_OBJ_MESSAGE_ID+LMP_CTYPE_1, "1" },
331 { 256*LMP_OBJ_MESSAGE_ID+LMP_CTYPE_2, "2" },
332 { 256*LMP_OBJ_CONFIG+LMP_CTYPE_1, "1" },
333 { 256*LMP_OBJ_HELLO+LMP_CTYPE_1, "1" },
334 { 256*LMP_OBJ_VERIFY_BEGIN+LMP_CTYPE_1, "1" },
335 { 256*LMP_OBJ_VERIFY_BEGIN_ACK+LMP_CTYPE_1, "1" },
336 { 256*LMP_OBJ_VERIFY_ID+LMP_CTYPE_1, "1" },
337 { 256*LMP_OBJ_TE_LINK+LMP_CTYPE_IPV4, "IPv4" },
338 { 256*LMP_OBJ_TE_LINK+LMP_CTYPE_IPV6, "IPv6" },
339 { 256*LMP_OBJ_TE_LINK+LMP_CTYPE_UNMD, "Unnumbered" },
340 { 256*LMP_OBJ_DATA_LINK+LMP_CTYPE_IPV4, "IPv4" },
341 { 256*LMP_OBJ_DATA_LINK+LMP_CTYPE_IPV6, "IPv6" },
342 { 256*LMP_OBJ_DATA_LINK+LMP_CTYPE_UNMD, "Unnumbered" },
343 { 256*LMP_OBJ_CHANNEL_STATUS+LMP_CTYPE_IPV4, "IPv4" },
344 { 256*LMP_OBJ_CHANNEL_STATUS+LMP_CTYPE_IPV6, "IPv6" },
345 { 256*LMP_OBJ_CHANNEL_STATUS+LMP_CTYPE_UNMD, "Unnumbered" },
346 { 256*LMP_OBJ_CHANNEL_STATUS_REQ+LMP_CTYPE_IPV4, "IPv4" },
347 { 256*LMP_OBJ_CHANNEL_STATUS_REQ+LMP_CTYPE_IPV6, "IPv6" },
348 { 256*LMP_OBJ_CHANNEL_STATUS_REQ+LMP_CTYPE_UNMD, "Unnumbered" },
349 { 256*LMP_OBJ_ERROR_CODE+LMP_CTYPE_1, "1" },
350 { 256*LMP_OBJ_ERROR_CODE+LMP_CTYPE_2, "2" },
351 { 256*LMP_OBJ_SERVICE_CONFIG+LMP_CTYPE_SERVICE_CONFIG_SP, "1" },
352 { 256*LMP_OBJ_SERVICE_CONFIG+LMP_CTYPE_SERVICE_CONFIG_CPSA, "2" },
353 { 256*LMP_OBJ_SERVICE_CONFIG+LMP_CTYPE_SERVICE_CONFIG_TRANSPARENCY_TCM, "3" },
354 { 256*LMP_OBJ_SERVICE_CONFIG+LMP_CTYPE_SERVICE_CONFIG_NETWORK_DIVERSITY, "4" },
355 { 0, NULL}
356 };
357
358 static int
359 lmp_print_data_link_subobjs(netdissect_options *ndo, const u_char *obj_tptr,
360 int total_subobj_len, int offset)
361 {
362 int hexdump = FALSE;
363 int subobj_type, subobj_len;
364
365 union { /* int to float conversion buffer */
366 float f;
367 uint32_t i;
368 } bw;
369
370 while (total_subobj_len > 0 && hexdump == FALSE ) {
371 subobj_type = GET_U_1(obj_tptr + offset);
372 subobj_len = GET_U_1(obj_tptr + offset + 1);
373 ND_PRINT("\n\t Subobject, Type: %s (%u), Length: %u",
374 tok2str(lmp_data_link_subobj,
375 "Unknown",
376 subobj_type),
377 subobj_type,
378 subobj_len);
379 if (subobj_len < 4) {
380 ND_PRINT(" (too short)");
381 break;
382 }
383 if ((subobj_len % 4) != 0) {
384 ND_PRINT(" (not a multiple of 4)");
385 break;
386 }
387 if (total_subobj_len < subobj_len) {
388 ND_PRINT(" (goes past the end of the object)");
389 break;
390 }
391 switch(subobj_type) {
392 case INT_SWITCHING_TYPE_SUBOBJ:
393 ND_PRINT("\n\t Switching Type: %s (%u)",
394 tok2str(gmpls_switch_cap_values,
395 "Unknown",
396 GET_U_1(obj_tptr + offset + 2)),
397 GET_U_1(obj_tptr + offset + 2));
398 ND_PRINT("\n\t Encoding Type: %s (%u)",
399 tok2str(gmpls_encoding_values,
400 "Unknown",
401 GET_U_1(obj_tptr + offset + 3)),
402 GET_U_1(obj_tptr + offset + 3));
403 bw.i = GET_BE_U_4(obj_tptr + offset + 4);
404 ND_PRINT("\n\t Min Reservable Bandwidth: %.3f Mbps",
405 bw.f*8/1000000);
406 bw.i = GET_BE_U_4(obj_tptr + offset + 8);
407 ND_PRINT("\n\t Max Reservable Bandwidth: %.3f Mbps",
408 bw.f*8/1000000);
409 break;
410 case WAVELENGTH_SUBOBJ:
411 ND_PRINT("\n\t Wavelength: %u",
412 GET_BE_U_4(obj_tptr + offset + 4));
413 break;
414 default:
415 /* Any Unknown Subobject ==> Exit loop */
416 hexdump=TRUE;
417 break;
418 }
419 total_subobj_len-=subobj_len;
420 offset+=subobj_len;
421 }
422 return (hexdump);
423 }
424
425 void
426 lmp_print(netdissect_options *ndo,
427 const u_char *pptr, u_int length)
428 {
429 const struct lmp_common_header *lmp_com_header;
430 const struct lmp_object_header *lmp_obj_header;
431 const u_char *tptr,*obj_tptr;
432 u_int version_res, tlen, lmp_obj_len, lmp_obj_ctype, obj_tlen;
433 int hexdump;
434 u_int offset;
435 u_int link_type;
436
437 union { /* int to float conversion buffer */
438 float f;
439 uint32_t i;
440 } bw;
441
442 ndo->ndo_protocol = "lmp";
443 tptr=pptr;
444 lmp_com_header = (const struct lmp_common_header *)pptr;
445 ND_TCHECK_SIZE(lmp_com_header);
446
447 version_res = GET_BE_U_2(lmp_com_header->version_res);
448
449 /*
450 * Sanity checking of the header.
451 */
452 if (LMP_EXTRACT_VERSION(version_res) != LMP_VERSION) {
453 ND_PRINT("LMP version %u packet not supported",
454 LMP_EXTRACT_VERSION(version_res));
455 return;
456 }
457
458 /* in non-verbose mode just lets print the basic Message Type*/
459 if (ndo->ndo_vflag < 1) {
460 ND_PRINT("LMPv%u %s Message, length: %u",
461 LMP_EXTRACT_VERSION(version_res),
462 tok2str(lmp_msg_type_values, "unknown (%u)",GET_U_1(lmp_com_header->msg_type)),
463 length);
464 return;
465 }
466
467 /* ok they seem to want to know everything - lets fully decode it */
468
469 tlen=GET_BE_U_2(lmp_com_header->length);
470
471 ND_PRINT("\n\tLMPv%u, msg-type: %s, Flags: [%s], length: %u",
472 LMP_EXTRACT_VERSION(version_res),
473 tok2str(lmp_msg_type_values, "unknown, type: %u",GET_U_1(lmp_com_header->msg_type)),
474 bittok2str(lmp_header_flag_values,"none",GET_U_1(lmp_com_header->flags)),
475 tlen);
476 if (tlen < sizeof(struct lmp_common_header)) {
477 ND_PRINT(" (too short)");
478 return;
479 }
480 if (tlen > length) {
481 ND_PRINT(" (too long)");
482 tlen = length;
483 }
484
485 tptr+=sizeof(struct lmp_common_header);
486 tlen-=sizeof(struct lmp_common_header);
487
488 while(tlen>0) {
489 /* did we capture enough for fully decoding the object header ? */
490 ND_TCHECK_LEN(tptr, sizeof(struct lmp_object_header));
491
492 lmp_obj_header = (const struct lmp_object_header *)tptr;
493 lmp_obj_len=GET_BE_U_2(lmp_obj_header->length);
494 lmp_obj_ctype=GET_U_1(lmp_obj_header->ctype)&0x7f;
495
496 ND_PRINT("\n\t %s Object (%u), Class-Type: %s (%u) Flags: [%snegotiable], length: %u",
497 tok2str(lmp_obj_values,
498 "Unknown",
499 GET_U_1(lmp_obj_header->class_num)),
500 GET_U_1(lmp_obj_header->class_num),
501 tok2str(lmp_ctype_values,
502 "Unknown",
503 (GET_U_1(lmp_obj_header->class_num)<<8)+lmp_obj_ctype),
504 lmp_obj_ctype,
505 GET_U_1(lmp_obj_header->ctype)&0x80 ? "" : "non-",
506 lmp_obj_len);
507
508 if (lmp_obj_len < 4) {
509 ND_PRINT(" (too short)");
510 return;
511 }
512 if ((lmp_obj_len % 4) != 0) {
513 ND_PRINT(" (not a multiple of 4)");
514 return;
515 }
516
517 obj_tptr=tptr+sizeof(struct lmp_object_header);
518 obj_tlen=lmp_obj_len-sizeof(struct lmp_object_header);
519
520 /* did we capture enough for fully decoding the object ? */
521 ND_TCHECK_LEN(tptr, lmp_obj_len);
522 hexdump=FALSE;
523
524 switch(GET_U_1(lmp_obj_header->class_num)) {
525
526 case LMP_OBJ_CC_ID:
527 switch(lmp_obj_ctype) {
528 case LMP_CTYPE_LOC:
529 case LMP_CTYPE_RMT:
530 if (obj_tlen != 4) {
531 ND_PRINT(" (not correct for object)");
532 break;
533 }
534 ND_PRINT("\n\t Control Channel ID: %u (0x%08x)",
535 GET_BE_U_4(obj_tptr),
536 GET_BE_U_4(obj_tptr));
537 break;
538
539 default:
540 hexdump=TRUE;
541 }
542 break;
543
544 case LMP_OBJ_LINK_ID:
545 case LMP_OBJ_INTERFACE_ID:
546 switch(lmp_obj_ctype) {
547 case LMP_CTYPE_IPV4_LOC:
548 case LMP_CTYPE_IPV4_RMT:
549 if (obj_tlen != 4) {
550 ND_PRINT(" (not correct for object)");
551 break;
552 }
553 ND_PRINT("\n\t IPv4 Link ID: %s (0x%08x)",
554 GET_IPADDR_STRING(obj_tptr),
555 GET_BE_U_4(obj_tptr));
556 break;
557 case LMP_CTYPE_IPV6_LOC:
558 case LMP_CTYPE_IPV6_RMT:
559 if (obj_tlen != 16) {
560 ND_PRINT(" (not correct for object)");
561 break;
562 }
563 ND_PRINT("\n\t IPv6 Link ID: %s (0x%08x)",
564 GET_IP6ADDR_STRING(obj_tptr),
565 GET_BE_U_4(obj_tptr));
566 break;
567 case LMP_CTYPE_UNMD_LOC:
568 case LMP_CTYPE_UNMD_RMT:
569 if (obj_tlen != 4) {
570 ND_PRINT(" (not correct for object)");
571 break;
572 }
573 ND_PRINT("\n\t Link ID: %u (0x%08x)",
574 GET_BE_U_4(obj_tptr),
575 GET_BE_U_4(obj_tptr));
576 break;
577 default:
578 hexdump=TRUE;
579 }
580 break;
581
582 case LMP_OBJ_MESSAGE_ID:
583 switch(lmp_obj_ctype) {
584 case LMP_CTYPE_1:
585 if (obj_tlen != 4) {
586 ND_PRINT(" (not correct for object)");
587 break;
588 }
589 ND_PRINT("\n\t Message ID: %u (0x%08x)",
590 GET_BE_U_4(obj_tptr),
591 GET_BE_U_4(obj_tptr));
592 break;
593 case LMP_CTYPE_2:
594 if (obj_tlen != 4) {
595 ND_PRINT(" (not correct for object)");
596 break;
597 }
598 ND_PRINT("\n\t Message ID Ack: %u (0x%08x)",
599 GET_BE_U_4(obj_tptr),
600 GET_BE_U_4(obj_tptr));
601 break;
602 default:
603 hexdump=TRUE;
604 }
605 break;
606
607 case LMP_OBJ_NODE_ID:
608 switch(lmp_obj_ctype) {
609 case LMP_CTYPE_LOC:
610 case LMP_CTYPE_RMT:
611 if (obj_tlen != 4) {
612 ND_PRINT(" (not correct for object)");
613 break;
614 }
615 ND_PRINT("\n\t Node ID: %s (0x%08x)",
616 GET_IPADDR_STRING(obj_tptr),
617 GET_BE_U_4(obj_tptr));
618 break;
619
620 default:
621 hexdump=TRUE;
622 }
623 break;
624
625 case LMP_OBJ_CONFIG:
626 switch(lmp_obj_ctype) {
627 case LMP_CTYPE_HELLO_CONFIG:
628 if (obj_tlen != 4) {
629 ND_PRINT(" (not correct for object)");
630 break;
631 }
632 ND_PRINT("\n\t Hello Interval: %u\n\t Hello Dead Interval: %u",
633 GET_BE_U_2(obj_tptr),
634 GET_BE_U_2(obj_tptr + 2));
635 break;
636
637 default:
638 hexdump=TRUE;
639 }
640 break;
641
642 case LMP_OBJ_HELLO:
643 switch(lmp_obj_ctype) {
644 case LMP_CTYPE_HELLO:
645 if (obj_tlen != 8) {
646 ND_PRINT(" (not correct for object)");
647 break;
648 }
649 ND_PRINT("\n\t Tx Seq: %u, Rx Seq: %u",
650 GET_BE_U_4(obj_tptr),
651 GET_BE_U_4(obj_tptr + 4));
652 break;
653
654 default:
655 hexdump=TRUE;
656 }
657 break;
658
659 case LMP_OBJ_TE_LINK:
660 switch(lmp_obj_ctype) {
661 case LMP_CTYPE_IPV4:
662 if (obj_tlen != 12) {
663 ND_PRINT(" (not correct for object)");
664 break;
665 }
666 ND_PRINT("\n\t Flags: [%s]",
667 bittok2str(lmp_obj_te_link_flag_values,
668 "none",
669 GET_U_1(obj_tptr)));
670
671 ND_PRINT("\n\t Local Link-ID: %s (0x%08x)"
672 "\n\t Remote Link-ID: %s (0x%08x)",
673 GET_IPADDR_STRING(obj_tptr+4),
674 GET_BE_U_4(obj_tptr + 4),
675 GET_IPADDR_STRING(obj_tptr+8),
676 GET_BE_U_4(obj_tptr + 8));
677 break;
678
679 case LMP_CTYPE_IPV6:
680 if (obj_tlen != 36) {
681 ND_PRINT(" (not correct for object)");
682 break;
683 }
684 ND_PRINT("\n\t Flags: [%s]",
685 bittok2str(lmp_obj_te_link_flag_values,
686 "none",
687 GET_U_1(obj_tptr)));
688
689 ND_PRINT("\n\t Local Link-ID: %s (0x%08x)"
690 "\n\t Remote Link-ID: %s (0x%08x)",
691 GET_IP6ADDR_STRING(obj_tptr+4),
692 GET_BE_U_4(obj_tptr + 4),
693 GET_IP6ADDR_STRING(obj_tptr+20),
694 GET_BE_U_4(obj_tptr + 20));
695 break;
696
697 case LMP_CTYPE_UNMD:
698 if (obj_tlen != 12) {
699 ND_PRINT(" (not correct for object)");
700 break;
701 }
702 ND_PRINT("\n\t Flags: [%s]",
703 bittok2str(lmp_obj_te_link_flag_values,
704 "none",
705 GET_U_1(obj_tptr)));
706
707 ND_PRINT("\n\t Local Link-ID: %u (0x%08x)"
708 "\n\t Remote Link-ID: %u (0x%08x)",
709 GET_BE_U_4(obj_tptr + 4),
710 GET_BE_U_4(obj_tptr + 4),
711 GET_BE_U_4(obj_tptr + 8),
712 GET_BE_U_4(obj_tptr + 8));
713 break;
714
715 default:
716 hexdump=TRUE;
717 }
718 break;
719
720 case LMP_OBJ_DATA_LINK:
721 switch(lmp_obj_ctype) {
722 case LMP_CTYPE_IPV4:
723 if (obj_tlen < 12) {
724 ND_PRINT(" (not correct for object)");
725 break;
726 }
727 ND_PRINT("\n\t Flags: [%s]",
728 bittok2str(lmp_obj_data_link_flag_values,
729 "none",
730 GET_U_1(obj_tptr)));
731 ND_PRINT("\n\t Local Interface ID: %s (0x%08x)"
732 "\n\t Remote Interface ID: %s (0x%08x)",
733 GET_IPADDR_STRING(obj_tptr+4),
734 GET_BE_U_4(obj_tptr + 4),
735 GET_IPADDR_STRING(obj_tptr+8),
736 GET_BE_U_4(obj_tptr + 8));
737
738 if (lmp_print_data_link_subobjs(ndo, obj_tptr, obj_tlen - 12, 12))
739 hexdump=TRUE;
740 break;
741
742 case LMP_CTYPE_IPV6:
743 if (obj_tlen < 36) {
744 ND_PRINT(" (not correct for object)");
745 break;
746 }
747 ND_PRINT("\n\t Flags: [%s]",
748 bittok2str(lmp_obj_data_link_flag_values,
749 "none",
750 GET_U_1(obj_tptr)));
751 ND_PRINT("\n\t Local Interface ID: %s (0x%08x)"
752 "\n\t Remote Interface ID: %s (0x%08x)",
753 GET_IP6ADDR_STRING(obj_tptr+4),
754 GET_BE_U_4(obj_tptr + 4),
755 GET_IP6ADDR_STRING(obj_tptr+20),
756 GET_BE_U_4(obj_tptr + 20));
757
758 if (lmp_print_data_link_subobjs(ndo, obj_tptr, obj_tlen - 36, 36))
759 hexdump=TRUE;
760 break;
761
762 case LMP_CTYPE_UNMD:
763 if (obj_tlen < 12) {
764 ND_PRINT(" (not correct for object)");
765 break;
766 }
767 ND_PRINT("\n\t Flags: [%s]",
768 bittok2str(lmp_obj_data_link_flag_values,
769 "none",
770 GET_U_1(obj_tptr)));
771 ND_PRINT("\n\t Local Interface ID: %u (0x%08x)"
772 "\n\t Remote Interface ID: %u (0x%08x)",
773 GET_BE_U_4(obj_tptr + 4),
774 GET_BE_U_4(obj_tptr + 4),
775 GET_BE_U_4(obj_tptr + 8),
776 GET_BE_U_4(obj_tptr + 8));
777
778 if (lmp_print_data_link_subobjs(ndo, obj_tptr, obj_tlen - 12, 12))
779 hexdump=TRUE;
780 break;
781
782 default:
783 hexdump=TRUE;
784 }
785 break;
786
787 case LMP_OBJ_VERIFY_BEGIN:
788 switch(lmp_obj_ctype) {
789 case LMP_CTYPE_1:
790 if (obj_tlen != 20) {
791 ND_PRINT(" (not correct for object)");
792 break;
793 }
794 ND_PRINT("\n\t Flags: %s",
795 bittok2str(lmp_obj_begin_verify_flag_values,
796 "none",
797 GET_BE_U_2(obj_tptr)));
798 ND_PRINT("\n\t Verify Interval: %u",
799 GET_BE_U_2(obj_tptr + 2));
800 ND_PRINT("\n\t Data links: %u",
801 GET_BE_U_4(obj_tptr + 4));
802 ND_PRINT("\n\t Encoding type: %s",
803 tok2str(gmpls_encoding_values, "Unknown", GET_U_1((obj_tptr + 8))));
804 ND_PRINT("\n\t Verify Transport Mechanism: %u (0x%x)%s",
805 GET_BE_U_2(obj_tptr + 10),
806 GET_BE_U_2(obj_tptr + 10),
807 GET_BE_U_2(obj_tptr + 10)&8000 ? " (Payload test messages capable)" : "");
808 bw.i = GET_BE_U_4(obj_tptr + 12);
809 ND_PRINT("\n\t Transmission Rate: %.3f Mbps",bw.f*8/1000000);
810 ND_PRINT("\n\t Wavelength: %u",
811 GET_BE_U_4(obj_tptr + 16));
812 break;
813
814 default:
815 hexdump=TRUE;
816 }
817 break;
818
819 case LMP_OBJ_VERIFY_BEGIN_ACK:
820 switch(lmp_obj_ctype) {
821 case LMP_CTYPE_1:
822 if (obj_tlen != 4) {
823 ND_PRINT(" (not correct for object)");
824 break;
825 }
826 ND_PRINT("\n\t Verify Dead Interval: %u"
827 "\n\t Verify Transport Response: %u",
828 GET_BE_U_2(obj_tptr),
829 GET_BE_U_2(obj_tptr + 2));
830 break;
831
832 default:
833 hexdump=TRUE;
834 }
835 break;
836
837 case LMP_OBJ_VERIFY_ID:
838 switch(lmp_obj_ctype) {
839 case LMP_CTYPE_1:
840 if (obj_tlen != 4) {
841 ND_PRINT(" (not correct for object)");
842 break;
843 }
844 ND_PRINT("\n\t Verify ID: %u",
845 GET_BE_U_4(obj_tptr));
846 break;
847
848 default:
849 hexdump=TRUE;
850 }
851 break;
852
853 case LMP_OBJ_CHANNEL_STATUS:
854 switch(lmp_obj_ctype) {
855 case LMP_CTYPE_IPV4:
856 offset = 0;
857 /* Decode pairs: <Interface_ID (4 bytes), Channel_status (4 bytes)> */
858 while (offset+8 <= obj_tlen) {
859 ND_PRINT("\n\t Interface ID: %s (0x%08x)",
860 GET_IPADDR_STRING(obj_tptr+offset),
861 GET_BE_U_4(obj_tptr + offset));
862
863 ND_PRINT("\n\t\t Active: %s (%u)",
864 (GET_BE_U_4(obj_tptr + offset + 4)>>31) ?
865 "Allocated" : "Non-allocated",
866 (GET_BE_U_4(obj_tptr + offset + 4)>>31));
867
868 ND_PRINT("\n\t\t Direction: %s (%u)",
869 (GET_BE_U_4(obj_tptr + offset + 4)>>30)&0x1 ?
870 "Transmit" : "Receive",
871 (GET_BE_U_4(obj_tptr + offset + 4)>>30)&0x1);
872
873 ND_PRINT("\n\t\t Channel Status: %s (%u)",
874 tok2str(lmp_obj_channel_status_values,
875 "Unknown",
876 GET_BE_U_4(obj_tptr + offset + 4)&0x3FFFFFF),
877 GET_BE_U_4(obj_tptr + offset + 4)&0x3FFFFFF);
878 offset+=8;
879 }
880 break;
881
882 case LMP_CTYPE_IPV6:
883 offset = 0;
884 /* Decode pairs: <Interface_ID (16 bytes), Channel_status (4 bytes)> */
885 while (offset+20 <= obj_tlen) {
886 ND_PRINT("\n\t Interface ID: %s (0x%08x)",
887 GET_IP6ADDR_STRING(obj_tptr+offset),
888 GET_BE_U_4(obj_tptr + offset));
889
890 ND_PRINT("\n\t\t Active: %s (%u)",
891 (GET_BE_U_4(obj_tptr + offset + 16)>>31) ?
892 "Allocated" : "Non-allocated",
893 (GET_BE_U_4(obj_tptr + offset + 16)>>31));
894
895 ND_PRINT("\n\t\t Direction: %s (%u)",
896 (GET_BE_U_4(obj_tptr + offset + 16)>>30)&0x1 ?
897 "Transmit" : "Receive",
898 (GET_BE_U_4(obj_tptr + offset + 16)>>30)&0x1);
899
900 ND_PRINT("\n\t\t Channel Status: %s (%u)",
901 tok2str(lmp_obj_channel_status_values,
902 "Unknown",
903 GET_BE_U_4(obj_tptr + offset + 16)&0x3FFFFFF),
904 GET_BE_U_4(obj_tptr + offset + 16)&0x3FFFFFF);
905 offset+=20;
906 }
907 break;
908
909 case LMP_CTYPE_UNMD:
910 offset = 0;
911 /* Decode pairs: <Interface_ID (4 bytes), Channel_status (4 bytes)> */
912 while (offset+8 <= obj_tlen) {
913 ND_PRINT("\n\t Interface ID: %u (0x%08x)",
914 GET_BE_U_4(obj_tptr + offset),
915 GET_BE_U_4(obj_tptr + offset));
916
917 ND_PRINT("\n\t\t Active: %s (%u)",
918 (GET_BE_U_4(obj_tptr + offset + 4)>>31) ?
919 "Allocated" : "Non-allocated",
920 (GET_BE_U_4(obj_tptr + offset + 4)>>31));
921
922 ND_PRINT("\n\t\t Direction: %s (%u)",
923 (GET_BE_U_4(obj_tptr + offset + 4)>>30)&0x1 ?
924 "Transmit" : "Receive",
925 (GET_BE_U_4(obj_tptr + offset + 4)>>30)&0x1);
926
927 ND_PRINT("\n\t\t Channel Status: %s (%u)",
928 tok2str(lmp_obj_channel_status_values,
929 "Unknown",
930 GET_BE_U_4(obj_tptr + offset + 4)&0x3FFFFFF),
931 GET_BE_U_4(obj_tptr + offset + 4)&0x3FFFFFF);
932 offset+=8;
933 }
934 break;
935
936 default:
937 hexdump=TRUE;
938 }
939 break;
940
941 case LMP_OBJ_CHANNEL_STATUS_REQ:
942 switch(lmp_obj_ctype) {
943 case LMP_CTYPE_IPV4:
944 offset = 0;
945 while (offset+4 <= obj_tlen) {
946 ND_PRINT("\n\t Interface ID: %s (0x%08x)",
947 GET_IPADDR_STRING(obj_tptr+offset),
948 GET_BE_U_4(obj_tptr + offset));
949 offset+=4;
950 }
951 break;
952
953 case LMP_CTYPE_IPV6:
954 offset = 0;
955 while (offset+16 <= obj_tlen) {
956 ND_PRINT("\n\t Interface ID: %s (0x%08x)",
957 GET_IP6ADDR_STRING(obj_tptr+offset),
958 GET_BE_U_4(obj_tptr + offset));
959 offset+=16;
960 }
961 break;
962
963 case LMP_CTYPE_UNMD:
964 offset = 0;
965 while (offset+4 <= obj_tlen) {
966 ND_PRINT("\n\t Interface ID: %u (0x%08x)",
967 GET_BE_U_4(obj_tptr + offset),
968 GET_BE_U_4(obj_tptr + offset));
969 offset+=4;
970 }
971 break;
972
973 default:
974 hexdump=TRUE;
975 }
976 break;
977
978 case LMP_OBJ_ERROR_CODE:
979 switch(lmp_obj_ctype) {
980 case LMP_CTYPE_BEGIN_VERIFY_ERROR:
981 if (obj_tlen != 4) {
982 ND_PRINT(" (not correct for object)");
983 break;
984 }
985 ND_PRINT("\n\t Error Code: %s",
986 bittok2str(lmp_obj_begin_verify_error_values,
987 "none",
988 GET_BE_U_4(obj_tptr)));
989 break;
990
991 case LMP_CTYPE_LINK_SUMMARY_ERROR:
992 if (obj_tlen != 4) {
993 ND_PRINT(" (not correct for object)");
994 break;
995 }
996 ND_PRINT("\n\t Error Code: %s",
997 bittok2str(lmp_obj_link_summary_error_values,
998 "none",
999 GET_BE_U_4(obj_tptr)));
1000 break;
1001 default:
1002 hexdump=TRUE;
1003 }
1004 break;
1005
1006 case LMP_OBJ_SERVICE_CONFIG:
1007 switch (lmp_obj_ctype) {
1008 case LMP_CTYPE_SERVICE_CONFIG_SP:
1009 if (obj_tlen != 4) {
1010 ND_PRINT(" (not correct for object)");
1011 break;
1012 }
1013 ND_PRINT("\n\t Flags: %s",
1014 bittok2str(lmp_obj_service_config_sp_flag_values,
1015 "none",
1016 GET_U_1(obj_tptr)));
1017
1018 ND_PRINT("\n\t UNI Version: %u",
1019 GET_U_1(obj_tptr + 1));
1020
1021 break;
1022
1023 case LMP_CTYPE_SERVICE_CONFIG_CPSA:
1024 if (obj_tlen != 16) {
1025 ND_PRINT(" (not correct for object)");
1026 break;
1027 }
1028
1029 link_type = GET_U_1(obj_tptr);
1030
1031 ND_PRINT("\n\t Link Type: %s (%u)",
1032 tok2str(lmp_sd_service_config_cpsa_link_type_values,
1033 "Unknown", link_type),
1034 link_type);
1035
1036 switch (link_type) {
1037 case LMP_SD_SERVICE_CONFIG_CPSA_LINK_TYPE_SDH:
1038 ND_PRINT("\n\t Signal Type: %s (%u)",
1039 tok2str(lmp_sd_service_config_cpsa_signal_type_sdh_values,
1040 "Unknown",
1041 GET_U_1(obj_tptr + 1)),
1042 GET_U_1(obj_tptr + 1));
1043 break;
1044
1045 case LMP_SD_SERVICE_CONFIG_CPSA_LINK_TYPE_SONET:
1046 ND_PRINT("\n\t Signal Type: %s (%u)",
1047 tok2str(lmp_sd_service_config_cpsa_signal_type_sonet_values,
1048 "Unknown",
1049 GET_U_1(obj_tptr + 1)),
1050 GET_U_1(obj_tptr + 1));
1051 break;
1052 }
1053
1054 ND_PRINT("\n\t Transparency: %s",
1055 bittok2str(lmp_obj_service_config_cpsa_tp_flag_values,
1056 "none",
1057 GET_U_1(obj_tptr + 2)));
1058
1059 ND_PRINT("\n\t Contiguous Concatenation Types: %s",
1060 bittok2str(lmp_obj_service_config_cpsa_cct_flag_values,
1061 "none",
1062 GET_U_1(obj_tptr + 3)));
1063
1064 ND_PRINT("\n\t Minimum NCC: %u",
1065 GET_BE_U_2(obj_tptr + 4));
1066
1067 ND_PRINT("\n\t Maximum NCC: %u",
1068 GET_BE_U_2(obj_tptr + 6));
1069
1070 ND_PRINT("\n\t Minimum NVC:%u",
1071 GET_BE_U_2(obj_tptr + 8));
1072
1073 ND_PRINT("\n\t Maximum NVC:%u",
1074 GET_BE_U_2(obj_tptr + 10));
1075
1076 ND_PRINT("\n\t Local Interface ID: %s (0x%08x)",
1077 GET_IPADDR_STRING(obj_tptr+12),
1078 GET_BE_U_4(obj_tptr + 12));
1079
1080 break;
1081
1082 case LMP_CTYPE_SERVICE_CONFIG_TRANSPARENCY_TCM:
1083 if (obj_tlen != 8) {
1084 ND_PRINT(" (not correct for object)");
1085 break;
1086 }
1087
1088 ND_PRINT("\n\t Transparency Flags: %s",
1089 bittok2str(
1090 lmp_obj_service_config_nsa_transparency_flag_values,
1091 "none",
1092 GET_BE_U_4(obj_tptr)));
1093
1094 ND_PRINT("\n\t TCM Monitoring Flags: %s",
1095 bittok2str(
1096 lmp_obj_service_config_nsa_tcm_flag_values,
1097 "none",
1098 GET_U_1(obj_tptr + 7)));
1099
1100 break;
1101
1102 case LMP_CTYPE_SERVICE_CONFIG_NETWORK_DIVERSITY:
1103 if (obj_tlen != 4) {
1104 ND_PRINT(" (not correct for object)");
1105 break;
1106 }
1107
1108 ND_PRINT("\n\t Diversity: Flags: %s",
1109 bittok2str(
1110 lmp_obj_service_config_nsa_network_diversity_flag_values,
1111 "none",
1112 GET_U_1(obj_tptr + 3)));
1113 break;
1114
1115 default:
1116 hexdump = TRUE;
1117 }
1118
1119 break;
1120
1121 default:
1122 if (ndo->ndo_vflag <= 1)
1123 print_unknown_data(ndo,obj_tptr,"\n\t ",obj_tlen);
1124 break;
1125 }
1126 /* do we want to see an additionally hexdump ? */
1127 if (ndo->ndo_vflag > 1 || hexdump==TRUE)
1128 print_unknown_data(ndo,tptr+sizeof(struct lmp_object_header),"\n\t ",
1129 lmp_obj_len-sizeof(struct lmp_object_header));
1130
1131 if (tlen < lmp_obj_len) {
1132 ND_PRINT(" [remaining objects length %u < %u]", tlen, lmp_obj_len);
1133 nd_print_invalid(ndo);
1134 break;
1135 }
1136 tptr+=lmp_obj_len;
1137 tlen-=lmp_obj_len;
1138 }
1139 return;
1140 trunc:
1141 nd_print_trunc(ndo);
1142 }