summaryrefslogtreecommitdiffstats
path: root/src/plugins/linux-cp/lcp.api
blob: e7eaa5a3669f9551ab84eb012844f1d8a72a233b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
/* Hey Emacs use -*- mode: C -*- */
/*
 * Linux Control Plane API
 *
 * Copyright 2020 Rubicon Communications, LLC.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

option version = "1.0.0";

import "vnet/interface_types.api";

/** \brief Set the default Linux Control Plane netns
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param netns - the new default netns; netns[0] == 0 if none
*/
autoreply define lcp_default_ns_set
{
  u32 client_index;
  u32 context;
  string netns[32];		/* LCP_NS_LEN */
  option in_progress;
};

/** \brief get the default Linux Control Plane netns
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
*/
define lcp_default_ns_get
{
  u32 client_index;
  u32 context;
};

/** \brief get the default Linux Control Plane netns
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param netns - the default netns; netns[0] == 0 if none
*/
define lcp_default_ns_get_reply
{
  u32 context;
  string netns[32];		/* LCP_NS_LEN */
  option in_progress;
};

enum lcp_itf_host_type : u8
{
  LCP_API_ITF_HOST_TAP = 0,
  LCP_API_ITF_HOST_TUN = 1,
};

/** \brief Add or delete a Linux Conrol Plane interface pair
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_add - 0 if deleting, != 0 if adding
    @param sw_if_index - index of VPP PHY SW interface
    @param host_if_name - host tap interface name
    @param host_if_type - the type of host interface to create (tun, tap)
    @param netns - optional tap netns; netns[0] == 0 if none
*/
autoreply autoendian define lcp_itf_pair_add_del
{
  option deprecated;

  u32 client_index;
  u32 context;
  bool is_add;
  vl_api_interface_index_t sw_if_index;
  string host_if_name[16];		/* IFNAMSIZ */
  vl_api_lcp_itf_host_type_t host_if_type;
  string netns[32];			/* LCP_NS_LEN */
};
autoendian define lcp_itf_pair_add_del_v2
{
  option in_progress;

  u32 client_index;
  u32 context;
  bool is_add;
  vl_api_interface_index_t sw_if_index;
  string host_if_name[16];		/* IFNAMSIZ */
  vl_api_lcp_itf_host_type_t host_if_type;
  string netns[32];			/* LCP_NS_LEN */
};
define lcp_itf_pair_add_del_v2_reply
{
  option in_progress;

  u32 context;
  i32 retval;
  vl_api_interface_index_t host_sw_if_index;
};
autoendian define lcp_itf_pair_add_del_v3
{
  option in_progress;

  u32 client_index;
  u32 context;
  bool is_add;
  vl_api_interface_index_t sw_if_index;
  string host_if_name[16];		/* IFNAMSIZ */
  vl_api_lcp_itf_host_type_t host_if_type;
  string netns[32];			/* LCP_NS_LEN */
};
define lcp_itf_pair_add_del_v3_reply
{
  option in_progress;

  u32 context;
  i32 retval;
  u32 vif_index;
  vl_api_interface_index_t host_sw_if_index;
};

/** \brief Dump Linux Control Plane interface pair data
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param sw_if_index - interface to use as filter (~0 == "all")
*/
autoendian define lcp_itf_pair_get
{
  u32 client_index;
  u32 context;
  u32 cursor;
};
autoendian define lcp_itf_pair_get_reply
{
  u32 context;
  i32 retval;
  u32 cursor;
};
autoendian define lcp_itf_pair_get_v2
{
  u32 client_index;
  u32 context;
  u32 cursor;
  vl_api_interface_index_t sw_if_index;
};
autoendian define lcp_itf_pair_get_v2_reply
{
  u32 context;
  i32 retval;
  u32 cursor;
};

/** \brief Linux Control Plane interface pair dump response
    @param context - sender context which was passed in the request
    @param phy_sw_if_index - VPP's sw_if_index for the PHY
    @param host_sw_if_index - VPP's sw_if_index for the host tap
    @param vif_index - tap linux index
    @param host_if_name - host interface name
    @param host_if_type - host interface type (tun, tap)
    @param netns - host interface netns
*/
autoendian define lcp_itf_pair_details
{
  u32 context;
  vl_api_interface_index_t phy_sw_if_index;
  vl_api_interface_index_t host_sw_if_index;
  u32 vif_index;
  string host_if_name[16];	/* IFNAMSIZ */
  vl_api_lcp_itf_host_type_t host_if_type;
  string netns[32];		/* LCP_NS_LEN */
  option in_progress;
};

service {
  rpc lcp_itf_pair_get returns lcp_itf_pair_get_reply
    stream lcp_itf_pair_details;
};

service {
  rpc lcp_itf_pair_get_v2 returns lcp_itf_pair_get_v2_reply
    stream lcp_itf_pair_details;
};

/** \brief Replace end/begin
 */
autoreply define lcp_itf_pair_replace_begin
{
  u32 client_index;
  u32 context;
};
autoreply define lcp_itf_pair_replace_end
{
  u32 client_index;
  u32 context;
};

/*
 * Linux-CP Error counters/messages
 */
counters linuxcp {
  packets {
    severity info;
    type counter64;
    units "packets";
    description "ARP packets processed";
  };
  copies {
    severity info;
    type counter64;
    units "packets";
    description "ARP replies copied to host";
  };
};

paths {
  "/err/linux-cp-arp-phy" "linuxcp";
  "/err/linux-cp-arp-host" "linuxcp";
};

/*
 * Local Variables:
 * eval: (c-set-style "gnu")
 * End:
 */