diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2021-02-16 08:29:17 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2021-02-16 08:29:17 +0000 |
commit | 39b52f0b716d5ce1c237f1eb534455dae06869ed (patch) | |
tree | 959f223deedcf0dff435d4a03ab186d15e0ef5ce /usr.sbin/bgpd/util.c | |
parent | 4711aa99691ac32d7473eb3410e143ad00ea0b38 (diff) |
Add RTR support to OpenBGPD. Add basic support for the protocol.
The RTR client runs in a new process where the protocol handling is done
and when new data is available all sources are merged into one ROA set
which is then loaded into the RDE. The roa-set from the config is also
handled by the new RTR engine.
Tested by and ok job@
Diffstat (limited to 'usr.sbin/bgpd/util.c')
-rw-r--r-- | usr.sbin/bgpd/util.c | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/util.c b/usr.sbin/bgpd/util.c index 5d677b0c605..09d82e402e9 100644 --- a/usr.sbin/bgpd/util.c +++ b/usr.sbin/bgpd/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.60 2021/01/25 09:15:24 claudio Exp $ */ +/* $OpenBSD: util.c,v 1.61 2021/02/16 08:29:16 claudio Exp $ */ /* * Copyright (c) 2006 Claudio Jeker <claudio@openbsd.org> @@ -162,6 +162,38 @@ log_reason(const char *communication) { } const char * +log_rtr_error(enum rtr_error err) +{ + static char buf[20]; + + switch (err) { + case NO_ERROR: + return "No Error"; + case CORRUPT_DATA: + return "Corrupt Data"; + case INTERNAL_ERROR: + return "Internal Error"; + case NO_DATA_AVAILABLE: + return "No Data Available"; + case INVALID_REQUEST: + return "Invalid Request"; + case UNSUPP_PROTOCOL_VERS: + return "Unsupported Protocol Version"; + case UNSUPP_PDU_TYPE: + return "Unsupported PDU Type"; + case UNK_REC_WDRAWL: + return "Withdrawl of Unknown Record"; + case DUP_REC_RECV: + return "Duplicate Announcement Received"; + case UNEXP_PROTOCOL_VERS: + return "Unexpected Protocol Version"; + default: + snprintf(buf, sizeof(buf), "unknown %u", err); + return buf; + } +} + +const char * aspath_delim(u_int8_t seg_type, int closing) { static char db[8]; |