Lines Matching +full:pc +full:- +full:ack
2 * Copyright (c) 2007-2011 Grégoire Henry, Juliusz Chroboczek
35 * draft-ietf-babel-rfc6126bis-17
36 * draft-ietf-babel-hmac-10
37 * draft-ietf-babel-source-specific-0
42 #include "netdissect-stdinc.h"
57 ndo->ndo_protocol = "babel"; in babel_print()
98 #define MESSAGE_UPDATE_SRC_SPECIFIC 13 /* last appearance in draft-boutier-babel-source-specific-01…
106 /* sub-TLVs */
112 /* "Mandatory" bit in sub-TLV types */
118 /* Diversity sub-TLV channel codes */
151 snprintf(buf, 50, "%s/%u", ipaddr_string(ndo, prefix + 12), plen - 96); in format_prefix()
198 * in bytes), or -1 for encoding error. */
216 return -1; in network_prefix()
223 if(omitted > 4 || pb > 4 || (pb > omitted && len < pb - omitted)) in network_prefix()
224 return -1; in network_prefix()
227 if (dp == NULL) return -1; in network_prefix()
231 memcpy(prefix + 12 + omitted, p, pb - omitted); in network_prefix()
232 consumed = pb - omitted; in network_prefix()
236 if(omitted > 16 || (pb > omitted && len < pb - omitted)) in network_prefix()
237 return -1; in network_prefix()
239 if (dp == NULL) return -1; in network_prefix()
243 memcpy(prefix + omitted, p, pb - omitted); in network_prefix()
244 consumed = pb - omitted; in network_prefix()
248 if(pb > 8 && len < pb - 8) return -1; in network_prefix()
252 memcpy(prefix + 8, p, pb - 8); in network_prefix()
253 consumed = pb - 8; in network_prefix()
257 return -1; in network_prefix()
268 return network_prefix(ae, -1, 0, a, NULL, len, a_r); in network_address()
272 * Sub-TLVs consume the "extra data" of Babel TLVs (see Section 4.3 of RFC6126),
276 * o Type 0 stands for Pad1 sub-TLV with the same encoding as the Pad1 TLV.
277 * o Type 1 stands for PadN sub-TLV with the same encoding as the PadN TLV.
278 * o Type 2 stands for Diversity sub-TLV, which propagates diversity routing
279 * data. Its body is a variable-length sequence of 8-bit unsigned integers,
280 * each representing per-hop number of interfering radio channel for the
281 * prefix. Channel 0 is invalid and must not be used in the sub-TLV, channel
283 * o Type 3 stands for Timestamp sub-TLV, used to compute RTT between
284 * neighbours. In the case of a Hello TLV, the body stores a 32-bits
285 * timestamp, while in the case of a IHU TLV, two 32-bits timestamps are
288 * Sub-TLV types 0 and 1 are valid for any TLV type, whether sub-TLV type 2 is
290 * Diversity sub-TLV is not the same as a Diversity sub-TLV with an empty body.
293 * A type 3 sub-TLV is valid both for Hello and IHU TLVs, though the exact
294 * semantic of the sub-TLV is different in each case.
308 ND_PRINT(" sub-pad1"); in subtlvs_print()
322 ND_PRINT(" sub-padn"); in subtlvs_print()
326 ND_PRINT(" sub-diversity"); in subtlvs_print()
336 sep = "-"; in subtlvs_print()
337 sublen--; in subtlvs_print()
344 ND_PRINT(" sub-timestamp"); in subtlvs_print()
362 ND_PRINT(" sub-unknown-0x%02x", subtype); in subtlvs_print()
396 ND_PRINT(ndo->ndo_vflag ? "\n\tPad 1" : " pad1"); in babel_print_v2_tlvs()
410 if (!ndo->ndo_vflag) in babel_print_v2_tlvs()
419 if (!ndo->ndo_vflag) in babel_print_v2_tlvs()
420 ND_PRINT(" ack-req"); in babel_print_v2_tlvs()
433 if (!ndo->ndo_vflag) in babel_print_v2_tlvs()
434 ND_PRINT(" ack"); in babel_print_v2_tlvs()
446 if (!ndo->ndo_vflag) in babel_print_v2_tlvs()
470 if (!ndo->ndo_vflag) in babel_print_v2_tlvs()
482 len - 6, address); in babel_print_v2_tlvs()
488 if((u_int)rc < len - 6) in babel_print_v2_tlvs()
496 if (!ndo->ndo_vflag) in babel_print_v2_tlvs()
497 ND_PRINT(" router-id"); in babel_print_v2_tlvs()
507 if (!ndo->ndo_vflag) in babel_print_v2_tlvs()
517 len - 2, nh); in babel_print_v2_tlvs()
525 if (!ndo->ndo_vflag) { in babel_print_v2_tlvs()
548 len - 10, prefix); in babel_print_v2_tlvs()
566 if((u_int)rc < len - 10) in babel_print_v2_tlvs()
573 if (!ndo->ndo_vflag) in babel_print_v2_tlvs()
574 ND_PRINT(" route-request"); in babel_print_v2_tlvs()
584 message + 4, NULL, len - 2, prefix); in babel_print_v2_tlvs()
593 if (!ndo->ndo_vflag) in babel_print_v2_tlvs()
594 ND_PRINT(" seqno-request"); in babel_print_v2_tlvs()
605 message + 16, NULL, len - 14, prefix); in babel_print_v2_tlvs()
616 if (!ndo->ndo_vflag) in babel_print_v2_tlvs()
619 ND_PRINT("\n\tTS/PC "); in babel_print_v2_tlvs()
627 if (!ndo->ndo_vflag) in babel_print_v2_tlvs()
633 ND_PRINT("key-id %u digest-%u ", GET_BE_U_2(message + 2), in babel_print_v2_tlvs()
634 len - 2); in babel_print_v2_tlvs()
635 for (j = 0; j < len - 2; j++) in babel_print_v2_tlvs()
642 if(!ndo->ndo_vflag) { in babel_print_v2_tlvs()
643 ND_PRINT(" ss-update"); in babel_print_v2_tlvs()
650 ND_PRINT("\n\tSS-Update"); in babel_print_v2_tlvs()
661 len - parsed_len, prefix); in babel_print_v2_tlvs()
667 NULL, len - parsed_len, src_prefix); in babel_print_v2_tlvs()
686 if(!ndo->ndo_vflag) in babel_print_v2_tlvs()
687 ND_PRINT(" ss-request"); in babel_print_v2_tlvs()
691 ND_PRINT("\n\tSS-Request "); in babel_print_v2_tlvs()
697 NULL, len - parsed_len, prefix); in babel_print_v2_tlvs()
703 NULL, len - parsed_len, src_prefix); in babel_print_v2_tlvs()
719 if(!ndo->ndo_vflag) in babel_print_v2_tlvs()
720 ND_PRINT(" ss-mh-request"); in babel_print_v2_tlvs()
726 ND_PRINT("\n\tSS-MH-Request "); in babel_print_v2_tlvs()
735 NULL, len - parsed_len, prefix); in babel_print_v2_tlvs()
741 NULL, len - parsed_len, src_prefix); in babel_print_v2_tlvs()
755 if (!ndo->ndo_vflag) in babel_print_v2_tlvs()
765 if (!ndo->ndo_vflag) in babel_print_v2_tlvs()
766 ND_PRINT(" pc"); in babel_print_v2_tlvs()
772 ND_PRINT(" index len %u", len-4); in babel_print_v2_tlvs()
778 if (!ndo->ndo_vflag) in babel_print_v2_tlvs()
789 if (!ndo->ndo_vflag) in babel_print_v2_tlvs()
800 if (!ndo->ndo_vflag) in babel_print_v2_tlvs()
811 return -1; /* packet truncated by capture process */ in babel_print_v2_tlvs()
814 return -2; /* packet is invalid */ in babel_print_v2_tlvs()
829 length -= 4; in babel_print_v2()
836 if (ret == -1) in babel_print_v2()
838 if (ret == -2) in babel_print_v2()
840 length -= bodylen; in babel_print_v2()
845 if(ndo->ndo_vflag) ND_PRINT("\n\t----"); in babel_print_v2()
848 if (ret == -1) in babel_print_v2()
850 if (ret == -2) in babel_print_v2()