aboutgitcodebugslistschat
path: root/passt.h
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2021-05-21 11:14:47 +0200
committerStefano Brivio <sbrivio@redhat.com>2021-05-21 11:14:47 +0200
commit9010054ea4ceee9105aa938f15b79a3a91ec5969 (patch)
treef9f1ca6a2b506d6b4b2f1fdb210e702d016fecf8 /passt.h
parent0231ac1c86578a8dac2ae6531d30c71ba89688e1 (diff)
downloadpasst-9010054ea4ceee9105aa938f15b79a3a91ec5969.tar
passt-9010054ea4ceee9105aa938f15b79a3a91ec5969.tar.gz
passt-9010054ea4ceee9105aa938f15b79a3a91ec5969.tar.bz2
passt-9010054ea4ceee9105aa938f15b79a3a91ec5969.tar.lz
passt-9010054ea4ceee9105aa938f15b79a3a91ec5969.tar.xz
passt-9010054ea4ceee9105aa938f15b79a3a91ec5969.tar.zst
passt-9010054ea4ceee9105aa938f15b79a3a91ec5969.zip
dhcp, ndp, dhcpv6: Support for multiple DNS servers, search list
Add support for a variable amount of DNS servers, including zero, from /etc/resolv.conf, in DHCP, NDP and DHCPv6 implementations. Introduce support for domain search list for DHCP (RFC 3397), NDP (RFC 8106), and DHCPv6 (RFC 3646), also sourced from /etc/resolv.conf. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'passt.h')
-rw-r--r--passt.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/passt.h b/passt.h
index 22a91d6..bfbdc06 100644
--- a/passt.h
+++ b/passt.h
@@ -20,6 +20,12 @@ struct tap_msg {
#include "tcp.h"
#include "udp.h"
+#include <resolv.h> /* For MAXNS below */
+
+struct fqdn {
+ char n[NS_MAXDNAME];
+};
+
/**
* struct ctx - Execution context
* @epollfd: file descriptor for epoll instance
@@ -31,13 +37,14 @@ struct tap_msg {
* @addr4_seen: Latest IPv4 address seen as source from tap
* @mask4: IPv4 netmask, network order
* @gw4: Default IPv4 gateway, network order
- * @dns4: IPv4 DNS address, network order
+ * @dns4: IPv4 DNS addresses, zero-terminated, network order
+ * @dns_search: DNS search list
* @v6: Enable IPv6 transport
* @addr6: IPv6 address for external, routable interface
* @addr6_seen: Latest IPv6 global/site address seen as source from tap
* @addr6_ll_seen: Latest IPv6 link-local address seen as source from tap
* @gw6: Default IPv6 gateway
- * @dns4: IPv6 DNS address
+ * @dns4: IPv4 DNS addresses, zero-terminated
* @ifn: Name of routable interface
*/
struct ctx {
@@ -51,14 +58,16 @@ struct ctx {
uint32_t addr4_seen;
uint32_t mask4;
uint32_t gw4;
- uint32_t dns4;
+ uint32_t dns4[MAXNS + 1];
+
+ struct fqdn dns_search[MAXDNSRCH];
int v6;
struct in6_addr addr6;
struct in6_addr addr6_seen;
struct in6_addr addr6_ll_seen;
struct in6_addr gw6;
- struct in6_addr dns6;
+ struct in6_addr dns6[MAXNS + 1];
char ifn[IF_NAMESIZE];