1 | /* AUTOMATICALLY GENERATED, DO NOT MODIFY */ |
2 | |
3 | /* |
4 | * Schema-defined QAPI types |
5 | * |
6 | * Copyright IBM, Corp. 2011 |
7 | * Copyright (c) 2013-2018 Red Hat Inc. |
8 | * |
9 | * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. |
10 | * See the COPYING.LIB file in the top-level directory. |
11 | */ |
12 | |
13 | #ifndef QAPI_TYPES_NET_H |
14 | #define QAPI_TYPES_NET_H |
15 | |
16 | #include "qapi/qapi-builtin-types.h" |
17 | #include "qapi-types-common.h" |
18 | |
19 | typedef struct q_obj_set_link_arg q_obj_set_link_arg; |
20 | |
21 | typedef struct q_obj_netdev_add_arg q_obj_netdev_add_arg; |
22 | |
23 | typedef struct q_obj_netdev_del_arg q_obj_netdev_del_arg; |
24 | |
25 | typedef struct NetLegacyNicOptions NetLegacyNicOptions; |
26 | |
27 | typedef struct NetdevUserOptions NetdevUserOptions; |
28 | |
29 | typedef struct NetdevTapOptions NetdevTapOptions; |
30 | |
31 | typedef struct NetdevSocketOptions NetdevSocketOptions; |
32 | |
33 | typedef struct NetdevL2TPv3Options NetdevL2TPv3Options; |
34 | |
35 | typedef struct NetdevVdeOptions NetdevVdeOptions; |
36 | |
37 | typedef struct NetdevBridgeOptions NetdevBridgeOptions; |
38 | |
39 | typedef struct NetdevHubPortOptions NetdevHubPortOptions; |
40 | |
41 | typedef struct NetdevNetmapOptions NetdevNetmapOptions; |
42 | |
43 | typedef struct NetdevVhostUserOptions NetdevVhostUserOptions; |
44 | |
45 | typedef enum NetClientDriver { |
46 | NET_CLIENT_DRIVER_NONE, |
47 | NET_CLIENT_DRIVER_NIC, |
48 | NET_CLIENT_DRIVER_USER, |
49 | NET_CLIENT_DRIVER_TAP, |
50 | NET_CLIENT_DRIVER_L2TPV3, |
51 | NET_CLIENT_DRIVER_SOCKET, |
52 | NET_CLIENT_DRIVER_VDE, |
53 | NET_CLIENT_DRIVER_BRIDGE, |
54 | NET_CLIENT_DRIVER_HUBPORT, |
55 | NET_CLIENT_DRIVER_NETMAP, |
56 | NET_CLIENT_DRIVER_VHOST_USER, |
57 | NET_CLIENT_DRIVER__MAX, |
58 | } NetClientDriver; |
59 | |
60 | #define NetClientDriver_str(val) \ |
61 | qapi_enum_lookup(&NetClientDriver_lookup, (val)) |
62 | |
63 | extern const QEnumLookup NetClientDriver_lookup; |
64 | |
65 | typedef struct q_obj_Netdev_base q_obj_Netdev_base; |
66 | |
67 | typedef struct Netdev Netdev; |
68 | |
69 | typedef struct NetLegacy NetLegacy; |
70 | |
71 | typedef enum NetLegacyOptionsType { |
72 | NET_LEGACY_OPTIONS_TYPE_NONE, |
73 | NET_LEGACY_OPTIONS_TYPE_NIC, |
74 | NET_LEGACY_OPTIONS_TYPE_USER, |
75 | NET_LEGACY_OPTIONS_TYPE_TAP, |
76 | NET_LEGACY_OPTIONS_TYPE_L2TPV3, |
77 | NET_LEGACY_OPTIONS_TYPE_SOCKET, |
78 | NET_LEGACY_OPTIONS_TYPE_VDE, |
79 | NET_LEGACY_OPTIONS_TYPE_BRIDGE, |
80 | NET_LEGACY_OPTIONS_TYPE_NETMAP, |
81 | NET_LEGACY_OPTIONS_TYPE_VHOST_USER, |
82 | NET_LEGACY_OPTIONS_TYPE__MAX, |
83 | } NetLegacyOptionsType; |
84 | |
85 | #define NetLegacyOptionsType_str(val) \ |
86 | qapi_enum_lookup(&NetLegacyOptionsType_lookup, (val)) |
87 | |
88 | extern const QEnumLookup NetLegacyOptionsType_lookup; |
89 | |
90 | typedef struct q_obj_NetLegacyOptions_base q_obj_NetLegacyOptions_base; |
91 | |
92 | typedef struct NetLegacyOptions NetLegacyOptions; |
93 | |
94 | typedef enum NetFilterDirection { |
95 | NET_FILTER_DIRECTION_ALL, |
96 | NET_FILTER_DIRECTION_RX, |
97 | NET_FILTER_DIRECTION_TX, |
98 | NET_FILTER_DIRECTION__MAX, |
99 | } NetFilterDirection; |
100 | |
101 | #define NetFilterDirection_str(val) \ |
102 | qapi_enum_lookup(&NetFilterDirection_lookup, (val)) |
103 | |
104 | extern const QEnumLookup NetFilterDirection_lookup; |
105 | |
106 | typedef enum RxState { |
107 | RX_STATE_NORMAL, |
108 | RX_STATE_NONE, |
109 | RX_STATE_ALL, |
110 | RX_STATE__MAX, |
111 | } RxState; |
112 | |
113 | #define RxState_str(val) \ |
114 | qapi_enum_lookup(&RxState_lookup, (val)) |
115 | |
116 | extern const QEnumLookup RxState_lookup; |
117 | |
118 | typedef struct RxFilterInfo RxFilterInfo; |
119 | |
120 | typedef struct q_obj_query_rx_filter_arg q_obj_query_rx_filter_arg; |
121 | |
122 | typedef struct RxFilterInfoList RxFilterInfoList; |
123 | |
124 | typedef struct q_obj_NIC_RX_FILTER_CHANGED_arg q_obj_NIC_RX_FILTER_CHANGED_arg; |
125 | |
126 | typedef struct AnnounceParameters AnnounceParameters; |
127 | |
128 | struct q_obj_set_link_arg { |
129 | char *name; |
130 | bool up; |
131 | }; |
132 | |
133 | struct q_obj_netdev_add_arg { |
134 | char *type; |
135 | char *id; |
136 | }; |
137 | |
138 | struct q_obj_netdev_del_arg { |
139 | char *id; |
140 | }; |
141 | |
142 | struct NetLegacyNicOptions { |
143 | bool has_netdev; |
144 | char *netdev; |
145 | bool has_macaddr; |
146 | char *macaddr; |
147 | bool has_model; |
148 | char *model; |
149 | bool has_addr; |
150 | char *addr; |
151 | bool has_vectors; |
152 | uint32_t vectors; |
153 | }; |
154 | |
155 | void qapi_free_NetLegacyNicOptions(NetLegacyNicOptions *obj); |
156 | |
157 | struct NetdevUserOptions { |
158 | bool has_hostname; |
159 | char *hostname; |
160 | bool has_q_restrict; |
161 | bool q_restrict; |
162 | bool has_ipv4; |
163 | bool ipv4; |
164 | bool has_ipv6; |
165 | bool ipv6; |
166 | bool has_ip; |
167 | char *ip; |
168 | bool has_net; |
169 | char *net; |
170 | bool has_host; |
171 | char *host; |
172 | bool has_tftp; |
173 | char *tftp; |
174 | bool has_bootfile; |
175 | char *bootfile; |
176 | bool has_dhcpstart; |
177 | char *dhcpstart; |
178 | bool has_dns; |
179 | char *dns; |
180 | bool has_dnssearch; |
181 | StringList *dnssearch; |
182 | bool has_domainname; |
183 | char *domainname; |
184 | bool has_ipv6_prefix; |
185 | char *ipv6_prefix; |
186 | bool has_ipv6_prefixlen; |
187 | int64_t ipv6_prefixlen; |
188 | bool has_ipv6_host; |
189 | char *ipv6_host; |
190 | bool has_ipv6_dns; |
191 | char *ipv6_dns; |
192 | bool has_smb; |
193 | char *smb; |
194 | bool has_smbserver; |
195 | char *smbserver; |
196 | bool has_hostfwd; |
197 | StringList *hostfwd; |
198 | bool has_guestfwd; |
199 | StringList *guestfwd; |
200 | bool has_tftp_server_name; |
201 | char *tftp_server_name; |
202 | }; |
203 | |
204 | void qapi_free_NetdevUserOptions(NetdevUserOptions *obj); |
205 | |
206 | struct NetdevTapOptions { |
207 | bool has_ifname; |
208 | char *ifname; |
209 | bool has_fd; |
210 | char *fd; |
211 | bool has_fds; |
212 | char *fds; |
213 | bool has_script; |
214 | char *script; |
215 | bool has_downscript; |
216 | char *downscript; |
217 | bool has_br; |
218 | char *br; |
219 | bool has_helper; |
220 | char *helper; |
221 | bool has_sndbuf; |
222 | uint64_t sndbuf; |
223 | bool has_vnet_hdr; |
224 | bool vnet_hdr; |
225 | bool has_vhost; |
226 | bool vhost; |
227 | bool has_vhostfd; |
228 | char *vhostfd; |
229 | bool has_vhostfds; |
230 | char *vhostfds; |
231 | bool has_vhostforce; |
232 | bool vhostforce; |
233 | bool has_queues; |
234 | uint32_t queues; |
235 | bool has_poll_us; |
236 | uint32_t poll_us; |
237 | }; |
238 | |
239 | void qapi_free_NetdevTapOptions(NetdevTapOptions *obj); |
240 | |
241 | struct NetdevSocketOptions { |
242 | bool has_fd; |
243 | char *fd; |
244 | bool has_listen; |
245 | char *listen; |
246 | bool has_connect; |
247 | char *connect; |
248 | bool has_mcast; |
249 | char *mcast; |
250 | bool has_localaddr; |
251 | char *localaddr; |
252 | bool has_udp; |
253 | char *udp; |
254 | }; |
255 | |
256 | void qapi_free_NetdevSocketOptions(NetdevSocketOptions *obj); |
257 | |
258 | struct NetdevL2TPv3Options { |
259 | char *src; |
260 | char *dst; |
261 | bool has_srcport; |
262 | char *srcport; |
263 | bool has_dstport; |
264 | char *dstport; |
265 | bool has_ipv6; |
266 | bool ipv6; |
267 | bool has_udp; |
268 | bool udp; |
269 | bool has_cookie64; |
270 | bool cookie64; |
271 | bool has_counter; |
272 | bool counter; |
273 | bool has_pincounter; |
274 | bool pincounter; |
275 | bool has_txcookie; |
276 | uint64_t txcookie; |
277 | bool has_rxcookie; |
278 | uint64_t rxcookie; |
279 | uint32_t txsession; |
280 | bool has_rxsession; |
281 | uint32_t rxsession; |
282 | bool has_offset; |
283 | uint32_t offset; |
284 | }; |
285 | |
286 | void qapi_free_NetdevL2TPv3Options(NetdevL2TPv3Options *obj); |
287 | |
288 | struct NetdevVdeOptions { |
289 | bool has_sock; |
290 | char *sock; |
291 | bool has_port; |
292 | uint16_t port; |
293 | bool has_group; |
294 | char *group; |
295 | bool has_mode; |
296 | uint16_t mode; |
297 | }; |
298 | |
299 | void qapi_free_NetdevVdeOptions(NetdevVdeOptions *obj); |
300 | |
301 | struct NetdevBridgeOptions { |
302 | bool has_br; |
303 | char *br; |
304 | bool has_helper; |
305 | char *helper; |
306 | }; |
307 | |
308 | void qapi_free_NetdevBridgeOptions(NetdevBridgeOptions *obj); |
309 | |
310 | struct NetdevHubPortOptions { |
311 | int32_t hubid; |
312 | bool has_netdev; |
313 | char *netdev; |
314 | }; |
315 | |
316 | void qapi_free_NetdevHubPortOptions(NetdevHubPortOptions *obj); |
317 | |
318 | struct NetdevNetmapOptions { |
319 | char *ifname; |
320 | bool has_devname; |
321 | char *devname; |
322 | }; |
323 | |
324 | void qapi_free_NetdevNetmapOptions(NetdevNetmapOptions *obj); |
325 | |
326 | struct NetdevVhostUserOptions { |
327 | char *chardev; |
328 | bool has_vhostforce; |
329 | bool vhostforce; |
330 | bool has_queues; |
331 | int64_t queues; |
332 | }; |
333 | |
334 | void qapi_free_NetdevVhostUserOptions(NetdevVhostUserOptions *obj); |
335 | |
336 | struct q_obj_Netdev_base { |
337 | char *id; |
338 | NetClientDriver type; |
339 | }; |
340 | |
341 | struct Netdev { |
342 | char *id; |
343 | NetClientDriver type; |
344 | union { /* union tag is @type */ |
345 | NetLegacyNicOptions nic; |
346 | NetdevUserOptions user; |
347 | NetdevTapOptions tap; |
348 | NetdevL2TPv3Options l2tpv3; |
349 | NetdevSocketOptions socket; |
350 | NetdevVdeOptions vde; |
351 | NetdevBridgeOptions bridge; |
352 | NetdevHubPortOptions hubport; |
353 | NetdevNetmapOptions netmap; |
354 | NetdevVhostUserOptions vhost_user; |
355 | } u; |
356 | }; |
357 | |
358 | void qapi_free_Netdev(Netdev *obj); |
359 | |
360 | struct NetLegacy { |
361 | bool has_id; |
362 | char *id; |
363 | bool has_name; |
364 | char *name; |
365 | NetLegacyOptions *opts; |
366 | }; |
367 | |
368 | void qapi_free_NetLegacy(NetLegacy *obj); |
369 | |
370 | struct q_obj_NetLegacyOptions_base { |
371 | NetLegacyOptionsType type; |
372 | }; |
373 | |
374 | struct NetLegacyOptions { |
375 | NetLegacyOptionsType type; |
376 | union { /* union tag is @type */ |
377 | NetLegacyNicOptions nic; |
378 | NetdevUserOptions user; |
379 | NetdevTapOptions tap; |
380 | NetdevL2TPv3Options l2tpv3; |
381 | NetdevSocketOptions socket; |
382 | NetdevVdeOptions vde; |
383 | NetdevBridgeOptions bridge; |
384 | NetdevNetmapOptions netmap; |
385 | NetdevVhostUserOptions vhost_user; |
386 | } u; |
387 | }; |
388 | |
389 | void qapi_free_NetLegacyOptions(NetLegacyOptions *obj); |
390 | |
391 | struct RxFilterInfo { |
392 | char *name; |
393 | bool promiscuous; |
394 | RxState multicast; |
395 | RxState unicast; |
396 | RxState vlan; |
397 | bool broadcast_allowed; |
398 | bool multicast_overflow; |
399 | bool unicast_overflow; |
400 | char *main_mac; |
401 | intList *vlan_table; |
402 | strList *unicast_table; |
403 | strList *multicast_table; |
404 | }; |
405 | |
406 | void qapi_free_RxFilterInfo(RxFilterInfo *obj); |
407 | |
408 | struct q_obj_query_rx_filter_arg { |
409 | bool has_name; |
410 | char *name; |
411 | }; |
412 | |
413 | struct RxFilterInfoList { |
414 | RxFilterInfoList *next; |
415 | RxFilterInfo *value; |
416 | }; |
417 | |
418 | void qapi_free_RxFilterInfoList(RxFilterInfoList *obj); |
419 | |
420 | struct q_obj_NIC_RX_FILTER_CHANGED_arg { |
421 | bool has_name; |
422 | char *name; |
423 | char *path; |
424 | }; |
425 | |
426 | struct AnnounceParameters { |
427 | int64_t initial; |
428 | int64_t max; |
429 | int64_t rounds; |
430 | int64_t step; |
431 | bool has_interfaces; |
432 | strList *interfaces; |
433 | bool has_id; |
434 | char *id; |
435 | }; |
436 | |
437 | void qapi_free_AnnounceParameters(AnnounceParameters *obj); |
438 | |
439 | #endif /* QAPI_TYPES_NET_H */ |
440 | |