+/* draft-ietf-ospf-mt-09 */
+static const struct tok ospf_topology_values[] = {
+ { 0, "default" },
+ { 1, "multicast" },
+ { 2, "management" },
+ { 0, NULL }
+};
+
+/*
+ * Print all the per-topology metrics.
+ */
+static int
+ospf_print_tos_metrics(netdissect_options *ndo,
+ const union un_tos *tos)
+{
+ u_int metric_count;
+ u_int toscount;
+ u_int tos_type;
+
+ toscount = EXTRACT_U_1(tos->link.link_tos_count)+1;
+ metric_count = 0;
+
+ /*
+ * All but the first metric contain a valid topology id.
+ */
+ while (toscount != 0) {
+ ND_TCHECK_SIZE(tos);
+ tos_type = EXTRACT_U_1(tos->metrics.tos_type);
+ ND_PRINT("\n\t\ttopology %s (%u), metric %u",
+ tok2str(ospf_topology_values, "Unknown",
+ metric_count ? tos_type : 0),
+ metric_count ? tos_type : 0,
+ EXTRACT_BE_U_2(tos->metrics.tos_metric));
+ metric_count++;
+ tos++;
+ toscount--;
+ }
+ return 0;
+trunc:
+ return 1;
+}
+