]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/shared/firewall-util.h
build-sys: use #if Y instead of #ifdef Y everywhere
[thirdparty/systemd.git] / src / shared / firewall-util.h
CommitLineData
76917807
LP
1#pragma once
2
3/***
4 This file is part of systemd.
5
6 Copyright 2015 Lennart Poettering
7
8 systemd is free software; you can redistribute it and/or modify it
9 under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 of the License, or
11 (at your option) any later version.
12
13 systemd is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public License
19 along with systemd; If not, see <http://www.gnu.org/licenses/>.
20***/
21
a8fbdf54
TA
22#include <stdbool.h>
23#include <stdint.h>
24
76917807
LP
25#include "in-addr-util.h"
26
349cc4a5 27#if HAVE_LIBIPTC
76917807
LP
28
29int fw_add_masquerade(
30 bool add,
31 int af,
32 int protocol,
33 const union in_addr_union *source,
34 unsigned source_prefixlen,
35 const char *out_interface,
36 const union in_addr_union *destination,
37 unsigned destination_prefixlen);
38
39int fw_add_local_dnat(
40 bool add,
41 int af,
42 int protocol,
43 const char *in_interface,
44 const union in_addr_union *source,
45 unsigned source_prefixlen,
46 const union in_addr_union *destination,
47 unsigned destination_prefixlen,
48 uint16_t local_port,
49 const union in_addr_union *remote,
50 uint16_t remote_port,
51 const union in_addr_union *previous_remote);
52
53#else
54
55static inline int fw_add_masquerade(
56 bool add,
57 int af,
58 int protocol,
59 const union in_addr_union *source,
60 unsigned source_prefixlen,
61 const char *out_interface,
62 const union in_addr_union *destination,
63 unsigned destination_prefixlen) {
15411c0c 64 return -EOPNOTSUPP;
76917807
LP
65}
66
67static inline int fw_add_local_dnat(
68 bool add,
69 int af,
70 int protocol,
71 const char *in_interface,
72 const union in_addr_union *source,
73 unsigned source_prefixlen,
74 const union in_addr_union *destination,
75 unsigned destination_prefixlen,
76 uint16_t local_port,
77 const union in_addr_union *remote,
78 uint16_t remote_port,
79 const union in_addr_union *previous_remote) {
15411c0c 80 return -EOPNOTSUPP;
76917807
LP
81}
82
83#endif