]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Pipe delay scaffolding delay
authorMaria Matejka <mq@ucw.cz>
Thu, 28 Feb 2019 17:17:06 +0000 (18:17 +0100)
committerMaria Matejka <mq@ucw.cz>
Thu, 28 Feb 2019 18:05:37 +0000 (19:05 +0100)
proto/pipe/config.Y
proto/pipe/pipe.c
proto/pipe/pipe.h

index 18e1d0fca5de430aaddce1eb79cd67c85d6d5b7c..aa17ab1e9a095fc1fbfa9424702a417f02c4eb8e 100644 (file)
@@ -16,7 +16,7 @@ CF_DEFINES
 
 CF_DECLS
 
-CF_KEYWORDS(PIPE, PEER, TABLE)
+CF_KEYWORDS(PIPE, PEER, TABLE, DELAY)
 
 CF_GRAMMAR
 
@@ -41,6 +41,7 @@ pipe_proto:
  | pipe_proto proto_item ';'
  | pipe_proto channel_item ';'
  | pipe_proto PEER TABLE rtable ';' { PIPE_CFG->peer = $4; }
+ | pipe_proto DELAY expr_us ';' { PIPE_CFG->delay = $3; }
  ;
 
 CF_CODE
index efb992cab7315924e59f0016116f39e99085d417..4bed80b620402ff4bcbfba75792c0372ef1d7af0 100644 (file)
@@ -182,6 +182,7 @@ pipe_init(struct proto_config *CF)
   P->preexport = pipe_preexport;
   P->reload_routes = pipe_reload_routes;
 
+  p->delay = cf->delay;
   pipe_configure_channels(p, cf);
 
   return P;
@@ -193,6 +194,9 @@ pipe_reconfigure(struct proto *P, struct proto_config *CF)
   struct pipe_proto *p = (void *) P;
   struct pipe_config *cf = (void *) CF;
 
+  if (p->delay != cf->delay)
+    return 0;
+
   return pipe_configure_channels(p, cf);
 }
 
index 038c66667448b0f506ac7de32453b5d40adb70ca..c116a8817891d5ca87b491187d4149f99704e34c 100644 (file)
 struct pipe_config {
   struct proto_config c;
   struct rtable_config *peer;          /* Table we're connected to */
+  btime delay;
 };
 
 struct pipe_proto {
   struct proto p;
   struct channel *pri;
   struct channel *sec;
+  btime delay;
 };
 
 #endif