aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/wireguard/wireguard_api.c
diff options
context:
space:
mode:
authorJon Loeliger <jdl@netgate.com>2022-03-02 14:26:56 -0600
committerMatthew Smith <mgsmith@netgate.com>2022-03-21 15:56:36 +0000
commitf47917959872afe2aff464343944bbffee545308 (patch)
treeab333044516e5c24a828fecffee541176b4c476f /src/plugins/wireguard/wireguard_api.c
parent17ecd853e9efc40023185ecdf38c37d23dd8a0ce (diff)
wireguard: improve peer dump details
- Add peer_index, table_id, and keep-alive. - Fix some lingering cut-n-paste issues in the API file. Type: improvement Signed-off-by: Jon Loeliger <jdl@netgate.com> Change-Id: I6fc0729ba0268bbcda0248f680979c44e68b6b0c
Diffstat (limited to 'src/plugins/wireguard/wireguard_api.c')
-rw-r--r--src/plugins/wireguard/wireguard_api.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/wireguard/wireguard_api.c b/src/plugins/wireguard/wireguard_api.c
index fecf93c9290..c5334e0ecd4 100644
--- a/src/plugins/wireguard/wireguard_api.c
+++ b/src/plugins/wireguard/wireguard_api.c
@@ -228,6 +228,7 @@ wg_api_send_peers_details (index_t peeri, void *data)
rmp->_vl_msg_id = htons (VL_API_WIREGUARD_PEERS_DETAILS +
wg_main.msg_id_base);
+ rmp->peer.peer_index = htonl (peeri);
rmp->peer.flags = peer->flags;
clib_memcpy (rmp->peer.public_key,
peer->remote.r_public, NOISE_PUBLIC_KEY_LEN);
@@ -236,6 +237,8 @@ wg_api_send_peers_details (index_t peeri, void *data)
rmp->peer.port = htons (peer->dst.port);
rmp->peer.n_allowed_ips = n_allowed_ips;
rmp->peer.sw_if_index = htonl (peer->wg_sw_if_index);
+ rmp->peer.persistent_keepalive = htons (peer->persistent_keepalive_interval);
+ rmp->peer.table_id = htonl (peer->table_id);
int ii;
for (ii = 0; ii < n_allowed_ips; ii++)