Unbreak tree: add log_policy() implementation missing from previous commit.
authortb <tb@openbsd.org>
Tue, 28 Jun 2022 05:49:05 +0000 (05:49 +0000)
committertb <tb@openbsd.org>
Tue, 28 Jun 2022 05:49:05 +0000 (05:49 +0000)
usr.sbin/bgpd/util.c

index 4cd3323..b4bdd5c 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: util.c,v 1.68 2022/06/24 10:36:53 claudio Exp $ */
+/*     $OpenBSD: util.c,v 1.69 2022/06/28 05:49:05 tb Exp $ */
 
 /*
  * Copyright (c) 2006 Claudio Jeker <claudio@openbsd.org>
@@ -195,6 +195,25 @@ log_rtr_error(enum rtr_error err)
        }
 }
 
+const char *
+log_policy(uint8_t role)
+{
+       switch (role) {
+       case CAPA_ROLE_PROVIDER:
+               return "provider";
+       case CAPA_ROLE_RS:
+               return "rs";
+       case CAPA_ROLE_RS_CLIENT:
+               return "rs-client";
+       case CAPA_ROLE_CUSTOMER:
+               return "customer";
+       case CAPA_ROLE_PEER:
+               return "peer";
+       default:
+               return "unknown";
+       }
+}
+
 const char *
 aspath_delim(uint8_t seg_type, int closing)
 {