fb5d1c5d7d
Callers of tap_send() can optionally use a small optimization by adding extra space for the 4 byte length header used on the qemu socket interface. tap_ip_send() is currently the only user of this, but this is used only for "slow path" ICMP and DHCP packets, so there's not a lot of value to the optimization. Worse, having the two paths here complicates the interface and makes future cleanups difficult, so just remove it. I have some plans to bring back the optimization in a more general way in future, but for now it's just in the way. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
19 lines
641 B
C
19 lines
641 B
C
/* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
* Copyright (c) 2021 Red Hat GmbH
|
|
* Author: Stefano Brivio <sbrivio@redhat.com>
|
|
*/
|
|
|
|
#ifndef TAP_H
|
|
#define TAP_H
|
|
|
|
in_addr_t tap_ip4_daddr(const struct ctx *c);
|
|
const struct in6_addr *tap_ip6_daddr(const struct ctx *c,
|
|
const struct in6_addr *src);
|
|
void tap_ip_send(const struct ctx *c, const struct in6_addr *src, uint8_t proto,
|
|
const char *in, size_t len, uint32_t flow);
|
|
int tap_send(const struct ctx *c, const void *data, size_t len);
|
|
void tap_handler(struct ctx *c, int fd, uint32_t events,
|
|
const struct timespec *now);
|
|
void tap_sock_init(struct ctx *c);
|
|
|
|
#endif /* TAP_H */
|