0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-11-08 12:18:42 +00:00

Pipe delay scaffolding

This commit is contained in:
Maria Matejka 2019-02-28 18:17:06 +01:00
parent b9deced219
commit 64e2d24f6f
3 changed files with 8 additions and 1 deletions

View File

@ -16,7 +16,7 @@ CF_DEFINES
CF_DECLS CF_DECLS
CF_KEYWORDS(PIPE, PEER, TABLE) CF_KEYWORDS(PIPE, PEER, TABLE, DELAY)
CF_GRAMMAR CF_GRAMMAR
@ -41,6 +41,7 @@ pipe_proto:
| pipe_proto proto_item ';' | pipe_proto proto_item ';'
| pipe_proto channel_item ';' | pipe_proto channel_item ';'
| pipe_proto PEER TABLE rtable ';' { PIPE_CFG->peer = $4; } | pipe_proto PEER TABLE rtable ';' { PIPE_CFG->peer = $4; }
| pipe_proto DELAY expr_us ';' { PIPE_CFG->delay = $3; }
; ;
CF_CODE CF_CODE

View File

@ -182,6 +182,7 @@ pipe_init(struct proto_config *CF)
P->preexport = pipe_preexport; P->preexport = pipe_preexport;
P->reload_routes = pipe_reload_routes; P->reload_routes = pipe_reload_routes;
p->delay = cf->delay;
pipe_configure_channels(p, cf); pipe_configure_channels(p, cf);
return P; return P;
@ -193,6 +194,9 @@ pipe_reconfigure(struct proto *P, struct proto_config *CF)
struct pipe_proto *p = (void *) P; struct pipe_proto *p = (void *) P;
struct pipe_config *cf = (void *) CF; struct pipe_config *cf = (void *) CF;
if (p->delay != cf->delay)
return 0;
return pipe_configure_channels(p, cf); return pipe_configure_channels(p, cf);
} }

View File

@ -12,12 +12,14 @@
struct pipe_config { struct pipe_config {
struct proto_config c; struct proto_config c;
struct rtable_config *peer; /* Table we're connected to */ struct rtable_config *peer; /* Table we're connected to */
btime delay;
}; };
struct pipe_proto { struct pipe_proto {
struct proto p; struct proto p;
struct channel *pri; struct channel *pri;
struct channel *sec; struct channel *sec;
btime delay;
}; };
#endif #endif