# -----------------------------------------------------------------------------
-if HAVE_LIBIPTC
-noinst_LTLIBRARIES += \
- libsystemd-fw.la
-
-libsystemd_fw_la_SOURCES = \
- src/shared/fw-util.h \
- src/shared/fw-util.c
-
-libsystemd_fw_la_CFLAGS = \
- $(AM_CFLAGS) \
- $(LIBIPTC_CFLAGS)
-
-libsystemd_fw_la_LIBADD = \
- $(LIBIPTC_LIBS)
-endif
-
-# -----------------------------------------------------------------------------
-
if ENABLE_LDCONFIG
dist_systemunit_DATA += \
units/ldconfig.service
test-ipcrm \
test-btrfs
-if HAVE_LIBIPTC
-manual_tests += \
- test-fw-util
-endif
-
if HAVE_KMOD
manual_tests += \
test-rtnl-manual
libsystemd-label.la \
libsystemd-shared.la
-if HAVE_LIBIPTC
-test_fw_util_SOURCES = \
- src/test/test-fw-util.c
-
-test_fw_util_CFLAGS = \
- $(AM_CFLAGS) \
- $(LIBIPTC_CFLAGS)
-
-test_fw_util_LDADD = \
- libsystemd-fw.la \
- libsystemd-shared.la \
- $(LIBIPTC_LIBS)
-endif
-
test_rtnl_manual_SOURCES = \
src/test/test-rtnl-manual.c
$(SECCOMP_LIBS)
endif
-if HAVE_LIBIPTC
-systemd_nspawn_LDADD += \
- libsystemd-fw.la
-endif
-
# ------------------------------------------------------------------------------
systemd_run_SOURCES = \
src/run/run.c
systemd_networkd_LDADD = \
libsystemd-networkd-core.la
-if HAVE_LIBIPTC
-systemd_networkd_LDADD += \
- libsystemd-fw.la
-endif
-
noinst_LTLIBRARIES += \
libsystemd-networkd-core.la
test_network_LDADD = \
libsystemd-networkd-core.la
-if HAVE_LIBIPTC
-test_network_LDADD += \
- libsystemd-fw.la
-endif
-
test_network_tables_SOURCES = \
src/network/test-network-tables.c \
src/shared/test-tables.h
libsystemd-networkd-core.la \
libudev-core.la
-if HAVE_LIBIPTC
-test_network_tables_LDADD += \
- libsystemd-fw.la
-endif
-
tests += \
test-network \
test-network-tables
fi
AM_CONDITIONAL(HAVE_LIBIDN, [test "$have_libidn" = "yes"])
-# ------------------------------------------------------------------------------
-have_libiptc=no
-AC_ARG_ENABLE(libiptc, AS_HELP_STRING([--disable-libiptc], [Disable optional LIBIPTC support]))
-if test "x$enable_libiptc" != "xno"; then
- PKG_CHECK_MODULES(LIBIPTC, [libiptc],
- [AC_DEFINE(HAVE_LIBIPTC, 1, [Define if libiptc is available])
- have_libiptc=yes
- M4_DEFINES="$M4_DEFINES -DHAVE_LIBIPTC"],
- [have_libiptc=no])
- if test "x$have_libiptc" = "xno" -a "x$enable_libiptc" = "xyes"; then
- AC_MSG_ERROR([*** libiptc support requested but libraries not found])
- fi
-fi
-AM_CONDITIONAL(HAVE_LIBIPTC, [test "$have_libiptc" = "yes"])
-
# ------------------------------------------------------------------------------
have_binfmt=no
AC_ARG_ENABLE(binfmt, AS_HELP_STRING([--disable-binfmt], [disable binfmt tool]))
GNUTLS: ${have_gnutls}
libcurl: ${have_libcurl}
libidn: ${have_libidn}
- libiptc: ${have_libiptc}
ELFUTILS: ${have_elfutils}
binfmt: ${have_binfmt}
vconsole: ${have_vconsole}
+++ /dev/null
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
-#pragma once
-
-/***
- This file is part of systemd.
-
- Copyright 2015 Lennart Poettering
-
- systemd is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 of the License, or
- (at your option) any later version.
-
- systemd is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with systemd; If not, see <http://www.gnu.org/licenses/>.
-***/
-
-#include "in-addr-util.h"
-
-#ifdef HAVE_LIBIPTC
-
-int fw_add_masquerade(
- bool add,
- int af,
- int protocol,
- const union in_addr_union *source,
- unsigned source_prefixlen,
- const char *out_interface,
- const union in_addr_union *destination,
- unsigned destination_prefixlen);
-
-int fw_add_local_dnat(
- bool add,
- int af,
- int protocol,
- const char *in_interface,
- const union in_addr_union *source,
- unsigned source_prefixlen,
- const union in_addr_union *destination,
- unsigned destination_prefixlen,
- uint16_t local_port,
- const union in_addr_union *remote,
- uint16_t remote_port,
- const union in_addr_union *previous_remote);
-
-#else
-
-static inline int fw_add_masquerade(
- bool add,
- int af,
- int protocol,
- const union in_addr_union *source,
- unsigned source_prefixlen,
- const char *out_interface,
- const union in_addr_union *destination,
- unsigned destination_prefixlen) {
- return -EOPNOTSUPP;
-}
-
-static inline int fw_add_local_dnat(
- bool add,
- int af,
- int protocol,
- const char *in_interface,
- const union in_addr_union *source,
- unsigned source_prefixlen,
- const union in_addr_union *destination,
- unsigned destination_prefixlen,
- uint16_t local_port,
- const union in_addr_union *remote,
- uint16_t remote_port,
- const union in_addr_union *previous_remote) {
- return -EOPNOTSUPP;
-}
-
-#endif