diff options
author | lynne <lynne@voltanet.io> | 2020-09-15 22:46:15 +0200 |
---|---|---|
committer | lynne <lynne@voltanet.io> | 2021-03-02 16:06:31 +0100 |
commit | 1ee746d99035155bcd906436cfe957f3a357ef26 (patch) | |
tree | 7795a82fc730a35c1b74a9b53913c5f21a62385e /isisd/isis_dynhn.c | |
parent | Merge pull request #8015 from mjstapp/fix_topo_gen_support (diff) | |
download | frr-1ee746d99035155bcd906436cfe957f3a357ef26.tar.xz frr-1ee746d99035155bcd906436cfe957f3a357ef26.zip |
isisd: support for snmp
Add support for read only mib objects from RFC4444.
Signed-off-by: Lynne Morrison <lynne@voltanet.io>
Signed-off-by: Karen Schoener <karen@voltanet.io>
Diffstat (limited to 'isisd/isis_dynhn.c')
-rw-r--r-- | isisd/isis_dynhn.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/isisd/isis_dynhn.c b/isisd/isis_dynhn.c index 244f388c2..d2c5d93e2 100644 --- a/isisd/isis_dynhn.c +++ b/isisd/isis_dynhn.c @@ -166,3 +166,38 @@ void dynhn_print_all(struct vty *vty, struct isis *isis) cmd_hostname_get()); return; } + +struct isis_dynhn *dynhn_snmp_next(const uint8_t *id, int level) +{ + struct listnode *node = NULL; + struct isis_dynhn *dyn = NULL; + struct isis_dynhn *found_dyn = NULL; + int res; + + for (ALL_LIST_ELEMENTS_RO(dyn_cache, node, dyn)) { + res = memcmp(dyn->id, id, ISIS_SYS_ID_LEN); + + if (res < 0) + continue; + + if (res == 0 && dyn->level <= level) + continue; + + if (res == 0) { + /* + * This is the best match, we can stop + * searching + */ + + found_dyn = dyn; + break; + } + + if (found_dyn == NULL + || memcmp(dyn->id, found_dyn->id, ISIS_SYS_ID_LEN) < 0) { + found_dyn = dyn; + } + } + + return found_dyn; +} |