isisd: drop unused per-type metric values

Expense, Error and Delay metrics never quite made it into the real
world.  Either way isisd does nothing useful with them, so let's drop
them from the code.  If someone wants to implement them, this patch can
still be reverted.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c
index 04c5155..aa30fcd 100644
--- a/isisd/isis_circuit.c
+++ b/isisd/isis_circuit.c
@@ -93,10 +93,7 @@
       circuit->csnp_interval[i] = DEFAULT_CSNP_INTERVAL;
       circuit->psnp_interval[i] = DEFAULT_PSNP_INTERVAL;
       circuit->priority[i] = DEFAULT_PRIORITY;
-      circuit->metrics[i].metric_default = DEFAULT_CIRCUIT_METRIC;
-      circuit->metrics[i].metric_expense = METRICS_UNSUPPORTED;
-      circuit->metrics[i].metric_error = METRICS_UNSUPPORTED;
-      circuit->metrics[i].metric_delay = METRICS_UNSUPPORTED;
+      circuit->metric[i] = DEFAULT_CIRCUIT_METRIC;
       circuit->te_metric[i] = DEFAULT_CIRCUIT_METRIC;
     }
 
@@ -901,7 +898,7 @@
             vty_out (vty, "      Metric: %d", circuit->te_metric[0]);
           else
             vty_out (vty, "      Metric: %d",
-                     circuit->metrics[0].metric_default);
+                     circuit->metric[0]);
           if (!circuit->is_passive)
             {
               vty_out (vty, ", Active neighbors: %u%s",
@@ -934,7 +931,7 @@
             vty_out (vty, "      Metric: %d", circuit->te_metric[1]);
           else
             vty_out (vty, "      Metric: %d",
-                     circuit->metrics[1].metric_default);
+                     circuit->metric[1]);
           if (!circuit->is_passive)
             {
               vty_out (vty, ", Active neighbors: %u%s",
@@ -1302,7 +1299,7 @@
     return -1;
 
   circuit->te_metric[level - 1] = metric;
-  circuit->metrics[level - 1].metric_default = metric;
+  circuit->metric[level - 1] = metric;
 
   if (circuit->area)
     lsp_regenerate_schedule (circuit->area, level, 0);
diff --git a/isisd/isis_circuit.h b/isisd/isis_circuit.h
index 9843ef3..9ada1e2 100644
--- a/isisd/isis_circuit.h
+++ b/isisd/isis_circuit.h
@@ -117,7 +117,7 @@
   u_int16_t hello_multiplier[2];	/* l1HelloMultiplier */
   u_int16_t csnp_interval[2];	/* level-1 csnp-interval in seconds */
   u_int16_t psnp_interval[2];	/* level-1 psnp-interval in seconds */
-  struct metric metrics[2];	/* l1XxxMetric */
+  u_int8_t  metric[2];
   u_int32_t te_metric[2];
   struct mpls_te_circuit *mtc; /* Support for MPLS-TE parameters - see isis_te.[c,h] */
   int ip_router;		/* Route IP ? */
diff --git a/isisd/isis_lsp.c b/isisd/isis_lsp.c
index 9032de4..aac8451 100644
--- a/isisd/isis_lsp.c
+++ b/isisd/isis_lsp.c
@@ -1544,7 +1544,10 @@
 		{
 		  ipreach =
 		    XMALLOC (MTYPE_ISIS_TLV, sizeof (struct ipv4_reachability));
-		  ipreach->metrics = circuit->metrics[level - 1];
+		  ipreach->metrics.metric_default = circuit->metric[level - 1];
+		  ipreach->metrics.metric_expense = METRICS_UNSUPPORTED;
+		  ipreach->metrics.metric_error = METRICS_UNSUPPORTED;
+		  ipreach->metrics.metric_delay = METRICS_UNSUPPORTED;
 		  masklen2ip (ipv4->prefixlen, &ipreach->mask);
 		  ipreach->prefix.s_addr = ((ipreach->mask.s_addr) &
 					    (ipv4->prefix.s_addr));
@@ -1569,7 +1572,7 @@
 					((ipv4->prefixlen + 7)/8) - 1);
 
 		  if (area->oldmetric)
-		    te_ipreach->te_metric = htonl (circuit->metrics[level - 1].metric_default);
+		    te_ipreach->te_metric = htonl (circuit->metric[level - 1]);
 		  else
 		    te_ipreach->te_metric = htonl (circuit->te_metric[level - 1]);
 
@@ -1604,7 +1607,7 @@
 
 	      if (area->oldmetric)
 		ip6reach->metric =
-			  htonl (circuit->metrics[level - 1].metric_default);
+			  htonl (circuit->metric[level - 1]);
 	      else
 		  ip6reach->metric = htonl (circuit->te_metric[level - 1]);
 
@@ -1643,7 +1646,10 @@
 		  else
 		    memcpy (is_neigh->neigh_id,
 			    circuit->u.bc.l2_desig_is, ISIS_SYS_ID_LEN + 1);
-		  is_neigh->metrics = circuit->metrics[level - 1];
+		  is_neigh->metrics.metric_default = circuit->metric[level - 1];
+		  is_neigh->metrics.metric_expense = METRICS_UNSUPPORTED;
+		  is_neigh->metrics.metric_error = METRICS_UNSUPPORTED;
+		  is_neigh->metrics.metric_delay = METRICS_UNSUPPORTED;
                   if (!memcmp (is_neigh->neigh_id, zero_id,
                                ISIS_SYS_ID_LEN + 1))
                     {
@@ -1675,7 +1681,7 @@
 		    memcpy (te_is_neigh->neigh_id,
 			    circuit->u.bc.l2_desig_is, ISIS_SYS_ID_LEN + 1);
 		  if (area->oldmetric)
-		    metric = circuit->metrics[level - 1].metric_default;
+		    metric = circuit->metric[level - 1];
 		  else
 		    metric = circuit->te_metric[level - 1];
 		  SET_TE_METRIC(te_is_neigh, metric);
@@ -1722,7 +1728,10 @@
 		    }
 		  is_neigh = XCALLOC (MTYPE_ISIS_TLV, sizeof (struct is_neigh));
 		  memcpy (is_neigh->neigh_id, nei->sysid, ISIS_SYS_ID_LEN);
-		  is_neigh->metrics = circuit->metrics[level - 1];
+		  is_neigh->metrics.metric_default = circuit->metric[level - 1];
+		  is_neigh->metrics.metric_expense = METRICS_UNSUPPORTED;
+		  is_neigh->metrics.metric_error = METRICS_UNSUPPORTED;
+		  is_neigh->metrics.metric_delay = METRICS_UNSUPPORTED;
 		  listnode_add (tlv_data.is_neighs, is_neigh);
 		  lsp_debug("ISIS (%s): Adding old-style is reach for %s", area->area_tag,
                             sysid_print(is_neigh->neigh_id));