Compare commits
28 Commits
hibbian/la
...
ubuntu/nob
Author | SHA1 | Date |
---|---|---|
Hibby | e0ec5ec246 | |
Hibby | 81279b4b22 | |
Hibby | 14f7882f2f | |
Hibby | fbbb08966c | |
Hibby | a37d026f89 | |
Hibby | 62be7b55b5 | |
Hibby | f06c172633 | |
Hibby | 18da0369b1 | |
Hibby | bc090e47e9 | |
Hibby | 056b34d0f4 | |
Hibby | 594377a91b | |
Hibby | d2ff69e9ce | |
Hibby | c34d15c946 | |
Hibby | b5ff5e0f73 | |
Dave Hibberd | 9ab44dc753 | |
Dave Hibberd | 3e9dcea143 | |
Dave Hibberd | 552b65aaf2 | |
Dave Hibberd | 33dde662d8 | |
Dave Hibberd | 6c9d8101fd | |
Dave Hibberd | 1a97731f25 | |
Dave Hibberd | 9dd1003e91 | |
Dave Hibberd | c5456dd210 | |
Dave Hibberd | 3ea67a184e | |
Dave Hibberd | adc7c52d78 | |
Dave Hibberd | a9804cffa7 | |
Dave Hibberd | 227e793b7a | |
Dave Hibberd | c946034bca | |
Dave Hibberd | 27278c3915 |
|
@ -1,3 +1,9 @@
|
|||
linbpq (6.0.24.38-noble1) noble; urgency=medium
|
||||
|
||||
* Rebuild for noble.
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Sun, 09 Jun 2024 23:01:37 +0100
|
||||
|
||||
linbpq (6.0.24.38-1) unstable; urgency=medium
|
||||
|
||||
* New Upstream
|
||||
|
@ -6,19 +12,19 @@ linbpq (6.0.24.38-1) unstable; urgency=medium
|
|||
|
||||
-- Dave Hibberd <hibby@debian.org> Sun, 09 Jun 2024 22:38:40 +0100
|
||||
|
||||
linbpq (6.0.24.34-2) unstable; urgency=medium
|
||||
linbpq (6.0.24.34-jammy2) jammy; urgency=medium
|
||||
|
||||
* Fix config permissions bug as reported by Alex 2E1PKY
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Mon, 08 Apr 2024 22:27:02 +0100
|
||||
|
||||
linbpq (6.0.24.34-1) unstable; urgency=medium
|
||||
linbpq (6.0.24.34-jammy1) jammy; urgency=medium
|
||||
|
||||
* Upstream bump
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Sat, 06 Apr 2024 02:15:28 +0100
|
||||
|
||||
linbpq (6.0.24.33-1) unstable; urgency=medium
|
||||
linbpq (6.0.24.33-jammy1) jammy; urgency=medium
|
||||
|
||||
* Upstream bump
|
||||
* Moved config file to examples
|
||||
|
@ -27,26 +33,38 @@ linbpq (6.0.24.33-1) unstable; urgency=medium
|
|||
|
||||
-- Dave Hibberd <hibby@debian.org> Tue, 26 Mar 2024 20:24:08 +0000
|
||||
|
||||
linbpq (6.0.24.30-1) unstable; urgency=medium
|
||||
linbpq (6.0.24.30-jammy1) jammy; urgency=medium
|
||||
|
||||
* Upstream bump
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Fri, 23 Feb 2024 23:24:46 +0000
|
||||
|
||||
linbpq (6.0.24.29-jammy1) jammy; urgency=medium
|
||||
|
||||
* Rebuild for jammy.
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Tue, 13 Feb 2024 00:16:46 +0000
|
||||
|
||||
linbpq (6.0.24.29-1) unstable; urgency=medium
|
||||
|
||||
* Upstream bump
|
||||
* Added my new details
|
||||
* Tidied up some packaging errors
|
||||
|
||||
-- Dave Hibberd <hibby@debian.org> Tue, 13 Feb 2024 00:06:33 +0000
|
||||
-- Dave Hibberd <hibby@debian.org> Tue, 13 Feb 2024 00:06:33 +0000-
|
||||
|
||||
linbpq (6.0.24.27-2) unstable; urgency=medium
|
||||
linbpq (6.0.24.27-jammy2) jammy; urgency=medium
|
||||
|
||||
* Permissions fix for web-config-editor users
|
||||
|
||||
-- Dave Hibberd <d@vehibberd.com> Thu, 18 Jan 2024 10:31:56 +0000
|
||||
|
||||
linbpq (6.0.24.27-jammy1) jammy; urgency=medium
|
||||
|
||||
* Rebuild for jammy.
|
||||
|
||||
-- Dave Hibberd <d@vehibberd.com> Tue, 16 Jan 2024 20:59:52 +0000
|
||||
|
||||
linbpq (6.0.24.27-1) unstable; urgency=medium
|
||||
|
||||
* New Upstream Release
|
||||
|
@ -59,18 +77,36 @@ linbpq (6.0.24.25-1) unstable; urgency=medium
|
|||
|
||||
-- Dave Hibberd <d@vehibberd.com> Thu, 28 Dec 2023 10:44:47 +0000
|
||||
|
||||
linbpq (6.0.24.22-jammy2) jammy; urgency=medium
|
||||
|
||||
* Rebuild for jammy.
|
||||
|
||||
-- Dave Hibberd <d@vehibberd.com> Sat, 16 Dec 2023 14:44:15 +0000
|
||||
|
||||
linbpq (6.0.24.22-2) unstable; urgency=medium
|
||||
|
||||
* Moved config file home, caused chaos
|
||||
|
||||
-- Dave Hibberd <d@vehibberd.com> Sat, 16 Dec 2023 14:40:20 +0000
|
||||
|
||||
linbpq (6.0.24.22-jammy1) jammy; urgency=medium
|
||||
|
||||
* Rebuild for jammy.
|
||||
|
||||
-- Dave Hibberd <d@vehibberd.com> Fri, 08 Dec 2023 12:36:41 +0000
|
||||
|
||||
linbpq (6.0.24.22-1) unstable; urgency=medium
|
||||
|
||||
* New Upstream Release
|
||||
|
||||
-- Dave Hibberd <d@vehibberd.com> Fri, 08 Dec 2023 12:29:40 +0000
|
||||
|
||||
linbpq (6.0.24.16-jammy1) jammy; urgency=medium
|
||||
|
||||
* jammy rebuild
|
||||
|
||||
-- Dave Hibberd <d@vehibberd.com> Tue, 31 Oct 2023 22:50:01 +0000
|
||||
|
||||
linbpq (6.0.24.16-1) unstable; urgency=medium
|
||||
|
||||
* New Upstream release
|
||||
|
|
187
upnp.c.bak
187
upnp.c.bak
|
@ -1,187 +0,0 @@
|
|||
// Includes code from MiniUPnPc, used subject to the following conditions:
|
||||
|
||||
/*
|
||||
|
||||
MiniUPnPc
|
||||
Copyright (c) 2005-2020, Thomas BERNARD
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* The name of the author may not be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#define MINIUPNP_STATICLIB
|
||||
|
||||
#include <stdio.h>
|
||||
#ifdef _WIN32
|
||||
#include "upnpcommands.h"
|
||||
#include "miniupnpc.h"
|
||||
#include "upnperrors.h"
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
#include <miniupnpc/upnpcommands.h>
|
||||
#include <miniupnpc/miniupnpc.h>
|
||||
#include <miniupnpc/upnperrors.h>
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
int AddMap(char * controlURL, char * eport, char * iport, char * proto);
|
||||
int DeleteMap(char * controlURL, char * eport, char * iport, char * proto);
|
||||
|
||||
void Consoleprintf(const char * format, ...);
|
||||
|
||||
struct UPNP
|
||||
{
|
||||
struct UPNP * Next;
|
||||
char * Protocol;
|
||||
char * LANport;
|
||||
char * WANPort;
|
||||
};
|
||||
|
||||
extern struct UPNP * UPNPConfig;
|
||||
|
||||
char * controlURL = 0;
|
||||
char * servicetype = 0;
|
||||
char iaddr[] = "IP";
|
||||
char * inClient = NULL;
|
||||
#ifdef LINBPQ
|
||||
char desc[] = "LinBPQ ";
|
||||
#else
|
||||
char desc[] = "BPQ32 ";
|
||||
#endif
|
||||
char * remoteHost = NULL;
|
||||
char * leaseDuration = NULL;
|
||||
|
||||
struct UPNPDev * devlist = 0;
|
||||
char lanaddr[64] = "unset"; /* my ip address on the LAN */
|
||||
struct UPNPUrls urls;
|
||||
struct IGDdatas data;
|
||||
|
||||
int i;
|
||||
const char * rootdescurl = 0;
|
||||
const char * multicastif = 0;
|
||||
const char * minissdpdpath = 0;
|
||||
int localport = UPNP_LOCAL_PORT_ANY;
|
||||
int retcode = 0;
|
||||
int error = 0;
|
||||
int ipv6 = 0;
|
||||
int ignore = 0;
|
||||
unsigned char ttl = 2;
|
||||
|
||||
|
||||
int upnpInit()
|
||||
{
|
||||
struct UPNP * Config = UPNPConfig;
|
||||
int i;
|
||||
#ifdef WIN32
|
||||
WSADATA wsaData;
|
||||
int nResult = WSAStartup(MAKEWORD(2,2), &wsaData);
|
||||
if(nResult != NO_ERROR)
|
||||
{
|
||||
fprintf(stderr, "WSAStartup() failed.\n");
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
while (Config)
|
||||
{
|
||||
if (devlist == NULL)
|
||||
{
|
||||
devlist = upnpDiscover(2000, multicastif, minissdpdpath, localport, ipv6, ttl, &error);
|
||||
|
||||
if (devlist == NULL)
|
||||
{
|
||||
Consoleprintf("Failed to find a UPNP device");
|
||||
return 0;
|
||||
}
|
||||
|
||||
i = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr));
|
||||
}
|
||||
|
||||
AddMap(devlist->descURL, Config->LANport, Config->WANPort, Config->Protocol);
|
||||
Config = Config->Next;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int upnpClose()
|
||||
{
|
||||
struct UPNP * Config = UPNPConfig;
|
||||
int i;
|
||||
|
||||
while (Config)
|
||||
{
|
||||
if (devlist == NULL)
|
||||
{
|
||||
devlist = upnpDiscover(2000, multicastif, minissdpdpath, localport, ipv6, ttl, &error);
|
||||
|
||||
if (devlist == NULL)
|
||||
{
|
||||
Consoleprintf("Failed to find a UPNP device");
|
||||
return 0;
|
||||
}
|
||||
|
||||
i = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr));
|
||||
}
|
||||
|
||||
DeleteMap(devlist->descURL, Config->LANport, Config->WANPort, Config->Protocol);
|
||||
Config = Config->Next;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int AddMap(char * controlURL, char * eport, char * iport, char * proto)
|
||||
{
|
||||
int r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,
|
||||
eport, iport, lanaddr, desc,
|
||||
proto, remoteHost, leaseDuration);
|
||||
|
||||
if (r != UPNPCOMMAND_SUCCESS)
|
||||
{
|
||||
Consoleprintf("UPNP AddPortMapping(%s, %s, %s) failed with code %d (%s)", eport, iport, lanaddr, r, strupnperror(r));
|
||||
return -2;
|
||||
}
|
||||
Consoleprintf("UPNP AddPortMapping(%s, %s, %s) Succeeded", eport, iport, lanaddr, r);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int DeleteMap(char * controlURL, char * eport, char * iport, char * proto)
|
||||
{
|
||||
int r = UPNP_DeletePortMapping(urls.controlURL, data.first.servicetype, eport, proto, remoteHost);
|
||||
|
||||
if(r != UPNPCOMMAND_SUCCESS)
|
||||
{
|
||||
Consoleprintf("UPNP DeletePortMapping(%s, %s, %s) failed with code %d (%s)", eport, iport, lanaddr, r, strupnperror(r));
|
||||
return -2;
|
||||
}
|
||||
Consoleprintf("UPNP DeletePortMapping(%s, %s, %s) Succeeded", eport, iport, lanaddr, r);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue