diff options
author | 2023-06-26 15:57:57 +0000 | |
---|---|---|
committer | 2023-06-29 05:11:10 +0000 | |
commit | e1cc8753605a40b24f132a99e915a2650ce7df51 (patch) | |
tree | 517f4945e1948b691e77e0daf97ccac8d80f7447 /src/vnet/ip-neighbor/ip_neighbor_api.c | |
parent | c8767c42aadb5bd63206e117673991ef799e2d18 (diff) |
ip-neighbor: add api for getting neighbor db config
There is an API call to change neighbor database configuration (i.e.
limit on peer number, aging, and recycling). With this change, make
getting current values of these settings available via the API.
Type: improvement
Change-Id: Ie9394e086b68cf9b28ad98dea162f203f8043cbb
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Diffstat (limited to 'src/vnet/ip-neighbor/ip_neighbor_api.c')
-rw-r--r-- | src/vnet/ip-neighbor/ip_neighbor_api.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/vnet/ip-neighbor/ip_neighbor_api.c b/src/vnet/ip-neighbor/ip_neighbor_api.c index 81af86211de..a5ed546f114 100644 --- a/src/vnet/ip-neighbor/ip_neighbor_api.c +++ b/src/vnet/ip-neighbor/ip_neighbor_api.c @@ -314,6 +314,32 @@ vl_api_ip_neighbor_config_t_handler (vl_api_ip_neighbor_config_t * mp) } static void +vl_api_ip_neighbor_config_get_t_handler (vl_api_ip_neighbor_config_get_t *mp) +{ + vl_api_ip_neighbor_config_get_reply_t *rmp; + int rv; + ip_address_family_t af = AF_IP4; + u32 max_number = ~0; + u32 max_age = ~0; + bool recycle = false; + + rv = ip_address_family_decode (mp->af, &af); + + if (!rv) + rv = ip_neighbor_get_config (af, &max_number, &max_age, &recycle); + + // clang-format off + REPLY_MACRO2 (VL_API_IP_NEIGHBOR_CONFIG_GET_REPLY, + ({ + rmp->af = ip_address_family_encode (af); + rmp->max_number = htonl (max_number); + rmp->max_age = htonl (max_age); + rmp->recycle = recycle; + })); + // clang-format on +} + +static void vl_api_ip_neighbor_replace_begin_t_handler (vl_api_ip_neighbor_replace_begin_t * mp) { |