* isis_circuit.[ch]: Some preliminary support for specifying wide
	  circuit metrics. Needs more thinking though, but should do for now.
diff --git a/isisd/ChangeLog b/isisd/ChangeLog
index 139985e..04f048a 100644
--- a/isisd/ChangeLog
+++ b/isisd/ChangeLog
@@ -1,5 +1,10 @@
 2005-09-26 Hasso Tepper <hasso at quagga.net>
 
+	* isis_circuit.[ch]: Some preliminary support for specifying wide
+	  circuit metrics. Needs more thinking though, but should do for now.
+
+2005-09-26 Hasso Tepper <hasso at quagga.net>
+
 	* isisd.[ch]: Introduce oldmetric flag for area and transition
 	  metricstyle command. With metricstyle wide only extended TLVs
 	  should be used.
diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c
index e885a65..23cb0ac 100644
--- a/isisd/isis_circuit.c
+++ b/isisd/isis_circuit.c
@@ -77,6 +77,7 @@
 	  circuit->metrics[i].metric_expense = METRICS_UNSUPPORTED;
 	  circuit->metrics[i].metric_error = METRICS_UNSUPPORTED;
 	  circuit->metrics[i].metric_delay = METRICS_UNSUPPORTED;
+	  circuit->te_metric[i] = DEFAULT_CIRCUIT_METRICS;
 	}
     }
   else
@@ -785,12 +786,12 @@
 		}
 	    }
 	  /* ISIS - Metric */
-	  if (c->metrics[0].metric_default == c->metrics[1].metric_default)
+	  if (c->te_metric[0] == c->te_metric[1])
 	    {
-	      if (c->metrics[0].metric_default != DEFAULT_CIRCUIT_METRICS)
+	      if (c->te_metric[0] != DEFAULT_CIRCUIT_METRICS)
 		{
-		  vty_out (vty, " isis metric %d%s",
-			   c->metrics[0].metric_default, VTY_NEWLINE);
+		  vty_out (vty, " isis metric %d%s", c->te_metric[0],
+			   VTY_NEWLINE);
 		  write++;
 		}
 	    }
@@ -798,11 +799,10 @@
 	    {
 	      for (i = 0; i < 2; i++)
 		{
-		  if (c->metrics[i].metric_default != DEFAULT_CIRCUIT_METRICS)
+		  if (c->te_metric[i] != DEFAULT_CIRCUIT_METRICS)
 		    {
 		      vty_out (vty, " isis metric %d level-%d%s",
-			       c->metrics[i].metric_default, i + 1,
-			       VTY_NEWLINE);
+			       c->te_metric[i], i + 1, VTY_NEWLINE);
 		      write++;
 		    }
 		}
@@ -1235,7 +1235,7 @@
 /* Metric command */
   DEFUN (isis_metric,
        isis_metric_cmd,
-       "isis metric <0-63>",
+       "isis metric <0-16777215>",
        "IS-IS commands\n"
        "Set default metric for circuit\n"
        "Default metric value\n")
@@ -1254,6 +1254,12 @@
 
   met = atoi (argv[0]);
 
+  circuit->te_metric[0] = met;
+  circuit->te_metric[1] = met;
+
+  if (met > 63)
+    met = 63;
+
   circuit->metrics[0].metric_default = met;
   circuit->metrics[1].metric_default = met;
 
@@ -1278,6 +1284,8 @@
     }
   assert (circuit);
 
+  circuit->te_metric[0] = DEFAULT_CIRCUIT_METRICS;
+  circuit->te_metric[1] = DEFAULT_CIRCUIT_METRICS;
   circuit->metrics[0].metric_default = DEFAULT_CIRCUIT_METRICS;
   circuit->metrics[1].metric_default = DEFAULT_CIRCUIT_METRICS;
 
@@ -1286,14 +1294,14 @@
 
 ALIAS (no_isis_metric,
        no_isis_metric_arg_cmd,
-       "no isis metric <0-127>",
+       "no isis metric <0-16777215>",
        NO_STR
        "IS-IS commands\n"
        "Set default metric for circuit\n"
        "Default metric value\n")
 
 /* end of metrics */
-  DEFUN (isis_hello_interval,
+DEFUN (isis_hello_interval,
        isis_hello_interval_cmd,
        "isis hello-interval (<1-65535>|minimal)",
        "IS-IS commands\n"
diff --git a/isisd/isis_circuit.h b/isisd/isis_circuit.h
index 484c057..b5ef269 100644
--- a/isisd/isis_circuit.h
+++ b/isisd/isis_circuit.h
@@ -108,6 +108,7 @@
   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_int32_t te_metric[2];
   struct password *c_rx_passwds;	/* circuitReceivePasswords */
   struct password *c_tc_passwd;	/* circuitTransmitPassword */
   int ip_router;		/* Route IP ? */