Miniupnpd: update to 1.9 (20150430)
[tomato.git] / release / src / router / miniupnpd / genconfig.sh
blobf3d0ed23801275d0a97736d75b241ec245d87a1e
1 #! /bin/sh
2 # $Id: genconfig.sh,v 1.78 2014/12/10 09:34:42 nanard Exp $
3 # miniupnp daemon
4 # http://miniupnp.free.fr or http://miniupnp.tuxfamily.org/
5 # (c) 2006-2014 Thomas Bernard
6 # This software is subject to the conditions detailed in the
7 # LICENCE file provided within the distribution
9 for argv; do
10 case "$argv" in
11 --ipv6) IPV6=1 ;;
12 --igd2) IGD2=1 ;;
13 --strict) STRICT=1 ;;
14 --leasefile) LEASEFILE=1 ;;
15 --vendorcfg) VENDORCFG=1 ;;
16 --pcp-peer) PCP_PEER=1 ;;
17 --portinuse) PORTINUSE=1 ;;
18 --help|-h)
19 echo "Usage : $0 [options]"
20 echo " --ipv6 enable IPv6"
21 echo " --igd2 build an IGDv2 instead of an IGDv1"
22 echo " --strict be more strict regarding compliance with UPnP specifications"
23 echo " --leasefile enable lease file"
24 echo " --vendorcfg enable configuration of manufacturer info"
25 echo " --pcp-peer enable PCP PEER operation"
26 echo " --portinuse enable port in use check"
27 exit 1
30 echo "Option not recognized : $argv"
31 echo "use -h option to display help"
32 exit 1
34 esac
35 done
37 RM="rm -f"
38 MV="mv"
39 CONFIGFILE="config.h.tmp"
40 CONFIGFILE_FINAL="config.h"
41 CONFIGMACRO="CONFIG_H_INCLUDED"
43 # version reported in XML descriptions
44 #UPNP_VERSION=20070827
45 UPNP_VERSION=`date +"%Y%m%d"`
46 # Facility to syslog
47 LOG_MINIUPNPD="LOG_DAEMON"
49 # detecting the OS name and version
50 OS_NAME=`uname -s`
51 OS_VERSION=`uname -r`
53 # pfSense special case
54 if [ -f /etc/platform ]; then
55 if [ `cat /etc/platform` = "pfSense" ]; then
56 OS_NAME=pfSense
57 OS_VERSION=`cat /etc/version`
61 # OpenWRT special case
62 if [ -f ./os.openwrt ]; then
63 OS_NAME=OpenWRT
64 OS_VERSION=$(cat ./os.openwrt)
67 # Tomato USB special case
68 if [ -f ../shared/tomato_version ]; then
69 OS_NAME=Tomato
70 OS_VERSION="Tomato $(cat ../shared/tomato_version)"
73 # AstLinux special case
74 if [ -f ./os.astlinux ]; then
75 OS_NAME=AstLinux
76 OS_VERSION=$(cat ./os.astlinux)
79 # Tomato USB special case
80 if [ -f ../shared/tomato_version ]; then
81 OS_NAME=Tomato
82 OS_VERSION="Tomato $(cat ../shared/tomato_version)"
85 ${RM} ${CONFIGFILE}
87 echo "/* MiniUPnP Project" >> ${CONFIGFILE}
88 echo " * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/" >> ${CONFIGFILE}
89 echo " * (c) 2006-2014 Thomas Bernard" >> ${CONFIGFILE}
90 echo " * generated by $0 on `date`" >> ${CONFIGFILE}
91 echo " * using command line options $* */" >> ${CONFIGFILE}
92 echo "#ifndef $CONFIGMACRO" >> ${CONFIGFILE}
93 echo "#define $CONFIGMACRO" >> ${CONFIGFILE}
94 echo "" >> ${CONFIGFILE}
95 echo "#include <inttypes.h>" >> ${CONFIGFILE}
96 echo "" >> ${CONFIGFILE}
97 echo "#define MINIUPNPD_VERSION \"`cat VERSION`\"" >> ${CONFIGFILE}
98 echo "" >> ${CONFIGFILE}
99 echo "#define UPNP_VERSION \"$UPNP_VERSION\"" >> ${CONFIGFILE}
101 # OS Specific stuff
102 case $OS_NAME in
103 OpenBSD)
104 MAJORVER=`echo $OS_VERSION | cut -d. -f1`
105 MINORVER=`echo $OS_VERSION | cut -d. -f2`
106 #echo "OpenBSD majorversion=$MAJORVER minorversion=$MINORVER"
107 # rtableid was introduced in OpenBSD 4.0
108 if [ $MAJORVER -ge 4 ]; then
109 echo "#define PFRULE_HAS_RTABLEID" >> ${CONFIGFILE}
111 # from the 3.8 version, packets and bytes counters are double : in/out
112 if [ \( $MAJORVER -ge 4 \) -o \( $MAJORVER -eq 3 -a $MINORVER -ge 8 \) ]; then
113 echo "#define PFRULE_INOUT_COUNTS" >> ${CONFIGFILE}
115 # from the 4.7 version, new pf
116 if [ \( $MAJORVER -ge 5 \) -o \( $MAJORVER -eq 4 -a $MINORVER -ge 7 \) ]; then
117 echo "#define PF_NEWSTYLE" >> ${CONFIGFILE}
119 # onrdomain was introduced in OpenBSD 5.0
120 if [ $MAJORVER -ge 5 ]; then
121 echo "#define PFRULE_HAS_ONRDOMAIN" >> ${CONFIGFILE}
123 FW=pf
124 echo "#define USE_IFACEWATCHER 1" >> ${CONFIGFILE}
125 OS_URL=http://www.openbsd.org/
126 V6SOCKETS_ARE_V6ONLY=`sysctl -n net.inet6.ip6.v6only`
128 FreeBSD)
129 VER=`grep '#define __FreeBSD_version' /usr/include/sys/param.h | awk '{print $3}'`
130 if [ $VER -ge 700049 ]; then
131 echo "#define PFRULE_INOUT_COUNTS" >> ${CONFIGFILE}
133 # new way to see which one to use PF or IPF.
134 # see http://miniupnp.tuxfamily.org/forum/viewtopic.php?p=957
135 if [ -f /etc/rc.subr ] && [ -f /etc/rc.conf ] ; then
136 # source file with handy subroutines like checkyesno
137 . /etc/rc.subr
138 # source config file so we can probe vars
139 . /etc/rc.conf
140 if checkyesno ipfilter_enable; then
141 echo "Using ipf"
142 FW=ipf
143 elif checkyesno pf_enable; then
144 echo "Using pf"
145 FW=pf
146 elif checkyesno firewall_enable; then
147 echo "Using ifpw"
148 FW=ipfw
151 if [ -z $FW ] ; then
152 echo "Could not detect usage of ipf, pf, ipfw. Compiling for pf by default"
153 FW=pf
155 echo "#define USE_IFACEWATCHER 1" >> ${CONFIGFILE}
156 OS_URL=http://www.freebsd.org/
157 V6SOCKETS_ARE_V6ONLY=`sysctl -n net.inet6.ip6.v6only`
159 pfSense)
160 # we need to detect if PFRULE_INOUT_COUNTS macro is needed
161 FW=pf
162 echo "#define USE_IFACEWATCHER 1" >> ${CONFIGFILE}
163 OS_URL=http://www.pfsense.com/
164 V6SOCKETS_ARE_V6ONLY=`sysctl -n net.inet6.ip6.v6only`
166 NetBSD)
167 if [ -f /etc/rc.subr ] && [ -f /etc/rc.conf ] ; then
168 # source file with handy subroutines like checkyesno
169 . /etc/rc.subr
170 # source config file so we can probe vars
171 . /etc/rc.conf
172 if checkyesno pf; then
173 FW=pf
174 elif checkyesno ipfilter; then
175 FW=ipf
178 if [ -z $FW ] ; then
179 echo "Could not detect ipf nor pf, defaulting to pf."
180 FW=pf
182 echo "#define USE_IFACEWATCHER 1" >> ${CONFIGFILE}
183 OS_URL=http://www.netbsd.org/
185 DragonFly)
186 if [ -f /etc/rc.subr ] && [ -f /etc/rc.conf ] ; then
187 # source file with handy subroutines like checkyesno
188 . /etc/rc.subr
189 # source config file so we can probe vars
190 . /etc/rc.conf
191 if checkyesno pf; then
192 FW=pf
193 elif checkyesno ipfilter; then
194 FW=ipf
197 if [ -z $FW ] ; then
198 echo "Could not detect ipf nor pf, defaulting to pf."
199 FW=pf
201 echo "#define USE_IFACEWATCHER 1" >> ${CONFIGFILE}
202 OS_URL=http://www.dragonflybsd.org/
204 SunOS)
205 echo "#define USE_IFACEWATCHER 1" >> ${CONFIGFILE}
206 FW=ipf
207 echo "#define LOG_PERROR 0" >> ${CONFIGFILE}
208 echo "#define SOLARIS_KSTATS 1" >> ${CONFIGFILE}
209 # solaris 10 does not define u_int64_t ?
210 # but it does define uint64_t
211 echo "typedef uint64_t u_int64_t;" >> ${CONFIGFILE}
212 OS_URL=http://www.sun.com/solaris/
214 Linux)
215 OS_URL=http://www.kernel.org/
216 KERNVERA=`echo $OS_VERSION | awk -F. '{print $1}'`
217 KERNVERB=`echo $OS_VERSION | awk -F. '{print $2}'`
218 KERNVERC=`echo $OS_VERSION | awk -F. '{print $3}'`
219 KERNVERD=`echo $OS_VERSION | awk -F. '{print $4}'`
220 #echo "$KERNVERA.$KERNVERB.$KERNVERC.$KERNVERD"
221 # Debian GNU/Linux special case
222 if [ -f /etc/debian_version ]; then
223 OS_NAME=Debian
224 OS_VERSION=`cat /etc/debian_version`
225 OS_URL=http://www.debian.org/
227 # same thing for Gentoo linux
228 if [ -f /etc/gentoo-release ]; then
229 OS_NAME=Gentoo
230 OS_VERSION=`cat /etc/gentoo-release`
231 OS_URL=http://www.gentoo.org/
233 # use lsb_release (Linux Standard Base) when available
234 LSB_RELEASE=`which lsb_release`
235 if [ 0 -eq $? ]; then
236 OS_NAME=`${LSB_RELEASE} -i -s`
237 OS_VERSION=`${LSB_RELEASE} -r -s`
238 case $OS_NAME in
239 Debian)
240 OS_URL=http://www.debian.org/
241 OS_VERSION=`${LSB_RELEASE} -c -s`
243 Ubuntu)
244 OS_URL=http://www.ubuntu.com/
245 OS_VERSION=`${LSB_RELEASE} -c -s`
247 Gentoo)
248 OS_URL=http://www.gentoo.org/
250 arch)
251 OS_URL=http://www.archlinux.org/
252 OS_VERSION=`uname -r`
254 esac
256 echo "#define USE_IFACEWATCHER 1" >> ${CONFIGFILE}
257 FW=netfilter
258 V6SOCKETS_ARE_V6ONLY=`/sbin/sysctl -n net.ipv6.bindv6only`
260 OpenWRT)
261 OS_URL=http://www.openwrt.org/
262 echo "#define USE_IFACEWATCHER 1" >> ${CONFIGFILE}
263 FW=netfilter
265 Tomato)
266 OS_NAME=UPnP
267 OS_URL=http://tomatousb.org/
268 echo "" >> ${CONFIGFILE}
269 echo "#ifdef LINUX26" >> ${CONFIGFILE}
270 echo "#define USE_IFACEWATCHER 1" >> ${CONFIGFILE}
271 echo "#endif" >> ${CONFIGFILE}
272 echo "#ifdef TCONFIG_IPV6" >> ${CONFIGFILE}
273 echo "#define ENABLE_IPV6" >> ${CONFIGFILE}
274 echo "#endif" >> ${CONFIGFILE}
275 FW=netfilter
277 Darwin)
278 MAJORVER=`echo $OS_VERSION | cut -d. -f1`
279 echo "#define USE_IFACEWATCHER 1" >> ${CONFIGFILE}
280 # OS X switched to pf since 10.7 Lion (Darwin 11.0)
281 if [ $MAJORVER -ge 11 ] ; then
282 FW=pf
283 echo "#define PFRULE_INOUT_COUNTS" >> ${CONFIGFILE}
284 else
285 FW=ipfw
287 OS_URL=http://developer.apple.com/macosx
290 echo "Unknown OS : $OS_NAME"
291 echo "Please contact the author at http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/."
292 exit 1
294 esac
296 case $FW in
298 echo "#define USE_PF 1" >> ${CONFIGFILE}
300 ipf)
301 echo "#define USE_IPF 1" >> ${CONFIGFILE}
303 ipfw)
304 echo "#define USE_IPFW 1" >> ${CONFIGFILE}
306 netfilter)
307 echo "#define USE_NETFILTER 1" >> ${CONFIGFILE}
310 echo "Unknown Firewall/packet filtering software [$FW]"
311 echo "Please contact the author at http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/."
312 exit 1
314 esac
316 # set V6SOCKETS_ARE_V6ONLY to 0 if it was not set above
317 if [ -z "$V6SOCKETS_ARE_V6ONLY" ] ; then
318 V6SOCKETS_ARE_V6ONLY=0
321 echo "Configuring compilation for [$OS_NAME] [$OS_VERSION] with [$FW] firewall software."
322 echo "Please edit config.h for more compilation options."
324 # define SUPPORT_REMOTEHOST if the FW related code really supports setting
325 # a RemoteHost
326 if [ \( "$FW" = "netfilter" \) -o \( "$FW" = "pf" \) -o \( "$FW" = "ipfw" \) ] ; then
327 echo "#define SUPPORT_REMOTEHOST" >> ${CONFIGFILE}
330 echo "" >> ${CONFIGFILE}
331 echo "#define OS_NAME \"$OS_NAME\"" >> ${CONFIGFILE}
332 echo "#define OS_VERSION \"$OS_NAME/$OS_VERSION\"" >> ${CONFIGFILE}
333 echo "#define OS_URL \"${OS_URL}\"" >> ${CONFIGFILE}
334 echo "" >> ${CONFIGFILE}
336 echo "/* syslog facility to be used by miniupnpd */" >> ${CONFIGFILE}
337 echo "#define LOG_MINIUPNPD ${LOG_MINIUPNPD}" >> ${CONFIGFILE}
338 echo "" >> ${CONFIGFILE}
340 echo "/* Uncomment the following line to allow miniupnpd to be" >> ${CONFIGFILE}
341 echo " * controlled by miniupnpdctl */" >> ${CONFIGFILE}
342 echo "/*#define USE_MINIUPNPDCTL*/" >> ${CONFIGFILE}
343 echo "" >> ${CONFIGFILE}
345 echo "/* Comment the following line to disable NAT-PMP operations */" >> ${CONFIGFILE}
346 echo "#define ENABLE_NATPMP" >> ${CONFIGFILE}
347 echo "" >> ${CONFIGFILE}
349 echo "/* Comment the following line to disable PCP operations */" >> ${CONFIGFILE}
350 echo "#define ENABLE_PCP" >> ${CONFIGFILE}
351 echo "" >> ${CONFIGFILE}
353 echo "#ifdef ENABLE_PCP" >> ${CONFIGFILE}
354 if [ -n "$PCP_PEER" ]; then
355 echo "/* Comment the following line to disable PCP PEER operation */" >> ${CONFIGFILE}
356 echo "#define PCP_PEER" >> ${CONFIGFILE}
357 else
358 echo "/* Uncomment the following line to enable PCP PEER operation */" >> ${CONFIGFILE}
359 echo "/*#define PCP_PEER*/" >> ${CONFIGFILE}
361 echo "#ifdef PCP_PEER" >> ${CONFIGFILE}
362 echo "/*#define PCP_FLOWP*/" >> ${CONFIGFILE}
363 echo "#endif /*PCP_PEER*/" >> ${CONFIGFILE}
364 echo "/*#define PCP_SADSCP*/" >> ${CONFIGFILE}
365 echo "#endif /*ENABLE_PCP*/" >> ${CONFIGFILE}
366 echo "" >> ${CONFIGFILE}
368 echo "/* Uncomment the following line to enable generation of" >> ${CONFIGFILE}
369 echo " * filter rules with pf */" >> ${CONFIGFILE}
370 echo "/*#define PF_ENABLE_FILTER_RULES*/">> ${CONFIGFILE}
371 echo "" >> ${CONFIGFILE}
373 echo "/* Uncomment the following line to enable caching of results of" >> ${CONFIGFILE}
374 echo " * the getifstats() function */" >> ${CONFIGFILE}
375 echo "/*#define ENABLE_GETIFSTATS_CACHING*/" >> ${CONFIGFILE}
376 echo "/* The cache duration is indicated in seconds */" >> ${CONFIGFILE}
377 echo "#define GETIFSTATS_CACHING_DURATION 2" >> ${CONFIGFILE}
378 echo "" >> ${CONFIGFILE}
380 echo "/* Uncomment the following line to enable multiple external ip support */" >> ${CONFIGFILE}
381 echo "/* note : That is EXPERIMENTAL, do not use that unless you know perfectly what you are doing */" >> ${CONFIGFILE}
382 echo "/* Dynamic external ip adresses are not supported when this option is enabled." >> ${CONFIGFILE}
383 echo " * Also note that you would need to configure your .conf file accordingly. */" >> ${CONFIGFILE}
384 echo "/*#define MULTIPLE_EXTERNAL_IP*/" >> ${CONFIGFILE}
385 echo "" >> ${CONFIGFILE}
387 echo "/* Comment the following line to use home made daemonize() func instead" >> ${CONFIGFILE}
388 echo " * of BSD daemon() */" >> ${CONFIGFILE}
389 echo "#define USE_DAEMON" >> ${CONFIGFILE}
390 echo "" >> ${CONFIGFILE}
392 echo "/* Uncomment the following line to enable lease file support */" >> ${CONFIGFILE}
393 if [ -n "$LEASEFILE" ] ; then
394 echo "#define ENABLE_LEASEFILE" >> ${CONFIGFILE}
395 else
396 echo "/*#define ENABLE_LEASEFILE*/" >> ${CONFIGFILE}
398 echo "" >> ${CONFIGFILE}
400 echo "/* Uncomment the following line to enable port in use check */" >> ${CONFIGFILE}
401 if [ -n "$PORTINUSE" ]; then
402 echo "#define CHECK_PORTINUSE" >> ${CONFIGFILE}
403 else
404 echo "/*#define CHECK_PORTINUSE*/" >> ${CONFIGFILE}
406 echo "" >> ${CONFIGFILE}
408 echo "/* Define one or none of the two following macros in order to make some" >> ${CONFIGFILE}
409 echo " * clients happy. It will change the XML Root Description of the IGD." >> ${CONFIGFILE}
410 echo " * Enabling the Layer3Forwarding Service seems to be the more compatible" >> ${CONFIGFILE}
411 echo " * option. */" >> ${CONFIGFILE}
412 echo "/*#define HAS_DUMMY_SERVICE*/" >> ${CONFIGFILE}
413 echo "#define ENABLE_L3F_SERVICE" >> ${CONFIGFILE}
414 echo "" >> ${CONFIGFILE}
416 echo "/* Enable IP v6 support */" >> ${CONFIGFILE}
417 if [ -n "$IPV6" ]; then
418 echo "#define ENABLE_IPV6" >> ${CONFIGFILE}
419 else
420 echo "/*#define ENABLE_IPV6*/" >> ${CONFIGFILE}
422 echo "" >> ${CONFIGFILE}
424 echo "/* Define V6SOCKETS_ARE_V6ONLY if AF_INET6 sockets are restricted" >> ${CONFIGFILE}
425 echo " * to IPv6 communications only. */" >> ${CONFIGFILE}
426 if [ $V6SOCKETS_ARE_V6ONLY -eq 1 ] ; then
427 echo "#define V6SOCKETS_ARE_V6ONLY" >> ${CONFIGFILE}
428 else
429 echo "/*#define V6SOCKETS_ARE_V6ONLY*/" >> ${CONFIGFILE}
431 echo "" >> ${CONFIGFILE}
433 echo "/* Enable the support of IGD v2 specification." >> ${CONFIGFILE}
434 echo " * This is not fully tested yet and can cause incompatibilities with some" >> ${CONFIGFILE}
435 echo " * control points, so enable with care. */" >> ${CONFIGFILE}
436 if [ -n "$IGD2" ]; then
437 echo "#define IGD_V2" >> ${CONFIGFILE}
438 else
439 echo "/*#define IGD_V2*/" >> ${CONFIGFILE}
441 echo "" >> ${CONFIGFILE}
443 echo "#ifdef IGD_V2" >> ${CONFIGFILE}
444 echo "/* Enable DeviceProtection service (IGDv2) */" >> ${CONFIGFILE}
445 echo "#define ENABLE_DP_SERVICE" >> ${CONFIGFILE}
446 echo "/*#define ENABLE_HTTPS*/" >> ${CONFIGFILE}
447 echo "/*#define HTTPS_CERTFILE \"/path/to/certificate.pem\"*/" >> ${CONFIGFILE}
448 echo "/*#define HTTPS_KEYFILE \"/path/to/private.key\"*/" >> ${CONFIGFILE}
449 echo "" >> ${CONFIGFILE}
450 echo "/* Enable WANIPv6FirewallControl service (IGDv2). needs IPv6 */" >> ${CONFIGFILE}
451 echo "#ifdef ENABLE_IPV6" >> ${CONFIGFILE}
452 echo "#define ENABLE_6FC_SERVICE" >> ${CONFIGFILE}
453 echo "#endif /* ENABLE_IPV6 */" >> ${CONFIGFILE}
454 echo "#endif /* IGD_V2 */" >> ${CONFIGFILE}
455 echo "" >> ${CONFIGFILE}
457 echo "/* UPnP Events support. Working well enough to be enabled by default." >> ${CONFIGFILE}
458 echo " * It can be disabled to save a few bytes. */" >> ${CONFIGFILE}
459 echo "#define ENABLE_EVENTS" >> ${CONFIGFILE}
460 echo "" >> ${CONFIGFILE}
462 echo "/* include interface name in pf and ipf rules */" >> ${CONFIGFILE}
463 echo "#define USE_IFNAME_IN_RULES" >> ${CONFIGFILE}
464 echo "" >> ${CONFIGFILE}
466 echo "/* Experimental NFQUEUE support. */" >> ${CONFIGFILE}
467 echo "/*#define ENABLE_NFQUEUE*/" >> ${CONFIGFILE}
468 echo "" >> ${CONFIGFILE}
470 echo "/* Enable to make MiniUPnPd more strict about UPnP conformance" >> ${CONFIGFILE}
471 echo " * and the messages it receives from control points */" >> ${CONFIGFILE}
472 if [ -n "$STRICT" ] ; then
473 echo "#define UPNP_STRICT" >> ${CONFIGFILE}
474 else
475 echo "/*#define UPNP_STRICT*/" >> ${CONFIGFILE}
477 echo "" >> ${CONFIGFILE}
479 echo "/* If SSDP_RESPOND_SAME_VERSION is defined, the M-SEARCH response" >> ${CONFIGFILE}
480 echo " * include the same device version as was contained in the search" >> ${CONFIGFILE}
481 echo " * request. It conforms to UPnP DA v1.1 */" >> ${CONFIGFILE}
482 echo "#define SSDP_RESPOND_SAME_VERSION" >> ${CONFIGFILE}
483 echo "" >> ${CONFIGFILE}
485 echo "/* Add the optional Date: header in all HTTP responses */" >> ${CONFIGFILE}
486 if [ -n "$STRICT" ] ; then
487 echo "#define ENABLE_HTTP_DATE" >> ${CONFIGFILE}
488 else
489 echo "/*#define ENABLE_HTTP_DATE*/" >> ${CONFIGFILE}
491 echo "" >> ${CONFIGFILE}
493 echo "/* Wait a little before answering M-SEARCH request */" >> ${CONFIGFILE}
494 if [ -n "$STRICT" ] ; then
495 echo "#define DELAY_MSEARCH_RESPONSE" >> ${CONFIGFILE}
496 else
497 echo "/*#define DELAY_MSEARCH_RESPONSE*/" >> ${CONFIGFILE}
499 echo "" >> ${CONFIGFILE}
501 echo "/* disable reading and parsing of config file (miniupnpd.conf) */" >> ${CONFIGFILE}
502 echo "/*#define DISABLE_CONFIG_FILE*/" >> ${CONFIGFILE}
503 echo "" >> ${CONFIGFILE}
505 echo "/* Uncomment the following line to configure all manufacturer infos through miniupnpd.conf */" >> ${CONFIGFILE}
506 if [ -n "$VENDORCFG" ] ; then
507 echo "#define ENABLE_MANUFACTURER_INFO_CONFIGURATION" >> ${CONFIGFILE}
508 else
509 echo "/*#define ENABLE_MANUFACTURER_INFO_CONFIGURATION*/" >> ${CONFIGFILE}
511 echo "" >> ${CONFIGFILE}
513 cat >> ${CONFIGFILE} <<EOF
514 #if defined(ENABLE_6FC_SERVICE) || (defined(ENABLE_PCP) && defined(ENABLE_IPV6))
515 #define ENABLE_UPNPPINHOLE
516 #endif
520 cat >> ${CONFIGFILE} <<EOF
521 /* Uncomment the following line if your device does not have a proper clock
522 * BOOTID.UPNP.ORG can be set with command line */
523 #define USE_TIME_AS_BOOTID
526 echo "#endif /* ${CONFIGMACRO} */" >> ${CONFIGFILE}
528 ${MV} ${CONFIGFILE} ${CONFIGFILE_FINAL}
530 exit 0