1 /* Hey Emacs use -*- mode: C -*- */
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:
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 option version = "0.1.0";
19 import "vnet/interface_types.api";
20 import "vnet/ip/ip_types.api";
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.
30 typedef wireguard_interface
32 u32 user_instance [default=0xffffffff];
33 vl_api_interface_index_t sw_if_index;
36 vl_api_address_t src_ip;
39 /** \brief Create an Wireguard interface
41 define wireguard_interface_create {
44 vl_api_wireguard_interface_t interface;
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)
53 define wireguard_interface_create_reply
57 vl_api_interface_index_t sw_if_index;
60 autoreply define wireguard_interface_delete
64 vl_api_interface_index_t sw_if_index;
67 define wireguard_interface_dump
71 bool show_private_key;
72 vl_api_interface_index_t sw_if_index;
75 define wireguard_interface_details
78 vl_api_wireguard_interface_t interface;
81 enum wireguard_peer_flags : u8
83 WIREGUARD_PEER_STATUS_DEAD = 0x1,
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
95 typedef wireguard_peer
99 u16 persistent_keepalive;
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];
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
113 define wireguard_peer_add
117 vl_api_wireguard_peer_t peer;
119 define wireguard_peer_add_reply
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
131 autoreply define wireguard_peer_remove
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
142 define wireguard_peers_dump {
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
153 define wireguard_peers_details {
155 vl_api_wireguard_peer_t peer;
160 * eval: (c-set-style "gnu")