From: Christopher Faulet Date: Thu, 25 Feb 2021 17:50:02 +0000 (+0100) Subject: MINOR: tools: Add net_addr structure describing a network addess X-Git-Tag: v2.4-dev10~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=01f02a4d84d155ef9480ccb8cf8cf97ce0918b25;p=thirdparty%2Fhaproxy.git MINOR: tools: Add net_addr structure describing a network addess The net_addr structure describes a IPv4 or IPv6 address. Its ip and mask are represented. Among other things, this structure will be used to add support of IPv6 for "except" parameter of "forwardfor" and "originalto" options. --- diff --git a/include/haproxy/tools-t.h b/include/haproxy/tools-t.h index 34f79bea8a..488b90d863 100644 --- a/include/haproxy/tools-t.h +++ b/include/haproxy/tools-t.h @@ -142,4 +142,18 @@ struct name_desc { const char *desc; }; +struct net_addr { + int family; /* AF_INET or AF_INET6 if defined, AF_UNSET if undefined */ + union { + struct { + struct in_addr ip; + struct in_addr mask; + } v4; + struct { + struct in6_addr ip; + struct in6_addr mask; + } v6; + } addr; +}; + #endif /* _HAPROXY_TOOLS_T_H */