11422e32dSPaolo Bonzini /* 21422e32dSPaolo Bonzini * QEMU System Emulator 31422e32dSPaolo Bonzini * 41422e32dSPaolo Bonzini * Copyright (c) 2003-2008 Fabrice Bellard 51422e32dSPaolo Bonzini * Copyright (c) 2009 Red Hat, Inc. 61422e32dSPaolo Bonzini * 71422e32dSPaolo Bonzini * Permission is hereby granted, free of charge, to any person obtaining a copy 81422e32dSPaolo Bonzini * of this software and associated documentation files (the "Software"), to deal 91422e32dSPaolo Bonzini * in the Software without restriction, including without limitation the rights 101422e32dSPaolo Bonzini * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 111422e32dSPaolo Bonzini * copies of the Software, and to permit persons to whom the Software is 121422e32dSPaolo Bonzini * furnished to do so, subject to the following conditions: 131422e32dSPaolo Bonzini * 141422e32dSPaolo Bonzini * The above copyright notice and this permission notice shall be included in 151422e32dSPaolo Bonzini * all copies or substantial portions of the Software. 161422e32dSPaolo Bonzini * 171422e32dSPaolo Bonzini * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 181422e32dSPaolo Bonzini * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 191422e32dSPaolo Bonzini * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 201422e32dSPaolo Bonzini * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 211422e32dSPaolo Bonzini * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 221422e32dSPaolo Bonzini * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 231422e32dSPaolo Bonzini * THE SOFTWARE. 241422e32dSPaolo Bonzini */ 251422e32dSPaolo Bonzini 26121d0712SMarkus Armbruster #ifndef NET_TAP_INT_H 27121d0712SMarkus Armbruster #define NET_TAP_INT_H 281422e32dSPaolo Bonzini 299af23989SMarkus Armbruster #include "qapi/qapi-types-net.h" 301422e32dSPaolo Bonzini 31264986e2SJason Wang int tap_open(char *ifname, int ifname_size, int *vnet_hdr, 32468dd824SMarkus Armbruster int vnet_hdr_required, int mq_required, Error **errp); 331422e32dSPaolo Bonzini 341422e32dSPaolo Bonzini ssize_t tap_read_packet(int tapfd, uint8_t *buf, int maxlen); 351422e32dSPaolo Bonzini 3680b832c3SMarkus Armbruster void tap_set_sndbuf(int fd, const NetdevTapOptions *tap, Error **errp); 37e7b347d0SDaniel P. Berrange int tap_probe_vnet_hdr(int fd, Error **errp); 381422e32dSPaolo Bonzini int tap_probe_has_ufo(int fd); 39*f03e0cf6SYuri Benditovich int tap_probe_has_uso(int fd); 402ab0ec31SAndrew Melnychenko void tap_fd_set_offload(int fd, int csum, int tso4, int tso6, int ecn, int ufo, 412ab0ec31SAndrew Melnychenko int uso4, int uso6); 421422e32dSPaolo Bonzini void tap_fd_set_vnet_hdr_len(int fd, int len); 43c80cd6bbSGreg Kurz int tap_fd_set_vnet_le(int fd, int vnet_is_le); 44c80cd6bbSGreg Kurz int tap_fd_set_vnet_be(int fd, int vnet_is_be); 4594fdc6d0SJason Wang int tap_fd_enable(int fd); 4694fdc6d0SJason Wang int tap_fd_disable(int fd); 47e5dc0b40SJason Wang int tap_fd_get_ifname(int fd, char *ifname); 488f364e34SAndrew Melnychenko int tap_fd_set_steering_ebpf(int fd, int prog_fd); 491422e32dSPaolo Bonzini 50121d0712SMarkus Armbruster #endif /* NET_TAP_INT_H */ 51