api: lcp - Mark old message versions as deprecated
[vpp.git] / src / plugins / linux-cp / lcp.api
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 netns
25     @param client_index - opaque cookie to identify the sender
26     @param context - sender context, to match reply w/ request
27     @param netns - the new default netns; netns[0] == 0 if none
28 */
29 autoreply define lcp_default_ns_set
30 {
31   u32 client_index;
32   u32 context;
33   string netns[32];             /* LCP_NS_LEN */
34   option in_progress;
35 };
36
37 /** \brief get the default Linux Control Plane netns
38     @param client_index - opaque cookie to identify the sender
39     @param context - sender context, to match reply w/ request
40 */
41 define lcp_default_ns_get
42 {
43   u32 client_index;
44   u32 context;
45 };
46
47 /** \brief get the default Linux Control Plane netns
48     @param client_index - opaque cookie to identify the sender
49     @param context - sender context, to match reply w/ request
50     @param netns - the default netns; netns[0] == 0 if none
51 */
52 define lcp_default_ns_get_reply
53 {
54   u32 context;
55   string netns[32];             /* LCP_NS_LEN */
56   option in_progress;
57 };
58
59 enum lcp_itf_host_type : u8
60 {
61   LCP_API_ITF_HOST_TAP = 0,
62   LCP_API_ITF_HOST_TUN = 1,
63 };
64
65 /** \brief Add or delete a Linux Conrol Plane interface pair
66     @param client_index - opaque cookie to identify the sender
67     @param context - sender context, to match reply w/ request
68     @param is_add - 0 if deleting, != 0 if adding
69     @param sw_if_index - index of VPP PHY SW interface
70     @param host_if_name - host tap interface name
71     @param host_if_type - the type of host interface to create (tun, tap)
72     @param netns - optional tap netns; netns[0] == 0 if none
73 */
74 autoreply autoendian define lcp_itf_pair_add_del
75 {
76   option deprecated;
77
78   u32 client_index;
79   u32 context;
80   bool is_add;
81   vl_api_interface_index_t sw_if_index;
82   string host_if_name[16];              /* IFNAMSIZ */
83   vl_api_lcp_itf_host_type_t host_if_type;
84   string netns[32];                     /* LCP_NS_LEN */
85 };
86 autoendian define lcp_itf_pair_add_del_v2
87 {
88   option in_progress;
89
90   u32 client_index;
91   u32 context;
92   bool is_add;
93   vl_api_interface_index_t sw_if_index;
94   string host_if_name[16];              /* IFNAMSIZ */
95   vl_api_lcp_itf_host_type_t host_if_type;
96   string netns[32];                     /* LCP_NS_LEN */
97 };
98 define lcp_itf_pair_add_del_v2_reply
99 {
100   option in_progress;
101
102   u32 context;
103   i32 retval;
104   vl_api_interface_index_t host_sw_if_index;
105 };
106
107 /** \brief Dump Linux Control Plane interface pair data
108     @param client_index - opaque cookie to identify the sender
109     @param context - sender context, to match reply w/ request
110     @param sw_if_index - interface to use as filter (~0 == "all")
111 */
112 autoendian define lcp_itf_pair_get
113 {
114   u32 client_index;
115   u32 context;
116   u32 cursor;
117 };
118 autoendian define lcp_itf_pair_get_reply
119 {
120   u32 context;
121   i32 retval;
122   u32 cursor;
123 };
124
125 /** \brief Linux Control Plane interface pair dump response
126     @param context - sender context which was passed in the request
127     @param phy_sw_if_index - VPP's sw_if_index for the PHY
128     @param host_sw_if_index - VPP's sw_if_index for the host tap
129     @param vif_index - tap linux index
130     @param host_if_name - host interface name
131     @param host_if_type - host interface type (tun, tap)
132     @param netns - host interface netns
133 */
134 autoendian define lcp_itf_pair_details
135 {
136   u32 context;
137   vl_api_interface_index_t phy_sw_if_index;
138   vl_api_interface_index_t host_sw_if_index;
139   u32 vif_index;
140   string host_if_name[16];      /* IFNAMSIZ */
141   vl_api_lcp_itf_host_type_t host_if_type;
142   string netns[32];             /* LCP_NS_LEN */
143   option in_progress;
144 };
145
146 service {
147   rpc lcp_itf_pair_get returns lcp_itf_pair_get_reply
148     stream lcp_itf_pair_details;
149 };
150
151 /** \brief Replace end/begin
152  */
153 autoreply define lcp_itf_pair_replace_begin
154 {
155   u32 client_index;
156   u32 context;
157 };
158 autoreply define lcp_itf_pair_replace_end
159 {
160   u32 client_index;
161   u32 context;
162 };
163
164 /*
165  * Linux-CP Error counters/messages
166  */
167 counters linuxcp {
168   packets {
169     severity info;
170     type counter64;
171     units "packets";
172     description "ARP packets processed";
173   };
174   copies {
175     severity info;
176     type counter64;
177     units "packets";
178     description "ARP replies copied to host";
179   };
180 };
181
182 paths {
183   "/err/linux-cp-arp-phy" "linuxcp";
184   "/err/linux-cp-arp-host" "linuxcp";
185 };
186
187 /*
188  * Local Variables:
189  * eval: (c-set-style "gnu")
190  * End:
191  */