diff options
| author | 2017-01-13 18:59:12 +0000 | |
|---|---|---|
| committer | 2017-01-13 18:59:12 +0000 | |
| commit | 0561b344da393d4a962339c507c2e78057100ae1 (patch) | |
| tree | ad3a2ad1705827b43d380a85d8981727e7d4b135 /usr.sbin/bgpctl/parser.c | |
| parent | traceroute never sees a timeout when poll(2) returns when it receives (diff) | |
| download | wireguard-openbsd-0561b344da393d4a962339c507c2e78057100ae1.tar.xz wireguard-openbsd-0561b344da393d4a962339c507c2e78057100ae1.zip | |
Add support for draft-ietf-idr-shutdown
BGP state = Idle, marked down with shutdown reason "goodbye, we are
upgrading to openbsd 6.1", down for 00:00:17
developed by Peter van Dijk <peter.van.dijk@powerdns.com> and Job
Snijders <job@ntt.net>, thank you!
OK benno@
Diffstat (limited to 'usr.sbin/bgpctl/parser.c')
| -rw-r--r-- | usr.sbin/bgpctl/parser.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/usr.sbin/bgpctl/parser.c b/usr.sbin/bgpctl/parser.c index 4b65785a0a6..f93881d2cee 100644 --- a/usr.sbin/bgpctl/parser.c +++ b/usr.sbin/bgpctl/parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parser.c,v 1.74 2016/10/14 16:05:35 phessler Exp $ */ +/* $OpenBSD: parser.c,v 1.75 2017/01/13 18:59:12 phessler Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -45,6 +45,7 @@ enum token_type { PREFIX, PEERDESC, RIBNAME, + SHUTDOWN_COMMUNICATION, COMMUNITY, LARGE_COMMUNITY, LOCALPREF, @@ -245,9 +246,15 @@ static const struct token t_neighbor[] = { { ENDTOKEN, "", NONE, NULL} }; +static const struct token t_nei_mod_shutc[] = { + { NOTOKEN, "", NONE, NULL}, + { SHUTDOWN_COMMUNICATION, "", NONE, NULL}, + { ENDTOKEN, "", NONE, NULL} +}; + static const struct token t_neighbor_modifiers[] = { { KEYWORD, "up", NEIGHBOR_UP, NULL}, - { KEYWORD, "down", NEIGHBOR_DOWN, NULL}, + { KEYWORD, "down", NEIGHBOR_DOWN, t_nei_mod_shutc}, { KEYWORD, "clear", NEIGHBOR_CLEAR, NULL}, { KEYWORD, "refresh", NEIGHBOR_RREFRESH, NULL}, { KEYWORD, "destroy", NEIGHBOR_DESTROY, NULL}, @@ -571,6 +578,16 @@ match_token(int *argc, char **argv[], const struct token table[]) t = &table[i]; } break; + case SHUTDOWN_COMMUNICATION: + if (!match && word != NULL && wordlen > 0) { + if (strlcpy(res.shutcomm, word, + sizeof(res.shutcomm)) >= + sizeof(res.shutcomm)) + errx(1, "shutdown reason too long"); + match++; + t = &table[i]; + } + break; case COMMUNITY: if (word != NULL && wordlen > 0 && parse_community(word, &res)) { @@ -694,6 +711,9 @@ show_valid_args(const struct token table[]) case RIBNAME: fprintf(stderr, " <rib name>\n"); break; + case SHUTDOWN_COMMUNICATION: + fprintf(stderr, " <shutdown reason>\n"); + break; case COMMUNITY: fprintf(stderr, " <community>\n"); break; |
