head 1.5; access; symbols pkgsrc-2020Q4:1.4.0.58 pkgsrc-2020Q4-base:1.4 pkgsrc-2020Q3:1.4.0.56 pkgsrc-2020Q3-base:1.4 pkgsrc-2020Q2:1.4.0.52 pkgsrc-2020Q2-base:1.4 pkgsrc-2020Q1:1.4.0.32 pkgsrc-2020Q1-base:1.4 pkgsrc-2019Q4:1.4.0.54 pkgsrc-2019Q4-base:1.4 pkgsrc-2019Q3:1.4.0.50 pkgsrc-2019Q3-base:1.4 pkgsrc-2019Q2:1.4.0.48 pkgsrc-2019Q2-base:1.4 pkgsrc-2019Q1:1.4.0.46 pkgsrc-2019Q1-base:1.4 pkgsrc-2018Q4:1.4.0.44 pkgsrc-2018Q4-base:1.4 pkgsrc-2018Q3:1.4.0.42 pkgsrc-2018Q3-base:1.4 pkgsrc-2018Q2:1.4.0.40 pkgsrc-2018Q2-base:1.4 pkgsrc-2018Q1:1.4.0.38 pkgsrc-2018Q1-base:1.4 pkgsrc-2017Q4:1.4.0.36 pkgsrc-2017Q4-base:1.4 pkgsrc-2017Q3:1.4.0.34 pkgsrc-2017Q3-base:1.4 pkgsrc-2017Q2:1.4.0.30 pkgsrc-2017Q2-base:1.4 pkgsrc-2017Q1:1.4.0.28 pkgsrc-2017Q1-base:1.4 pkgsrc-2016Q4:1.4.0.26 pkgsrc-2016Q4-base:1.4 pkgsrc-2016Q3:1.4.0.24 pkgsrc-2016Q3-base:1.4 pkgsrc-2016Q2:1.4.0.22 pkgsrc-2016Q2-base:1.4 pkgsrc-2016Q1:1.4.0.20 pkgsrc-2016Q1-base:1.4 pkgsrc-2015Q4:1.4.0.18 pkgsrc-2015Q4-base:1.4 pkgsrc-2015Q3:1.4.0.16 pkgsrc-2015Q3-base:1.4 pkgsrc-2015Q2:1.4.0.14 pkgsrc-2015Q2-base:1.4 pkgsrc-2015Q1:1.4.0.12 pkgsrc-2015Q1-base:1.4 pkgsrc-2014Q4:1.4.0.10 pkgsrc-2014Q4-base:1.4 pkgsrc-2014Q3:1.4.0.8 pkgsrc-2014Q3-base:1.4 pkgsrc-2014Q2:1.4.0.6 pkgsrc-2014Q2-base:1.4 pkgsrc-2014Q1:1.4.0.4 pkgsrc-2014Q1-base:1.4 pkgsrc-2013Q4:1.4.0.2 pkgsrc-2013Q4-base:1.4 pkgsrc-2013Q3:1.3.0.8 pkgsrc-2013Q3-base:1.3 pkgsrc-2013Q2:1.3.0.6 pkgsrc-2013Q2-base:1.3 pkgsrc-2013Q1:1.3.0.4 pkgsrc-2013Q1-base:1.3 pkgsrc-2012Q4:1.3.0.2 pkgsrc-2012Q4-base:1.3 pkgsrc-2012Q3:1.2.0.4 pkgsrc-2012Q3-base:1.2 pkgsrc-2012Q2:1.2.0.2 pkgsrc-2012Q2-base:1.2 pkgsrc-2012Q1:1.1.1.1.0.16 pkgsrc-2012Q1-base:1.1.1.1 pkgsrc-2011Q4:1.1.1.1.0.14 pkgsrc-2011Q4-base:1.1.1.1 pkgsrc-2011Q3:1.1.1.1.0.12 pkgsrc-2011Q3-base:1.1.1.1 pkgsrc-2011Q2:1.1.1.1.0.10 pkgsrc-2011Q2-base:1.1.1.1 pkgsrc-2011Q1:1.1.1.1.0.8 pkgsrc-2011Q1-base:1.1.1.1 pkgsrc-2010Q4:1.1.1.1.0.6 pkgsrc-2010Q4-base:1.1.1.1 pkgsrc-2010Q3:1.1.1.1.0.4 pkgsrc-2010Q3-base:1.1.1.1 pkgsrc-2010Q2:1.1.1.1.0.2 pkgsrc-2010Q2-base:1.1.1.1 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.5 date 2021.03.09.08.27.19; author nia; state dead; branches; next 1.4; commitid uwdBufatXKEvSBKC; 1.4 date 2013.11.21.09.18.17; author obache; state Exp; branches; next 1.3; commitid PiXYPcJN7VsdP7ex; 1.3 date 2012.12.25.21.05.49; author joerg; state Exp; branches; next 1.2; 1.2 date 2012.04.13.23.44.39; author obache; state Exp; branches; next 1.1; 1.1 date 2010.05.23.08.18.04; author obache; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2010.05.23.08.18.04; author obache; state Exp; branches; next ; desc @@ 1.5 log @ushare: remove this has not been building all year, upstream development is discontinued. @ text @$NetBSD: patch-af,v 1.4 2013/11/21 09:18:17 obache Exp $ * Treat NetBSD same as FreeBSD. * Move sys/param.h and config.h header files before using conditions. * libupnp>=1.6.7 support. --- src/ushare.c.orig 2007-12-09 13:03:36.000000000 +0000 +++ src/ushare.c @@@@ -28,7 +28,11 @@@@ #include #include -#if (defined(BSD) || defined(__FreeBSD__) || defined(__APPLE__)) +#if (defined(__unix__) || defined(unix)) && !defined(USG) || defined(__NetBSD__) +#include +#endif + +#if (defined(BSD) || defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__)) #include #include #include @@@@ -49,18 +53,19 @@@@ #include #endif -#if (defined(__unix__) || defined(unix)) && !defined(USG) -#include -#endif - #include #include +#if UPNP_VERSION >= 10607 +#include +#endif + +#include "config.h" + #if (defined(HAVE_SETLOCALE) && defined(CONFIG_NLS)) # include #endif -#include "config.h" #include "ushare.h" #include "services.h" #include "http.h" @@@@ -177,7 +182,12 @@@@ handle_action_request (struct Upnp_Actio struct service_t *service; struct service_action_t *action; char val[256]; +#if UPNP_VERSION < 10607 uint32_t ip; +#else + int error; + int slen; +#endif if (!request || !ut) return; @@@@ -188,10 +198,30 @@@@ handle_action_request (struct Upnp_Actio if (strcmp (request->DevUDN + 5, ut->udn)) return; +#if UPNP_VERSION < 10607 ip = request->CtrlPtIPAddr.s_addr; ip = ntohl (ip); sprintf (val, "%d.%d.%d.%d", (ip >> 24) & 0xFF, (ip >> 16) & 0xFF, (ip >> 8) & 0xFF, ip & 0xFF); +#else +#ifdef __sun + switch (request->CtrlPtIPAddr.ss_family) { + case AF_INET: + slen = sizeof (struct sockaddr_in); + break; + case AF_INET6: + slen = sizeof (struct sockaddr_in6); + break; + default: + slen = sizeof (request->CtrlPtIPAddr); + break; + } +#else + slen = request->CtrlPtIPAddr.ss_len; +#endif + error = getnameinfo((struct sockaddr *)&(request->CtrlPtIPAddr), slen, + val, sizeof(val), NULL, 0, NI_NUMERICHOST); +#endif if (ut->verbose) { @@@@ -505,7 +535,7 @@@@ create_udn (char *interface) char *buf; unsigned char *ptr; -#if (defined(BSD) || defined(__FreeBSD__) || defined(__APPLE__)) +#if (defined(BSD) || defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__)) int mib[6]; size_t len; struct if_msghdr *ifm; @@@@ -517,7 +547,7 @@@@ create_udn (char *interface) if (!interface) return NULL; -#if (defined(BSD) || defined(__FreeBSD__) || defined(__APPLE__)) +#if (defined(BSD) || defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__)) mib[0] = CTL_NET; mib[1] = AF_ROUTE; mib[2] = 0; @@@@ -568,7 +598,7 @@@@ create_udn (char *interface) buf = (char *) malloc (64 * sizeof (char)); memset (buf, 0, 64); ptr = (unsigned char *) ifr.ifr_hwaddr.sa_data; -#endif /* (defined(BSD) || defined(__FreeBSD__)) */ +#endif /* (defined(BSD) || defined(__FreeBSD__) || defined(__NetBSD__)) */ snprintf (buf, 64, "%s-%02x%02x%02x%02x%02x%02x", DEFAULT_UUID, (ptr[0] & 0377), (ptr[1] & 0377), (ptr[2] & 0377), @@@@ -718,7 +748,7 @@@@ reload_config (int s __attribute__ ((unu } } -inline void +void display_headers (void) { printf (_("%s (version %s), a lightweight UPnP A/V and DLNA Media Server.\n"), @@@@ -734,11 +764,8 @@@@ setup_i18n(void) #ifdef HAVE_SETLOCALE setlocale (LC_ALL, ""); #endif -#if (!defined(BSD) && !defined(__FreeBSD__)) bindtextdomain (PACKAGE, LOCALEDIR); #endif - textdomain (PACKAGE); -#endif } #define SHUTDOWN_MSG _("Server is shutting down: other clients will be notified soon, Bye bye ...\n") @@@@ -845,6 +872,9 @@@@ main (int argc, char **argv) signal (SIGINT, UPnPBreak); signal (SIGHUP, reload_config); +#ifndef MSG_NOSIGNAL + signal (SIGPIPE, SIG_IGN); +#endif if (ut->use_telnet) { @ 1.4 log @Fixes build on Solaris. @ text @d1 1 a1 1 $NetBSD: patch-af,v 1.3 2012/12/25 21:05:49 joerg Exp $ @ 1.3 log @Fix use of inline. @ text @d1 1 a1 1 $NetBSD: patch-af,v 1.2 2012/04/13 23:44:39 obache Exp $ d47 1 a47 1 @@@@ -177,7 +182,11 @@@@ handle_action_request (struct Upnp_Actio d55 1 d60 1 a60 1 @@@@ -188,10 +197,16 @@@@ handle_action_request (struct Upnp_Actio d70 16 a85 2 + error = getnameinfo((struct sockaddr *)&(request->CtrlPtIPAddr), + request->CtrlPtIPAddr.ss_len, d91 1 a91 1 @@@@ -505,7 +520,7 @@@@ create_udn (char *interface) d100 1 a100 1 @@@@ -517,7 +532,7 @@@@ create_udn (char *interface) d109 1 a109 1 @@@@ -568,7 +583,7 @@@@ create_udn (char *interface) d118 1 a118 1 @@@@ -718,7 +733,7 @@@@ reload_config (int s __attribute__ ((unu d127 1 a127 1 @@@@ -734,11 +749,8 @@@@ setup_i18n(void) d139 1 a139 1 @@@@ -845,6 +857,9 @@@@ main (int argc, char **argv) @ 1.2 log @* fixes build with libupnp>=1.6.7. * Bump PKGREVISION from libupnp shlib bump. @ text @d1 1 a1 1 $NetBSD: patch-af,v 1.1.1.1 2010/05/23 08:18:04 obache Exp $ d103 9 @ 1.1 log @Initial revision @ text @d1 1 a1 1 $NetBSD$ d5 1 d22 1 a22 1 @@@@ -49,18 +53,15 @@@@ d33 4 d47 30 a76 1 @@@@ -505,7 +506,7 @@@@ create_udn (char *interface) d85 1 a85 1 @@@@ -517,7 +518,7 @@@@ create_udn (char *interface) d94 1 a94 1 @@@@ -568,7 +569,7 @@@@ create_udn (char *interface) d103 1 a103 1 @@@@ -734,7 +735,7 @@@@ setup_i18n(void) a107 1 +#if (!defined(BSD) && !defined(__FreeBSD__) && !defined(__NetBSD__)) d110 6 a115 2 textdomain (PACKAGE); @@@@ -845,6 +846,9 @@@@ main (int argc, char **argv) @ 1.1.1.1 log @Import ushare-1.1a as multimedia/ushare. uShare is a UPnP (TM) A/V Media Server. It implements the server component that provides UPnP media devices with information on available multimedia files. uShare uses the built-in http server of libupnp to stream the files to clients. GeeXboX uShare is able to provide access to both images, videos, music or playlists files (see below for a complete file format support list). It does not act as an UPnP Media Adaptor and thus, can't transcode streams to fit the client requirements. uShare is written in C for the GeeXboX project. It is designed to provide access to multimedia contents to GeeXboX but can of course be used by any other UPnP client device. It should compile and run on any modern POSIX compatible system such as Linux. uShare is free software - it is licensed under the terms of the GNU General Public License (GPL). @ text @@