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>
This commit is contained in:
parent
f6d9787d30
commit
b93c2c1713
16 changed files with 28 additions and 24 deletions
2
arp.c
2
arp.c
|
@ -23,8 +23,6 @@
|
|||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <linux/ipv6.h>
|
||||
|
||||
#include "util.h"
|
||||
#include "arp.h"
|
||||
#include "dhcp.h"
|
||||
|
|
2
conf.c
2
conf.c
|
@ -31,8 +31,6 @@
|
|||
#include <netinet/in.h>
|
||||
#include <netinet/if_ether.h>
|
||||
|
||||
#include <linux/ipv6.h>
|
||||
|
||||
#include "util.h"
|
||||
#include "passt.h"
|
||||
#include "netlink.h"
|
||||
|
|
2
dhcp.c
2
dhcp.c
|
@ -23,8 +23,6 @@
|
|||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <linux/ipv6.h>
|
||||
|
||||
#include "util.h"
|
||||
#include "checksum.h"
|
||||
#include "passt.h"
|
||||
|
|
2
dhcpv6.c
2
dhcpv6.c
|
@ -25,8 +25,6 @@
|
|||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <linux/ipv6.h>
|
||||
|
||||
#include "util.h"
|
||||
#include "passt.h"
|
||||
#include "tap.h"
|
||||
|
|
1
icmp.c
1
icmp.c
|
@ -30,7 +30,6 @@
|
|||
#include <time.h>
|
||||
|
||||
#include <linux/icmpv6.h>
|
||||
#include <linux/ipv6.h>
|
||||
|
||||
#include "util.h"
|
||||
#include "passt.h"
|
||||
|
|
1
ndp.c
1
ndp.c
|
@ -24,7 +24,6 @@
|
|||
#include <net/if_arp.h>
|
||||
#include <netinet/if_ether.h>
|
||||
|
||||
#include <linux/ipv6.h>
|
||||
#include <linux/icmpv6.h>
|
||||
|
||||
#include "checksum.h"
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include <netinet/in.h>
|
||||
#include <netinet/if_ether.h>
|
||||
|
||||
#include <linux/ipv6.h>
|
||||
#include <linux/netlink.h>
|
||||
#include <linux/rtnetlink.h>
|
||||
|
||||
|
|
1
passt.c
1
passt.c
|
@ -54,7 +54,6 @@
|
|||
#include <linux/audit.h>
|
||||
#include <linux/filter.h>
|
||||
#include <linux/capability.h>
|
||||
#include <linux/ipv6.h>
|
||||
#include <linux/icmpv6.h>
|
||||
|
||||
#include "seccomp.h"
|
||||
|
|
2
pasta.c
2
pasta.c
|
@ -35,8 +35,6 @@
|
|||
#include <net/ethernet.h>
|
||||
#include <sys/syscall.h>
|
||||
|
||||
#include <linux/ipv6.h>
|
||||
|
||||
#include "util.h"
|
||||
#include "passt.h"
|
||||
#include "netlink.h"
|
||||
|
|
2
pcap.c
2
pcap.c
|
@ -28,8 +28,6 @@
|
|||
#include <unistd.h>
|
||||
#include <net/if.h>
|
||||
|
||||
#include <linux/ipv6.h>
|
||||
|
||||
#include "util.h"
|
||||
#include "passt.h"
|
||||
|
||||
|
|
2
qrap.c
2
qrap.c
|
@ -26,8 +26,6 @@
|
|||
#include <netinet/in.h>
|
||||
#include <netinet/if_ether.h>
|
||||
|
||||
#include <linux/ipv6.h>
|
||||
|
||||
#include "util.h"
|
||||
#include "passt.h"
|
||||
#include "arp.h"
|
||||
|
|
1
tap.c
1
tap.c
|
@ -40,7 +40,6 @@
|
|||
#include <netinet/if_ether.h>
|
||||
|
||||
#include <linux/if_tun.h>
|
||||
#include <linux/ipv6.h>
|
||||
#include <linux/icmpv6.h>
|
||||
|
||||
#include "checksum.h"
|
||||
|
|
1
tcp.c
1
tcp.c
|
@ -328,7 +328,6 @@
|
|||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <linux/ipv6.h>
|
||||
#include <linux/tcp.h> /* For struct tcp_info */
|
||||
|
||||
#include "checksum.h"
|
||||
|
|
2
udp.c
2
udp.c
|
@ -110,8 +110,6 @@
|
|||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <linux/ipv6.h>
|
||||
|
||||
#include "checksum.h"
|
||||
#include "util.h"
|
||||
#include "passt.h"
|
||||
|
|
2
util.c
2
util.c
|
@ -32,8 +32,6 @@
|
|||
#include <time.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <linux/ipv6.h>
|
||||
|
||||
#include "util.h"
|
||||
#include "passt.h"
|
||||
|
||||
|
|
28
util.h
28
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);
|
||||
|
|
Loading…
Reference in a new issue