Electroneum
Loading...
Searching...
No Matches
upnpglobalvars.h
Go to the documentation of this file.
1/* $Id: upnpglobalvars.h,v 1.45 2018/01/16 00:50:49 nanard Exp $ */
2/* vim: tabstop=4 shiftwidth=4 noexpandtab
3 * MiniUPnP project
4 * http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
5 * (c) 2006-2018 Thomas Bernard
6 * This software is subject to the conditions detailed
7 * in the LICENCE file provided within the distribution */
8
9#ifndef UPNPGLOBALVARS_H_INCLUDED
10#define UPNPGLOBALVARS_H_INCLUDED
11
12#include <time.h>
13#include "upnppermissions.h"
14#include "miniupnpdtypes.h"
15#include "config.h"
16
17/* name of the network interface used to access internet */
18extern const char * ext_if_name;
19
20/* file to store all leases */
21#ifdef ENABLE_LEASEFILE
22extern const char * lease_file;
23#endif
24
25/* forced ip address to use for this interface
26 * when NULL, getifaddr() is used */
27extern const char * use_ext_ip_addr;
28
29/* parameters to return to upnp client when asked */
30extern unsigned long downstream_bitrate;
31extern unsigned long upstream_bitrate;
32
33/* statup time */
34extern time_t startup_time;
35#if defined(ENABLE_NATPMP) || defined(ENABLE_PCP)
36/* origin for "epoch time" sent into NATPMP and PCP responses */
37extern time_t epoch_origin;
38#endif /* defined(ENABLE_NATPMP) || defined(ENABLE_PCP) */
39
40extern unsigned long int min_lifetime;
41extern unsigned long int max_lifetime;
42
43/* runtime boolean flags */
44extern int runtime_flags;
45#define LOGPACKETSMASK 0x0001
46#define SYSUPTIMEMASK 0x0002
47#ifdef ENABLE_NATPMP
48#define ENABLENATPMPMASK 0x0004
49#endif
50#define CHECKCLIENTIPMASK 0x0008
51#define SECUREMODEMASK 0x0010
52
53#define ENABLEUPNPMASK 0x0020
54
55#ifdef PF_ENABLE_FILTER_RULES
56#define PFNOQUICKRULESMASK 0x0040
57#endif
58#ifdef ENABLE_IPV6
59#define IPV6DISABLEDMASK 0x0080
60#endif
61#ifdef ENABLE_6FC_SERVICE
62#define IPV6FCFWDISABLEDMASK 0x0100
63#define IPV6FCINBOUNDDISALLOWEDMASK 0x0200
64#endif
65#ifdef ENABLE_PCP
66#define PCP_ALLOWTHIRDPARTYMASK 0x0400
67#endif
68#ifdef IGD_V2
69#define FORCEIGDDESCV1MASK 0x0800
70#endif
71
72#define SETFLAG(mask) runtime_flags |= mask
73#define GETFLAG(mask) (runtime_flags & mask)
74#define CLEARFLAG(mask) runtime_flags &= ~mask
75
76extern const char * pidfilename;
77
78extern char uuidvalue_igd[]; /* uuid of root device (IGD) */
79extern char uuidvalue_wan[]; /* uuid of WAN Device */
80extern char uuidvalue_wcd[]; /* uuid of WAN Connection Device */
81
82#define SERIALNUMBER_MAX_LEN (10)
83extern char serialnumber[];
84
85#define MODELNUMBER_MAX_LEN (48)
86extern char modelnumber[];
87
88#define PRESENTATIONURL_MAX_LEN (64)
89extern char presentationurl[];
90
91#ifdef ENABLE_MANUFACTURER_INFO_CONFIGURATION
92#define FRIENDLY_NAME_MAX_LEN (64)
93extern char friendly_name[];
94
95#define MANUFACTURER_NAME_MAX_LEN (64)
96extern char manufacturer_name[];
97
98#define MANUFACTURER_URL_MAX_LEN (64)
99extern char manufacturer_url[];
100
101#define MODEL_NAME_MAX_LEN (64)
102extern char model_name[];
103
104#define MODEL_DESCRIPTION_MAX_LEN (64)
105extern char model_description[];
106
107#define MODEL_URL_MAX_LEN (64)
108extern char model_url[];
109#endif
110
111/* UPnP permission rules : */
112extern struct upnpperm * upnppermlist;
113extern unsigned int num_upnpperm;
114
115#ifdef PCP_SADSCP
116extern struct dscp_values* dscp_values_list;
117extern unsigned int num_dscp_values;
118#endif
119
120/* For automatic removal of expired rules (with LeaseDuration) */
121extern unsigned int nextruletoclean_timestamp;
122
123#ifdef USE_PF
124extern const char * anchor_name;
125/* queue and tag for PF rules */
126extern const char * queue;
127extern const char * tag;
128#endif
129
130#ifdef USE_NETFILTER
131extern const char * miniupnpd_nat_chain;
132extern const char * miniupnpd_nat_postrouting_chain;
133extern const char * miniupnpd_forward_chain;
134#ifdef ENABLE_UPNPPINHOLE
135extern const char * miniupnpd_v6_filter_chain;
136#endif
137#endif
138
139#ifdef ENABLE_NFQUEUE
140extern int nfqueue;
141extern int n_nfqix;
142extern unsigned nfqix[];
143#endif
144
145/* lan addresses to listen to SSDP traffic */
146extern struct lan_addr_list lan_addrs;
147
148#ifdef ENABLE_IPV6
149/* ipv6 address used for HTTP */
150extern char ipv6_addr_for_http_with_brackets[64];
151
152/* address used to bind local services */
153extern struct in6_addr ipv6_bind_addr;
154
155#endif /* ENABLE_IPV6 */
156
157extern const char * minissdpdsocketpath;
158
159/* BOOTID.UPNP.ORG and CONFIGID.UPNP.ORG */
160extern unsigned int upnp_bootid;
161extern unsigned int upnp_configid;
162
163#ifdef RANDOMIZE_URLS
164#define RANDOM_URL_MAX_LEN (16)
165extern char random_url[];
166#endif /* RANDOMIZE_URLS */
167
168#endif /* UPNPGLOBALVARS_H_INCLUDED */
unsigned int nextruletoclean_timestamp
char uuidvalue_wcd[]
unsigned int num_upnpperm
struct lan_addr_list lan_addrs
unsigned long downstream_bitrate
time_t startup_time
unsigned long int max_lifetime
const char * use_ext_ip_addr
const char * minissdpdsocketpath
unsigned int upnp_configid
struct upnpperm * upnppermlist
int runtime_flags
const char * ext_if_name
unsigned int upnp_bootid
char serialnumber[]
char presentationurl[]
char modelnumber[]
unsigned long int min_lifetime
unsigned long upstream_bitrate
char uuidvalue_igd[]
char uuidvalue_wan[]
const char * pidfilename