/* followed by options */
} UNALIGNED;
+/* http://www.iana.org/assignments/ipv6-parameters/ipv6-parameters.xhtml */
+
/* Option types and related macros */
#define IP6OPT_PAD1 0x00 /* 00 0 00000 */
#define IP6OPT_PADN 0x01 /* 00 0 00001 */
#define IP6OPT_JUMBO 0xC2 /* 11 0 00010 = 194 */
#define IP6OPT_JUMBO_LEN 6
+#define IP6OPT_RPL 0x63 /* 01 1 00011 */
+#define IP6OPT_TUN_ENC_LIMIT 0x04 /* 00 0 00100 */
#define IP6OPT_ROUTER_ALERT 0x05 /* 00 0 00101 */
#define IP6OPT_RTALERT_LEN 4
#define IP6OPT_RTALERT_ACTNET 2 /* contains an Active Networks msg */
#define IP6OPT_MINLEN 2
-#define IP6OPT_BINDING_UPDATE 0xc6 /* 11 0 00110 */
-#define IP6OPT_BINDING_ACK 0x07 /* 00 0 00111 */
-#define IP6OPT_BINDING_REQ 0x08 /* 00 0 01000 */
+#define IP6OPT_QUICK_START 0x26 /* 00 1 00110 */
+#define IP6OPT_CALIPSO 0x07 /* 00 0 00111 */
+#define IP6OPT_SMF_DPD 0x08 /* 00 0 01000 */
#define IP6OPT_HOME_ADDRESS 0xc9 /* 11 0 01001 */
+#define IP6OPT_HOMEADDR_MINLEN 18
#define IP6OPT_EID 0x8a /* 10 0 01010 */
+#define IP6OPT_ILNP_NOTICE 0x8b /* 10 0 01011 */
+#define IP6OPT_LINE_ID 0x8c /* 10 0 01100 */
+#define IP6OPT_MPL 0x6d /* 01 1 01101 */
+#define IP6OPT_IP_DFF 0xee /* 11 1 01110 */
#define IP6OPT_TYPE(o) ((o) & 0xC0)
#define IP6OPT_TYPE_SKIP 0x00
#include "addrtoname.h"
#include "extract.h"
-/* items outside of rfc2292bis */
-#ifndef IP6OPT_MINLEN
-#define IP6OPT_MINLEN 2
-#endif
-#ifndef IP6OPT_RTALERT_LEN
-#define IP6OPT_RTALERT_LEN 4
-#endif
-#ifndef IP6OPT_JUMBO_LEN
-#define IP6OPT_JUMBO_LEN 6
-#endif
-#define IP6OPT_HOMEADDR_MINLEN 18
-#define IP6OPT_BU_MINLEN 10
-#define IP6OPT_BA_MINLEN 13
-#define IP6OPT_BR_MINLEN 2
-#define IP6SOPT_UI 0x2
-#define IP6SOPT_UI_MINLEN 4
-#define IP6SOPT_ALTCOA 0x3
-#define IP6SOPT_ALTCOA_MINLEN 18
-#define IP6SOPT_AUTH 0x4
-#define IP6SOPT_AUTH_MINLEN 6
-
-static void ip6_sopt_print(const u_char *, int);
-
static void
ip6_sopt_print(const u_char *bp, int len)
{
}
printf(", padn");
break;
- case IP6SOPT_UI:
- if (len - i < IP6SOPT_UI_MINLEN) {
- printf(", ui: trunc");
- goto trunc;
- }
- printf(", ui: 0x%04x ", EXTRACT_16BITS(&bp[i + 2]));
- break;
- case IP6SOPT_ALTCOA:
- if (len - i < IP6SOPT_ALTCOA_MINLEN) {
- printf(", altcoa: trunc");
- goto trunc;
- }
- printf(", alt-CoA: %s", ip6addr_string(&bp[i+2]));
- break;
- case IP6SOPT_AUTH:
- if (len - i < IP6SOPT_AUTH_MINLEN) {
- printf(", auth: trunc");
- goto trunc;
- }
- printf(", auth spi: 0x%08x", EXTRACT_32BITS(&bp[i + 2]));
- break;
default:
if (len - i < IP6OPT_MINLEN) {
printf(", sopt_type %d: trunc)", bp[i]);
}
printf(")");
break;
- case IP6OPT_BINDING_UPDATE:
- if (len - i < IP6OPT_BU_MINLEN) {
- printf("(bu: trunc)");
- goto trunc;
- }
- if (bp[i + 1] < IP6OPT_BU_MINLEN - 2) {
- printf("(bu: invalid len %d)", bp[i + 1]);
- goto trunc;
- }
- printf("(bu: ");
- if (bp[i + 2] & 0x80)
- printf("A");
- if (bp[i + 2] & 0x40)
- printf("H");
- if (bp[i + 2] & 0x20)
- printf("S");
- if (bp[i + 2] & 0x10)
- printf("D");
- if ((bp[i + 2] & 0x0f) || bp[i + 3] || bp[i + 4])
- printf("res");
- printf(", sequence: %u", bp[i + 5]);
- printf(", lifetime: %u", EXTRACT_32BITS(&bp[i + 6]));
-
- if (bp[i + 1] > IP6OPT_BU_MINLEN - 2) {
- ip6_sopt_print(&bp[i + IP6OPT_BU_MINLEN],
- (optlen - IP6OPT_BU_MINLEN));
- }
- printf(")");
- break;
- case IP6OPT_BINDING_ACK:
- if (len - i < IP6OPT_BA_MINLEN) {
- printf("(ba: trunc)");
- goto trunc;
- }
- if (bp[i + 1] < IP6OPT_BA_MINLEN - 2) {
- printf("(ba: invalid len %d)", bp[i + 1]);
- goto trunc;
- }
- printf("(ba: ");
- printf("status: %u", bp[i + 2]);
- if (bp[i + 3])
- printf("res");
- printf(", sequence: %u", bp[i + 4]);
- printf(", lifetime: %u", EXTRACT_32BITS(&bp[i + 5]));
- printf(", refresh: %u", EXTRACT_32BITS(&bp[i + 9]));
-
- if (bp[i + 1] > IP6OPT_BA_MINLEN - 2) {
- ip6_sopt_print(&bp[i + IP6OPT_BA_MINLEN],
- (optlen - IP6OPT_BA_MINLEN));
- }
- printf(")");
- break;
- case IP6OPT_BINDING_REQ:
- if (len - i < IP6OPT_BR_MINLEN) {
- printf("(br: trunc)");
- goto trunc;
- }
- printf("(br");
- if (bp[i + 1] > IP6OPT_BR_MINLEN - 2) {
- ip6_sopt_print(&bp[i + IP6OPT_BR_MINLEN],
- (optlen - IP6OPT_BR_MINLEN));
- }
- printf(")");
- break;
default:
if (len - i < IP6OPT_MINLEN) {
printf("(type %d: trunc)", bp[i]);
}
}
printf(" ");
-
-#if 0
-end:
-#endif
return;
trunc: