]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/shared/firewall-util.h
resolved: rework parsing of /etc/hosts
[thirdparty/systemd.git] / src / shared / firewall-util.h
CommitLineData
53e1b683 1/* SPDX-License-Identifier: LGPL-2.1+ */
76917807
LP
2#pragma once
3
a8fbdf54
TA
4#include <stdbool.h>
5#include <stdint.h>
6
76917807
LP
7#include "in-addr-util.h"
8
349cc4a5 9#if HAVE_LIBIPTC
76917807
LP
10
11int fw_add_masquerade(
12 bool add,
13 int af,
14 int protocol,
15 const union in_addr_union *source,
16 unsigned source_prefixlen,
17 const char *out_interface,
18 const union in_addr_union *destination,
19 unsigned destination_prefixlen);
20
21int fw_add_local_dnat(
22 bool add,
23 int af,
24 int protocol,
25 const char *in_interface,
26 const union in_addr_union *source,
27 unsigned source_prefixlen,
28 const union in_addr_union *destination,
29 unsigned destination_prefixlen,
30 uint16_t local_port,
31 const union in_addr_union *remote,
32 uint16_t remote_port,
33 const union in_addr_union *previous_remote);
34
35#else
36
37static inline int fw_add_masquerade(
38 bool add,
39 int af,
40 int protocol,
41 const union in_addr_union *source,
42 unsigned source_prefixlen,
43 const char *out_interface,
44 const union in_addr_union *destination,
45 unsigned destination_prefixlen) {
15411c0c 46 return -EOPNOTSUPP;
76917807
LP
47}
48
49static inline int fw_add_local_dnat(
50 bool add,
51 int af,
52 int protocol,
53 const char *in_interface,
54 const union in_addr_union *source,
55 unsigned source_prefixlen,
56 const union in_addr_union *destination,
57 unsigned destination_prefixlen,
58 uint16_t local_port,
59 const union in_addr_union *remote,
60 uint16_t remote_port,
61 const union in_addr_union *previous_remote) {
15411c0c 62 return -EOPNOTSUPP;
76917807
LP
63}
64
65#endif