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