From 9010054ea4ceee9105aa938f15b79a3a91ec5969 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Fri, 21 May 2021 11:14:47 +0200 Subject: 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 --- util.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'util.h') diff --git a/util.h b/util.h index fe129ee..7d0704c 100644 --- a/util.h +++ b/util.h @@ -22,11 +22,16 @@ void debug(const char *format, ...); CHECK_SET_MIN_MAX(c->proto_ctx.fd_, (fd)); \ } while (0) +#ifndef MIN #define MIN(x, y) (((x) < (y)) ? (x) : (y)) +#endif +#ifndef MAX #define MAX(x, y) (((x) > (y)) ? (x) : (y)) +#endif -#define IN_INTERVAL(a, b, x) ((x) >= (a) && (x) <= (b)) +#define ARRAY_SIZE(a) ((int)(sizeof(a) / sizeof((a)[0]))) +#define IN_INTERVAL(a, b, x) ((x) >= (a) && (x) <= (b)) #define FD_PROTO(x, proto) \ (IN_INTERVAL(c->proto.fd_min, c->proto.fd_max, (x))) -- cgit v1.2.3