diff options
author | Christian Hopps <chopps@labn.net> | 2023-07-09 05:11:15 +0200 |
---|---|---|
committer | Christian Hopps <chopps@labn.net> | 2023-11-06 23:44:58 +0100 |
commit | a65cda16b28bc84b052636118823082de9600cfc (patch) | |
tree | 975a1abb64919cc9a9c201b8c50ef7602bd72483 /lib/mgmt_be_client.h | |
parent | Merge pull request #14691 from LabNConsulting/fix-mgmt-msg-valgrind-errors (diff) | |
download | frr-a65cda16b28bc84b052636118823082de9600cfc.tar.xz frr-a65cda16b28bc84b052636118823082de9600cfc.zip |
mgmtd: simplify xpath registries
- move from client id indexed array of uints for register info
per client to a u64 bitmask.
- add bit walking FOREACH macro
Walk the client IDs whose bits are set in a mask.
Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'lib/mgmt_be_client.h')
-rw-r--r-- | lib/mgmt_be_client.h | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/lib/mgmt_be_client.h b/lib/mgmt_be_client.h index 4ad5ca595..051c908a3 100644 --- a/lib/mgmt_be_client.h +++ b/lib/mgmt_be_client.h @@ -17,27 +17,6 @@ extern "C" { #include "mgmtd/mgmt_defines.h" /*************************************************************** - * Client IDs - ***************************************************************/ - -/* - * Add enum value for each supported component, wrap with - * #ifdef HAVE_COMPONENT - */ -enum mgmt_be_client_id { - MGMTD_BE_CLIENT_ID_MIN = 0, - MGMTD_BE_CLIENT_ID_INIT = -1, -#ifdef HAVE_STATICD - MGMTD_BE_CLIENT_ID_STATICD, -#endif - MGMTD_BE_CLIENT_ID_MAX -}; - -#define FOREACH_MGMTD_BE_CLIENT_ID(id) \ - for ((id) = MGMTD_BE_CLIENT_ID_MIN; \ - (id) < MGMTD_BE_CLIENT_ID_MAX; (id)++) - -/*************************************************************** * Constants ***************************************************************/ @@ -108,29 +87,6 @@ struct mgmt_be_client_cbs { * Global data exported ***************************************************************/ -extern const char *mgmt_be_client_names[MGMTD_BE_CLIENT_ID_MAX + 1]; - -static inline const char *mgmt_be_client_id2name(enum mgmt_be_client_id id) -{ - if (id > MGMTD_BE_CLIENT_ID_MAX) - id = MGMTD_BE_CLIENT_ID_MAX; - return mgmt_be_client_names[id]; -} - -static inline enum mgmt_be_client_id -mgmt_be_client_name2id(const char *name) -{ - enum mgmt_be_client_id id; - - FOREACH_MGMTD_BE_CLIENT_ID (id) { - if (!strncmp(mgmt_be_client_names[id], name, - MGMTD_CLIENT_NAME_MAX_LEN)) - return id; - } - - return MGMTD_BE_CLIENT_ID_MAX; -} - extern struct debug mgmt_dbg_be_client; /*************************************************************** |