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";
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);
198 * in bytes), or -1 for encoding error. */
216 return -1;
223 if(omitted > 4 || pb > 4 || (pb > omitted && len < pb - omitted))
224 return -1;
227 if (dp == NULL) return -1;
231 memcpy(prefix + 12 + omitted, p, pb - omitted);
232 consumed = pb - omitted;
236 if(omitted > 16 || (pb > omitted && len < pb - omitted))
237 return -1;
239 if (dp == NULL) return -1;
243 memcpy(prefix + omitted, p, pb - omitted);
244 consumed = pb - omitted;
248 if(pb > 8 && len < pb - 8) return -1;
252 memcpy(prefix + 8, p, pb - 8);
253 consumed = pb - 8;
257 return -1;
268 return network_prefix(ae, -1, 0, a, NULL, len, a_r);
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");
322 ND_PRINT(" sub-padn");
326 ND_PRINT(" sub-diversity");
336 sep = "-";
337 sublen--;
344 ND_PRINT(" sub-timestamp");
362 ND_PRINT(" sub-unknown-0x%02x", subtype);
396 ND_PRINT(ndo->ndo_vflag ? "\n\tPad 1" : " pad1");
410 if (!ndo->ndo_vflag)
419 if (!ndo->ndo_vflag)
420 ND_PRINT(" ack-req");
433 if (!ndo->ndo_vflag)
434 ND_PRINT(" ack");
446 if (!ndo->ndo_vflag)
470 if (!ndo->ndo_vflag)
482 len - 6, address);
488 if((u_int)rc < len - 6)
496 if (!ndo->ndo_vflag)
497 ND_PRINT(" router-id");
507 if (!ndo->ndo_vflag)
517 len - 2, nh);
525 if (!ndo->ndo_vflag) {
548 len - 10, prefix);
566 if((u_int)rc < len - 10)
573 if (!ndo->ndo_vflag)
574 ND_PRINT(" route-request");
584 message + 4, NULL, len - 2, prefix);
593 if (!ndo->ndo_vflag)
594 ND_PRINT(" seqno-request");
605 message + 16, NULL, len - 14, prefix);
616 if (!ndo->ndo_vflag)
619 ND_PRINT("\n\tTS/PC ");
627 if (!ndo->ndo_vflag)
633 ND_PRINT("key-id %u digest-%u ", GET_BE_U_2(message + 2),
634 len - 2);
635 for (j = 0; j < len - 2; j++)
642 if(!ndo->ndo_vflag) {
643 ND_PRINT(" ss-update");
650 ND_PRINT("\n\tSS-Update");
661 len - parsed_len, prefix);
667 NULL, len - parsed_len, src_prefix);
686 if(!ndo->ndo_vflag)
687 ND_PRINT(" ss-request");
691 ND_PRINT("\n\tSS-Request ");
697 NULL, len - parsed_len, prefix);
703 NULL, len - parsed_len, src_prefix);
719 if(!ndo->ndo_vflag)
720 ND_PRINT(" ss-mh-request");
726 ND_PRINT("\n\tSS-MH-Request ");
735 NULL, len - parsed_len, prefix);
741 NULL, len - parsed_len, src_prefix);
755 if (!ndo->ndo_vflag)
765 if (!ndo->ndo_vflag)
766 ND_PRINT(" pc");
772 ND_PRINT(" index len %u", len-4);
778 if (!ndo->ndo_vflag)
789 if (!ndo->ndo_vflag)
800 if (!ndo->ndo_vflag)
811 return -1; /* packet truncated by capture process */
814 return -2; /* packet is invalid */
829 length -= 4;
836 if (ret == -1)
838 if (ret == -2)
840 length -= bodylen;
845 if(ndo->ndo_vflag) ND_PRINT("\n\t----");
848 if (ret == -1)
850 if (ret == -2)