diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2004-01-05 16:29:21 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2004-01-05 16:29:21 +0000 |
commit | 2af6957f09232545c828209865e1e4a97f34b72d (patch) | |
tree | adb59830e57ab4ded472fa135ff60746998002c2 /usr.sbin | |
parent | 6e56adbddd6bb7c2542638e0e08349ba11b0d64e (diff) |
add support for couple/decouple
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bgpctl/bgpctl.8 | 10 | ||||
-rw-r--r-- | usr.sbin/bgpctl/bgpctl.c | 41 |
2 files changed, 47 insertions, 4 deletions
diff --git a/usr.sbin/bgpctl/bgpctl.8 b/usr.sbin/bgpctl/bgpctl.8 index af78d4e9bfb..0a6e1fc47f7 100644 --- a/usr.sbin/bgpctl/bgpctl.8 +++ b/usr.sbin/bgpctl/bgpctl.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: bgpctl.8,v 1.5 2004/01/05 09:49:42 jmc Exp $ +.\" $OpenBSD: bgpctl.8,v 1.6 2004/01/05 16:29:20 henning Exp $ .\" .\" Copyright (c) 2003 Henning Brauer <henning@openbsd.org> .\" @@ -50,6 +50,14 @@ Show the BGP timers. .Pp .It Li reload Reload the configuration file. +.Pp +.It Li fib couple +Insert the learned routes into the Forward Information Base aka the kernel +routing table. +.Pp +.It Li fib decouple +Remove the learned routes into the Forward Information Base aka the kernel +routing table. .El .Sh FILES .Bl -tag -width "/etc/bgpd.conf" -compact diff --git a/usr.sbin/bgpctl/bgpctl.c b/usr.sbin/bgpctl/bgpctl.c index e8416295ec8..1c17448b5ca 100644 --- a/usr.sbin/bgpctl/bgpctl.c +++ b/usr.sbin/bgpctl/bgpctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpctl.c,v 1.16 2004/01/04 23:44:17 henning Exp $ */ +/* $OpenBSD: bgpctl.c,v 1.17 2004/01/05 16:29:20 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -33,7 +33,10 @@ enum actions { SHOW_SUMMARY, SHOW_NEIGHBOR, SHOW_NEIGHBOR_TIMERS, - RELOAD + RELOAD, + FIB, + FIB_COUPLE, + FIB_DECOUPLE }; enum neighbor_views { @@ -48,7 +51,8 @@ struct keywords { static const struct keywords keywords_main[] = { { "reload", RELOAD}, - { "show", SHOW} + { "show", SHOW}, + { "fib", FIB} }; static const struct keywords keywords_show[] = { @@ -61,6 +65,11 @@ static const struct keywords keywords_neighbor[] = { { "messages", SHOW_NEIGHBOR} }; +static const struct keywords keywords_fib[] = { + { "couple", FIB_COUPLE}, + { "decouple", FIB_DECOUPLE} +}; + int main(int, char *[]); int match_keyword(const char *, const struct keywords [], size_t); void show_summary_head(void); @@ -141,6 +150,29 @@ again: imsg_compose(&ibuf, IMSG_CTL_RELOAD, 0, NULL, 0); printf("reload request sent.\n"); done = 1; + break; + case FIB: + if (argc >= 3) { + action = match_keyword(argv[2], keywords_fib, + sizeof(keywords_fib)/sizeof(keywords_fib[0])); + goto again; + } else + errx(1, "fib [couple|decouple]"); + break; + case FIB_COUPLE: + if (argc >= 4) + errx(1, "\"fib couple\" takes no options"); + imsg_compose(&ibuf, IMSG_CTL_FIB_COUPLE, 0, NULL, 0); + printf("couple request sent.\n"); + done = 1; + break; + case FIB_DECOUPLE: + if (argc >= 4) + errx(1, "\"fib decouple\" takes no options"); + imsg_compose(&ibuf, IMSG_CTL_FIB_DECOUPLE, 0, NULL, 0); + printf("decouple request sent.\n"); + done = 1; + break; } while (!done) { @@ -166,6 +198,9 @@ again: done = show_neighbor_msg(&imsg, NV_TIMERS); break; case RELOAD: + case FIB: + case FIB_COUPLE: + case FIB_DECOUPLE: break; } imsg_free(&imsg); |