2 * Affinity-map function.
4 * Copyright 2022 Hiroki Shirokura, LINE Corporation
5 * Copyright 2022 Masakazu Asama
6 * Copyright 2022 6WIND S.A.
8 * This file is part of Free Range Routing (FRR).
10 * FRR is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2, or (at your option) any
15 * FRR is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
20 * You should have received a copy of the GNU General Public License along
21 * with this program; see the file COPYING; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 #ifndef _ZEBRA_AFFINITYMAP_H
26 #define _ZEBRA_AFFINITYMAP_H
33 #include "lib/plist.h"
34 #include "lib/plist_int.h"
40 #define AFFINITY_NAME_SIZE 32
43 char name
[AFFINITY_NAME_SIZE
];
44 uint16_t bit_position
;
48 DECLARE_QOBJ_TYPE(affinity_map
);
50 struct affinity_maps
{
53 bool (*check_use_hook
)(const char *affmap_name
);
54 bool (*check_update_hook
)(const char *affmap_name
, uint16_t new_pos
);
55 void (*update_hook
)(const char *affmap_name
, uint16_t old_pos
,
60 DECLARE_QOBJ_TYPE(affinity_maps
);
62 extern const struct frr_yang_module_info frr_affinity_map_info
;
64 void affinity_map_set(const char *name
, int pos
);
65 void affinity_map_unset(const char *name
);
66 struct affinity_map
*affinity_map_get(const char *name
);
67 char *affinity_map_name_get(const int pos
);
69 bool affinity_map_check_use_hook(const char *affmap_name
);
70 bool affinity_map_check_update_hook(const char *affmap_name
, uint16_t new_pos
);
71 void affinity_map_update_hook(const char *affmap_name
, uint16_t new_pos
);
73 void affinity_map_set_check_use_hook(bool (*func
)(const char *affmap_name
));
74 void affinity_map_set_check_update_hook(bool (*func
)(const char *affmap_name
,
76 void affinity_map_set_update_hook(void (*func
)(const char *affmap_name
,
80 void cli_show_affinity_map(struct vty
*vty
, const struct lyd_node
*dnode
,
83 void affinity_map_init(void);
90 #endif /* _ZEBRA_AFFINITYMAP_H */