Skip to content

Commit

Permalink
Merge pull request #45 from zpc0/vncrepeater
Browse files Browse the repository at this point in the history
vncrepeater: import package
  • Loading branch information
neheb authored Sep 16, 2024
2 parents c56210d + 5fcb5f9 commit 86f6b3e
Show file tree
Hide file tree
Showing 3 changed files with 146 additions and 0 deletions.
69 changes: 69 additions & 0 deletions net/vncrepeater/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#
# Copyright (C) 2006-2014 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=vncrepeater
PKG_VERSION:=0.14
PKG_RELEASE:=2
PKG_MAINTAINER:=Jirka Spicak <[email protected]>
PKG_LICENSE:=GPL-2.0


PKG_SOURCE:=repeater014.zip
PKG_SOURCE_URL:=http://jtko.mbnet.fi/uvncrepeater
PKG_HASH:=79178e9baa9cac05f26e43f742933958707cb5c0632c51a5706b13922f3bb5b0

PKG_BUILD_PARALLEL:=1

include $(INCLUDE_DIR)/package.mk

define Package/vncrepeater
SECTION:=net
CATEGORY:=Network
DEPENDS:=+libstdcpp
TITLE:=UltraVNC repeater for Linux
URL:=http://www.uvnc.com/addons/repeater.html
endef

define Package/vncrepeater/conffiles
/etc/vncrepeater.conf
endef

define Package/vncrepeater/description
Viewer can be behind Nat router or directly connected to the internet
instead of forwarding serveral ports, you only need to forward 1 port.
If the PC that runs the Repeater has access to the local DNS server,
you can use your local DNS names instead of 10.10.10.12.
This could be handy when you have a dynamic DHCP server allocating
ip adresses for your PC.
endef

define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(PKG_UNPACK)
$(CP) $(PKG_BUILD_DIR)/../Ver014/* $(PKG_BUILD_DIR)/
rm -rf $(PKG_BUILD_DIR)/../Ver014/
$(Build/Patch)
endef

define Build/Compile
$(call Build/Compile/Default, \
CC="$(TARGET_CXX)" \
CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -fno-rtti" \
repeater \
)
endef

define Package/vncrepeater/install
$(INSTALL_DIR) $(1)/usr/sbin
$(CP) $(PKG_BUILD_DIR)/repeater $(1)/usr/sbin/$(PKG_NAME)
$(INSTALL_DIR) $(1)/etc
$(CP) $(PKG_BUILD_DIR)/uvncrepeater.ini $(1)/etc/vncrepeater.conf
endef

$(eval $(call BuildPackage,vncrepeater))
39 changes: 39 additions & 0 deletions net/vncrepeater/patches/001-uclibcxx_linking.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
--- a/Makefile
+++ b/Makefile
@@ -1,27 +1,28 @@
CFLAGS=-Wall
repeater: repeater.o repeaterproc.o openbsd_stringfuncs.o iniparser.o readini.o repeaterutil.o repeaterevents.o
- g++ $(CFLAGS) -o repeater repeater.o repeaterproc.o openbsd_stringfuncs.o iniparser.o readini.o repeaterutil.o repeaterevents.o
+ $(CC) $(CFLAGS) -o repeater repeater.o repeaterproc.o openbsd_stringfuncs.o iniparser.o readini.o repeaterutil.o repeaterevents.o $(LDFLAGS)

repeater.o: repeater.cpp
- g++ $(CFLAGS) -c repeater.cpp
+ $(CC) $(CFLAGS) -c repeater.cpp

repeaterproc.o: repeaterproc.cpp
- g++ $(CFLAGS) -c repeaterproc.cpp
+ $(CC) $(CFLAGS) -c repeaterproc.cpp

openbsd_stringfuncs.o: openbsd_stringfuncs.cpp
- g++ $(CFLAGS) -c openbsd_stringfuncs.cpp
+ $(CC) $(CFLAGS) -c openbsd_stringfuncs.cpp

iniparser.o: iniparser.cpp
- g++ $(CFLAGS) -c iniparser.cpp
+ $(CC) $(CFLAGS) -c iniparser.cpp

readini.o: readini.cpp
- g++ $(CFLAGS) -c readini.cpp
+ $(CC) $(CFLAGS) -c readini.cpp

repeaterutil.o: repeaterutil.cpp
- g++ $(CFLAGS) -c repeaterutil.cpp
+ $(CC) $(CFLAGS) -c repeaterutil.cpp

repeaterevents.o: repeaterevents.cpp
- g++ $(CFLAGS) -c repeaterevents.cpp
+ $(CC) $(CFLAGS) -c repeaterevents.cpp

clean:
rm -f *.o repeater
+
38 changes: 38 additions & 0 deletions net/vncrepeater/patches/002-cfg-path.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
--- a/repeater.cpp
+++ b/repeater.cpp
@@ -593,7 +593,9 @@ static bool checkIdCode(char *IdCode)
static long parseId(char *IdCode)
{
unsigned int ii;
- int retVal;
+ //PFaf 20101122: Minor correction due to compiler warning
+ //int retVal;
+ long retVal;

debug(LEVEL_3, "parseId(): IdCode = %s\n", IdCode);

@@ -998,9 +1000,13 @@ static bool isServerAddressAllowed(char
allow = false;

//server 0 == denied
- if ((srvAddr.a == 0) || (srvAddr.b == 0) || (srvAddr.c == 0) || (srvAddr.d == 0))
+ //Fix by PFaf - 20101122
+ //Server address can be X.0.0.Y i.e. 10.0.0.1
+ //since these are valid addresses, so we should not exclude them.
+ //Only exclude addresses that start or end with zeros (0).
+ //if ((srvAddr.a == 0) || (srvAddr.b == 0) || (srvAddr.c == 0) || (srvAddr.d == 0))
+ if ((srvAddr.a == 0) || (srvAddr.d == 0))
allow = false;
-

//allowed so far ?
if (allow)
@@ -1983,7 +1989,7 @@ int main(int argc, char **argv)
struct sigaction saInt;

//ini file default
- char defaultIniFilePathAndName[] = "/etc/uvncrepeater.ini";
+ char defaultIniFilePathAndName[] = "/etc/vncrepeater.conf";
char tmpBuf[MAX_PATH];
bool memoryOk;

0 comments on commit 86f6b3e

Please sign in to comment.