]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Possibility to define unnamed protocols from template added.
authorOndrej Filip <feela@network.cz>
Mon, 9 Mar 2015 22:59:26 +0000 (23:59 +0100)
committerOndrej Filip <feela@network.cz>
Mon, 9 Mar 2015 22:59:26 +0000 (23:59 +0100)
nest/config.Y

index 8e1e9880fe1e991e5543c150a0008e86bd232b33..939bed6a8c527a27b0e40184ec3fbcff5e7ff6d2 100644 (file)
@@ -181,6 +181,12 @@ proto_name:
      cf_define_symbol($1, this_proto->class, this_proto);
      this_proto->name = $1->name;
    }
+ | FROM SYM {
+     struct symbol *s = cf_default_name(this_proto->protocol->template, &this_proto->protocol->name_counter);
+     this_proto->name = s->name;
+     if (($2->class != SYM_TEMPLATE) && ($2->class != SYM_PROTO)) cf_error("Template or protocol name expected");
+     proto_copy_config(this_proto, $2->def);
+   }
  | SYM FROM SYM {
      if (($3->class != SYM_TEMPLATE) && ($3->class != SYM_PROTO)) cf_error("Template or protocol name expected");