* Add 3 more LS types and the M6-bit.
* Print multicast LS type and prefix option as deprecated.
* Remove needless forward declarations.
* Make ospf6_decode_v3() consider vflag for every packet type and raise
the margin from "> 0" to "> 1" because it is already "> 0" that far.
* Fix a message to refer to packet type instead of LS type.
* Remove irrelevant comment.
* Don't print unknown protocol version 2nd time.
#define OSPF6_DB_INIT 0x04 /* */
#define OSPF6_DB_MORE 0x02
#define OSPF6_DB_MASTER 0x01
#define OSPF6_DB_INIT 0x04 /* */
#define OSPF6_DB_MORE 0x02
#define OSPF6_DB_MASTER 0x01
+#define OSPF6_DB_M6 0x10 /* IPv6 MTU */
/* ls_type */
#define LS_TYPE_ROUTER 1 /* router link */
/* ls_type */
#define LS_TYPE_ROUTER 1 /* router link */
#define LS_TYPE_INTRA_AP 9 /* Intra-Area-Prefix */
#define LS_TYPE_INTRA_ATE 10 /* Intra-Area-TE */
#define LS_TYPE_GRACE 11 /* Grace LSA */
#define LS_TYPE_INTRA_AP 9 /* Intra-Area-Prefix */
#define LS_TYPE_INTRA_ATE 10 /* Intra-Area-TE */
#define LS_TYPE_GRACE 11 /* Grace LSA */
+#define LS_TYPE_RI 12 /* Router information */
+#define LS_TYPE_INTER_ASTE 13 /* Inter-AS-TE */
+#define LS_TYPE_L1VPN 14 /* L1VPN */
#define LS_TYPE_MASK 0x1fff
#define LS_SCOPE_LINKLOCAL 0x0000
#define LS_TYPE_MASK 0x1fff
#define LS_SCOPE_LINKLOCAL 0x0000
{ LS_TYPE_INTER_AP, "Inter-Area Prefix" },
{ LS_TYPE_INTER_AR, "Inter-Area Router" },
{ LS_TYPE_ASE, "External" },
{ LS_TYPE_INTER_AP, "Inter-Area Prefix" },
{ LS_TYPE_INTER_AR, "Inter-Area Router" },
{ LS_TYPE_ASE, "External" },
- { LS_TYPE_GROUP, "Multicast Group" },
+ { LS_TYPE_GROUP, "Deprecated" },
{ LS_TYPE_NSSA, "NSSA" },
{ LS_TYPE_LINK, "Link" },
{ LS_TYPE_INTRA_AP, "Intra-Area Prefix" },
{ LS_TYPE_INTRA_ATE, "Intra-Area TE" },
{ LS_TYPE_GRACE, "Grace" },
{ LS_TYPE_NSSA, "NSSA" },
{ LS_TYPE_LINK, "Link" },
{ LS_TYPE_INTRA_AP, "Intra-Area Prefix" },
{ LS_TYPE_INTRA_ATE, "Intra-Area TE" },
{ LS_TYPE_GRACE, "Grace" },
+ { LS_TYPE_RI, "Router Information" },
+ { LS_TYPE_INTER_ASTE, "Inter-AS-TE" },
+ { LS_TYPE_L1VPN, "Layer 1 VPN" },
{ OSPF6_DB_INIT, "Init" },
{ OSPF6_DB_MORE, "More" },
{ OSPF6_DB_MASTER, "Master" },
{ OSPF6_DB_INIT, "Init" },
{ OSPF6_DB_MORE, "More" },
{ OSPF6_DB_MASTER, "Master" },
+ { OSPF6_DB_M6, "IPv6 MTU" },
{ 0, NULL }
};
static const struct tok ospf6_lsa_prefix_option_values[] = {
{ LSA_PREFIX_OPT_NU, "No Unicast" },
{ LSA_PREFIX_OPT_LA, "Local address" },
{ 0, NULL }
};
static const struct tok ospf6_lsa_prefix_option_values[] = {
{ LSA_PREFIX_OPT_NU, "No Unicast" },
{ LSA_PREFIX_OPT_LA, "Local address" },
- { LSA_PREFIX_OPT_MC, "Multicast" },
+ { LSA_PREFIX_OPT_MC, "Deprecated" },
{ LSA_PREFIX_OPT_P, "Propagate" },
{ LSA_PREFIX_OPT_DN, "Down" },
{ 0, NULL }
};
{ LSA_PREFIX_OPT_P, "Propagate" },
{ LSA_PREFIX_OPT_DN, "Down" },
{ 0, NULL }
};
-/* Forwards */
-static void ospf6_print_ls_type(u_int, const rtrid_t *);
-static int ospf6_print_lshdr(const struct lsa6_hdr *);
-static int ospf6_print_lsa(const struct lsa6 *);
-static int ospf6_decode_v3(const struct ospf6hdr *, const u_char *);
-
static void
ospf6_print_ls_type(register u_int ls_type, register const rtrid_t *ls_stateid)
static void
ospf6_print_ls_type(register u_int ls_type, register const rtrid_t *ls_stateid)
if (op->ospf6_hello.hello_bdr != 0)
printf(", Backup Designated Router %s",
ipaddr_string(&op->ospf6_hello.hello_bdr));
if (op->ospf6_hello.hello_bdr != 0)
printf(", Backup Designated Router %s",
ipaddr_string(&op->ospf6_hello.hello_bdr));
printf("\n\t Neighbor List:");
ap = op->ospf6_hello.hello_neighbor;
while ((u_char *)ap < dataend) {
printf("\n\t Neighbor List:");
ap = op->ospf6_hello.hello_neighbor;
while ((u_char *)ap < dataend) {
printf(", MTU %u, DD-Sequence 0x%08x",
EXTRACT_16BITS(&op->ospf6_db.db_mtu),
EXTRACT_32BITS(&op->ospf6_db.db_seq));
printf(", MTU %u, DD-Sequence 0x%08x",
EXTRACT_16BITS(&op->ospf6_db.db_mtu),
EXTRACT_32BITS(&op->ospf6_db.db_seq));
-
- /* Print all the LS adv's */
- lshp = op->ospf6_db.db_lshdr;
- while (!ospf6_print_lshdr(lshp)) {
- ++lshp;
- }
+ if (vflag > 1) {
+ /* Print all the LS adv's */
+ lshp = op->ospf6_db.db_lshdr;
+ while (!ospf6_print_lshdr(lshp)) {
+ ++lshp;
+ }
+ }
break;
case OSPF_TYPE_LS_REQ:
break;
case OSPF_TYPE_LS_REQ:
lsrp = op->ospf6_lsr;
while ((u_char *)lsrp < dataend) {
TCHECK(*lsrp);
lsrp = op->ospf6_lsr;
while ((u_char *)lsrp < dataend) {
TCHECK(*lsrp);
break;
case OSPF_TYPE_LS_UPDATE:
break;
case OSPF_TYPE_LS_UPDATE:
lsap = op->ospf6_lsu.lsu_lsa;
TCHECK(op->ospf6_lsu.lsu_count);
i = EXTRACT_32BITS(&op->ospf6_lsu.lsu_count);
lsap = op->ospf6_lsu.lsu_lsa;
TCHECK(op->ospf6_lsu.lsu_count);
i = EXTRACT_32BITS(&op->ospf6_lsu.lsu_count);
lshp = op->ospf6_lsa.lsa_lshdr;
while (!ospf6_print_lshdr(lshp)) {
lshp = op->ospf6_lsa.lsa_lshdr;
while (!ospf6_print_lshdr(lshp)) {
/* If the type is valid translate it, or just print the type */
/* value. If it's not valid, say so and return */
TCHECK(op->ospf6_type);
/* If the type is valid translate it, or just print the type */
/* value. If it's not valid, say so and return */
TCHECK(op->ospf6_type);
- cp = tok2str(ospf6_type_values, "unknown LS-type", op->ospf6_type);
+ cp = tok2str(ospf6_type_values, "unknown packet type (%u)", op->ospf6_type);
printf("OSPFv%u, %s, length %d", op->ospf6_version, cp, length);
if (*cp == 'u') {
return;
printf("OSPFv%u, %s, length %d", op->ospf6_version, cp, length);
if (*cp == 'u') {
return;
- /* Print the routerid if it is not the same as the source */
TCHECK(op->ospf6_routerid);
printf("\n\tRouter-ID %s", ipaddr_string(&op->ospf6_routerid));
TCHECK(op->ospf6_routerid);
printf("\n\tRouter-ID %s", ipaddr_string(&op->ospf6_routerid));
if (ospf6_decode_v3(op, dataend))
goto trunc;
break;
if (ospf6_decode_v3(op, dataend))
goto trunc;
break;
-
- default:
- printf(" ospf [version %d]", op->ospf6_version);
- break;
} /* end switch on version */
return;
} /* end switch on version */
return;