From 9ecf7fedc5bd9cef6e3b90e67e8a21f5074cfea7 Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Thu, 13 Jun 2024 14:36:50 +0200 Subject: tap: refactor packets handling functions Consolidate pool_tap4() and pool_tap6() into tap_flush_pools(), and tap4_handler() and tap6_handler() into tap_handler(). Create a generic tap_add_packet() to consolidate packet addition logic and reduce code duplication. The purpose is to ease the export of these functions to use them with the vhost-user backend. Signed-off-by: Laurent Vivier Signed-off-by: Stefano Brivio --- tap.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tap.h') diff --git a/tap.h b/tap.h index 2285a87..d496bd0 100644 --- a/tap.h +++ b/tap.h @@ -70,5 +70,8 @@ void tap_handler_passt(struct ctx *c, uint32_t events, const struct timespec *now); int tap_sock_unix_open(char *sock_path); void tap_sock_init(struct ctx *c); +void tap_flush_pools(void); +void tap_handler(struct ctx *c, const struct timespec *now); +void tap_add_packet(struct ctx *c, ssize_t l2len, char *p); #endif /* TAP_H */ -- cgit v1.2.3