2 * Copyright (c) 2007-2011 Grégoire Henry, Juliusz Chroboczek
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * 3. Neither the name of the project nor the names of its contributors
13 * may be used to endorse or promote products derived from this software
14 * without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 /* \summary: Babel Routing Protocol printer */
35 * draft-ietf-babel-rfc6126bis-17
36 * draft-ietf-babel-hmac-10
37 * draft-ietf-babel-source-specific-0
44 #include "netdissect-stdinc.h"
49 #include "netdissect.h"
50 #include "addrtoname.h"
53 static void babel_print_v2(netdissect_options
*, const u_char
*cp
, u_int length
);
56 babel_print(netdissect_options
*ndo
,
57 const u_char
*cp
, u_int length
)
59 ndo
->ndo_protocol
= "babel";
64 if(GET_U_1(cp
) != 42) {
65 ND_PRINT(" invalid header");
68 ND_PRINT(" %u", GET_U_1(cp
+ 1));
71 switch(GET_U_1(cp
+ 1)) {
73 babel_print_v2(ndo
, cp
, length
);
76 ND_PRINT(" unknown version");
87 #define MESSAGE_PAD1 0
88 #define MESSAGE_PADN 1
89 #define MESSAGE_ACK_REQ 2
91 #define MESSAGE_HELLO 4
93 #define MESSAGE_ROUTER_ID 6
95 #define MESSAGE_UPDATE 8
96 #define MESSAGE_ROUTE_REQUEST 9
97 #define MESSAGE_SEQNO_REQUEST 10
98 #define MESSAGE_TSPC 11
99 #define MESSAGE_HMAC 12
100 #define MESSAGE_UPDATE_SRC_SPECIFIC 13 /* last appearance in draft-boutier-babel-source-specific-01 */
101 #define MESSAGE_REQUEST_SRC_SPECIFIC 14 /* idem */
102 #define MESSAGE_MH_REQUEST_SRC_SPECIFIC 15 /* idem */
103 #define MESSAGE_MAC 16
104 #define MESSAGE_PC 17
105 #define MESSAGE_CHALLENGE_REQUEST 18
106 #define MESSAGE_CHALLENGE_REPLY 19
109 #define MESSAGE_SUB_PAD1 0
110 #define MESSAGE_SUB_PADN 1
111 #define MESSAGE_SUB_DIVERSITY 2
112 #define MESSAGE_SUB_TIMESTAMP 3
114 /* "Mandatory" bit in sub-TLV types */
115 #define MANDATORY_MASK 0x80
117 /* Flags for the Hello TLV */
118 #define UNICAST_MASK 0x8000
120 /* Diversity sub-TLV channel codes */
121 static const struct tok diversity_str
[] = {
128 format_id(netdissect_options
*ndo
, const u_char
*id
)
131 snprintf(buf
, 25, "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x",
132 GET_U_1(id
), GET_U_1(id
+ 1), GET_U_1(id
+ 2),
133 GET_U_1(id
+ 3), GET_U_1(id
+ 4), GET_U_1(id
+ 5),
134 GET_U_1(id
+ 6), GET_U_1(id
+ 7));
139 static const unsigned char v4prefix
[16] =
140 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF, 0, 0, 0, 0 };
143 format_prefix(netdissect_options
*ndo
, const u_char
*prefix
, unsigned char plen
)
148 * prefix points to a buffer on the stack into which the prefix has
149 * been placed, so we can't use GET_IPADDR_STRING() or
150 * GET_IP6ADDR_STRING() on it.
152 if(plen
>= 96 && memcmp(prefix
, v4prefix
, 12) == 0)
153 snprintf(buf
, 50, "%s/%u", ipaddr_string(ndo
, prefix
+ 12), plen
- 96);
155 snprintf(buf
, 50, "%s/%u", ip6addr_string(ndo
, prefix
), plen
);
161 format_address(netdissect_options
*ndo
, const u_char
*prefix
)
164 * prefix points to a buffer on the stack into which the prefix has
165 * been placed, so we can't use GET_IPADDR_STRING() or
166 * GET_IP6ADDR_STRING() on it.
168 if(memcmp(prefix
, v4prefix
, 12) == 0)
169 return ipaddr_string(ndo
, prefix
+ 12);
171 return ip6addr_string(ndo
, prefix
);
175 format_interval(const uint16_t i
)
177 static char buf
[sizeof("000.00s")];
180 return "0.0s (bogus)";
181 snprintf(buf
, sizeof(buf
), "%u.%02us", i
/ 100, i
% 100);
186 format_interval_update(const uint16_t i
)
188 return i
== 0xFFFF ? "infinity" : format_interval(i
);
192 format_timestamp(const uint32_t i
)
194 static char buf
[sizeof("0000.000000s")];
195 snprintf(buf
, sizeof(buf
), "%u.%06us", i
/ 1000000, i
% 1000000);
199 /* Return number of octets consumed from the input buffer (not the prefix length
200 * in bytes), or -1 for encoding error. */
202 network_prefix(int ae
, int plen
, unsigned int omitted
,
203 const unsigned char *p
, const unsigned char *dp
,
204 unsigned int len
, unsigned char *p_r
)
207 unsigned char prefix
[16];
220 memset(prefix
, 0, 16);
225 if(omitted
> 4 || pb
> 4 || (pb
> omitted
&& len
< pb
- omitted
))
227 memcpy(prefix
, v4prefix
, 12);
229 if (dp
== NULL
) return -1;
230 memcpy(prefix
, dp
, 12 + omitted
);
233 memcpy(prefix
+ 12 + omitted
, p
, pb
- omitted
);
234 consumed
= pb
- omitted
;
238 if(omitted
> 16 || (pb
> omitted
&& len
< pb
- omitted
))
241 if (dp
== NULL
) return -1;
242 memcpy(prefix
, dp
, omitted
);
245 memcpy(prefix
+ omitted
, p
, pb
- omitted
);
246 consumed
= pb
- omitted
;
250 if(pb
> 8 && len
< pb
- 8) return -1;
254 memcpy(prefix
+ 8, p
, pb
- 8);
262 memcpy(p_r
, prefix
, 16);
267 network_address(int ae
, const unsigned char *a
, unsigned int len
,
270 return network_prefix(ae
, -1, 0, a
, NULL
, len
, a_r
);
274 * Sub-TLVs consume the "extra data" of Babel TLVs (see Section 4.3 of RFC6126),
275 * their encoding is similar to the encoding of TLVs, but the type namespace is
278 * o Type 0 stands for Pad1 sub-TLV with the same encoding as the Pad1 TLV.
279 * o Type 1 stands for PadN sub-TLV with the same encoding as the PadN TLV.
280 * o Type 2 stands for Diversity sub-TLV, which propagates diversity routing
281 * data. Its body is a variable-length sequence of 8-bit unsigned integers,
282 * each representing per-hop number of interfering radio channel for the
283 * prefix. Channel 0 is invalid and must not be used in the sub-TLV, channel
284 * 255 interferes with any other channel.
285 * o Type 3 stands for Timestamp sub-TLV, used to compute RTT between
286 * neighbours. In the case of a Hello TLV, the body stores a 32-bits
287 * timestamp, while in the case of a IHU TLV, two 32-bits timestamps are
290 * Sub-TLV types 0 and 1 are valid for any TLV type, whether sub-TLV type 2 is
291 * only valid for TLV type 8 (Update). Note that within an Update TLV a missing
292 * Diversity sub-TLV is not the same as a Diversity sub-TLV with an empty body.
293 * The former would mean a lack of any claims about the interference, and the
294 * latter would state that interference is definitely absent.
295 * A type 3 sub-TLV is valid both for Hello and IHU TLVs, though the exact
296 * semantic of the sub-TLV is different in each case.
299 subtlvs_print(netdissect_options
*ndo
,
300 const u_char
*cp
, const u_char
*ep
, const uint8_t tlv_type
)
302 uint8_t subtype
, sublen
;
307 subtype
= GET_U_1(cp
);
309 if(subtype
== MESSAGE_SUB_PAD1
) {
310 ND_PRINT(" sub-pad1");
313 if ((MANDATORY_MASK
& subtype
) != 0)
317 sublen
= GET_U_1(cp
);
323 case MESSAGE_SUB_PADN
:
324 ND_PRINT(" sub-padn");
327 case MESSAGE_SUB_DIVERSITY
:
328 ND_PRINT(" sub-diversity");
335 ND_PRINT("%s%s", sep
,
336 tok2str(diversity_str
, "%u", GET_U_1(cp
)));
341 if(tlv_type
!= MESSAGE_UPDATE
&&
342 tlv_type
!= MESSAGE_UPDATE_SRC_SPECIFIC
)
343 ND_PRINT(" (bogus)");
345 case MESSAGE_SUB_TIMESTAMP
:
346 ND_PRINT(" sub-timestamp");
347 if(tlv_type
== MESSAGE_HELLO
) {
351 ND_PRINT(" %s", format_timestamp(t1
));
352 } else if(tlv_type
== MESSAGE_IHU
) {
356 ND_PRINT(" %s", format_timestamp(t1
));
357 t2
= GET_BE_U_4(cp
+ 4);
358 ND_PRINT("|%s", format_timestamp(t2
));
360 ND_PRINT(" (bogus)");
364 ND_PRINT(" sub-unknown-0x%02x", subtype
);
371 nd_print_invalid(ndo
);
374 #define ICHECK(i, l) \
375 if ((i) + (l) > tlvs_length || (i) + (l) > packet_length_remaining) \
379 babel_print_v2_tlvs(netdissect_options
*ndo
,
380 const u_char
*cp
, u_int tlvs_length
,
381 u_int packet_length_remaining
)
384 u_char v4_prefix
[16] =
385 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF, 0, 0, 0, 0 };
386 u_char v6_prefix
[16] = {0};
389 while(i
< tlvs_length
) {
390 const u_char
*message
;
397 if((type
= GET_U_1(message
)) == MESSAGE_PAD1
) {
398 ND_PRINT(ndo
->ndo_vflag
? "\n\tPad 1" : " pad1");
404 ND_TCHECK_2(message
);
405 len
= GET_U_1(message
+ 1);
408 ND_TCHECK_LEN(message
, 2 + len
);
415 ND_PRINT("\n\tPad %u", len
+ 2);
419 case MESSAGE_ACK_REQ
: {
420 u_short nonce
, interval
;
422 ND_PRINT(" ack-req");
424 ND_PRINT("\n\tAcknowledgment Request ");
425 if(len
< 6) goto invalid
;
426 nonce
= GET_BE_U_2(message
+ 4);
427 interval
= GET_BE_U_2(message
+ 6);
428 ND_PRINT("%04x %s", nonce
, format_interval(interval
));
438 ND_PRINT("\n\tAcknowledgment ");
439 if(len
< 2) goto invalid
;
440 nonce
= GET_BE_U_2(message
+ 2);
441 ND_PRINT("%04x", nonce
);
446 case MESSAGE_HELLO
: {
447 u_short seqno
, interval
, unicast
;
451 ND_PRINT("\n\tHello ");
452 if(len
< 6) goto invalid
;
453 unicast
= (GET_BE_U_2(message
+ 2) & UNICAST_MASK
);
454 seqno
= GET_BE_U_2(message
+ 4);
455 interval
= GET_BE_U_2(message
+ 6);
457 ND_PRINT("(Unicast) ");
458 ND_PRINT("seqno %u ", seqno
);
460 ND_PRINT("interval %s", format_interval(interval
));
462 ND_PRINT("unscheduled");
465 subtlvs_print(ndo
, message
+ 8, message
+ 2 + len
, type
);
471 unsigned short rxcost
, interval
;
478 ND_PRINT("\n\tIHU ");
479 if(len
< 6) goto invalid
;
480 rxcost
= GET_BE_U_2(message
+ 4);
481 interval
= GET_BE_U_2(message
+ 6);
482 ae
= GET_U_1(message
+ 2);
483 rc
= network_address(ae
, message
+ 8,
485 if(rc
< 0) { nd_print_trunc(ndo
); break; }
486 ND_PRINT("%s rxcost %u interval %s",
487 ae
== 0 ? "any" : format_address(ndo
, address
),
488 rxcost
, format_interval(interval
));
490 if((u_int
)rc
< len
- 6)
491 subtlvs_print(ndo
, message
+ 8 + rc
, message
+ 2 + len
,
497 case MESSAGE_ROUTER_ID
: {
499 ND_PRINT(" router-id");
501 ND_PRINT("\n\tRouter Id");
502 if(len
< 10) goto invalid
;
503 ND_PRINT(" %s", format_id(ndo
, message
+ 4));
515 ND_PRINT("\n\tNext Hop");
516 if(len
< 2) goto invalid
;
517 ae
= GET_U_1(message
+ 2);
518 rc
= network_address(ae
, message
+ 4,
520 if(rc
< 0) goto invalid
;
521 ND_PRINT(" %s", ae
== 0 ? "invalid AE 0" : format_address(ndo
, nh
));
526 case MESSAGE_UPDATE
: {
527 if (!ndo
->ndo_vflag
) {
533 (GET_U_1(message
+ 3) & 0x80) ? "/prefix": "",
534 (GET_U_1(message
+ 3) & 0x40) ? "/id" : "",
535 (GET_U_1(message
+ 3) & 0x3f) ? "/unknown" : "");
537 u_short interval
, seqno
, metric
;
541 ND_PRINT("\n\tUpdate");
542 if(len
< 10) goto invalid
;
543 ae
= GET_U_1(message
+ 2);
544 plen
= GET_U_1(message
+ 4) + (GET_U_1(message
+ 2) == 1 ? 96 : 0);
545 rc
= network_prefix(ae
,
546 GET_U_1(message
+ 4),
547 GET_U_1(message
+ 5),
549 GET_U_1(message
+ 2) == 1 ? v4_prefix
: v6_prefix
,
551 if(rc
< 0) goto invalid
;
552 interval
= GET_BE_U_2(message
+ 6);
553 seqno
= GET_BE_U_2(message
+ 8);
554 metric
= GET_BE_U_2(message
+ 10);
555 ND_PRINT("%s%s%s %s metric %u seqno %u interval %s",
556 (GET_U_1(message
+ 3) & 0x80) ? "/prefix": "",
557 (GET_U_1(message
+ 3) & 0x40) ? "/id" : "",
558 (GET_U_1(message
+ 3) & 0x3f) ? "/unknown" : "",
559 ae
== 0 ? "any" : format_prefix(ndo
, prefix
, plen
),
560 metric
, seqno
, format_interval_update(interval
));
561 if(GET_U_1(message
+ 3) & 0x80) {
562 if(GET_U_1(message
+ 2) == 1)
563 memcpy(v4_prefix
, prefix
, 16);
565 memcpy(v6_prefix
, prefix
, 16);
568 if((u_int
)rc
< len
- 10)
569 subtlvs_print(ndo
, message
+ 12 + rc
, message
+ 2 + len
, type
);
574 case MESSAGE_ROUTE_REQUEST
: {
576 ND_PRINT(" route-request");
579 u_char prefix
[16], ae
, plen
;
580 ND_PRINT("\n\tRoute Request ");
581 if(len
< 2) goto invalid
;
582 ae
= GET_U_1(message
+ 2);
583 plen
= GET_U_1(message
+ 3) + (GET_U_1(message
+ 2) == 1 ? 96 : 0);
584 rc
= network_prefix(ae
,
585 GET_U_1(message
+ 3), 0,
586 message
+ 4, NULL
, len
- 2, prefix
);
587 if(rc
< 0) goto invalid
;
589 ae
== 0 ? "any" : format_prefix(ndo
, prefix
, plen
));
594 case MESSAGE_SEQNO_REQUEST
: {
596 ND_PRINT(" seqno-request");
600 u_char prefix
[16], ae
, plen
;
601 ND_PRINT("\n\tSeqno Request ");
602 if(len
< 14) goto invalid
;
603 ae
= GET_U_1(message
+ 2);
604 seqno
= GET_BE_U_2(message
+ 4);
605 rc
= network_prefix(ae
,
606 GET_U_1(message
+ 3), 0,
607 message
+ 16, NULL
, len
- 14, prefix
);
608 if(rc
< 0) goto invalid
;
609 plen
= GET_U_1(message
+ 3) + (GET_U_1(message
+ 2) == 1 ? 96 : 0);
610 ND_PRINT("(%u hops) for %s seqno %u id %s",
611 GET_U_1(message
+ 6),
612 ae
== 0 ? "invalid AE 0" : format_prefix(ndo
, prefix
, plen
),
613 seqno
, format_id(ndo
, message
+ 8));
621 ND_PRINT("\n\tTS/PC ");
622 if(len
< 6) goto invalid
;
623 ND_PRINT("timestamp %u packetcounter %u",
624 GET_BE_U_4(message
+ 4),
625 GET_BE_U_2(message
+ 2));
628 case MESSAGE_HMAC
: {
633 ND_PRINT("\n\tHMAC ");
634 if(len
< 18) goto invalid
;
635 ND_PRINT("key-id %u digest-%u ", GET_BE_U_2(message
+ 2),
637 for (j
= 0; j
< len
- 2; j
++)
638 ND_PRINT("%02X", GET_U_1(message
+ j
+ 4));
643 case MESSAGE_UPDATE_SRC_SPECIFIC
: {
644 if(!ndo
->ndo_vflag
) {
645 ND_PRINT(" ss-update");
647 u_char prefix
[16], src_prefix
[16];
648 u_short interval
, seqno
, metric
;
649 u_char ae
, plen
, src_plen
, omitted
;
652 ND_PRINT("\n\tSS-Update");
653 if(len
< 10) goto invalid
;
654 ae
= GET_U_1(message
+ 2);
655 src_plen
= GET_U_1(message
+ 3);
656 plen
= GET_U_1(message
+ 4);
657 omitted
= GET_U_1(message
+ 5);
658 interval
= GET_BE_U_2(message
+ 6);
659 seqno
= GET_BE_U_2(message
+ 8);
660 metric
= GET_BE_U_2(message
+ 10);
661 rc
= network_prefix(ae
, plen
, omitted
, message
+ 2 + parsed_len
,
662 ae
== 1 ? v4_prefix
: v6_prefix
,
663 len
- parsed_len
, prefix
);
664 if(rc
< 0) goto invalid
;
668 rc
= network_prefix(ae
, src_plen
, 0, message
+ 2 + parsed_len
,
669 NULL
, len
- parsed_len
, src_prefix
);
670 if(rc
< 0) goto invalid
;
675 ND_PRINT(" %s from", format_prefix(ndo
, prefix
, plen
));
676 ND_PRINT(" %s metric %u seqno %u interval %s",
677 format_prefix(ndo
, src_prefix
, src_plen
),
678 metric
, seqno
, format_interval_update(interval
));
680 if((u_int
)parsed_len
< len
)
681 subtlvs_print(ndo
, message
+ 2 + parsed_len
,
682 message
+ 2 + len
, type
);
687 case MESSAGE_REQUEST_SRC_SPECIFIC
: {
689 ND_PRINT(" ss-request");
691 int rc
, parsed_len
= 3;
692 u_char ae
, plen
, src_plen
, prefix
[16], src_prefix
[16];
693 ND_PRINT("\n\tSS-Request ");
694 if(len
< 3) goto invalid
;
695 ae
= GET_U_1(message
+ 2);
696 plen
= GET_U_1(message
+ 3);
697 src_plen
= GET_U_1(message
+ 4);
698 rc
= network_prefix(ae
, plen
, 0, message
+ 2 + parsed_len
,
699 NULL
, len
- parsed_len
, prefix
);
700 if(rc
< 0) goto invalid
;
704 rc
= network_prefix(ae
, src_plen
, 0, message
+ 2 + parsed_len
,
705 NULL
, len
- parsed_len
, src_prefix
);
706 if(rc
< 0) goto invalid
;
713 ND_PRINT("for (%s, ", format_prefix(ndo
, prefix
, plen
));
714 ND_PRINT("%s)", format_prefix(ndo
, src_prefix
, src_plen
));
720 case MESSAGE_MH_REQUEST_SRC_SPECIFIC
: {
722 ND_PRINT(" ss-mh-request");
724 int rc
, parsed_len
= 14;
726 u_char ae
, plen
, src_plen
, prefix
[16], src_prefix
[16], hopc
;
727 const u_char
*router_id
= NULL
;
728 ND_PRINT("\n\tSS-MH-Request ");
729 if(len
< 14) goto invalid
;
730 ae
= GET_U_1(message
+ 2);
731 plen
= GET_U_1(message
+ 3);
732 seqno
= GET_BE_U_2(message
+ 4);
733 hopc
= GET_U_1(message
+ 6);
734 src_plen
= GET_U_1(message
+ 7);
735 router_id
= message
+ 8;
736 rc
= network_prefix(ae
, plen
, 0, message
+ 2 + parsed_len
,
737 NULL
, len
- parsed_len
, prefix
);
738 if(rc
< 0) goto invalid
;
742 rc
= network_prefix(ae
, src_plen
, 0, message
+ 2 + parsed_len
,
743 NULL
, len
- parsed_len
, src_prefix
);
744 if(rc
< 0) goto invalid
;
747 ND_PRINT("(%u hops) for (%s, ",
748 hopc
, format_prefix(ndo
, prefix
, plen
));
749 ND_PRINT("%s) seqno %u id %s",
750 format_prefix(ndo
, src_prefix
, src_plen
),
751 seqno
, format_id(ndo
, router_id
));
760 ND_PRINT("\n\tMAC ");
761 ND_PRINT("len %u", len
);
771 if(len
< 4) goto invalid
;
772 ND_PRINT(" value %u",
773 GET_BE_U_4(message
+ 2));
774 ND_PRINT(" index len %u", len
-4);
779 case MESSAGE_CHALLENGE_REQUEST
: {
781 ND_PRINT(" challenge_request");
783 ND_PRINT("\n\tChallenge Request");
784 if(len
> 192) goto invalid
;
785 ND_PRINT(" len %u", len
);
790 case MESSAGE_CHALLENGE_REPLY
: {
792 ND_PRINT(" challenge_reply");
794 ND_PRINT("\n\tChallenge Reply");
795 if (len
> 192) goto invalid
;
796 ND_PRINT(" len %u", len
);
803 ND_PRINT(" unknown");
805 ND_PRINT("\n\tUnknown message type %u", type
);
813 return -1; /* packet truncated by capture process */
816 return -2; /* packet is invalid */
820 babel_print_v2(netdissect_options
*ndo
,
821 const u_char
*cp
, u_int length
)
829 bodylen
= GET_BE_U_2(cp
+ 2);
830 ND_PRINT(" (%u)", bodylen
);
834 /* Process the TLVs in the body */
835 if (length
< bodylen
)
837 ret
= babel_print_v2_tlvs(ndo
, cp
, bodylen
, length
);
845 /* If there's a trailer, process the TLVs in the trailer */
847 if(ndo
->ndo_vflag
) ND_PRINT("\n\t----");
849 ret
= babel_print_v2_tlvs(ndo
, cp
, length
, length
);
862 nd_print_invalid(ndo
);