FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
wireguard.api
Go to the documentation of this file.
1 /* Hey Emacs use -*- mode: C -*- */
2 /*
3  * Copyright (c) 2020 Doc.ai and/or its affiliates.
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at:
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 option version = "0.1.0";
18 
19 import "vnet/interface_types.api";
20 import "vnet/ip/ip_types.api";
21 
22 /** \brief Create wireguard interface
23  @param client_index - opaque cookie to identify the sender
24  @param context - sender context, to match reply w/ request
25  @param private_key - private key in binary format of this device
26  @param public_key - public key in binary format of this device
27  @param port - port of this device
28  @param src_ip - packet sent through this interface us this
29  address as the IP source.
30 */
31 typedef wireguard_interface
32 {
33  u32 user_instance [default=0xffffffff];
34  vl_api_interface_index_t sw_if_index;
38  vl_api_address_t src_ip;
39 };
40 
41 /** \brief Create an Wireguard interface
42  */
43 define wireguard_interface_create {
46  vl_api_wireguard_interface_t interface;
48 };
49 
50 /** \brief Add Wireguard interface interface response
51  @param context - sender context, to match reply w/ request
52  @param retval - return status
53  @param sw_if_index - sw_if_index of new interface (for successful add)
54 */
55 define wireguard_interface_create_reply
56 {
59  vl_api_interface_index_t sw_if_index;
60 };
61 
62 autoreply define wireguard_interface_delete
63 {
66  vl_api_interface_index_t sw_if_index;
67 };
68 
69 define wireguard_interface_dump
70 {
74  vl_api_interface_index_t sw_if_index;
75 };
76 
77 define wireguard_interface_details
78 {
80  vl_api_wireguard_interface_t interface;
81 };
82 
84 {
86 };
87 
88 /** \brief Create new peer
89  @param public_key - public key (in binary format) of destination peer
90  @param port - destination port
91  @param table_id - The IP table in which 'endpoint' is reachable
92  @param endpoint - destination ip
93  @param allowed_ip - allowed incoming ip tunnel
94  @param tun_sw_if_index - tunnel interface
95  @param persistent_keepalive - keepalive packet timeout
96 */
97 typedef wireguard_peer
98 {
99  u8 public_key[32];
100  u16 port;
103  vl_api_address_t endpoint;
104  vl_api_interface_index_t sw_if_index;
105  vl_api_wireguard_peer_flags_t flags;
107  vl_api_prefix_t allowed_ips[n_allowed_ips];
108 };
109 
110 /** \brief Create new peer
111  @param client_index - opaque cookie to identify the sender
112  @param context - sender context, to match reply w/ request
113  @param peer - peer to create
114 */
115 define wireguard_peer_add
116 {
119  vl_api_wireguard_peer_t peer;
120 };
121 define wireguard_peer_add_reply
122 {
126 };
127 
128 /** \brief Remove peer by public_key
129  @param client_index - opaque cookie to identify the sender
130  @param context - sender context, to match reply w/ request
131  @param public_key
132 */
133 autoreply define wireguard_peer_remove
134 {
138 };
139 
140 /** \brief Dump all peers
141  @param client_index - opaque cookie to identify the sender
142  @param context - sender context, to match reply w/ request
143 */
144 define wireguard_peers_dump {
147 };
148 
149 /** \brief Dump peers response
150  @param context - sender context, to match reply w/ request
151  @param is_dead - is peer valid yet
152  @param public_key - peer public_key
153  @param ip4_address - ip4 endpoint address
154 */
155 define wireguard_peers_details {
157  vl_api_wireguard_peer_t peer;
158 };
159 
160 /*
161  * Local Variables:
162  * eval: (c-set-style "gnu")
163  * End:
164  */
vl_api_wireguard_interface_delete_t::context
u32 context
Definition: wireguard.api:65
private_key
u8 private_key[32]
Definition: wireguard.api:35
vl_api_wireguard_interface_dump_t::show_private_key
bool show_private_key
Definition: wireguard.api:73
persistent_keepalive
u16 persistent_keepalive
Definition: wireguard.api:101
u16
unsigned short u16
Definition: types.h:57
vl_api_wireguard_interface_dump_t::context
u32 context
Definition: wireguard.api:72
public_key
u8 public_key[32]
Definition: wireguard.api:36
vl_api_wireguard_interface_create_reply_t::retval
i32 retval
Definition: wireguard.api:58
WIREGUARD_PEER_STATUS_DEAD
@ WIREGUARD_PEER_STATUS_DEAD
Definition: wireguard.api:85
i32
signed int i32
Definition: types.h:77
vl_api_wireguard_interface_create_t
Create an Wireguard interface.
Definition: wireguard.api:43
vl_api_wireguard_interface_create_reply_t::context
u32 context
Definition: wireguard.api:57
vl_api_wireguard_peers_details_t
Dump peers response.
Definition: wireguard.api:155
vl_api_wireguard_interface_create_t::context
u32 context
Definition: wireguard.api:45
vl_api_wireguard_peer_add_reply_t::context
u32 context
Definition: wireguard.api:123
vl_api_wireguard_peers_dump_t::client_index
u32 client_index
Definition: wireguard.api:145
vl_api_wireguard_interface_create_reply_t
Add Wireguard interface interface response.
Definition: wireguard.api:55
vl_api_wireguard_peers_details_t::context
u32 context
Definition: wireguard.api:156
vl_api_wireguard_interface_dump_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:74
vl_api_wireguard_interface_delete_t::client_index
u32 client_index
Definition: wireguard.api:64
port
u16 port
Definition: wireguard.api:37
vl_api_wireguard_interface_delete_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:66
vl_api_wireguard_peer_remove_t::context
u32 context
Definition: wireguard.api:136
vl_api_wireguard_interface_create_t::generate_key
bool generate_key
Definition: wireguard.api:47
vl_api_wireguard_peer_add_t::peer
vl_api_wireguard_peer_t peer
Definition: wireguard.api:119
vl_api_wireguard_interface_dump_t::client_index
u32 client_index
Definition: wireguard.api:71
vl_api_wireguard_interface_details_t
Definition: wireguard.api:77
vl_api_wireguard_interface_create_t::client_index
u32 client_index
Definition: wireguard.api:44
vl_api_wireguard_interface_details_t::interface
vl_api_wireguard_interface_t interface
Definition: wireguard.api:80
vl_api_wireguard_interface_create_t::interface
vl_api_wireguard_interface_t interface
Definition: wireguard.api:46
vl_api_wireguard_interface_delete_t
Definition: wireguard.api:62
vl_api_wireguard_peer_remove_t::client_index
u32 client_index
Definition: wireguard.api:135
wireguard_peer
typedef wireguard_peer
Create new peer.
Definition: wireguard.api:98
version
option version
Definition: wireguard.api:17
allowed_ips
vl_api_prefix_t allowed_ips[n_allowed_ips]
Definition: wireguard.api:107
vl_api_wireguard_peer_add_t::client_index
u32 client_index
Definition: wireguard.api:117
vl_api_wireguard_peer_add_reply_t
Definition: wireguard.api:121
endpoint
vl_api_address_t endpoint
Definition: wireguard.api:103
u32
unsigned int u32
Definition: types.h:88
wireguard_peer_flags
wireguard_peer_flags
Definition: wireguard.api:83
table_id
u32 table_id
Definition: wireguard.api:102
src_ip
vl_api_address_t src_ip
Definition: wireguard.api:38
vl_api_wireguard_peers_dump_t::context
u32 context
Definition: wireguard.api:146
vl_api_wireguard_peer_add_t::context
u32 context
Definition: wireguard.api:118
u8
unsigned char u8
Definition: types.h:56
vl_api_wireguard_peer_add_t
Create new peer.
Definition: wireguard.api:115
vl_api_wireguard_interface_dump_t
Definition: wireguard.api:69
vl_api_wireguard_peer_add_reply_t::retval
i32 retval
Definition: wireguard.api:124
vl_api_wireguard_peer_remove_t
Remove peer by public_key.
Definition: wireguard.api:133
wireguard_interface
typedef wireguard_interface
Create wireguard interface.
Definition: wireguard.api:32
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
vl_api_wireguard_peer_remove_t::peer_index
u32 peer_index
Definition: wireguard.api:137
vl_api_wireguard_peers_details_t::peer
vl_api_wireguard_peer_t peer
Definition: wireguard.api:157
vl_api_wireguard_interface_details_t::context
u32 context
Definition: wireguard.api:79
vl_api_wireguard_peer_add_reply_t::peer_index
u32 peer_index
Definition: wireguard.api:125
n_allowed_ips
u8 n_allowed_ips
Definition: wireguard.api:106
vl_api_wireguard_interface_create_reply_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:59
vl_api_wireguard_peers_dump_t
Dump all peers.
Definition: wireguard.api:144
flags
vl_api_wireguard_peer_flags_t flags
Definition: wireguard.api:105