ospf6d: compute interface cost from its bandwidth
Previously, the interface cost was a fixed default value that a user
was allowed to change with "ipv6 ospf6 cost XX". As what is done with
OSPFv2, we change this behaviour to compute the default interface cost
from the interface bandwidth.
The user can still force a cost with "ipv6 ospf6 cost XX". He can get
the default value with "no ipv6 ospf6 cost". Moreover, the default
cost value was 1. The cost is now computed from the bandwidth and a
default reference bandwidth of 100 MBps (as for OSPFv2). Since the
default bandwidth for an interface is 10 MBps, the "default" cost
becomes 10 instead of 1.
[DL: resolved conflict in ospf6d/ospf6_interface.c]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
diff --git a/ospf6d/ospf6_interface.h b/ospf6d/ospf6_interface.h
index 808f096..34f7523 100644
--- a/ospf6d/ospf6_interface.h
+++ b/ospf6d/ospf6_interface.h
@@ -128,6 +128,7 @@
/* flags */
#define OSPF6_INTERFACE_DISABLE 0x01
#define OSPF6_INTERFACE_PASSIVE 0x02
+#define OSPF6_INTERFACE_NOAUTOCOST 0x04
/* default values */
#define OSPF6_INTERFACE_HELLO_INTERVAL 10
@@ -137,6 +138,9 @@
#define OSPF6_INTERFACE_PRIORITY 1
#define OSPF6_INTERFACE_TRANSDELAY 1
#define OSPF6_INTERFACE_INSTANCE_ID 0
+#define OSPF6_INTERFACE_BANDWIDTH 10000 /* Kbps */
+#define OSPF6_REFERENCE_BANDWIDTH 100000 /* Kbps */
+
/* Function Prototypes */