+ /* dig deeper if LLS data is available; see RFC4813 */
+ length2 = EXTRACT_BE_U_2(op->ospf_len);
+ dptr = (const u_char *)op + length2;
+ dataend = (const u_char *)op + length;
+
+ if (EXTRACT_BE_U_2(op->ospf_authtype) == OSPF_AUTH_MD5) {
+ dptr = dptr + op->ospf_authdata[3];
+ length2 += op->ospf_authdata[3];
+ }
+ if (length2 >= length) {
+ ND_PRINT("\n\t[LLS truncated]");
+ return (1);
+ }
+ ND_TCHECK_2(dptr);
+ ND_PRINT("\n\t LLS: checksum: 0x%04x", (u_int) EXTRACT_BE_U_2(dptr));
+
+ dptr += 2;
+ ND_TCHECK_2(dptr);
+ length2 = EXTRACT_BE_U_2(dptr);
+ ND_PRINT(", length: %u", length2);
+
+ dptr += 2;
+ ND_TCHECK_1(dptr);
+ while (dptr < dataend) {
+ ND_TCHECK_2(dptr);
+ lls_type = EXTRACT_BE_U_2(dptr);
+ ND_PRINT("\n\t %s (%u)",
+ tok2str(ospf_lls_tlv_values,"Unknown TLV",lls_type),
+ lls_type);
+ dptr += 2;
+ ND_TCHECK_2(dptr);
+ lls_len = EXTRACT_BE_U_2(dptr);
+ ND_PRINT(", length: %u", lls_len);
+ dptr += 2;
+ switch (lls_type) {
+
+ case OSPF_LLS_EO:
+ if (lls_len != 4) {
+ ND_PRINT(" [should be 4]");
+ lls_len = 4;
+ }
+ ND_TCHECK_4(dptr);
+ lls_flags = EXTRACT_BE_U_4(dptr);
+ ND_PRINT("\n\t Options: 0x%08x [%s]", lls_flags,
+ bittok2str(ospf_lls_eo_options, "?", lls_flags));
+
+ break;
+
+ case OSPF_LLS_MD5:
+ if (lls_len != 20) {
+ ND_PRINT(" [should be 20]");
+ lls_len = 20;
+ }
+ ND_TCHECK_4(dptr);
+ ND_PRINT("\n\t Sequence number: 0x%08x", EXTRACT_BE_U_4(dptr));
+ break;
+ }
+
+ dptr += lls_len;
+ }
+
+ return (0);
+trunc:
+ return (1);
+}