diff options
author | Laurent Vivier <lvivier@redhat.com> | 2024-06-13 14:36:50 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2024-06-13 15:45:19 +0200 |
commit | 9ecf7fedc5bd9cef6e3b90e67e8a21f5074cfea7 (patch) | |
tree | d5a0e348eae7dfeadbe8ff07198383e9284bfc8c /tap.h | |
parent | fba2b544b6c60904ac1818fba44aa86772e40ebf (diff) | |
download | passt-9ecf7fedc5bd9cef6e3b90e67e8a21f5074cfea7.tar passt-9ecf7fedc5bd9cef6e3b90e67e8a21f5074cfea7.tar.gz passt-9ecf7fedc5bd9cef6e3b90e67e8a21f5074cfea7.tar.bz2 passt-9ecf7fedc5bd9cef6e3b90e67e8a21f5074cfea7.tar.lz passt-9ecf7fedc5bd9cef6e3b90e67e8a21f5074cfea7.tar.xz passt-9ecf7fedc5bd9cef6e3b90e67e8a21f5074cfea7.tar.zst passt-9ecf7fedc5bd9cef6e3b90e67e8a21f5074cfea7.zip |
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 <lvivier@redhat.com>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tap.h')
-rw-r--r-- | tap.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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 */ |