aboutgitcodebugslistschat
path: root/util.h
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2022-01-25 19:03:44 +0100
committerStefano Brivio <sbrivio@redhat.com>2022-01-26 07:57:09 +0100
commitb93c2c1713edf28815bb4057d04ff2dfb892c307 (patch)
tree4fc8639c6508f17428e2a057daf30bc7c1f28215 /util.h
parentf6d9787d30c6a58ea6c4c1612b89f4bd5dd8cb68 (diff)
downloadpasst-b93c2c1713edf28815bb4057d04ff2dfb892c307.tar
passt-b93c2c1713edf28815bb4057d04ff2dfb892c307.tar.gz
passt-b93c2c1713edf28815bb4057d04ff2dfb892c307.tar.bz2
passt-b93c2c1713edf28815bb4057d04ff2dfb892c307.tar.lz
passt-b93c2c1713edf28815bb4057d04ff2dfb892c307.tar.xz
passt-b93c2c1713edf28815bb4057d04ff2dfb892c307.tar.zst
passt-b93c2c1713edf28815bb4057d04ff2dfb892c307.zip
passt: Drop <linux/ipv6.h> include, carry own ipv6hdr and opt_hdr definitions
This is the only remaining Linux-specific include -- drop it to avoid clang-tidy warnings and to make code more portable. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'util.h')
-rw-r--r--util.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/util.h b/util.h
index 0d50868..44c85db 100644
--- a/util.h
+++ b/util.h
@@ -149,6 +149,34 @@ enum bind_type {
struct ctx;
+struct ipv6hdr {
+#pragma GCC diagnostic ignored "-Wpedantic"
+#if __BYTE_ORDER == __BIG_ENDIAN
+ __u8 version:4,
+ priority:4;
+#else
+ uint8_t priority:4,
+ version:4;
+#endif
+#pragma GCC diagnostic pop
+ uint8_t flow_lbl[3];
+
+ __be16 payload_len;
+ __u8 nexthdr;
+ __u8 hop_limit;
+
+ struct in6_addr saddr;
+ struct in6_addr daddr;
+};
+
+struct ipv6_opt_hdr {
+ __u8 nexthdr;
+ __u8 hdrlen;
+ /*
+ * TLV encoded option data follows.
+ */
+} __attribute__((packed)); /* required for some archs */
+
__attribute__ ((weak)) int ffsl(long int i) { return __builtin_ffsl(i); }
void __openlog(const char *ident, int option, int facility);
void passt_vsyslog(int pri, const char *format, va_list ap);