Statistics
| Branch: | Revision:

root / net / tap_int.h @ f487b677

History | View | Annotate | Download (1.9 kB)

1 a8ed73f7 Mark McLoughlin
/*
2 a8ed73f7 Mark McLoughlin
 * QEMU System Emulator
3 a8ed73f7 Mark McLoughlin
 *
4 a8ed73f7 Mark McLoughlin
 * Copyright (c) 2003-2008 Fabrice Bellard
5 a8ed73f7 Mark McLoughlin
 * Copyright (c) 2009 Red Hat, Inc.
6 a8ed73f7 Mark McLoughlin
 *
7 a8ed73f7 Mark McLoughlin
 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 a8ed73f7 Mark McLoughlin
 * of this software and associated documentation files (the "Software"), to deal
9 a8ed73f7 Mark McLoughlin
 * in the Software without restriction, including without limitation the rights
10 a8ed73f7 Mark McLoughlin
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 a8ed73f7 Mark McLoughlin
 * copies of the Software, and to permit persons to whom the Software is
12 a8ed73f7 Mark McLoughlin
 * furnished to do so, subject to the following conditions:
13 a8ed73f7 Mark McLoughlin
 *
14 a8ed73f7 Mark McLoughlin
 * The above copyright notice and this permission notice shall be included in
15 a8ed73f7 Mark McLoughlin
 * all copies or substantial portions of the Software.
16 a8ed73f7 Mark McLoughlin
 *
17 a8ed73f7 Mark McLoughlin
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 a8ed73f7 Mark McLoughlin
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 a8ed73f7 Mark McLoughlin
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 a8ed73f7 Mark McLoughlin
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 a8ed73f7 Mark McLoughlin
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 a8ed73f7 Mark McLoughlin
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 a8ed73f7 Mark McLoughlin
 * THE SOFTWARE.
24 a8ed73f7 Mark McLoughlin
 */
25 a8ed73f7 Mark McLoughlin
26 1422e32d Paolo Bonzini
#ifndef QEMU_TAP_H
27 1422e32d Paolo Bonzini
#define QEMU_TAP_H
28 a8ed73f7 Mark McLoughlin
29 a8ed73f7 Mark McLoughlin
#include "qemu-common.h"
30 6687b79d Laszlo Ersek
#include "qapi-types.h"
31 a8ed73f7 Mark McLoughlin
32 a8ed73f7 Mark McLoughlin
#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup"
33 a8ed73f7 Mark McLoughlin
#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown"
34 a8ed73f7 Mark McLoughlin
35 264986e2 Jason Wang
int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
36 264986e2 Jason Wang
             int vnet_hdr_required, int mq_required);
37 e7e92325 Mark McLoughlin
38 966ea5ec Mark McLoughlin
ssize_t tap_read_packet(int tapfd, uint8_t *buf, int maxlen);
39 966ea5ec Mark McLoughlin
40 08c573a8 Laszlo Ersek
int tap_set_sndbuf(int fd, const NetdevTapOptions *tap);
41 dc69004c Mark McLoughlin
int tap_probe_vnet_hdr(int fd);
42 445d892f Michael S. Tsirkin
int tap_probe_vnet_hdr_len(int fd, int len);
43 9c282718 Mark McLoughlin
int tap_probe_has_ufo(int fd);
44 1faac1f7 Mark McLoughlin
void tap_fd_set_offload(int fd, int csum, int tso4, int tso6, int ecn, int ufo);
45 445d892f Michael S. Tsirkin
void tap_fd_set_vnet_hdr_len(int fd, int len);
46 94fdc6d0 Jason Wang
int tap_fd_enable(int fd);
47 94fdc6d0 Jason Wang
int tap_fd_disable(int fd);
48 e5dc0b40 Jason Wang
int tap_fd_get_ifname(int fd, char *ifname);
49 15ac913b Mark McLoughlin
50 1422e32d Paolo Bonzini
#endif /* QEMU_TAP_H */