summaryrefslogtreecommitdiff
path: root/lib/affinitymap.h
diff options
context:
space:
mode:
authorLouis Scalbert <louis.scalbert@6wind.com>2022-11-03 14:30:23 +0100
committerLouis Scalbert <louis.scalbert@6wind.com>2023-02-09 15:48:21 +0100
commit05a12619dd6eca2feabebb987239c5a133754fef (patch)
tree826c0a9155d94f36b21c8f71919da18d4a3d22ad /lib/affinitymap.h
parentad1327b3d4c340920181265717401bcb91243527 (diff)
lib,yang,zebra: add affinity-map support
Add the affinity-map global command to zebra. The syntax is: > affinity-map NAME bit-position (0-1023) Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Diffstat (limited to 'lib/affinitymap.h')
-rw-r--r--lib/affinitymap.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/lib/affinitymap.h b/lib/affinitymap.h
new file mode 100644
index 0000000000..323439c743
--- /dev/null
+++ b/lib/affinitymap.h
@@ -0,0 +1,74 @@
+/*
+ * Affinity-map function.
+ *
+ * Copyright 2022 Hiroki Shirokura, LINE Corporation
+ * Copyright 2022 Masakazu Asama
+ * Copyright 2022 6WIND S.A.
+ *
+ * This file is part of Free Range Routing (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 _ZEBRA_AFFINITYMAP_H
+#define _ZEBRA_AFFINITYMAP_H
+
+#include "typesafe.h"
+#include "prefix.h"
+#include "memory.h"
+#include "qobj.h"
+#include "vty.h"
+#include "lib/plist.h"
+#include "lib/plist_int.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define AFFINITY_NAME_SIZE 32
+
+struct affinity_map {
+ char name[AFFINITY_NAME_SIZE];
+ uint16_t bit_position;
+
+ QOBJ_FIELDS;
+};
+DECLARE_QOBJ_TYPE(affinity_map);
+
+struct affinity_maps {
+ struct list *maps;
+
+ QOBJ_FIELDS;
+};
+DECLARE_QOBJ_TYPE(affinity_maps);
+
+extern const struct frr_yang_module_info frr_affinity_map_info;
+
+void affinity_map_set(const char *name, int pos);
+void affinity_map_unset(const char *name);
+struct affinity_map *affinity_map_get(const char *name);
+char *affinity_map_name_get(const int pos);
+
+void cli_show_affinity_map(struct vty *vty, const struct lyd_node *dnode,
+ bool show_defaults);
+
+void affinity_map_init(void);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _ZEBRA_AFFINITYMAP_H */