summaryrefslogtreecommitdiff
path: root/src/shared/in-addr-util.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-01-13 13:47:08 +0100
committerLennart Poettering <lennart@poettering.net>2015-01-13 13:55:15 +0100
commit5a8bcb674f71a20e95df55319b34c556638378ce (patch)
treedb1de9b03cb9bf4c017a0f620cf9d310c9de6098 /src/shared/in-addr-util.h
parent76917807eb50ccde58901e8bec7ed3d408d1cc22 (diff)
networkd: add minimal IP forwarding and masquerading support to .network files
This adds two new settings to networkd's .network files: IPForwarding=yes and IPMasquerade=yes. The former controls the "forwarding" sysctl setting of the interface, thus controlling whether IP forwarding shall be enabled on the specific interface. The latter controls whether a firewall rule shall be installed that exposes traffic coming from the interface as coming from the local host to all other interfaces. This also enables both options by default for container network interfaces, thus making "systemd-nspawn --network-veth" have network connectivity out of the box.
Diffstat (limited to 'src/shared/in-addr-util.h')
-rw-r--r--src/shared/in-addr-util.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/shared/in-addr-util.h b/src/shared/in-addr-util.h
index 4cf4418b4b..51af08868c 100644
--- a/src/shared/in-addr-util.h
+++ b/src/shared/in-addr-util.h
@@ -43,8 +43,11 @@ unsigned char in_addr_netmask_to_prefixlen(const struct in_addr *addr);
struct in_addr* in_addr_prefixlen_to_netmask(struct in_addr *addr, unsigned char prefixlen);
int in_addr_default_prefixlen(const struct in_addr *addr, unsigned char *prefixlen);
int in_addr_default_subnet_mask(const struct in_addr *addr, struct in_addr *mask);
+int in_addr_mask(int family, union in_addr_union *addr, unsigned char prefixlen);
static inline size_t FAMILY_ADDRESS_SIZE(int family) {
assert(family == AF_INET || family == AF_INET6);
return family == AF_INET6 ? 16 : 4;
}
+
+#define IN_ADDR_NULL ((union in_addr_union) {})