From 19d254bbbb3ab319d15891ff7287f5182980c105 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Fri, 21 May 2021 11:14:51 +0200 Subject: passt: Add support for multiple instances in different network namespaces ...sharing the same filesystem. Instead of a fixed path for the UNIX domain socket, passt now uses a path with a counter, probing for existing instances, and picking the first free one. The demo script is updated accordingly -- it can now be started several times to create multiple namespaces with an instance of passt each, with addressing reflecting separate subnets, and NDP proxying between them. Signed-off-by: Stefano Brivio --- util.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'util.h') diff --git a/util.h b/util.h index 7d0704c..3e24c9a 100644 --- a/util.h +++ b/util.h @@ -29,6 +29,9 @@ void debug(const char *format, ...); #define MAX(x, y) (((x) > (y)) ? (x) : (y)) #endif +#define STRINGIFY(x) #x +#define STR(x) STRINGIFY(x) + #define ARRAY_SIZE(a) ((int)(sizeof(a) / sizeof((a)[0]))) #define IN_INTERVAL(a, b, x) ((x) >= (a) && (x) <= (b)) @@ -37,6 +40,10 @@ void debug(const char *format, ...); #define PORT_IS_EPHEMERAL(port) ((port) >= (1 << 15) + (1 << 14)) /* RFC 6335 */ +#include +#include +#include + uint16_t csum_fold(uint32_t sum); uint16_t csum_ip4(void *buf, size_t len); void csum_tcp4(struct iphdr *iph); -- cgit v1.2.3