FD.io VPP  v20.09-64-g4f7b92f0a
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 port - port of this device
27  @param src_ip - packet sent through this interface us this
28  address as the IP source.
29 */
30 typedef wireguard_interface
31 {
32  u32 user_instance [default=0xffffffff];
33  vl_api_interface_index_t sw_if_index;
36  vl_api_address_t src_ip;
37 };
38 
39 /** \brief Create an Wireguard interface
40  */
41 define wireguard_interface_create {
44  vl_api_wireguard_interface_t interface;
46 };
47 
48 /** \brief Add Wireguard interface interface response
49  @param context - sender context, to match reply w/ request
50  @param retval - return status
51  @param sw_if_index - sw_if_index of new interface (for successful add)
52 */
53 define wireguard_interface_create_reply
54 {
57  vl_api_interface_index_t sw_if_index;
58 };
59 
60 autoreply define wireguard_interface_delete
61 {
64  vl_api_interface_index_t sw_if_index;
65 };
66 
67 define wireguard_interface_dump
68 {
72  vl_api_interface_index_t sw_if_index;
73 };
74 
75 define wireguard_interface_details
76 {
78  vl_api_wireguard_interface_t interface;
79 };
80 
82 {
84 };
85 
86 /** \brief Create new peer
87  @param public_key - public key (in binary format) of destination peer
88  @param port - destination port
89  @param table_id - The IP table in which 'endpoint' is reachable
90  @param endpoint - destination ip
91  @param allowed_ip - allowed incoming ip tunnel
92  @param tun_sw_if_index - tunnel interface
93  @param persistent_keepalive - keepalive packet timeout
94 */
95 typedef wireguard_peer
96 {
97  u8 public_key[32];
98  u16 port;
101  vl_api_address_t endpoint;
102  vl_api_interface_index_t sw_if_index;
103  vl_api_wireguard_peer_flags_t flags;
105  vl_api_prefix_t allowed_ips[n_allowed_ips];
106 };
107 
108 /** \brief Create new peer
109  @param client_index - opaque cookie to identify the sender
110  @param context - sender context, to match reply w/ request
111  @param peer - peer to create
112 */
113 define wireguard_peer_add
114 {
117  vl_api_wireguard_peer_t peer;
118 };
119 define wireguard_peer_add_reply
120 {
124 };
125 
126 /** \brief Remove peer by public_key
127  @param client_index - opaque cookie to identify the sender
128  @param context - sender context, to match reply w/ request
129  @param public_key
130 */
131 autoreply define wireguard_peer_remove
132 {
136 };
137 
138 /** \brief Dump all peers
139  @param client_index - opaque cookie to identify the sender
140  @param context - sender context, to match reply w/ request
141 */
142 define wireguard_peers_dump {
145 };
146 
147 /** \brief Dump peers response
148  @param context - sender context, to match reply w/ request
149  @param is_dead - is peer valid yet
150  @param public_key - peer public_key
151  @param ip4_address - ip4 endpoint address
152 */
153 define wireguard_peers_details {
155  vl_api_wireguard_peer_t peer;
156 };
157 
158 /*
159  * Local Variables:
160  * eval: (c-set-style "gnu")
161  * End:
162  */
vl_api_wireguard_peer_flags_t flags
Definition: wireguard.api:103
typedef wireguard_peer
Create new peer.
Definition: wireguard.api:96
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:57
vl_api_wireguard_interface_t interface
Definition: wireguard.api:78
wireguard_peer_flags
Definition: wireguard.api:81
unsigned char u8
Definition: types.h:56
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:64
u8 n_allowed_ips
Definition: wireguard.api:104
vl_api_prefix_t allowed_ips[n_allowed_ips]
Definition: wireguard.api:105
unsigned int u32
Definition: types.h:88
u16 port
Definition: wireguard.api:35
u8 private_key[32]
Definition: wireguard.api:34
unsigned short u16
Definition: types.h:57
option version
Definition: wireguard.api:17
vl_api_address_t endpoint
Definition: wireguard.api:101
signed int i32
Definition: types.h:77
u16 persistent_keepalive
Definition: wireguard.api:99
vl_api_wireguard_peer_t peer
Definition: wireguard.api:155
vl_api_wireguard_interface_t interface
Definition: wireguard.api:44
vl_api_address_t src_ip
Definition: wireguard.api:36
u32 table_id
Definition: wireguard.api:100
vl_api_wireguard_peer_t peer
Definition: wireguard.api:117
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:33
typedef wireguard_interface
Create wireguard interface.
Definition: wireguard.api:31
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:72