diff options
author | Artem Glazychev <artem.glazychev@xored.com> | 2021-06-11 00:10:00 +0700 |
---|---|---|
committer | Ed Warnicke <hagbard@gmail.com> | 2021-10-06 21:32:33 +0000 |
commit | dd630d15d3e9d13da9ed98d3171b9ec4529e4e66 (patch) | |
tree | 83b14e2ccf510b8296919b30825af28c81c49c34 /src/plugins/wireguard/wireguard.api | |
parent | 22efac3b537a3a1f0b57d5942bdb78c3190ce858 (diff) |
wireguard: add events for peer
we can receive events from peer about its state:
-WIREGUARD_PEER_STATUS_DEAD
-WIREGUARD_PEER_ESTABLISHED
Type: improvement
Change-Id: Ide83fbe2cfafa79ded5bcf3f6a884c26a7583db0
Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Diffstat (limited to 'src/plugins/wireguard/wireguard.api')
-rwxr-xr-x | src/plugins/wireguard/wireguard.api | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/plugins/wireguard/wireguard.api b/src/plugins/wireguard/wireguard.api index e290fc41ffc..1473d9ca39b 100755 --- a/src/plugins/wireguard/wireguard.api +++ b/src/plugins/wireguard/wireguard.api @@ -83,6 +83,7 @@ define wireguard_interface_details enum wireguard_peer_flags : u8 { WIREGUARD_PEER_STATUS_DEAD = 0x1, + WIREGUARD_PEER_ESTABLISHED = 0x2, }; /** \brief Create new peer @@ -107,6 +108,41 @@ typedef wireguard_peer vl_api_prefix_t allowed_ips[n_allowed_ips]; }; +service { + rpc want_wireguard_peer_events returns want_wireguard_peer_events_reply + events wireguard_peer_event; +}; +/** \brief Register for wireguard peer events + @param client_index - opaque cookie to identify the sender + @param context - sender context, to match reply w/ request + @param sw_if_index - index of the interface to dump peer info on, ~0 if on all + @param peer_index - index of the peer to dump info on, ~0 if on all + @param enable_disable - 1 => register for events, 0 => cancel registration + @param pid - sender's pid +*/ +autoreply define want_wireguard_peer_events +{ + u32 client_index; + u32 context; + vl_api_interface_index_t sw_if_index [default=0xFFFFFFFF]; + u32 peer_index [default=0xFFFFFFFF]; + u32 enable_disable; + u32 pid; +}; +/** \brief Interface Event generated by want_wireguard_peer_events + @param client_index - opaque cookie to identify the sender + @param pid - client pid registered to receive notification + @param peer_index - index of the peer for this event + @param deleted - interface was deleted +*/ +define wireguard_peer_event +{ + u32 client_index; + u32 pid; + u32 peer_index; + vl_api_wireguard_peer_flags_t flags; +}; + /** \brief Create new peer @param client_index - opaque cookie to identify the sender @param context - sender context, to match reply w/ request @@ -140,10 +176,12 @@ autoreply define wireguard_peer_remove /** \brief Dump all peers @param client_index - opaque cookie to identify the sender @param context - sender context, to match reply w/ request + @param peer_index - peer index to be dumped. If 0xFFFFFFFF dumps all peers */ define wireguard_peers_dump { u32 client_index; u32 context; + u32 peer_index [default=0xFFFFFFFF]; }; /** \brief Dump peers response |