FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
lcp.api
Go to the documentation of this file.
1 /* Hey Emacs use -*- mode: C -*- */
2 /*
3  * Linux Control Plane API
4  *
5  * Copyright 2020 Rubicon Communications, LLC.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at:
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 
20 option version = "1.0.0";
21 
22 import "vnet/interface_types.api";
23 
24 /** \brief Set the default Linux Control Plane namespace
25  @param client_index - opaque cookie to identify the sender
26  @param context - sender context, to match reply w/ request
27  @param namespace - the new default namespace; namespace[0] == 0 iff none
28 */
29 autoreply define lcp_default_ns_set
30 {
33  string namespace[32]; /* LCP_NS_LEN */
34 };
35 
36 /** \brief get the default Linux Control Plane namespace
37  @param client_index - opaque cookie to identify the sender
38  @param context - sender context, to match reply w/ request
39 */
40 define lcp_default_ns_get
41 {
44 };
45 
46 /** \brief get the default Linux Control Plane namespace
47  @param client_index - opaque cookie to identify the sender
48  @param context - sender context, to match reply w/ request
49  @param namespace - the default namespace; namespace[0] == 0 iff none
50 */
51 define lcp_default_ns_get_reply
52 {
54  string namespace[32]; /* LCP_NS_LEN */
55 };
56 
58 {
61 };
62 
63 /** \brief Add or delete a Linux Conrol Plane interface pair
64  @param client_index - opaque cookie to identify the sender
65  @param context - sender context, to match reply w/ request
66  @param is_add - 0 if deleting, != 0 if adding
67  @param sw_if_index - index of VPP PHY SW interface
68  @param host_if_name - host tap interface name
69  @param host_if_type - the type of host interface to create (tun, tap)
70  @param namespace - optional tap namespace; namespace[0] == 0 iff none
71 */
72 autoreply autoendian define lcp_itf_pair_add_del
73 {
76  bool is_add;
77  vl_api_interface_index_t sw_if_index;
78  string host_if_name[16]; /* IFNAMSIZ */
79  vl_api_lcp_itf_host_type_t host_if_type;
80  string namespace[32]; /* LCP_NS_LEN */
81 };
82 autoendian define lcp_itf_pair_add_del_v2
83 {
86  bool is_add;
87  vl_api_interface_index_t sw_if_index;
88  string host_if_name[16]; /* IFNAMSIZ */
89  vl_api_lcp_itf_host_type_t host_if_type;
90  string namespace[32]; /* LCP_NS_LEN */
91 };
92 define lcp_itf_pair_add_del_v2_reply
93 {
96  vl_api_interface_index_t host_sw_if_index;
97 };
98 
99 /** \brief Dump Linux Control Plane interface pair data
100  @param client_index - opaque cookie to identify the sender
101  @param context - sender context, to match reply w/ request
102  @param sw_if_index - interface to use as filter (~0 == "all")
103 */
105 {
109 };
110 define lcp_itf_pair_get_reply
111 {
115 };
116 
117 /** \brief Linux Control Plane interface pair dump response
118  @param context - sender context which was passed in the request
119  @param phy_sw_if_index - VPP's sw_if_index for the PHY
120  @param host_sw_if_index - VPP's sw_if_index for the host tap
121  @param vif_index - tap linux index
122  @param host_if_name - host interface name
123  @param host_if_type - host interface type (tun, tap)
124  @param namespace - host interface namespace
125 */
126 autoendian define lcp_itf_pair_details
127 {
129  vl_api_interface_index_t phy_sw_if_index;
130  vl_api_interface_index_t host_sw_if_index;
132  string host_if_name[16]; /* IFNAMSIZ */
133  vl_api_lcp_itf_host_type_t host_if_type;
134  string namespace[32]; /* LCP_NS_LEN */
135 };
136 
138  rpc lcp_itf_pair_get returns lcp_itf_pair_get_reply
139  stream lcp_itf_pair_details;
140 };
141 
142 /** \brief Replace end/begin
143  */
145 {
148 };
149 autoreply define lcp_itf_pair_replace_end
150 {
153 };
154 
155 /*
156  * Linux-CP Error counters/messages
157  */
158 counters linuxcp {
159  packets {
160  severity info;
161  type counter64;
162  units "packets";
163  description "ARP packets processed";
164  };
166  severity info;
168  units "packets";
169  description "ARP replies copied to host";
170  };
171 };
172 
174  "/err/linux-cp-arp-phy" "linuxcp";
175  "/err/linux-cp-arp-host" "linuxcp";
176 };
177 
178 /*
179  * Local Variables:
180  * eval: (c-set-style "gnu")
181  * End:
182  */
vl_api_lcp_itf_pair_details_t
Linux Control Plane interface pair dump response.
Definition: lcp.api:126
vl_api_lcp_default_ns_set_t::context
u32 context
Definition: lcp.api:32
vl_api_lcp_itf_pair_add_del_t::context
u32 context
Definition: lcp.api:75
vl_api_lcp_itf_pair_add_del_v2_reply_t
Definition: lcp.api:92
vl_api_lcp_itf_pair_get_t
Dump Linux Control Plane interface pair data.
Definition: lcp.api:104
vl_api_lcp_itf_pair_replace_end_t
Definition: lcp.api:149
vl_api_lcp_itf_pair_replace_end_t::client_index
u32 client_index
Definition: lcp.api:151
vl_api_lcp_itf_pair_details_t::vif_index
u32 vif_index
Definition: lcp.api:131
vl_api_lcp_itf_pair_details_t::host_if_type
vl_api_lcp_itf_host_type_t host_if_type
Definition: lcp.api:133
vl_api_lcp_itf_pair_add_del_t::is_add
bool is_add
Definition: lcp.api:76
vl_api_lcp_default_ns_get_reply_t
get the default Linux Control Plane namespace
Definition: lcp.api:51
packets
units packets
Definition: lcp.api:168
copies
copies
Definition: lcp.api:165
vl_api_lcp_itf_pair_get_reply_t
Definition: lcp.api:110
vl_api_lcp_itf_pair_get_t::cursor
u32 cursor
Definition: lcp.api:108
vl_api_lcp_itf_pair_details_t::host_if_name
string host_if_name[16]
Definition: lcp.api:132
i32
signed int i32
Definition: types.h:77
vl_api_lcp_itf_pair_get_reply_t::retval
i32 retval
Definition: lcp.api:113
lcp_itf_pair_get
lcp_itf_pair_t * lcp_itf_pair_get(u32 index)
Get an interface-pair object from its VPP index.
Definition: lcp_interface.c:156
vl_api_lcp_itf_pair_add_del_t::client_index
u32 client_index
Definition: lcp.api:74
vl_api_lcp_itf_pair_add_del_t
Add or delete a Linux Conrol Plane interface pair.
Definition: lcp.api:72
lcp_itf_host_type
lcp_itf_host_type
Definition: lcp.api:57
vl_api_lcp_itf_pair_add_del_v2_t::host_if_name
string host_if_name[16]
Definition: lcp.api:88
vl_api_lcp_itf_pair_add_del_v2_reply_t::host_sw_if_index
vl_api_interface_index_t host_sw_if_index
Definition: lcp.api:96
vl_api_lcp_itf_pair_get_reply_t::cursor
u32 cursor
Definition: lcp.api:114
vl_api_lcp_default_ns_set_t::client_index
u32 client_index
Definition: lcp.api:31
lcp_itf_pair_replace_begin
int lcp_itf_pair_replace_begin(void)
Begin and End the replace process.
Definition: lcp_interface.c:1049
vl_api_lcp_itf_pair_add_del_v2_t::context
u32 context
Definition: lcp.api:85
vl_api_lcp_itf_pair_replace_end_t::context
u32 context
Definition: lcp.api:152
vl_api_lcp_itf_pair_add_del_v2_reply_t::context
u32 context
Definition: lcp.api:94
vl_api_lcp_itf_pair_get_t::client_index
u32 client_index
Definition: lcp.api:106
vl_api_lcp_itf_pair_details_t::context
u32 context
Definition: lcp.api:128
vl_api_lcp_default_ns_get_reply_t::context
u32 context
Definition: lcp.api:53
paths
paths
Definition: lcp.api:173
vl_api_lcp_itf_pair_details_t::phy_sw_if_index
vl_api_interface_index_t phy_sw_if_index
Definition: lcp.api:129
vl_api_lcp_itf_pair_replace_begin_t::client_index
u32 client_index
Definition: lcp.api:146
u32
unsigned int u32
Definition: types.h:88
vl_api_lcp_itf_pair_add_del_v2_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: lcp.api:87
counter64
type counter64
Definition: lcp.api:167
vl_api_lcp_itf_pair_get_reply_t::context
u32 context
Definition: lcp.api:112
vl_api_lcp_default_ns_get_t
get the default Linux Control Plane namespace
Definition: lcp.api:40
vl_api_lcp_itf_pair_add_del_v2_t::is_add
bool is_add
Definition: lcp.api:86
vl_api_lcp_default_ns_get_t::context
u32 context
Definition: lcp.api:43
vl_api_lcp_itf_pair_add_del_t::host_if_type
vl_api_lcp_itf_host_type_t host_if_type
Definition: lcp.api:79
LCP_API_ITF_HOST_TAP
@ LCP_API_ITF_HOST_TAP
Definition: lcp.api:59
version
option version
Definition: lcp.api:20
u8
unsigned char u8
Definition: types.h:56
vl_api_lcp_default_ns_get_t::client_index
u32 client_index
Definition: lcp.api:42
vl_api_lcp_itf_pair_get_t::context
u32 context
Definition: lcp.api:107
service
service
Definition: lcp.api:137
linuxcp
counters linuxcp
Definition: lcp.api:158
vl_api_lcp_default_ns_set_t
Set the default Linux Control Plane namespace.
Definition: lcp.api:29
vl_api_lcp_itf_pair_add_del_v2_t::client_index
u32 client_index
Definition: lcp.api:84
vl_api_lcp_itf_pair_add_del_t::host_if_name
string host_if_name[16]
Definition: lcp.api:78
vl_api_lcp_itf_pair_add_del_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: lcp.api:77
vl_api_lcp_itf_pair_add_del_v2_reply_t::retval
i32 retval
Definition: lcp.api:95
vl_api_lcp_itf_pair_add_del_v2_t::host_if_type
vl_api_lcp_itf_host_type_t host_if_type
Definition: lcp.api:89
lcp_itf_pair_replace_end
int lcp_itf_pair_replace_end(void)
Definition: lcp_interface.c:1076
vl_api_lcp_itf_pair_replace_begin_t::context
u32 context
Definition: lcp.api:147
type
vl_api_fib_path_type_t type
Definition: fib_types.api:123
LCP_API_ITF_HOST_TUN
@ LCP_API_ITF_HOST_TUN
Definition: lcp.api:60
vl_api_lcp_itf_pair_details_t::host_sw_if_index
vl_api_interface_index_t host_sw_if_index
Definition: lcp.api:130
vl_api_lcp_itf_pair_replace_begin_t
Replace end/begin.
Definition: lcp.api:144
vl_api_lcp_itf_pair_add_del_v2_t
Definition: lcp.api:82