linux-cp: API downgrade due to namespace keyword
[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 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 {
31   u32 client_index;
32   u32 context;
33   string namespace[32];         /* LCP_NS_LEN */
34   option in_progress;
35 };
36
37 /** \brief get the default Linux Control Plane namespace
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 namespace
48     @param client_index - opaque cookie to identify the sender
49     @param context - sender context, to match reply w/ request
50     @param namespace - the default namespace; namespace[0] == 0 iff none
51 */
52 define lcp_default_ns_get_reply
53 {
54   u32 context;
55   string namespace[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 namespace - optional tap namespace; namespace[0] == 0 iff none
73 */
74 autoreply autoendian define lcp_itf_pair_add_del
75 {
76   u32 client_index;
77   u32 context;
78   bool is_add;
79   vl_api_interface_index_t sw_if_index;
80   string host_if_name[16];              /* IFNAMSIZ */
81   vl_api_lcp_itf_host_type_t host_if_type;
82   string namespace[32];                 /* LCP_NS_LEN */
83   option in_progress;
84 };
85 autoendian define lcp_itf_pair_add_del_v2
86 {
87   u32 client_index;
88   u32 context;
89   bool is_add;
90   vl_api_interface_index_t sw_if_index;
91   string host_if_name[16];              /* IFNAMSIZ */
92   vl_api_lcp_itf_host_type_t host_if_type;
93   string namespace[32];                 /* LCP_NS_LEN */
94   option in_progress;
95 };
96 define lcp_itf_pair_add_del_v2_reply
97 {
98   u32 context;
99   i32 retval;
100   vl_api_interface_index_t host_sw_if_index;
101 };
102
103 /** \brief Dump Linux Control Plane interface pair data
104     @param client_index - opaque cookie to identify the sender
105     @param context - sender context, to match reply w/ request
106     @param sw_if_index - interface to use as filter (~0 == "all")
107 */
108 define lcp_itf_pair_get
109 {
110   u32 client_index;
111   u32 context;
112   u32 cursor;
113 };
114 define lcp_itf_pair_get_reply
115 {
116   u32 context;
117   i32 retval;
118   u32 cursor;
119 };
120
121 /** \brief Linux Control Plane interface pair dump response
122     @param context - sender context which was passed in the request
123     @param phy_sw_if_index - VPP's sw_if_index for the PHY
124     @param host_sw_if_index - VPP's sw_if_index for the host tap
125     @param vif_index - tap linux index
126     @param host_if_name - host interface name
127     @param host_if_type - host interface type (tun, tap)
128     @param namespace - host interface namespace
129 */
130 autoendian define lcp_itf_pair_details
131 {
132   u32 context;
133   vl_api_interface_index_t phy_sw_if_index;
134   vl_api_interface_index_t host_sw_if_index;
135   u32 vif_index;
136   string host_if_name[16];      /* IFNAMSIZ */
137   vl_api_lcp_itf_host_type_t host_if_type;
138   string namespace[32];         /* LCP_NS_LEN */
139   option in_progress;
140 };
141
142 service {
143   rpc lcp_itf_pair_get returns lcp_itf_pair_get_reply
144     stream lcp_itf_pair_details;
145 };
146
147 /** \brief Replace end/begin
148  */
149 autoreply define lcp_itf_pair_replace_begin
150 {
151   u32 client_index;
152   u32 context;
153 };
154 autoreply define lcp_itf_pair_replace_end
155 {
156   u32 client_index;
157   u32 context;
158 };
159
160 /*
161  * Linux-CP Error counters/messages
162  */
163 counters linuxcp {
164   packets {
165     severity info;
166     type counter64;
167     units "packets";
168     description "ARP packets processed";
169   };
170   copies {
171     severity info;
172     type counter64;
173     units "packets";
174     description "ARP replies copied to host";
175   };
176 };
177
178 paths {
179   "/err/linux-cp-arp-phy" "linuxcp";
180   "/err/linux-cp-arp-host" "linuxcp";
181 };
182
183 /*
184  * Local Variables:
185  * eval: (c-set-style "gnu")
186  * End:
187  */