2024-03-11 23:37:21 +00:00
|
|
|
/* $Id: options.h,v 1.35 2024/03/11 23:17:56 nanard Exp $ */
|
2018-07-06 12:16:49 +00:00
|
|
|
/* vim: tabstop=4 shiftwidth=4 noexpandtab
|
|
|
|
* MiniUPnP project
|
2020-04-09 18:41:14 +00:00
|
|
|
* http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
|
2011-09-28 19:13:20 +00:00
|
|
|
* author: Ryan Wagoner
|
2024-03-11 23:37:21 +00:00
|
|
|
* (c) 2006-2024 Thomas Bernard
|
2011-09-28 19:13:20 +00:00
|
|
|
* This software is subject to the conditions detailed
|
|
|
|
* in the LICENCE file provided within the distribution */
|
|
|
|
|
2012-09-20 20:52:51 +00:00
|
|
|
#ifndef OPTIONS_H_INCLUDED
|
|
|
|
#define OPTIONS_H_INCLUDED
|
2011-09-28 19:13:20 +00:00
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2012-06-29 19:39:34 +00:00
|
|
|
#ifndef DISABLE_CONFIG_FILE
|
2011-09-28 19:13:20 +00:00
|
|
|
/* enum of option available in the miniupnpd.conf */
|
|
|
|
enum upnpconfigoptions {
|
|
|
|
UPNP_INVALID = 0,
|
|
|
|
UPNPEXT_IFNAME = 1, /* ext_ifname */
|
2019-05-21 08:42:40 +00:00
|
|
|
#ifdef ENABLE_IPV6
|
|
|
|
UPNPEXT_IFNAME6, /* ext_ifname6 */
|
|
|
|
#endif
|
2011-09-28 19:13:20 +00:00
|
|
|
UPNPEXT_IP, /* ext_ip */
|
2018-05-19 11:32:42 +00:00
|
|
|
UPNPEXT_PERFORM_STUN, /* ext_perform_stun */
|
|
|
|
UPNPEXT_STUN_HOST, /* ext_stun_host */
|
|
|
|
UPNPEXT_STUN_PORT, /* ext_stun_port */
|
2011-09-28 19:13:20 +00:00
|
|
|
UPNPLISTENING_IP, /* listening_ip */
|
2014-05-20 12:43:47 +00:00
|
|
|
#ifdef ENABLE_IPV6
|
|
|
|
UPNPIPV6_LISTENING_IP, /* listening address for IPv6 */
|
2020-04-09 18:41:14 +00:00
|
|
|
UPNPIPV6_DISABLE, /* ipv6_disable */
|
2014-05-20 12:43:47 +00:00
|
|
|
#endif /* ENABLE_IPV6 */
|
2014-04-20 16:06:00 +00:00
|
|
|
UPNPPORT, /* "port" / "http_port" */
|
|
|
|
#ifdef ENABLE_HTTPS
|
|
|
|
UPNPHTTPSPORT, /* "https_port" */
|
|
|
|
#endif
|
2011-09-28 19:13:20 +00:00
|
|
|
UPNPBITRATE_UP, /* "bitrate_up" */
|
|
|
|
UPNPBITRATE_DOWN, /* "bitrate_down" */
|
|
|
|
UPNPPRESENTATIONURL, /* presentation_url */
|
2013-12-13 11:03:28 +00:00
|
|
|
#ifdef ENABLE_MANUFACTURER_INFO_CONFIGURATION
|
2012-02-04 23:24:13 +00:00
|
|
|
UPNPFRIENDLY_NAME, /* "friendly_name" */
|
2013-10-20 21:02:19 +00:00
|
|
|
UPNPMANUFACTURER_NAME, /* "manufacturer_name" */
|
|
|
|
UPNPMANUFACTURER_URL, /* "manufacturer_url" */
|
|
|
|
UPNPMODEL_NAME, /* "model_name" */
|
|
|
|
UPNPMODEL_DESCRIPTION, /* "model_description" */
|
|
|
|
UPNPMODEL_URL, /* "model_url" */
|
2013-12-13 11:03:28 +00:00
|
|
|
#endif
|
2011-09-28 19:13:20 +00:00
|
|
|
UPNPNOTIFY_INTERVAL, /* notify_interval */
|
|
|
|
UPNPSYSTEM_UPTIME, /* "system_uptime" */
|
|
|
|
UPNPPACKET_LOG, /* "packet_log" */
|
|
|
|
UPNPUUID, /* uuid */
|
|
|
|
UPNPSERIAL, /* serial */
|
|
|
|
UPNPMODEL_NUMBER, /* model_number */
|
|
|
|
UPNPCLEANTHRESHOLD, /* clean_ruleset_threshold */
|
|
|
|
UPNPCLEANINTERVAL, /* clean_ruleset_interval */
|
|
|
|
UPNPENABLENATPMP, /* enable_natpmp */
|
2013-07-09 13:36:53 +00:00
|
|
|
UPNPPCPMINLIFETIME, /* minimum lifetime for PCP mapping */
|
|
|
|
UPNPPCPMAXLIFETIME, /* maximum lifetime for PCP mapping */
|
2014-05-03 04:04:45 +00:00
|
|
|
UPNPPCPALLOWTHIRDPARTY, /* allow third-party requests */
|
2011-09-28 19:13:20 +00:00
|
|
|
#ifdef USE_NETFILTER
|
2021-08-18 15:46:29 +00:00
|
|
|
UPNPTABLENAME,
|
|
|
|
UPNPNATTABLENAME,
|
2011-09-28 19:13:20 +00:00
|
|
|
UPNPFORWARDCHAIN,
|
|
|
|
UPNPNATCHAIN,
|
2016-01-26 15:59:04 +00:00
|
|
|
UPNPNATPOSTCHAIN,
|
2024-03-01 09:20:28 +00:00
|
|
|
UPNPNFFAMILYSPLIT,
|
2011-09-28 19:13:20 +00:00
|
|
|
#endif
|
|
|
|
#ifdef USE_PF
|
2012-02-03 12:14:10 +00:00
|
|
|
UPNPANCHOR, /* anchor */
|
2011-09-28 19:13:20 +00:00
|
|
|
UPNPQUEUE, /* queue */
|
|
|
|
UPNPTAG, /* tag */
|
|
|
|
#endif
|
|
|
|
#ifdef PF_ENABLE_FILTER_RULES
|
|
|
|
UPNPQUICKRULES, /* quickrules */
|
|
|
|
#endif
|
|
|
|
UPNPSECUREMODE, /* secure_mode */
|
|
|
|
#ifdef ENABLE_LEASEFILE
|
|
|
|
UPNPLEASEFILE, /* lease_file */
|
2021-08-17 07:19:33 +00:00
|
|
|
#ifdef ENABLE_UPNPPINHOLE
|
|
|
|
UPNPLEASEFILE6, /* lease_file v6 */
|
|
|
|
#endif
|
2011-09-28 19:13:20 +00:00
|
|
|
#endif
|
|
|
|
UPNPMINISSDPDSOCKET, /* minissdpdsocket */
|
2018-02-20 06:14:05 +00:00
|
|
|
#ifdef IGD_V2
|
|
|
|
UPNPFORCEIGDDESCV1,
|
|
|
|
#endif
|
2011-09-28 19:13:20 +00:00
|
|
|
UPNPENABLE /* enable_upnp */
|
|
|
|
};
|
|
|
|
|
|
|
|
/* readoptionsfile()
|
|
|
|
* parse and store the option file values
|
|
|
|
* returns: 0 success, -1 failure */
|
|
|
|
int
|
2021-06-17 22:21:16 +00:00
|
|
|
readoptionsfile(const char * fname, int debug_flag);
|
2011-09-28 19:13:20 +00:00
|
|
|
|
2012-03-01 01:44:38 +00:00
|
|
|
/* freeoptions()
|
2011-09-28 19:13:20 +00:00
|
|
|
* frees memory allocated to option values */
|
|
|
|
void
|
|
|
|
freeoptions(void);
|
|
|
|
|
|
|
|
struct option
|
|
|
|
{
|
|
|
|
enum upnpconfigoptions id;
|
2012-02-05 00:31:27 +00:00
|
|
|
const char * value;
|
2011-09-28 19:13:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern struct option * ary_options;
|
2012-05-01 09:52:21 +00:00
|
|
|
extern unsigned int num_options;
|
2011-09-28 19:13:20 +00:00
|
|
|
|
2012-06-29 19:39:34 +00:00
|
|
|
#endif /* DISABLE_CONFIG_FILE */
|
|
|
|
|
2012-09-20 20:52:51 +00:00
|
|
|
#endif /* OPTIONS_H_INCLUDED */
|