ND_PRINT("\n\t Advertising Router %s, seq 0x%08x, age %us, length %u",
GET_IPADDR_STRING(lshp->ls_router),
ND_PRINT("\n\t Advertising Router %s, seq 0x%08x, age %us, length %u",
GET_IPADDR_STRING(lshp->ls_router),
if (lsa_length < sizeof (lsap->lsa_un.un_rla.rla_options))
return (1);
lsa_length -= sizeof (lsap->lsa_un.un_rla.rla_options);
if (lsa_length < sizeof (lsap->lsa_un.un_rla.rla_options))
return (1);
lsa_length -= sizeof (lsap->lsa_un.un_rla.rla_options);
ND_PRINT("\n\t Options [%s]",
bittok2str(ospf6_option_values, "none",
GET_BE_U_4(lsap->lsa_un.un_rla.rla_options)));
ND_PRINT("\n\t Options [%s]",
bittok2str(ospf6_option_values, "none",
GET_BE_U_4(lsap->lsa_un.un_rla.rla_options)));
if (lsa_length < sizeof (lsap->lsa_un.un_nla.nla_options))
return (1);
lsa_length -= sizeof (lsap->lsa_un.un_nla.nla_options);
if (lsa_length < sizeof (lsap->lsa_un.un_nla.nla_options))
return (1);
lsa_length -= sizeof (lsap->lsa_un.un_nla.nla_options);
ND_PRINT("\n\t Options [%s]",
bittok2str(ospf6_option_values, "none",
GET_BE_U_4(lsap->lsa_un.un_nla.nla_options)));
ND_PRINT("\n\t Options [%s]",
bittok2str(ospf6_option_values, "none",
GET_BE_U_4(lsap->lsa_un.un_nla.nla_options)));
if (lsa_length < sizeof (lsap->lsa_un.un_inter_ap.inter_ap_metric))
return (1);
lsa_length -= sizeof (lsap->lsa_un.un_inter_ap.inter_ap_metric);
if (lsa_length < sizeof (lsap->lsa_un.un_inter_ap.inter_ap_metric))
return (1);
lsa_length -= sizeof (lsap->lsa_un.un_inter_ap.inter_ap_metric);
if (lsa_length < sizeof (lsap->lsa_un.un_asla.asla_metric))
return (1);
lsa_length -= sizeof (lsap->lsa_un.un_asla.asla_metric);
if (lsa_length < sizeof (lsap->lsa_un.un_asla.asla_metric))
return (1);
lsa_length -= sizeof (lsap->lsa_un.un_asla.asla_metric);
flags32 = GET_BE_U_4(lsap->lsa_un.un_asla.asla_metric);
ND_PRINT("\n\t Flags [%s]",
bittok2str(ospf6_asla_flag_values, "none", flags32));
flags32 = GET_BE_U_4(lsap->lsa_un.un_asla.asla_metric);
ND_PRINT("\n\t Flags [%s]",
bittok2str(ospf6_asla_flag_values, "none", flags32));
if (lsa_length < sizeof (llsap->llsa_lladdr) + sizeof (llsap->llsa_nprefix))
return (1);
lsa_length -= sizeof (llsap->llsa_lladdr) + sizeof (llsap->llsa_nprefix);
if (lsa_length < sizeof (llsap->llsa_lladdr) + sizeof (llsap->llsa_nprefix))
return (1);
lsa_length -= sizeof (llsap->llsa_lladdr) + sizeof (llsap->llsa_nprefix);
prefixes = GET_BE_U_4(llsap->llsa_nprefix);
ND_PRINT("\n\t Priority %u, Link-local address %s, Prefixes %u:",
GET_U_1(llsap->llsa_priority),
prefixes = GET_BE_U_4(llsap->llsa_nprefix);
ND_PRINT("\n\t Priority %u, Link-local address %s, Prefixes %u:",
GET_U_1(llsap->llsa_priority),
if (lsa_length < sizeof (lsap->lsa_un.un_intra_ap.intra_ap_nprefix))
return (1);
lsa_length -= sizeof (lsap->lsa_un.un_intra_ap.intra_ap_nprefix);
if (lsa_length < sizeof (lsap->lsa_un.un_intra_ap.intra_ap_nprefix))
return (1);
lsa_length -= sizeof (lsap->lsa_un.un_intra_ap.intra_ap_nprefix);
prefixes = GET_BE_U_2(lsap->lsa_un.un_intra_ap.intra_ap_nprefix);
ND_PRINT("\n\t Prefixes %u:", prefixes);
prefixes = GET_BE_U_2(lsap->lsa_un.un_intra_ap.intra_ap_nprefix);
ND_PRINT("\n\t Prefixes %u:", prefixes);
ND_PRINT("\n\tOptions [%s]",
bittok2str(ospf6_option_values, "none",
GET_BE_U_4(hellop->hello_options)));
ND_PRINT("\n\tOptions [%s]",
bittok2str(ospf6_option_values, "none",
GET_BE_U_4(hellop->hello_options)));
ND_PRINT("\n\t Hello Timer %us, Dead Timer %us, Interface-ID %s, Priority %u",
GET_BE_U_2(hellop->hello_helloint),
GET_BE_U_2(hellop->hello_deadint),
GET_IPADDR_STRING(hellop->hello_ifid),
GET_U_1(hellop->hello_priority));
ND_PRINT("\n\t Hello Timer %us, Dead Timer %us, Interface-ID %s, Priority %u",
GET_BE_U_2(hellop->hello_helloint),
GET_BE_U_2(hellop->hello_deadint),
GET_IPADDR_STRING(hellop->hello_ifid),
GET_U_1(hellop->hello_priority));
if (GET_BE_U_4(hellop->hello_dr) != 0)
ND_PRINT("\n\t Designated Router %s",
GET_IPADDR_STRING(hellop->hello_dr));
if (GET_BE_U_4(hellop->hello_dr) != 0)
ND_PRINT("\n\t Designated Router %s",
GET_IPADDR_STRING(hellop->hello_dr));
if (GET_BE_U_4(hellop->hello_bdr) != 0)
ND_PRINT(", Backup Designated Router %s",
GET_IPADDR_STRING(hellop->hello_bdr));
if (GET_BE_U_4(hellop->hello_bdr) != 0)
ND_PRINT(", Backup Designated Router %s",
GET_IPADDR_STRING(hellop->hello_bdr));
ND_PRINT("\n\tOptions [%s]",
bittok2str(ospf6_option_values, "none",
GET_BE_U_4(ddp->db_options)));
ND_PRINT("\n\tOptions [%s]",
bittok2str(ospf6_option_values, "none",
GET_BE_U_4(ddp->db_options)));
ND_PRINT(", DD Flags [%s]",
bittok2str(ospf6_dd_flag_values,"none",GET_U_1(ddp->db_flags)));
ND_PRINT(", DD Flags [%s]",
bittok2str(ospf6_dd_flag_values,"none",GET_U_1(ddp->db_flags)));
ND_PRINT(", MTU %u, DD-Sequence 0x%08x",
GET_BE_U_2(ddp->db_mtu),
GET_BE_U_4(ddp->db_seq));
ND_PRINT(", MTU %u, DD-Sequence 0x%08x",
GET_BE_U_2(ddp->db_mtu),
GET_BE_U_4(ddp->db_seq));
if (ndo->ndo_vflag > 1) {
const struct lsu6 *lsup = (const struct lsu6 *)((const uint8_t *)op + OSPF6HDR_LEN);
if (ndo->ndo_vflag > 1) {
const struct lsu6 *lsup = (const struct lsu6 *)((const uint8_t *)op + OSPF6HDR_LEN);
llsdatalen = GET_BE_U_2(cp);
ND_PRINT(", Data Length %u", llsdatalen);
if (llsdatalen < OSPF_LLS_HDRLEN || llsdatalen > len)
llsdatalen = GET_BE_U_2(cp);
ND_PRINT(", Data Length %u", llsdatalen);
if (llsdatalen < OSPF_LLS_HDRLEN || llsdatalen > len)
ND_PRINT("\n\tAuthentication Type %s",
tok2str(ospf6_auth_type_str, "unknown (0x%04x)", GET_BE_U_2(cp)));
cp += 2;
/* Auth Data Len */
ND_PRINT("\n\tAuthentication Type %s",
tok2str(ospf6_auth_type_str, "unknown (0x%04x)", GET_BE_U_2(cp)));
cp += 2;
/* Auth Data Len */
authdatalen = GET_BE_U_2(cp);
ND_PRINT(", Length %u", authdatalen);
if (authdatalen < OSPF6_AT_HDRLEN || authdatalen > len)
goto trunc;
cp += 2;
/* Reserved */
authdatalen = GET_BE_U_2(cp);
ND_PRINT(", Length %u", authdatalen);
if (authdatalen < OSPF6_AT_HDRLEN || authdatalen > len)
goto trunc;
cp += 2;
/* Reserved */
ND_PRINT(", SAID %u", GET_BE_U_2(cp));
cp += 2;
/* Cryptographic Sequence Number (High-Order 32 Bits) */
ND_PRINT(", SAID %u", GET_BE_U_2(cp));
cp += 2;
/* Cryptographic Sequence Number (High-Order 32 Bits) */
ND_PRINT(", CSN 0x%08x", GET_BE_U_4(cp));
cp += 4;
/* Cryptographic Sequence Number (Low-Order 32 Bits) */
ND_PRINT(", CSN 0x%08x", GET_BE_U_4(cp));
cp += 4;
/* Cryptographic Sequence Number (Low-Order 32 Bits) */
ND_PRINT(":%08x", GET_BE_U_4(cp));
cp += 4;
/* Authentication Data */
ND_PRINT(":%08x", GET_BE_U_4(cp));
cp += 4;
/* Authentication Data */
type = GET_U_1(op->ospf6_type);
if (type == OSPF_TYPE_HELLO) {
const struct hello6 *hellop = (const struct hello6 *)((const uint8_t *)op + OSPF6HDR_LEN);
type = GET_U_1(op->ospf6_type);
if (type == OSPF_TYPE_HELLO) {
const struct hello6 *hellop = (const struct hello6 *)((const uint8_t *)op + OSPF6HDR_LEN);
if (GET_BE_U_4(hellop->hello_options) & OSPF6_OPTION_L)
lls_hello = 1;
} else if (type == OSPF_TYPE_DD) {
const struct dd6 *ddp = (const struct dd6 *)((const uint8_t *)op + OSPF6HDR_LEN);
if (GET_BE_U_4(hellop->hello_options) & OSPF6_OPTION_L)
lls_hello = 1;
} else if (type == OSPF_TYPE_DD) {
const struct dd6 *ddp = (const struct dd6 *)((const uint8_t *)op + OSPF6HDR_LEN);
/* If the type is valid translate it, or just print the type */
/* value. If it's not valid, say so and return */
/* If the type is valid translate it, or just print the type */
/* value. If it's not valid, say so and return */
cp = tok2str(ospf6_type_values, "unknown packet type (%u)",
GET_U_1(op->ospf6_type));
ND_PRINT("OSPFv%u, %s, length %u", GET_U_1(op->ospf6_version), cp,
cp = tok2str(ospf6_type_values, "unknown packet type (%u)",
GET_U_1(op->ospf6_type));
ND_PRINT("OSPFv%u, %s, length %u", GET_U_1(op->ospf6_version), cp,
datalen = GET_BE_U_2(op->ospf6_len);
if (datalen > length) {
ND_PRINT(" [len %u]", datalen);
datalen = GET_BE_U_2(op->ospf6_len);
if (datalen > length) {
ND_PRINT(" [len %u]", datalen);
if (GET_BE_U_4(op->ospf6_areaid) != 0)
ND_PRINT(", Area %s", GET_IPADDR_STRING(op->ospf6_areaid));
else
ND_PRINT(", Backbone Area");
if (GET_BE_U_4(op->ospf6_areaid) != 0)
ND_PRINT(", Area %s", GET_IPADDR_STRING(op->ospf6_areaid));
else
ND_PRINT(", Backbone Area");
if (GET_U_1(op->ospf6_instanceid))
ND_PRINT(", Instance %u", GET_U_1(op->ospf6_instanceid));
if (GET_U_1(op->ospf6_instanceid))
ND_PRINT(", Instance %u", GET_U_1(op->ospf6_instanceid));