diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2006-03-22 15:37:45 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2006-03-22 15:37:45 +0000 |
commit | 93e62b255f32a33e21eed1171de38a9b05bb377c (patch) | |
tree | a9361799b3864331931046f56546bf40ae2891e6 | |
parent | 022bdc963534de84cbd86cddbcec6e0fd47a580c (diff) |
ospfd has the framework to couple and decouple the FIB. Add the needed
functionality to ospfctl for it.
NOTE: decoupling the FIB one a router may totaly fuck up the complete network.
Use it with care!
OK norby@
-rw-r--r-- | usr.sbin/ospfctl/ospfctl.c | 18 | ||||
-rw-r--r-- | usr.sbin/ospfctl/parser.c | 10 | ||||
-rw-r--r-- | usr.sbin/ospfctl/parser.h | 5 |
3 files changed, 30 insertions, 3 deletions
diff --git a/usr.sbin/ospfctl/ospfctl.c b/usr.sbin/ospfctl/ospfctl.c index 4b88142327d..339ab1be378 100644 --- a/usr.sbin/ospfctl/ospfctl.c +++ b/usr.sbin/ospfctl/ospfctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ospfctl.c,v 1.28 2006/03/09 18:11:33 norby Exp $ */ +/* $OpenBSD: ospfctl.c,v 1.29 2006/03/22 15:37:44 claudio Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -185,6 +185,19 @@ main(int argc, char *argv[]) imsg_compose(ibuf, IMSG_CTL_IFINFO, 0, 0, NULL, 0); show_interface_head(); break; + case FIB: + errx(1, "fib couple|decouple"); + break; + case FIB_COUPLE: + imsg_compose(ibuf, IMSG_CTL_FIB_COUPLE, 0, 0, NULL, 0); + printf("couple request sent.\n"); + done = 1; + break; + case FIB_DECOUPLE: + imsg_compose(ibuf, IMSG_CTL_FIB_DECOUPLE, 0, 0, NULL, 0); + printf("decouple request sent.\n"); + done = 1; + break; case RELOAD: imsg_compose(ibuf, IMSG_CTL_RELOAD, 0, 0, NULL, 0); printf("reload request sent.\n"); @@ -246,6 +259,9 @@ main(int argc, char *argv[]) done = show_fib_interface_msg(&imsg); break; case NONE: + case FIB: + case FIB_COUPLE: + case FIB_DECOUPLE: case RELOAD: break; } diff --git a/usr.sbin/ospfctl/parser.c b/usr.sbin/ospfctl/parser.c index 68b7b042330..72ce75bc635 100644 --- a/usr.sbin/ospfctl/parser.c +++ b/usr.sbin/ospfctl/parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parser.c,v 1.9 2005/06/16 18:48:43 henning Exp $ */ +/* $OpenBSD: parser.c,v 1.10 2006/03/22 15:37:44 claudio Exp $ */ /* * Copyright (c) 2004 Esben Norby <norby@openbsd.org> @@ -50,6 +50,7 @@ struct token { }; static const struct token t_main[]; +static const struct token t_fib[]; static const struct token t_show[]; static const struct token t_show_iface[]; static const struct token t_show_db[]; @@ -60,10 +61,17 @@ static const struct token t_show_fib[]; static const struct token t_main[] = { /* {KEYWORD, "reload", RELOAD, NULL}, */ + {KEYWORD, "fib", FIB, t_fib}, {KEYWORD, "show", SHOW, t_show}, {ENDTOKEN, "", NONE, NULL} }; +static const struct token t_fib[] = { + { KEYWORD, "couple", FIB_COUPLE, NULL}, + { KEYWORD, "decouple", FIB_DECOUPLE, NULL}, + { ENDTOKEN, "", NONE, NULL} +}; + static const struct token t_show[] = { {NOTOKEN, "", NONE, NULL}, {KEYWORD, "interfaces", SHOW_IFACE, t_show_iface}, diff --git a/usr.sbin/ospfctl/parser.h b/usr.sbin/ospfctl/parser.h index 79d7cc184f4..ac7dea40f42 100644 --- a/usr.sbin/ospfctl/parser.h +++ b/usr.sbin/ospfctl/parser.h @@ -1,4 +1,4 @@ -/* $OpenBSD: parser.h,v 1.6 2005/05/12 19:10:12 norby Exp $ */ +/* $OpenBSD: parser.h,v 1.7 2006/03/22 15:37:44 claudio Exp $ */ /* * Copyright (c) 2004 Esben Norby <norby@openbsd.org> @@ -26,6 +26,9 @@ enum actions { NONE, + FIB, + FIB_COUPLE, + FIB_DECOUPLE, SHOW, SHOW_SUM, SHOW_IFACE, |