#include "bgpd/bgp_mac.h"
#include "bgpd/bgp_network.h"
#include "bgpd/bgp_trace.h"
+#include "bgpd/bgp_rpki.h"
#ifdef ENABLE_BGP_VNC
#include "bgpd/rfapi/rfapi_backend.h"
return "n/a";
}
-static const char *bgp_rpki_validation2str(int v_state)
+static const char *bgp_rpki_validation2str(enum rpki_states v_state)
{
switch (v_state) {
- case 1:
+ case RPKI_NOT_BEING_USED:
+ return "not used";
+ case RPKI_VALID:
return "valid";
- case 2:
+ case RPKI_NOTFOUND:
return "not found";
- case 3:
+ case RPKI_INVALID:
return "invalid";
- default:
- break;
}
+
+ assert(!"We should never get here this is a dev escape");
return "ERROR";
}
int i;
char *nexthop_hostname =
bgp_nexthop_hostname(path->peer, path->nexthop);
- int rpki_validation_state = 0;
+ enum rpki_states rpki_validation_state = RPKI_NOT_BEING_USED;
if (json_paths) {
json_path = json_object_new_object();
}
const struct prefix *p = bgp_dest_get_prefix(bn);
+
if (p->family == AF_INET || p->family == AF_INET6)
rpki_validation_state = hook_call(bgp_rpki_prefix_status,
path->peer, path->attr, p);
- if (rpki_validation_state) {
+ if (rpki_validation_state != RPKI_NOT_BEING_USED) {
if (json_paths)
json_object_string_add(
json_path, "rpkiValidationState",
#include "bgpd/bgp_attr.h"
#include "bgpd/bgp_aspath.h"
#include "bgpd/bgp_route.h"
+#include "bgpd/bgp_rpki.h"
+
#include "lib/network.h"
#include "lib/thread.h"
#ifndef VTYSH_EXTRACT_PL
DEFINE_MTYPE_STATIC(BGPD, BGP_RPKI_CACHE, "BGP RPKI Cache server");
DEFINE_MTYPE_STATIC(BGPD, BGP_RPKI_CACHE_GROUP, "BGP RPKI Cache server group");
-#define RPKI_VALID 1
-#define RPKI_NOTFOUND 2
-#define RPKI_INVALID 3
-
#define POLLING_PERIOD_DEFAULT 3600
#define EXPIRE_INTERVAL_DEFAULT 7200
#define RETRY_INTERVAL_DEFAULT 600
--- /dev/null
+/*
+ * bgp_rpki code
+ * Copyright (C) 2021 NVIDIA Corporation and Mellanox Technologies, LTD
+ * All Rights Reserved
+ * Donald Sharp
+ *
+ * This file is part of FRR.
+ *
+ * FRR is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * FRR is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+#ifndef __BGP_RPKI_H__
+#define __BGP_RPKI_H__
+
+enum rpki_states {
+ RPKI_NOT_BEING_USED,
+ RPKI_VALID,
+ RPKI_NOTFOUND,
+ RPKI_INVALID
+};
+
+#endif
bgpd/bgp_pbr.h \
bgpd/bgp_rd.h \
bgpd/bgp_regex.h \
+ bgpd/bgp_rpki.h \
bgpd/bgp_route.h \
bgpd/bgp_script.h \
bgpd/bgp_table.h \