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");
88 #define MESSAGE_PAD1 0
89 #define MESSAGE_PADN 1
90 #define MESSAGE_ACK_REQ 2
92 #define MESSAGE_HELLO 4
94 #define MESSAGE_ROUTER_ID 6
96 #define MESSAGE_UPDATE 8
97 #define MESSAGE_ROUTE_REQUEST 9
98 #define MESSAGE_SEQNO_REQUEST 10
99 #define MESSAGE_TSPC 11
100 #define MESSAGE_HMAC 12
101 #define MESSAGE_UPDATE_SRC_SPECIFIC 13 /* last appearance in draft-boutier-babel-source-specific-01 */
102 #define MESSAGE_REQUEST_SRC_SPECIFIC 14 /* idem */
103 #define MESSAGE_MH_REQUEST_SRC_SPECIFIC 15 /* idem */
104 #define MESSAGE_MAC 16
105 #define MESSAGE_PC 17
106 #define MESSAGE_CHALLENGE_REQUEST 18
107 #define MESSAGE_CHALLENGE_REPLY 19
110 #define MESSAGE_SUB_PAD1 0
111 #define MESSAGE_SUB_PADN 1
112 #define MESSAGE_SUB_DIVERSITY 2
113 #define MESSAGE_SUB_TIMESTAMP 3
115 /* "Mandatory" bit in sub-TLV types */
116 #define MANDATORY_MASK 0x80
118 /* Flags for the Hello TLV */
119 #define UNICAST_MASK 0x8000
121 /* Diversity sub-TLV channel codes */
122 static const struct tok diversity_str
[] = {
129 format_id(netdissect_options
*ndo
, const u_char
*id
)
132 snprintf(buf
, 25, "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x",
133 GET_U_1(id
), GET_U_1(id
+ 1), GET_U_1(id
+ 2),
134 GET_U_1(id
+ 3), GET_U_1(id
+ 4), GET_U_1(id
+ 5),
135 GET_U_1(id
+ 6), GET_U_1(id
+ 7));
140 static const unsigned char v4prefix
[16] =
141 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF, 0, 0, 0, 0 };
144 format_prefix(netdissect_options
*ndo
, const u_char
*prefix
, unsigned char plen
)
149 * prefix points to a buffer on the stack into which the prefix has
150 * been placed, so we can't use GET_IPADDR_STRING() or
151 * GET_IP6ADDR_STRING() on it.
153 if(plen
>= 96 && memcmp(prefix
, v4prefix
, 12) == 0)
154 snprintf(buf
, 50, "%s/%u", ipaddr_string(ndo
, prefix
+ 12), plen
- 96);
156 snprintf(buf
, 50, "%s/%u", ip6addr_string(ndo
, prefix
), plen
);
162 format_address(netdissect_options
*ndo
, const u_char
*prefix
)
165 * prefix points to a buffer on the stack into which the prefix has
166 * been placed, so we can't use GET_IPADDR_STRING() or
167 * GET_IP6ADDR_STRING() on it.
169 if(memcmp(prefix
, v4prefix
, 12) == 0)
170 return ipaddr_string(ndo
, prefix
+ 12);
172 return ip6addr_string(ndo
, prefix
);
176 format_interval(const uint16_t i
)
178 static char buf
[sizeof("000.00s")];
181 return "0.0s (bogus)";
182 snprintf(buf
, sizeof(buf
), "%u.%02us", i
/ 100, i
% 100);
187 format_interval_update(const uint16_t i
)
189 return i
== 0xFFFF ? "infinity" : format_interval(i
);
193 format_timestamp(const uint32_t i
)
195 static char buf
[sizeof("0000.000000s")];
196 snprintf(buf
, sizeof(buf
), "%u.%06us", i
/ 1000000, i
% 1000000);
200 /* Return number of octets consumed from the input buffer (not the prefix length
201 * in bytes), or -1 for encoding error. */
203 network_prefix(int ae
, int plen
, unsigned int omitted
,
204 const unsigned char *p
, const unsigned char *dp
,
205 unsigned int len
, unsigned char *p_r
)
208 unsigned char prefix
[16];
221 memset(prefix
, 0, 16);
226 if(omitted
> 4 || pb
> 4 || (pb
> omitted
&& len
< pb
- omitted
))
228 memcpy(prefix
, v4prefix
, 12);
230 if (dp
== NULL
) return -1;
231 memcpy(prefix
, dp
, 12 + omitted
);
234 memcpy(prefix
+ 12 + omitted
, p
, pb
- omitted
);
235 consumed
= pb
- omitted
;
239 if(omitted
> 16 || (pb
> omitted
&& len
< pb
- omitted
))
242 if (dp
== NULL
) return -1;
243 memcpy(prefix
, dp
, omitted
);
246 memcpy(prefix
+ omitted
, p
, pb
- omitted
);
247 consumed
= pb
- omitted
;
251 if(pb
> 8 && len
< pb
- 8) return -1;
255 memcpy(prefix
+ 8, p
, pb
- 8);
263 memcpy(p_r
, prefix
, 16);
268 network_address(int ae
, const unsigned char *a
, unsigned int len
,
271 return network_prefix(ae
, -1, 0, a
, NULL
, len
, a_r
);
275 * Sub-TLVs consume the "extra data" of Babel TLVs (see Section 4.3 of RFC6126),
276 * their encoding is similar to the encoding of TLVs, but the type namespace is
279 * o Type 0 stands for Pad1 sub-TLV with the same encoding as the Pad1 TLV.
280 * o Type 1 stands for PadN sub-TLV with the same encoding as the PadN TLV.
281 * o Type 2 stands for Diversity sub-TLV, which propagates diversity routing
282 * data. Its body is a variable-length sequence of 8-bit unsigned integers,
283 * each representing per-hop number of interfering radio channel for the
284 * prefix. Channel 0 is invalid and must not be used in the sub-TLV, channel
285 * 255 interferes with any other channel.
286 * o Type 3 stands for Timestamp sub-TLV, used to compute RTT between
287 * neighbours. In the case of a Hello TLV, the body stores a 32-bits
288 * timestamp, while in the case of a IHU TLV, two 32-bits timestamps are
291 * Sub-TLV types 0 and 1 are valid for any TLV type, whether sub-TLV type 2 is
292 * only valid for TLV type 8 (Update). Note that within an Update TLV a missing
293 * Diversity sub-TLV is not the same as a Diversity sub-TLV with an empty body.
294 * The former would mean a lack of any claims about the interference, and the
295 * latter would state that interference is definitely absent.
296 * A type 3 sub-TLV is valid both for Hello and IHU TLVs, though the exact
297 * semantic of the sub-TLV is different in each case.
300 subtlvs_print(netdissect_options
*ndo
,
301 const u_char
*cp
, const u_char
*ep
, const uint8_t tlv_type
)
303 uint8_t subtype
, sublen
;
308 subtype
= GET_U_1(cp
);
310 if(subtype
== MESSAGE_SUB_PAD1
) {
311 ND_PRINT(" sub-pad1");
314 if ((MANDATORY_MASK
& subtype
) != 0)
318 sublen
= GET_U_1(cp
);
324 case MESSAGE_SUB_PADN
:
325 ND_PRINT(" sub-padn");
328 case MESSAGE_SUB_DIVERSITY
:
329 ND_PRINT(" sub-diversity");
336 ND_PRINT("%s%s", sep
,
337 tok2str(diversity_str
, "%u", GET_U_1(cp
)));
342 if(tlv_type
!= MESSAGE_UPDATE
&&
343 tlv_type
!= MESSAGE_UPDATE_SRC_SPECIFIC
)
344 ND_PRINT(" (bogus)");
346 case MESSAGE_SUB_TIMESTAMP
:
347 ND_PRINT(" sub-timestamp");
348 if(tlv_type
== MESSAGE_HELLO
) {
352 ND_PRINT(" %s", format_timestamp(t1
));
353 } else if(tlv_type
== MESSAGE_IHU
) {
357 ND_PRINT(" %s", format_timestamp(t1
));
358 t2
= GET_BE_U_4(cp
+ 4);
359 ND_PRINT("|%s", format_timestamp(t2
));
361 ND_PRINT(" (bogus)");
365 ND_PRINT(" sub-unknown-0x%02x", subtype
);
372 nd_print_invalid(ndo
);
375 #define ICHECK(i, l) \
376 if ((i) + (l) > tlvs_length || (i) + (l) > packet_length_remaining) \
380 babel_print_v2_tlvs(netdissect_options
*ndo
,
381 const u_char
*cp
, u_int tlvs_length
,
382 u_int packet_length_remaining
)
385 u_char v4_prefix
[16] =
386 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF, 0, 0, 0, 0 };
387 u_char v6_prefix
[16] = {0};
390 while(i
< tlvs_length
) {
391 const u_char
*message
;
398 if((type
= GET_U_1(message
)) == MESSAGE_PAD1
) {
399 ND_PRINT(ndo
->ndo_vflag
? "\n\tPad 1" : " pad1");
405 ND_TCHECK_2(message
);
406 len
= GET_U_1(message
+ 1);
409 ND_TCHECK_LEN(message
, 2 + len
);
416 ND_PRINT("\n\tPad %u", len
+ 2);
420 case MESSAGE_ACK_REQ
: {
421 u_short nonce
, interval
;
423 ND_PRINT(" ack-req");
425 ND_PRINT("\n\tAcknowledgment Request ");
426 if(len
< 6) goto invalid
;
427 nonce
= GET_BE_U_2(message
+ 4);
428 interval
= GET_BE_U_2(message
+ 6);
429 ND_PRINT("%04x %s", nonce
, format_interval(interval
));
439 ND_PRINT("\n\tAcknowledgment ");
440 if(len
< 2) goto invalid
;
441 nonce
= GET_BE_U_2(message
+ 2);
442 ND_PRINT("%04x", nonce
);
447 case MESSAGE_HELLO
: {
448 u_short seqno
, interval
, unicast
;
452 ND_PRINT("\n\tHello ");
453 if(len
< 6) goto invalid
;
454 unicast
= (GET_BE_U_2(message
+ 2) & UNICAST_MASK
);
455 seqno
= GET_BE_U_2(message
+ 4);
456 interval
= GET_BE_U_2(message
+ 6);
458 ND_PRINT("(Unicast) ");
459 ND_PRINT("seqno %u ", seqno
);
461 ND_PRINT("interval %s", format_interval(interval
));
463 ND_PRINT("unscheduled");
466 subtlvs_print(ndo
, message
+ 8, message
+ 2 + len
, type
);
472 unsigned short rxcost
, interval
;
479 ND_PRINT("\n\tIHU ");
480 if(len
< 6) goto invalid
;
481 rxcost
= GET_BE_U_2(message
+ 4);
482 interval
= GET_BE_U_2(message
+ 6);
483 ae
= GET_U_1(message
+ 2);
484 rc
= network_address(ae
, message
+ 8,
486 if(rc
< 0) { nd_print_trunc(ndo
); break; }
487 ND_PRINT("%s rxcost %u interval %s",
488 ae
== 0 ? "any" : format_address(ndo
, address
),
489 rxcost
, format_interval(interval
));
491 if((u_int
)rc
< len
- 6)
492 subtlvs_print(ndo
, message
+ 8 + rc
, message
+ 2 + len
,
498 case MESSAGE_ROUTER_ID
: {
500 ND_PRINT(" router-id");
502 ND_PRINT("\n\tRouter Id");
503 if(len
< 10) goto invalid
;
504 ND_PRINT(" %s", format_id(ndo
, message
+ 4));
516 ND_PRINT("\n\tNext Hop");
517 if(len
< 2) goto invalid
;
518 ae
= GET_U_1(message
+ 2);
519 rc
= network_address(ae
, message
+ 4,
521 if(rc
< 0) goto invalid
;
522 ND_PRINT(" %s", ae
== 0 ? "invalid AE 0" : format_address(ndo
, nh
));
527 case MESSAGE_UPDATE
: {
528 if (!ndo
->ndo_vflag
) {
534 (GET_U_1(message
+ 3) & 0x80) ? "/prefix": "",
535 (GET_U_1(message
+ 3) & 0x40) ? "/id" : "",
536 (GET_U_1(message
+ 3) & 0x3f) ? "/unknown" : "");
538 u_short interval
, seqno
, metric
;
542 ND_PRINT("\n\tUpdate");
543 if(len
< 10) goto invalid
;
544 ae
= GET_U_1(message
+ 2);
545 plen
= GET_U_1(message
+ 4) + (GET_U_1(message
+ 2) == 1 ? 96 : 0);
546 rc
= network_prefix(ae
,
547 GET_U_1(message
+ 4),
548 GET_U_1(message
+ 5),
550 GET_U_1(message
+ 2) == 1 ? v4_prefix
: v6_prefix
,
552 if(rc
< 0) goto invalid
;
553 interval
= GET_BE_U_2(message
+ 6);
554 seqno
= GET_BE_U_2(message
+ 8);
555 metric
= GET_BE_U_2(message
+ 10);
556 ND_PRINT("%s%s%s %s metric %u seqno %u interval %s",
557 (GET_U_1(message
+ 3) & 0x80) ? "/prefix": "",
558 (GET_U_1(message
+ 3) & 0x40) ? "/id" : "",
559 (GET_U_1(message
+ 3) & 0x3f) ? "/unknown" : "",
560 ae
== 0 ? "any" : format_prefix(ndo
, prefix
, plen
),
561 metric
, seqno
, format_interval_update(interval
));
562 if(GET_U_1(message
+ 3) & 0x80) {
563 if(GET_U_1(message
+ 2) == 1)
564 memcpy(v4_prefix
, prefix
, 16);
566 memcpy(v6_prefix
, prefix
, 16);
569 if((u_int
)rc
< len
- 10)
570 subtlvs_print(ndo
, message
+ 12 + rc
, message
+ 2 + len
, type
);
575 case MESSAGE_ROUTE_REQUEST
: {
577 ND_PRINT(" route-request");
580 u_char prefix
[16], ae
, plen
;
581 ND_PRINT("\n\tRoute Request ");
582 if(len
< 2) goto invalid
;
583 ae
= GET_U_1(message
+ 2);
584 plen
= GET_U_1(message
+ 3) + (GET_U_1(message
+ 2) == 1 ? 96 : 0);
585 rc
= network_prefix(ae
,
586 GET_U_1(message
+ 3), 0,
587 message
+ 4, NULL
, len
- 2, prefix
);
588 if(rc
< 0) goto invalid
;
590 ae
== 0 ? "any" : format_prefix(ndo
, prefix
, plen
));
595 case MESSAGE_SEQNO_REQUEST
: {
597 ND_PRINT(" seqno-request");
601 u_char prefix
[16], ae
, plen
;
602 ND_PRINT("\n\tSeqno Request ");
603 if(len
< 14) goto invalid
;
604 ae
= GET_U_1(message
+ 2);
605 seqno
= GET_BE_U_2(message
+ 4);
606 rc
= network_prefix(ae
,
607 GET_U_1(message
+ 3), 0,
608 message
+ 16, NULL
, len
- 14, prefix
);
609 if(rc
< 0) goto invalid
;
610 plen
= GET_U_1(message
+ 3) + (GET_U_1(message
+ 2) == 1 ? 96 : 0);
611 ND_PRINT("(%u hops) for %s seqno %u id %s",
612 GET_U_1(message
+ 6),
613 ae
== 0 ? "invalid AE 0" : format_prefix(ndo
, prefix
, plen
),
614 seqno
, format_id(ndo
, message
+ 8));
622 ND_PRINT("\n\tTS/PC ");
623 if(len
< 6) goto invalid
;
624 ND_PRINT("timestamp %u packetcounter %u",
625 GET_BE_U_4(message
+ 4),
626 GET_BE_U_2(message
+ 2));
629 case MESSAGE_HMAC
: {
634 ND_PRINT("\n\tHMAC ");
635 if(len
< 18) goto invalid
;
636 ND_PRINT("key-id %u digest-%u ", GET_BE_U_2(message
+ 2),
638 for (j
= 0; j
< len
- 2; j
++)
639 ND_PRINT("%02X", GET_U_1(message
+ j
+ 4));
644 case MESSAGE_UPDATE_SRC_SPECIFIC
: {
645 if(!ndo
->ndo_vflag
) {
646 ND_PRINT(" ss-update");
648 u_char prefix
[16], src_prefix
[16];
649 u_short interval
, seqno
, metric
;
650 u_char ae
, plen
, src_plen
, omitted
;
653 ND_PRINT("\n\tSS-Update");
654 if(len
< 10) goto invalid
;
655 ae
= GET_U_1(message
+ 2);
656 src_plen
= GET_U_1(message
+ 3);
657 plen
= GET_U_1(message
+ 4);
658 omitted
= GET_U_1(message
+ 5);
659 interval
= GET_BE_U_2(message
+ 6);
660 seqno
= GET_BE_U_2(message
+ 8);
661 metric
= GET_BE_U_2(message
+ 10);
662 rc
= network_prefix(ae
, plen
, omitted
, message
+ 2 + parsed_len
,
663 ae
== 1 ? v4_prefix
: v6_prefix
,
664 len
- parsed_len
, prefix
);
665 if(rc
< 0) goto invalid
;
669 rc
= network_prefix(ae
, src_plen
, 0, message
+ 2 + parsed_len
,
670 NULL
, len
- parsed_len
, src_prefix
);
671 if(rc
< 0) goto invalid
;
676 ND_PRINT(" %s from", format_prefix(ndo
, prefix
, plen
));
677 ND_PRINT(" %s metric %u seqno %u interval %s",
678 format_prefix(ndo
, src_prefix
, src_plen
),
679 metric
, seqno
, format_interval_update(interval
));
681 if((u_int
)parsed_len
< len
)
682 subtlvs_print(ndo
, message
+ 2 + parsed_len
,
683 message
+ 2 + len
, type
);
688 case MESSAGE_REQUEST_SRC_SPECIFIC
: {
690 ND_PRINT(" ss-request");
692 int rc
, parsed_len
= 3;
693 u_char ae
, plen
, src_plen
, prefix
[16], src_prefix
[16];
694 ND_PRINT("\n\tSS-Request ");
695 if(len
< 3) goto invalid
;
696 ae
= GET_U_1(message
+ 2);
697 plen
= GET_U_1(message
+ 3);
698 src_plen
= GET_U_1(message
+ 4);
699 rc
= network_prefix(ae
, plen
, 0, message
+ 2 + parsed_len
,
700 NULL
, len
- parsed_len
, prefix
);
701 if(rc
< 0) goto invalid
;
705 rc
= network_prefix(ae
, src_plen
, 0, message
+ 2 + parsed_len
,
706 NULL
, len
- parsed_len
, src_prefix
);
707 if(rc
< 0) goto invalid
;
714 ND_PRINT("for (%s, ", format_prefix(ndo
, prefix
, plen
));
715 ND_PRINT("%s)", format_prefix(ndo
, src_prefix
, src_plen
));
721 case MESSAGE_MH_REQUEST_SRC_SPECIFIC
: {
723 ND_PRINT(" ss-mh-request");
725 int rc
, parsed_len
= 14;
727 u_char ae
, plen
, src_plen
, prefix
[16], src_prefix
[16], hopc
;
728 const u_char
*router_id
= NULL
;
729 ND_PRINT("\n\tSS-MH-Request ");
730 if(len
< 14) goto invalid
;
731 ae
= GET_U_1(message
+ 2);
732 plen
= GET_U_1(message
+ 3);
733 seqno
= GET_BE_U_2(message
+ 4);
734 hopc
= GET_U_1(message
+ 6);
735 src_plen
= GET_U_1(message
+ 7);
736 router_id
= message
+ 8;
737 rc
= network_prefix(ae
, plen
, 0, message
+ 2 + parsed_len
,
738 NULL
, len
- parsed_len
, prefix
);
739 if(rc
< 0) goto invalid
;
743 rc
= network_prefix(ae
, src_plen
, 0, message
+ 2 + parsed_len
,
744 NULL
, len
- parsed_len
, src_prefix
);
745 if(rc
< 0) goto invalid
;
748 ND_PRINT("(%u hops) for (%s, ",
749 hopc
, format_prefix(ndo
, prefix
, plen
));
750 ND_PRINT("%s) seqno %u id %s",
751 format_prefix(ndo
, src_prefix
, src_plen
),
752 seqno
, format_id(ndo
, router_id
));
761 ND_PRINT("\n\tMAC ");
762 ND_PRINT("len %u", len
);
772 if(len
< 4) goto invalid
;
773 ND_PRINT(" value %u",
774 GET_BE_U_4(message
+ 2));
775 ND_PRINT(" index len %u", len
-4);
780 case MESSAGE_CHALLENGE_REQUEST
: {
782 ND_PRINT(" challenge_request");
784 ND_PRINT("\n\tChallenge Request");
785 if(len
> 192) goto invalid
;
786 ND_PRINT(" len %u", len
);
791 case MESSAGE_CHALLENGE_REPLY
: {
793 ND_PRINT(" challenge_reply");
795 ND_PRINT("\n\tChallenge Reply");
796 if (len
> 192) goto invalid
;
797 ND_PRINT(" len %u", len
);
804 ND_PRINT(" unknown");
806 ND_PRINT("\n\tUnknown message type %u", type
);
814 return -1; /* packet truncated by capture process */
817 return -2; /* packet is invalid */
821 babel_print_v2(netdissect_options
*ndo
,
822 const u_char
*cp
, u_int length
)
830 bodylen
= GET_BE_U_2(cp
+ 2);
831 ND_PRINT(" (%u)", bodylen
);
835 /* Process the TLVs in the body */
836 if (length
< bodylen
)
838 ret
= babel_print_v2_tlvs(ndo
, cp
, bodylen
, length
);
846 /* If there's a trailer, process the TLVs in the trailer */
848 if(ndo
->ndo_vflag
) ND_PRINT("\n\t----");
850 ret
= babel_print_v2_tlvs(ndo
, cp
, length
, length
);
863 nd_print_invalid(ndo
);