summaryrefslogtreecommitdiffstats
path: root/staticd/static_vrf.h
diff options
context:
space:
mode:
Diffstat (limited to 'staticd/static_vrf.h')
-rw-r--r--staticd/static_vrf.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/staticd/static_vrf.h b/staticd/static_vrf.h
index 8f55775..26ee28f 100644
--- a/staticd/static_vrf.h
+++ b/staticd/static_vrf.h
@@ -7,15 +7,27 @@
#ifndef __STATIC_VRF_H__
#define __STATIC_VRF_H__
+#include "openbsd-tree.h"
+
#ifdef __cplusplus
extern "C" {
#endif
struct static_vrf {
+ RB_ENTRY(static_vrf) entry;
+
+ char name[VRF_NAMSIZ + 1];
struct vrf *vrf;
struct route_table *stable[AFI_MAX][SAFI_MAX];
};
+RB_HEAD(svrf_name_head, static_vrf);
+RB_PROTOTYPE(svrf_name_head, static_vrf, entry, svrf_name_compare)
+
+extern struct svrf_name_head svrfs;
+
+struct static_vrf *static_vrf_alloc(const char *name);
+void static_vrf_free(struct static_vrf *svrf);
struct stable_info {
struct static_vrf *svrf;
@@ -25,8 +37,6 @@ struct stable_info {
#define GET_STABLE_VRF_ID(info) info->svrf->vrf->vrf_id
-struct static_vrf *static_vrf_lookup_by_name(const char *vrf_name);
-
void static_vrf_init(void);
struct route_table *static_vrf_static_table(afi_t afi, safi_t safi,