aboutgitcodebugslistschat
path: root/util.h
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2021-07-26 14:10:29 +0200
committerStefano Brivio <sbrivio@redhat.com>2021-07-26 14:10:29 +0200
commit86b273150a47c6f5783db865d1385675f5c4e5a6 (patch)
treebc0011bc64f00a519817eb7b74a7d20664f8e3fb /util.h
parentf4aaa471a1d304b0b6c767ef4b2fb88b45c02ef1 (diff)
downloadpasst-86b273150a47c6f5783db865d1385675f5c4e5a6.tar
passt-86b273150a47c6f5783db865d1385675f5c4e5a6.tar.gz
passt-86b273150a47c6f5783db865d1385675f5c4e5a6.tar.bz2
passt-86b273150a47c6f5783db865d1385675f5c4e5a6.tar.lz
passt-86b273150a47c6f5783db865d1385675f5c4e5a6.tar.xz
passt-86b273150a47c6f5783db865d1385675f5c4e5a6.tar.zst
passt-86b273150a47c6f5783db865d1385675f5c4e5a6.zip
tcp, udp: Allow binding ports in init namespace to both tap and loopback
Traffic with loopback source address will be forwarded to the direct loopback connection in the namespace, and the tap interface is used for the rest. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'util.h')
-rw-r--r--util.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/util.h b/util.h
index 1c11474..90d7f7c 100644
--- a/util.h
+++ b/util.h
@@ -115,11 +115,17 @@ void debug(const char *format, ...);
#include <linux/ip.h>
#include <limits.h>
+enum bind_type {
+ BIND_ANY = 0,
+ BIND_LOOPBACK,
+ BIND_EXT,
+};
+
struct ctx;
char *ipv6_l4hdr(struct ipv6hdr *ip6h, uint8_t *proto);
-int sock_l4(struct ctx *c, int af, uint8_t proto, uint16_t port, int lo,
- uint32_t data);
+int sock_l4(struct ctx *c, int af, uint8_t proto, uint16_t port,
+ enum bind_type bind_addr, uint32_t data);
int timespec_diff_ms(struct timespec *a, struct timespec *b);
void bitmap_set(uint8_t *map, int bit);
void bitmap_clear(uint8_t *map, int bit);