n2n/include/n2n_port_mapping.h
Hamish Coleman 4f568b03c1
Autoconf simplification (#927)
* Convert zstd feature to default disable

* All autoconf test use one standard template

To simplify the testing, cross-compilation and repeatable build process,
no configure options are automatically probed for - they all default to
off and are all using the same template.

The --with-x options should be deprecated and replaced with --enable-x
because there is no syntax checking for --with options in autoconf.

There are still some differences between the config options, but this
should provide a starting point.

* Remove unused code from the autoconf

* Remove warnings from default build

* Avoid calling port mapping functions if none are enabled

* Start with all builds in neutral config

* Add more missing code guards

* Adjust code guard location to placate cmake
2022-01-10 19:58:15 +00:00

33 lines
733 B
C

#ifndef _N2N_PORT_MAPPING_H_
#define _N2N_PORT_MAPPING_H_
#ifdef HAVE_PORT_FORWARDING
#include <stdint.h>
#ifdef HAVE_MINIUPNP
#ifdef CMAKE_BUILD
// CMAKE uses static linked lib as submodule which requires different includes than
// the dynamically linked, intalled library in case of plain make
#include <miniupnpc.h>
#include <upnpcommands.h>
#include <upnperrors.h>
#else
#include <miniupnpc/miniupnpc.h>
#include <miniupnpc/upnpcommands.h>
#include <miniupnpc/upnperrors.h>
#endif // CMAKE_BUILD
#endif // HAVE_MINIUPNP
#ifdef HAVE_NATPMP
#include "natpmp.h"
#endif // HAVE_NATPMP
void n2n_chg_port_mapping (struct n2n_edge *eee, const uint16_t port);
#endif // HAVE_PORT_FORWARDING
#endif // _N2N_PORT_MAPPING_H_