2018-01-16 01:06:46 +00:00
|
|
|
/* $Id: upnpglobalvars.h,v 1.45 2018/01/16 00:50:49 nanard Exp $ */
|
2017-05-27 08:25:53 +00:00
|
|
|
/* vim: tabstop=4 shiftwidth=4 noexpandtab
|
|
|
|
* MiniUPnP project
|
2018-01-16 01:06:46 +00:00
|
|
|
* http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
|
|
|
|
* (c) 2006-2018 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 UPNPGLOBALVARS_H_INCLUDED
|
|
|
|
#define UPNPGLOBALVARS_H_INCLUDED
|
2011-09-28 19:13:20 +00:00
|
|
|
|
|
|
|
#include <time.h>
|
|
|
|
#include "upnppermissions.h"
|
|
|
|
#include "miniupnpdtypes.h"
|
|
|
|
#include "config.h"
|
|
|
|
|
2018-01-09 01:32:39 +00:00
|
|
|
/* name of the network interface used to access internet */
|
2011-09-28 19:13:20 +00:00
|
|
|
extern const char * ext_if_name;
|
|
|
|
|
2018-05-19 11:32:42 +00:00
|
|
|
/* stun host/port configuration */
|
|
|
|
extern const char * ext_stun_host;
|
|
|
|
extern uint16_t ext_stun_port;
|
|
|
|
|
2011-09-28 19:13:20 +00:00
|
|
|
/* file to store all leases */
|
|
|
|
#ifdef ENABLE_LEASEFILE
|
|
|
|
extern const char * lease_file;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* forced ip address to use for this interface
|
|
|
|
* when NULL, getifaddr() is used */
|
|
|
|
extern const char * use_ext_ip_addr;
|
|
|
|
|
2018-05-19 11:32:04 +00:00
|
|
|
/* disallow all port forwarding requests when
|
|
|
|
* we are behind restrictive nat */
|
|
|
|
extern int disable_port_forwarding;
|
|
|
|
|
2011-09-28 19:13:20 +00:00
|
|
|
/* parameters to return to upnp client when asked */
|
|
|
|
extern unsigned long downstream_bitrate;
|
|
|
|
extern unsigned long upstream_bitrate;
|
|
|
|
|
|
|
|
/* statup time */
|
|
|
|
extern time_t startup_time;
|
2017-11-27 20:47:35 +00:00
|
|
|
#if defined(ENABLE_NATPMP) || defined(ENABLE_PCP)
|
|
|
|
/* origin for "epoch time" sent into NATPMP and PCP responses */
|
|
|
|
extern time_t epoch_origin;
|
|
|
|
#endif /* defined(ENABLE_NATPMP) || defined(ENABLE_PCP) */
|
2011-09-28 19:13:20 +00:00
|
|
|
|
2013-07-09 13:36:53 +00:00
|
|
|
extern unsigned long int min_lifetime;
|
|
|
|
extern unsigned long int max_lifetime;
|
|
|
|
|
2011-09-28 19:13:20 +00:00
|
|
|
/* runtime boolean flags */
|
|
|
|
extern int runtime_flags;
|
|
|
|
#define LOGPACKETSMASK 0x0001
|
|
|
|
#define SYSUPTIMEMASK 0x0002
|
|
|
|
#ifdef ENABLE_NATPMP
|
|
|
|
#define ENABLENATPMPMASK 0x0004
|
|
|
|
#endif
|
|
|
|
#define CHECKCLIENTIPMASK 0x0008
|
|
|
|
#define SECUREMODEMASK 0x0010
|
|
|
|
|
|
|
|
#define ENABLEUPNPMASK 0x0020
|
|
|
|
|
|
|
|
#ifdef PF_ENABLE_FILTER_RULES
|
|
|
|
#define PFNOQUICKRULESMASK 0x0040
|
|
|
|
#endif
|
2014-03-13 10:26:53 +00:00
|
|
|
#ifdef ENABLE_IPV6
|
|
|
|
#define IPV6DISABLEDMASK 0x0080
|
|
|
|
#endif
|
|
|
|
#ifdef ENABLE_6FC_SERVICE
|
|
|
|
#define IPV6FCFWDISABLEDMASK 0x0100
|
|
|
|
#define IPV6FCINBOUNDDISALLOWEDMASK 0x0200
|
|
|
|
#endif
|
2014-05-06 11:15:24 +00:00
|
|
|
#ifdef ENABLE_PCP
|
|
|
|
#define PCP_ALLOWTHIRDPARTYMASK 0x0400
|
|
|
|
#endif
|
2018-02-22 12:47:48 +00:00
|
|
|
#ifdef IGD_V2
|
|
|
|
#define FORCEIGDDESCV1MASK 0x0800
|
|
|
|
#endif
|
2011-09-28 19:13:20 +00:00
|
|
|
|
2018-05-19 11:32:42 +00:00
|
|
|
#define PERFORMSTUN 0x1000
|
|
|
|
|
2011-09-28 19:13:20 +00:00
|
|
|
#define SETFLAG(mask) runtime_flags |= mask
|
|
|
|
#define GETFLAG(mask) (runtime_flags & mask)
|
|
|
|
#define CLEARFLAG(mask) runtime_flags &= ~mask
|
|
|
|
|
|
|
|
extern const char * pidfilename;
|
|
|
|
|
2013-06-13 14:03:36 +00:00
|
|
|
extern char uuidvalue_igd[]; /* uuid of root device (IGD) */
|
|
|
|
extern char uuidvalue_wan[]; /* uuid of WAN Device */
|
|
|
|
extern char uuidvalue_wcd[]; /* uuid of WAN Connection Device */
|
2011-09-28 19:13:20 +00:00
|
|
|
|
|
|
|
#define SERIALNUMBER_MAX_LEN (10)
|
|
|
|
extern char serialnumber[];
|
|
|
|
|
|
|
|
#define MODELNUMBER_MAX_LEN (48)
|
|
|
|
extern char modelnumber[];
|
|
|
|
|
|
|
|
#define PRESENTATIONURL_MAX_LEN (64)
|
|
|
|
extern char presentationurl[];
|
|
|
|
|
2013-12-13 11:03:28 +00:00
|
|
|
#ifdef ENABLE_MANUFACTURER_INFO_CONFIGURATION
|
2012-02-04 23:24:13 +00:00
|
|
|
#define FRIENDLY_NAME_MAX_LEN (64)
|
|
|
|
extern char friendly_name[];
|
|
|
|
|
2013-10-20 21:02:19 +00:00
|
|
|
#define MANUFACTURER_NAME_MAX_LEN (64)
|
|
|
|
extern char manufacturer_name[];
|
|
|
|
|
|
|
|
#define MANUFACTURER_URL_MAX_LEN (64)
|
|
|
|
extern char manufacturer_url[];
|
|
|
|
|
|
|
|
#define MODEL_NAME_MAX_LEN (64)
|
|
|
|
extern char model_name[];
|
|
|
|
|
|
|
|
#define MODEL_DESCRIPTION_MAX_LEN (64)
|
|
|
|
extern char model_description[];
|
|
|
|
|
|
|
|
#define MODEL_URL_MAX_LEN (64)
|
|
|
|
extern char model_url[];
|
2013-12-13 11:03:28 +00:00
|
|
|
#endif
|
2013-10-20 21:02:19 +00:00
|
|
|
|
2011-09-28 19:13:20 +00:00
|
|
|
/* UPnP permission rules : */
|
|
|
|
extern struct upnpperm * upnppermlist;
|
|
|
|
extern unsigned int num_upnpperm;
|
|
|
|
|
2013-07-09 13:36:53 +00:00
|
|
|
#ifdef PCP_SADSCP
|
|
|
|
extern struct dscp_values* dscp_values_list;
|
|
|
|
extern unsigned int num_dscp_values;
|
|
|
|
#endif
|
2011-09-28 19:13:20 +00:00
|
|
|
|
|
|
|
/* For automatic removal of expired rules (with LeaseDuration) */
|
|
|
|
extern unsigned int nextruletoclean_timestamp;
|
|
|
|
|
|
|
|
#ifdef USE_PF
|
2012-02-03 12:14:10 +00:00
|
|
|
extern const char * anchor_name;
|
2011-09-28 19:13:20 +00:00
|
|
|
/* queue and tag for PF rules */
|
|
|
|
extern const char * queue;
|
|
|
|
extern const char * tag;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef USE_NETFILTER
|
|
|
|
extern const char * miniupnpd_nat_chain;
|
2016-01-26 15:50:48 +00:00
|
|
|
extern const char * miniupnpd_nat_postrouting_chain;
|
2011-09-28 19:13:20 +00:00
|
|
|
extern const char * miniupnpd_forward_chain;
|
2014-05-10 11:09:48 +00:00
|
|
|
#ifdef ENABLE_UPNPPINHOLE
|
2012-04-26 14:08:39 +00:00
|
|
|
extern const char * miniupnpd_v6_filter_chain;
|
|
|
|
#endif
|
2011-09-28 19:13:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef ENABLE_NFQUEUE
|
|
|
|
extern int nfqueue;
|
|
|
|
extern int n_nfqix;
|
|
|
|
extern unsigned nfqix[];
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* lan addresses to listen to SSDP traffic */
|
|
|
|
extern struct lan_addr_list lan_addrs;
|
|
|
|
|
|
|
|
#ifdef ENABLE_IPV6
|
|
|
|
/* ipv6 address used for HTTP */
|
|
|
|
extern char ipv6_addr_for_http_with_brackets[64];
|
2014-05-20 12:43:47 +00:00
|
|
|
|
|
|
|
/* address used to bind local services */
|
|
|
|
extern struct in6_addr ipv6_bind_addr;
|
|
|
|
|
2015-09-14 10:10:15 +00:00
|
|
|
#endif /* ENABLE_IPV6 */
|
2011-09-28 19:13:20 +00:00
|
|
|
|
|
|
|
extern const char * minissdpdsocketpath;
|
|
|
|
|
|
|
|
/* BOOTID.UPNP.ORG and CONFIGID.UPNP.ORG */
|
|
|
|
extern unsigned int upnp_bootid;
|
|
|
|
extern unsigned int upnp_configid;
|
|
|
|
|
2015-09-14 10:10:15 +00:00
|
|
|
#ifdef RANDOMIZE_URLS
|
|
|
|
#define RANDOM_URL_MAX_LEN (16)
|
|
|
|
extern char random_url[];
|
|
|
|
#endif /* RANDOMIZE_URLS */
|
2011-09-28 19:13:20 +00:00
|
|
|
|
2015-09-14 10:10:15 +00:00
|
|
|
#endif /* UPNPGLOBALVARS_H_INCLUDED */
|