]> The Tcpdump Group git mirrors - tcpdump/blob - print-stp.c
Remove some now redundant ND_TCHECK_LEN(e, sizeof(nd_ipv6)) calls
[tcpdump] / print-stp.c
1 /*
2 * Copyright (c) 2000 Lennert Buytenhek
3 *
4 * This software may be distributed either under the terms of the
5 * BSD-style license that accompanies tcpdump or the GNU General
6 * Public License
7 *
8 * Contributed by Lennert Buytenhek <buytenh@gnu.org>
9 */
10
11 /* \summary: IEEE 802.1d Spanning Tree Protocol (STP) printer */
12
13 #ifdef HAVE_CONFIG_H
14 #include <config.h>
15 #endif
16
17 #include "netdissect-stdinc.h"
18
19 #include <stdio.h>
20
21 #include "netdissect.h"
22 #include "extract.h"
23
24 #define RSTP_EXTRACT_PORT_ROLE(x) (((x)&0x0C)>>2)
25 /* STP timers are expressed in multiples of 1/256th second */
26 #define STP_TIME_BASE 256
27 #define STP_BPDU_MSTP_MIN_LEN 102
28
29 struct stp_bpdu_ {
30 nd_uint16_t protocol_id;
31 nd_uint8_t protocol_version;
32 nd_uint8_t bpdu_type;
33 nd_uint8_t flags;
34 nd_byte root_id[8];
35 nd_uint32_t root_path_cost;
36 nd_byte bridge_id[8];
37 nd_uint16_t port_id;
38 nd_uint16_t message_age;
39 nd_uint16_t max_age;
40 nd_uint16_t hello_time;
41 nd_uint16_t forward_delay;
42 nd_uint8_t v1_length;
43 };
44
45 #define STP_PROTO_REGULAR 0x00
46 #define STP_PROTO_RAPID 0x02
47 #define STP_PROTO_MSTP 0x03
48 #define STP_PROTO_SPB 0x04
49
50 static const struct tok stp_proto_values[] = {
51 { STP_PROTO_REGULAR, "802.1d" },
52 { STP_PROTO_RAPID, "802.1w" },
53 { STP_PROTO_MSTP, "802.1s" },
54 { STP_PROTO_SPB, "802.1aq" },
55 { 0, NULL}
56 };
57
58 #define STP_BPDU_TYPE_CONFIG 0x00
59 #define STP_BPDU_TYPE_RSTP 0x02
60 #define STP_BPDU_TYPE_TOPO_CHANGE 0x80
61
62 static const struct tok stp_bpdu_flag_values[] = {
63 { 0x01, "Topology change" },
64 { 0x02, "Proposal" },
65 { 0x10, "Learn" },
66 { 0x20, "Forward" },
67 { 0x40, "Agreement" },
68 { 0x80, "Topology change ACK" },
69 { 0, NULL}
70 };
71
72 static const struct tok stp_bpdu_type_values[] = {
73 { STP_BPDU_TYPE_CONFIG, "Config" },
74 { STP_BPDU_TYPE_RSTP, "Rapid STP" },
75 { STP_BPDU_TYPE_TOPO_CHANGE, "Topology Change" },
76 { 0, NULL}
77 };
78
79 static const struct tok rstp_obj_port_role_values[] = {
80 { 0x00, "Unknown" },
81 { 0x01, "Alternate" },
82 { 0x02, "Root" },
83 { 0x03, "Designated" },
84 { 0, NULL}
85 };
86
87 #define ND_TCHECK_BRIDGE_ID(p) ND_TCHECK_8(p)
88
89 static char *
90 stp_print_bridge_id(netdissect_options *ndo, const u_char *p)
91 {
92 static char bridge_id_str[sizeof("pppp.aa:bb:cc:dd:ee:ff")];
93
94 snprintf(bridge_id_str, sizeof(bridge_id_str),
95 "%.2x%.2x.%.2x:%.2x:%.2x:%.2x:%.2x:%.2x",
96 GET_U_1(p), GET_U_1(p + 1), GET_U_1(p + 2),
97 GET_U_1(p + 3), GET_U_1(p + 4), GET_U_1(p + 5),
98 GET_U_1(p + 6), GET_U_1(p + 7));
99
100 return bridge_id_str;
101 }
102
103 static int
104 stp_print_config_bpdu(netdissect_options *ndo, const struct stp_bpdu_ *stp_bpdu,
105 u_int length)
106 {
107 uint8_t bpdu_flags;
108
109 bpdu_flags = GET_U_1(stp_bpdu->flags);
110 ND_PRINT(", Flags [%s]",
111 bittok2str(stp_bpdu_flag_values, "none", bpdu_flags));
112
113 ND_PRINT(", bridge-id %s.%04x, length %u",
114 stp_print_bridge_id(ndo, stp_bpdu->bridge_id),
115 GET_BE_U_2(stp_bpdu->port_id), length);
116
117 /* in non-verbose mode just print the bridge-id */
118 if (!ndo->ndo_vflag) {
119 return 1;
120 }
121
122 ND_TCHECK_2(stp_bpdu->forward_delay);
123 ND_PRINT("\n\tmessage-age %.2fs, max-age %.2fs"
124 ", hello-time %.2fs, forwarding-delay %.2fs",
125 (float) GET_BE_U_2(stp_bpdu->message_age) / STP_TIME_BASE,
126 (float) GET_BE_U_2(stp_bpdu->max_age) / STP_TIME_BASE,
127 (float) GET_BE_U_2(stp_bpdu->hello_time) / STP_TIME_BASE,
128 (float) GET_BE_U_2(stp_bpdu->forward_delay) / STP_TIME_BASE);
129
130 ND_PRINT("\n\troot-id %s, root-pathcost %u",
131 stp_print_bridge_id(ndo, stp_bpdu->root_id),
132 GET_BE_U_4(stp_bpdu->root_path_cost));
133
134 /* Port role is only valid for 802.1w */
135 if (GET_U_1(stp_bpdu->protocol_version) == STP_PROTO_RAPID) {
136 ND_PRINT(", port-role %s",
137 tok2str(rstp_obj_port_role_values, "Unknown",
138 RSTP_EXTRACT_PORT_ROLE(bpdu_flags)));
139 }
140 return 1;
141
142 trunc:
143 return 0;
144 }
145
146 /*
147 * MSTP packet format
148 * Ref. IEEE 802.1Q 2003 Ed. Section 14
149 *
150 * MSTP BPDU
151 *
152 * 2 - bytes Protocol Id
153 * 1 - byte Protocol Ver.
154 * 1 - byte BPDU tye
155 * 1 - byte Flags
156 * 8 - bytes CIST Root Identifier
157 * 4 - bytes CIST External Path Cost
158 * 8 - bytes CIST Regional Root Identifier
159 * 2 - bytes CIST Port Identifier
160 * 2 - bytes Message Age
161 * 2 - bytes Max age
162 * 2 - bytes Hello Time
163 * 2 - bytes Forward delay
164 * 1 - byte Version 1 length. Must be 0
165 * 2 - bytes Version 3 length
166 * 1 - byte Config Identifier
167 * 32 - bytes Config Name
168 * 2 - bytes Revision level
169 * 16 - bytes Config Digest [MD5]
170 * 4 - bytes CIST Internal Root Path Cost
171 * 8 - bytes CIST Bridge Identifier
172 * 1 - byte CIST Remaining Hops
173 * 16 - bytes MSTI information [Max 64 MSTI, each 16 bytes]
174 *
175 *
176 * SPB BPDU
177 * Ref. IEEE 802.1aq. Section 14
178 *
179 * 2 - bytes Version 4 length
180 * 1 - byte Aux Config Identifier
181 * 32 - bytes Aux Config Name
182 * 2 - bytes Aux Revision level
183 * 16 - bytes Aux Config Digest [MD5]
184 * 1 - byte (1 - 2) Agreement Number
185 * (3 - 4) Discarded Agreement Number
186 * (5) Agreement Valid Flag
187 * (6) Restricted Role Flag
188 * (7 - 8) Unused sent zero
189 * 1 - byte Unused
190 * 1 - byte (1 - 4) Agreement Digest Format Identifier
191 * (5 - 8) Agreement Digest Format Capabilities
192 * 1 - byte (1 - 4) Agreement Digest Convention Identifier
193 * (5 - 8) Agreement Digest Convention Capabilities
194 * 2 - bytes Agreement Digest Edge Count
195 * 8 - byte Reserved Set
196 * 20 - bytes Computed Topology Digest
197 *
198 *
199 * MSTI Payload
200 *
201 * 1 - byte MSTI flag
202 * 8 - bytes MSTI Regional Root Identifier
203 * 4 - bytes MSTI Regional Path Cost
204 * 1 - byte MSTI Bridge Priority
205 * 1 - byte MSTI Port Priority
206 * 1 - byte MSTI Remaining Hops
207 *
208 */
209
210 #define MST_BPDU_MSTI_LENGTH 16
211 #define MST_BPDU_CONFIG_INFO_LENGTH 64
212
213 /* Offsets of fields from the begginning for the packet */
214 #define MST_BPDU_VER3_LEN_OFFSET 36
215 #define MST_BPDU_CONFIG_NAME_OFFSET 39
216 #define MST_BPDU_CONFIG_DIGEST_OFFSET 73
217 #define MST_BPDU_CIST_INT_PATH_COST_OFFSET 89
218 #define MST_BPDU_CIST_BRIDGE_ID_OFFSET 93
219 #define MST_BPDU_CIST_REMAIN_HOPS_OFFSET 101
220 #define MST_BPDU_MSTI_OFFSET 102
221 /* Offsets within an MSTI */
222 #define MST_BPDU_MSTI_ROOT_PRIO_OFFSET 1
223 #define MST_BPDU_MSTI_ROOT_PATH_COST_OFFSET 9
224 #define MST_BPDU_MSTI_BRIDGE_PRIO_OFFSET 13
225 #define MST_BPDU_MSTI_PORT_PRIO_OFFSET 14
226 #define MST_BPDU_MSTI_REMAIN_HOPS_OFFSET 15
227
228 #define SPB_BPDU_MIN_LEN 87
229 #define SPB_BPDU_CONFIG_NAME_OFFSET 3
230 #define SPB_BPDU_CONFIG_REV_OFFSET SPB_BPDU_CONFIG_NAME_OFFSET + 32
231 #define SPB_BPDU_CONFIG_DIGEST_OFFSET SPB_BPDU_CONFIG_REV_OFFSET + 2
232 #define SPB_BPDU_AGREEMENT_OFFSET SPB_BPDU_CONFIG_DIGEST_OFFSET + 16
233 #define SPB_BPDU_AGREEMENT_UNUSED_OFFSET SPB_BPDU_AGREEMENT_OFFSET + 1
234 #define SPB_BPDU_AGREEMENT_FORMAT_OFFSET SPB_BPDU_AGREEMENT_UNUSED_OFFSET + 1
235 #define SPB_BPDU_AGREEMENT_CON_OFFSET SPB_BPDU_AGREEMENT_FORMAT_OFFSET + 1
236 #define SPB_BPDU_AGREEMENT_EDGE_OFFSET SPB_BPDU_AGREEMENT_CON_OFFSET + 1
237 #define SPB_BPDU_AGREEMENT_RES1_OFFSET SPB_BPDU_AGREEMENT_EDGE_OFFSET + 2
238 #define SPB_BPDU_AGREEMENT_RES2_OFFSET SPB_BPDU_AGREEMENT_RES1_OFFSET + 4
239 #define SPB_BPDU_AGREEMENT_DIGEST_OFFSET SPB_BPDU_AGREEMENT_RES2_OFFSET + 4
240
241 static int
242 stp_print_mstp_bpdu(netdissect_options *ndo, const struct stp_bpdu_ *stp_bpdu,
243 u_int length)
244 {
245 const u_char *ptr;
246 uint8_t bpdu_flags;
247 uint16_t v3len;
248 uint16_t len;
249 uint16_t msti;
250 u_int offset;
251
252 ptr = (const u_char *)stp_bpdu;
253 bpdu_flags = GET_U_1(stp_bpdu->flags);
254 ND_PRINT(", CIST Flags [%s], length %u",
255 bittok2str(stp_bpdu_flag_values, "none", bpdu_flags), length);
256
257 /*
258 * in non-verbose mode just print the flags.
259 */
260 if (!ndo->ndo_vflag) {
261 return 1;
262 }
263
264 ND_PRINT("\n\tport-role %s, ",
265 tok2str(rstp_obj_port_role_values, "Unknown",
266 RSTP_EXTRACT_PORT_ROLE(bpdu_flags)));
267
268 ND_PRINT("CIST root-id %s, CIST ext-pathcost %u",
269 stp_print_bridge_id(ndo, stp_bpdu->root_id),
270 GET_BE_U_4(stp_bpdu->root_path_cost));
271
272 ND_TCHECK_SIZE(&stp_bpdu->bridge_id);
273 ND_PRINT("\n\tCIST regional-root-id %s, ",
274 stp_print_bridge_id(ndo, stp_bpdu->bridge_id));
275
276 ND_PRINT("CIST port-id %04x,", GET_BE_U_2(stp_bpdu->port_id));
277
278 ND_TCHECK_2(stp_bpdu->forward_delay);
279 ND_PRINT("\n\tmessage-age %.2fs, max-age %.2fs"
280 ", hello-time %.2fs, forwarding-delay %.2fs",
281 (float) GET_BE_U_2(stp_bpdu->message_age) / STP_TIME_BASE,
282 (float) GET_BE_U_2(stp_bpdu->max_age) / STP_TIME_BASE,
283 (float) GET_BE_U_2(stp_bpdu->hello_time) / STP_TIME_BASE,
284 (float) GET_BE_U_2(stp_bpdu->forward_delay) / STP_TIME_BASE);
285
286 ND_PRINT("\n\tv3len %u, ", GET_BE_U_2(ptr + MST_BPDU_VER3_LEN_OFFSET));
287 ND_TCHECK_4(ptr + MST_BPDU_CONFIG_DIGEST_OFFSET + 12);
288 ND_PRINT("MCID Name ");
289 if (nd_printzp(ndo, ptr + MST_BPDU_CONFIG_NAME_OFFSET, 32, ndo->ndo_snapend))
290 goto trunc;
291 ND_PRINT(", rev %u,"
292 "\n\t\tdigest %08x%08x%08x%08x, ",
293 GET_BE_U_2(ptr + MST_BPDU_CONFIG_NAME_OFFSET + 32),
294 GET_BE_U_4(ptr + MST_BPDU_CONFIG_DIGEST_OFFSET),
295 GET_BE_U_4(ptr + MST_BPDU_CONFIG_DIGEST_OFFSET + 4),
296 GET_BE_U_4(ptr + MST_BPDU_CONFIG_DIGEST_OFFSET + 8),
297 GET_BE_U_4(ptr + MST_BPDU_CONFIG_DIGEST_OFFSET + 12));
298
299 ND_PRINT("CIST int-root-pathcost %u,",
300 GET_BE_U_4(ptr + MST_BPDU_CIST_INT_PATH_COST_OFFSET));
301
302 ND_TCHECK_BRIDGE_ID(ptr + MST_BPDU_CIST_BRIDGE_ID_OFFSET);
303 ND_PRINT("\n\tCIST bridge-id %s, ",
304 stp_print_bridge_id(ndo, ptr + MST_BPDU_CIST_BRIDGE_ID_OFFSET));
305
306 ND_PRINT("CIST remaining-hops %u",
307 GET_U_1(ptr + MST_BPDU_CIST_REMAIN_HOPS_OFFSET));
308
309 /* Dump all MSTI's */
310 v3len = GET_BE_U_2(ptr + MST_BPDU_VER3_LEN_OFFSET);
311 if (v3len > MST_BPDU_CONFIG_INFO_LENGTH) {
312 len = v3len - MST_BPDU_CONFIG_INFO_LENGTH;
313 offset = MST_BPDU_MSTI_OFFSET;
314 while (len >= MST_BPDU_MSTI_LENGTH) {
315 ND_TCHECK_LEN(ptr + offset, MST_BPDU_MSTI_LENGTH);
316
317 msti = GET_BE_U_2(ptr + offset + MST_BPDU_MSTI_ROOT_PRIO_OFFSET);
318 msti = msti & 0x0FFF;
319
320 ND_PRINT("\n\tMSTI %u, Flags [%s], port-role %s",
321 msti,
322 bittok2str(stp_bpdu_flag_values, "none", GET_U_1(ptr + offset)),
323 tok2str(rstp_obj_port_role_values, "Unknown",
324 RSTP_EXTRACT_PORT_ROLE(GET_U_1(ptr + offset))));
325 ND_PRINT("\n\t\tMSTI regional-root-id %s, pathcost %u",
326 stp_print_bridge_id(ndo, ptr + offset +
327 MST_BPDU_MSTI_ROOT_PRIO_OFFSET),
328 GET_BE_U_4(ptr + offset + MST_BPDU_MSTI_ROOT_PATH_COST_OFFSET));
329 ND_PRINT("\n\t\tMSTI bridge-prio %u, port-prio %u, hops %u",
330 GET_U_1(ptr + offset + MST_BPDU_MSTI_BRIDGE_PRIO_OFFSET) >> 4,
331 GET_U_1(ptr + offset + MST_BPDU_MSTI_PORT_PRIO_OFFSET) >> 4,
332 GET_U_1(ptr + offset + MST_BPDU_MSTI_REMAIN_HOPS_OFFSET));
333
334 len -= MST_BPDU_MSTI_LENGTH;
335 offset += MST_BPDU_MSTI_LENGTH;
336 }
337 }
338 return 1;
339
340 trunc:
341 return 0;
342 }
343
344 static int
345 stp_print_spb_bpdu(netdissect_options *ndo, const struct stp_bpdu_ *stp_bpdu,
346 u_int offset)
347 {
348 const u_char *ptr;
349
350 /*
351 * in non-verbose mode don't print anything.
352 */
353 if (!ndo->ndo_vflag) {
354 return 1;
355 }
356
357 ptr = (const u_char *)stp_bpdu;
358 ND_TCHECK_4(ptr + offset + SPB_BPDU_AGREEMENT_DIGEST_OFFSET + 16);
359
360 ND_PRINT("\n\tv4len %u, ", GET_BE_U_2(ptr + offset));
361 ND_PRINT("AUXMCID Name ");
362 if (nd_printzp(ndo, ptr + offset + SPB_BPDU_CONFIG_NAME_OFFSET, 32,
363 ndo->ndo_snapend))
364 goto trunc;
365 ND_PRINT(", Rev %u,\n\t\tdigest %08x%08x%08x%08x",
366 GET_BE_U_2(ptr + offset + SPB_BPDU_CONFIG_REV_OFFSET),
367 GET_BE_U_4(ptr + offset + SPB_BPDU_CONFIG_DIGEST_OFFSET),
368 GET_BE_U_4(ptr + offset + SPB_BPDU_CONFIG_DIGEST_OFFSET + 4),
369 GET_BE_U_4(ptr + offset + SPB_BPDU_CONFIG_DIGEST_OFFSET + 8),
370 GET_BE_U_4(ptr + offset + SPB_BPDU_CONFIG_DIGEST_OFFSET + 12));
371
372 ND_PRINT("\n\tAgreement num %u, Discarded Agreement num %u, Agreement valid-"
373 "flag %u,\n\tRestricted role-flag: %u, Format id %u cap %u, "
374 "Convention id %u cap %u,\n\tEdge count %u, "
375 "Agreement digest %08x%08x%08x%08x%08x",
376 GET_U_1(ptr + offset + SPB_BPDU_AGREEMENT_OFFSET)>>6,
377 GET_U_1(ptr + offset + SPB_BPDU_AGREEMENT_OFFSET)>>4 & 0x3,
378 GET_U_1(ptr + offset + SPB_BPDU_AGREEMENT_OFFSET)>>3 & 0x1,
379 GET_U_1(ptr + offset + SPB_BPDU_AGREEMENT_OFFSET)>>2 & 0x1,
380 GET_U_1(ptr + offset + SPB_BPDU_AGREEMENT_FORMAT_OFFSET)>>4,
381 GET_U_1(ptr + offset + SPB_BPDU_AGREEMENT_FORMAT_OFFSET)&0x00ff,
382 GET_U_1(ptr + offset + SPB_BPDU_AGREEMENT_CON_OFFSET)>>4,
383 GET_U_1(ptr + offset + SPB_BPDU_AGREEMENT_CON_OFFSET)&0x00ff,
384 GET_BE_U_2(ptr + offset + SPB_BPDU_AGREEMENT_EDGE_OFFSET),
385 GET_BE_U_4(ptr + offset + SPB_BPDU_AGREEMENT_DIGEST_OFFSET),
386 GET_BE_U_4(ptr + offset + SPB_BPDU_AGREEMENT_DIGEST_OFFSET + 4),
387 GET_BE_U_4(ptr + offset + SPB_BPDU_AGREEMENT_DIGEST_OFFSET + 8),
388 GET_BE_U_4(ptr + offset + SPB_BPDU_AGREEMENT_DIGEST_OFFSET + 12),
389 GET_BE_U_4(ptr + offset + SPB_BPDU_AGREEMENT_DIGEST_OFFSET + 16));
390 return 1;
391
392 trunc:
393 return 0;
394 }
395
396 /*
397 * Print 802.1d / 802.1w / 802.1q (mstp) / 802.1aq (spb) packets.
398 */
399 void
400 stp_print(netdissect_options *ndo, const u_char *p, u_int length)
401 {
402 const struct stp_bpdu_ *stp_bpdu;
403 u_int protocol_version;
404 u_int bpdu_type;
405 u_int mstp_len;
406 u_int spb_len;
407
408 ndo->ndo_protocol = "stp";
409 stp_bpdu = (const struct stp_bpdu_*)p;
410
411 /* Minimum STP Frame size. */
412 if (length < 4)
413 goto trunc;
414
415 if (GET_BE_U_2(stp_bpdu->protocol_id)) {
416 ND_PRINT("unknown STP version, length %u", length);
417 return;
418 }
419
420 protocol_version = GET_U_1(stp_bpdu->protocol_version);
421 ND_PRINT("STP %s", tok2str(stp_proto_values, "Unknown STP protocol (0x%02x)",
422 protocol_version));
423
424 switch (protocol_version) {
425 case STP_PROTO_REGULAR:
426 case STP_PROTO_RAPID:
427 case STP_PROTO_MSTP:
428 case STP_PROTO_SPB:
429 break;
430 default:
431 return;
432 }
433
434 bpdu_type = GET_U_1(stp_bpdu->bpdu_type);
435 ND_PRINT(", %s", tok2str(stp_bpdu_type_values, "Unknown BPDU Type (0x%02x)",
436 bpdu_type));
437
438 switch (bpdu_type) {
439 case STP_BPDU_TYPE_CONFIG:
440 if (length < sizeof(struct stp_bpdu_) - 1) {
441 goto trunc;
442 }
443 if (!stp_print_config_bpdu(ndo, stp_bpdu, length))
444 goto trunc;
445 break;
446
447 case STP_BPDU_TYPE_RSTP:
448 if (protocol_version == STP_PROTO_RAPID) {
449 if (length < sizeof(struct stp_bpdu_)) {
450 goto trunc;
451 }
452 if (!stp_print_config_bpdu(ndo, stp_bpdu, length))
453 goto trunc;
454 } else if (protocol_version == STP_PROTO_MSTP ||
455 protocol_version == STP_PROTO_SPB) {
456 if (length < STP_BPDU_MSTP_MIN_LEN) {
457 goto trunc;
458 }
459
460 if (GET_U_1(stp_bpdu->v1_length) != 0) {
461 /* FIX ME: Emit a message here ? */
462 goto trunc;
463 }
464
465 /* Validate v3 length */
466 mstp_len = GET_BE_U_2(p + MST_BPDU_VER3_LEN_OFFSET);
467 mstp_len += 2; /* length encoding itself is 2 bytes */
468 if (length < (sizeof(struct stp_bpdu_) + mstp_len)) {
469 goto trunc;
470 }
471 if (!stp_print_mstp_bpdu(ndo, stp_bpdu, length))
472 goto trunc;
473
474 if (protocol_version == STP_PROTO_SPB)
475 {
476 /* Validate v4 length */
477 spb_len = GET_BE_U_2(p + MST_BPDU_VER3_LEN_OFFSET + mstp_len);
478 spb_len += 2;
479 if (length < (sizeof(struct stp_bpdu_) + mstp_len + spb_len) ||
480 spb_len < SPB_BPDU_MIN_LEN) {
481 goto trunc;
482 }
483 if (!stp_print_spb_bpdu(ndo, stp_bpdu, (sizeof(struct stp_bpdu_) + mstp_len)))
484 goto trunc;
485 }
486 }
487 break;
488
489 case STP_BPDU_TYPE_TOPO_CHANGE:
490 /* always empty message - just break out */
491 break;
492
493 default:
494 break;
495 }
496
497 return;
498 trunc:
499 nd_print_trunc(ndo);
500 }