]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Allows to set instance ID for OSPFv3 interfaces.
authorOndrej Zajicek <santiago@crfreenet.org>
Fri, 11 May 2012 16:52:59 +0000 (18:52 +0200)
committerOndrej Zajicek <santiago@crfreenet.org>
Mon, 14 May 2012 08:22:14 +0000 (10:22 +0200)
doc/bird.sgml
proto/ospf/config.Y

index 3edd6e0e565947a65a742d23fe118c0d8152a541..820ebaa267bc44cd0161ce54e0876bce713228bd 100644 (file)
@@ -1811,7 +1811,7 @@ protocol ospf &lt;name&gt; {
                        summary &lt;switch&gt;;
                        cost &lt;num&gt;;
                }
-               interface &lt;interface pattern&gt; {
+               interface &lt;interface pattern&gt; [instance &lt;num&gt;] {
                        cost &lt;num&gt;;
                        stub &lt;switch&gt;;
                        hello &lt;num&gt;;
@@ -1841,7 +1841,7 @@ protocol ospf &lt;name&gt; {
                                &lt;ip&gt; eligible;
                        };
                };
-               virtual link &lt;id&gt; {
+               virtual link &lt;id&gt; [instance &lt;num&gt;] {
                        hello &lt;num&gt;;
                        retransmit &lt;num&gt;;
                        wait &lt;num&gt;;
@@ -1961,14 +1961,19 @@ protocol ospf &lt;name&gt; {
         subnetworks of given stub network are suppressed. This might
         be used, for example, to aggregate generated stub networks.
         
-       <tag>interface <M>pattern</M></tag>
+       <tag>interface <M>pattern</M> [instance <m/num/]</tag>
         Defines that the specified interfaces belong to the area being defined.
         See <ref id="dsc-iface" name="interface"> common option for detailed description.
-
-       <tag>virtual link <M>id</M></tag>
-        Virtual link to router with the router id. Virtual link acts as a
-         point-to-point interface belonging to backbone. The actual area is
-         used as transport area. This item cannot be in the backbone.
+        In OSPFv3, you can specify instance ID for that interface
+        description, so it is possible to have several instances of
+        that interface with different options or even in different areas.
+
+       <tag>virtual link <M>id</M> [instance <m/num/]</tag>
+        Virtual link to router with the router id. Virtual link acts
+         as a point-to-point interface belonging to backbone. The
+         actual area is used as transport area. This item cannot be in
+         the backbone. In OSPFv3, you could also use several virtual
+         links to one destination with different instance IDs.
 
        <tag>cost <M>num</M></tag>
         Specifies output cost (metric) of an interface. Default value is 10.
index 38e59886529eff9df21dbf4218ff89abe703f367..0c36b7f8b81e12b19892efc6de19d3ebab10ec8e 100644 (file)
@@ -107,7 +107,17 @@ static inline void
 check_defcost(int cost)
 {
   if ((cost <= 0) || (cost >= LSINFINITY))
-   cf_error("Default cost must be in range 1-%d", LSINFINITY);
+   cf_error("Default cost must be in range 1-%d", LSINFINITY-1);
+}
+
+static inline void
+set_instance_id(unsigned id)
+{
+#ifdef OSPFv3
+  OSPF_PATT->instance_id = id;
+#else
+  cf_error("Instance ID requires OSPFv3");
+#endif
 }
 
 CF_DECLS
@@ -120,7 +130,7 @@ CF_KEYWORDS(NONE, SIMPLE, AUTHENTICATION, STRICT, CRYPTOGRAPHIC)
 CF_KEYWORDS(ELIGIBLE, POLL, NETWORKS, HIDDEN, VIRTUAL, CHECK, LINK)
 CF_KEYWORDS(RX, BUFFER, LARGE, NORMAL, STUBNET, HIDDEN, SUMMARY, TAG, EXTERNAL)
 CF_KEYWORDS(WAIT, DELAY, LSADB, ECMP, LIMIT, WEIGHT, NSSA, TRANSLATOR, STABILITY)
-CF_KEYWORDS(GLOBAL, LSID, ROUTER, SELF)
+CF_KEYWORDS(GLOBAL, LSID, ROUTER, SELF, INSTANCE)
 
 %type <t> opttext
 %type <ld> lsadb_args
@@ -218,8 +228,8 @@ ospf_stubnet_item:
  ;
 
 ospf_vlink:
-   ospf_vlink_start '{' ospf_vlink_opts '}' { ospf_iface_finish(); }
- | ospf_vlink_start { ospf_iface_finish(); }
+   ospf_vlink_start ospf_instance_id '{' ospf_vlink_opts '}' { ospf_iface_finish(); }
+ | ospf_vlink_start ospf_instance_id { ospf_iface_finish(); }
  ;
 
 ospf_vlink_opts:
@@ -364,6 +374,11 @@ ospf_iface_start:
  }
 ;
 
+ospf_instance_id:
+   /* empty */
+ | INSTANCE expr { set_instance_id($2); }
+ ;
+
 ospf_iface_opts:
    /* empty */
  | ospf_iface_opts ospf_iface_item ';'
@@ -375,7 +390,7 @@ ospf_iface_opt_list:
  ;
 
 ospf_iface:
-  ospf_iface_start iface_patt_list ospf_iface_opt_list { ospf_iface_finish(); }
+  ospf_iface_start iface_patt_list ospf_instance_id ospf_iface_opt_list { ospf_iface_finish(); }
  ;
 
 opttext: