1/* $Id: options.h,v 1.21 2012/06/29 19:26:09 nanard Exp $ */ 2/* MiniUPnP project 3 * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ 4 * author: Ryan Wagoner 5 * (c) 2006-2014 Thomas Bernard 6 * This software is subject to the conditions detailed 7 * in the LICENCE file provided within the distribution */ 8 9#ifndef OPTIONS_H_INCLUDED 10#define OPTIONS_H_INCLUDED 11 12#include "config.h" 13 14#ifndef DISABLE_CONFIG_FILE 15/* enum of option available in the miniupnpd.conf */ 16enum upnpconfigoptions { 17 UPNP_INVALID = 0, 18 UPNPEXT_IFNAME = 1, /* ext_ifname */ 19 UPNPEXT_IP, /* ext_ip */ 20 UPNPLISTENING_IP, /* listening_ip */ 21#ifdef ENABLE_IPV6 22 UPNPIPV6_LISTENING_IP, /* listening address for IPv6 */ 23#endif /* ENABLE_IPV6 */ 24 UPNPPORT, /* "port" / "http_port" */ 25#ifdef ENABLE_HTTPS 26 UPNPHTTPSPORT, /* "https_port" */ 27#endif 28 UPNPBITRATE_UP, /* "bitrate_up" */ 29 UPNPBITRATE_DOWN, /* "bitrate_down" */ 30 UPNPPRESENTATIONURL, /* presentation_url */ 31#ifdef ENABLE_MANUFACTURER_INFO_CONFIGURATION 32 UPNPFRIENDLY_NAME, /* "friendly_name" */ 33 UPNPMANUFACTURER_NAME, /* "manufacturer_name" */ 34 UPNPMANUFACTURER_URL, /* "manufacturer_url" */ 35 UPNPMODEL_NAME, /* "model_name" */ 36 UPNPMODEL_DESCRIPTION, /* "model_description" */ 37 UPNPMODEL_URL, /* "model_url" */ 38#endif 39 UPNPNOTIFY_INTERVAL, /* notify_interval */ 40 UPNPSYSTEM_UPTIME, /* "system_uptime" */ 41 UPNPPACKET_LOG, /* "packet_log" */ 42 UPNPUUID, /* uuid */ 43 UPNPSERIAL, /* serial */ 44 UPNPMODEL_NUMBER, /* model_number */ 45 UPNPCLEANTHRESHOLD, /* clean_ruleset_threshold */ 46 UPNPCLEANINTERVAL, /* clean_ruleset_interval */ 47 UPNPENABLENATPMP, /* enable_natpmp */ 48 UPNPPCPMINLIFETIME, /* minimum lifetime for PCP mapping */ 49 UPNPPCPMAXLIFETIME, /* maximum lifetime for PCP mapping */ 50 UPNPPCPALLOWTHIRDPARTY, /* allow third-party requests */ 51#ifdef USE_NETFILTER 52 UPNPFORWARDCHAIN, 53 UPNPNATCHAIN, 54#endif 55#ifdef USE_PF 56 UPNPANCHOR, /* anchor */ 57 UPNPQUEUE, /* queue */ 58 UPNPTAG, /* tag */ 59#endif 60#ifdef PF_ENABLE_FILTER_RULES 61 UPNPQUICKRULES, /* quickrules */ 62#endif 63 UPNPSECUREMODE, /* secure_mode */ 64#ifdef ENABLE_LEASEFILE 65 UPNPLEASEFILE, /* lease_file */ 66#endif 67 UPNPMINISSDPDSOCKET, /* minissdpdsocket */ 68 UPNPENABLE /* enable_upnp */ 69}; 70 71/* readoptionsfile() 72 * parse and store the option file values 73 * returns: 0 success, -1 failure */ 74int 75readoptionsfile(const char * fname); 76 77/* freeoptions() 78 * frees memory allocated to option values */ 79void 80freeoptions(void); 81 82struct option 83{ 84 enum upnpconfigoptions id; 85 const char * value; 86}; 87 88extern struct option * ary_options; 89extern unsigned int num_options; 90 91#endif /* DISABLE_CONFIG_FILE */ 92 93#endif /* OPTIONS_H_INCLUDED */ 94 95