package lean: move to packages
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
parent
f57645200f
commit
ec4c3d0a75
@ -1,86 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt
|
||||
# <https://immortalwrt.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=UnblockNeteaseMusic-Go
|
||||
PKG_VERSION:=0.2.10
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/cnsilvan/UnblockNeteaseMusic/tar.gz/$(PKG_VERSION)?
|
||||
PKG_HASH:=2103562e399d04fcce0aa017057357e6fcec8beb6dc65c17ad1bdc06f38d6b7a
|
||||
|
||||
PKG_LICENSE:=GPL-3.0
|
||||
PKG_LICENSE_FILE:=LICENSE
|
||||
PKG_MAINTAINER:=Silvan <cnsilvan@gmail.com>
|
||||
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
CONFIG_UNBLOCKNETEASEMUSIC_GO_COMPRESS_GOPROXY \
|
||||
CONFIG_UNBLOCKNETEASEMUSIC_GO_COMPRESS_UPX
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(firstword $(subst -, ,$(PKG_NAME)))-$(PKG_VERSION)
|
||||
PKG_BUILD_DEPENDS:=golang/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
GO_PKG:=github.com/cnsilvan/UnblockNeteaseMusic
|
||||
GO_PKG_BUILD_PKG:=$$(GO_PKG)
|
||||
GO_PKG_LDFLAGS:=-s -w
|
||||
COMPILE_TIME:= $(shell TZ=UTC-8 date '+%Y-%m-%d %H:%M:%S')
|
||||
GO_PKG_LDFLAGS+= \
|
||||
-X '$(GO_PKG)/version.Version=$(PKG_VERSION)' \
|
||||
-X '$(GO_PKG)/version.BuildTime=$(COMPILE_TIME)' \
|
||||
-X '$(GO_PKG)/version.ExGoVersionInfo=$(GO_ARM) $(GO_MIPS)$(GO_MIPS64)'
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
|
||||
|
||||
define Package/UnblockNeteaseMusic-Go/config
|
||||
config UNBLOCKNETEASEMUSIC_GO_COMPRESS_GOPROXY
|
||||
bool "Compiling with GOPROXY proxy"
|
||||
default n
|
||||
|
||||
config UNBLOCKNETEASEMUSIC_GO_COMPRESS_UPX
|
||||
bool "Compress executable files with UPX"
|
||||
default y
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_UNBLOCKNETEASEMUSIC_GO_COMPRESS_GOPROXY),y)
|
||||
export GO111MODULE=on
|
||||
export GOPROXY=https://goproxy.io
|
||||
endif
|
||||
|
||||
define Package/UnblockNeteaseMusic-Go
|
||||
SECTION:=multimedia
|
||||
CATEGORY:=Multimedia
|
||||
TITLE:=Revive Netease Cloud Music (Golang)
|
||||
URL:=https://github.com/cnsilvan/UnblockNeteaseMusic
|
||||
DEPENDS:=$(GO_ARCH_DEPENDS)
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(call GoPackage/Build/Compile)
|
||||
ifeq ($(CONFIG_GOST_COMPRESS_UPX),y)
|
||||
$(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/UnblockNeteaseMusic
|
||||
endif
|
||||
endef
|
||||
|
||||
define Package/UnblockNeteaseMusic-Go/install
|
||||
$(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/UnblockNeteaseMusic $(1)/usr/bin/UnblockNeteaseMusic
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/share/UnblockNeteaseMusicGo
|
||||
$(CP) ./files/* $(1)/usr/share/UnblockNeteaseMusicGo/
|
||||
|
||||
endef
|
||||
|
||||
$(eval $(call GoBinPackage,UnblockNeteaseMusic-Go))
|
||||
$(eval $(call BuildPackage,UnblockNeteaseMusic-Go))
|
||||
@ -1,21 +0,0 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDdzCCAl+gAwIBAgIJAKX8LdIETDklMA0GCSqGSIb3DQEBCwUAMFIxCzAJBgNV
|
||||
BAYTAkNOMSQwIgYDVQQDDBtVbmJsb2NrTmV0ZWFzZU11c2ljIFJvb3QgQ0ExHTAb
|
||||
BgNVBAoMFEdpdEh1Yi5jb20gQG5vbmRhbmVlMB4XDTE5MDUxODE2MDU0NVoXDTI0
|
||||
MDUxNjE2MDU0NVowUjELMAkGA1UEBhMCQ04xJDAiBgNVBAMMG1VuYmxvY2tOZXRl
|
||||
YXNlTXVzaWMgUm9vdCBDQTEdMBsGA1UECgwUR2l0SHViLmNvbSBAbm9uZGFuZWUw
|
||||
ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQD23K6Ti2TfLJToCmpCAVgE
|
||||
Xb8+qTMfrifCpnKlJ+hrL+4KI1j4vSqTOOatqmxGSXZdF/j2kJuI40YThaokcgYx
|
||||
GFcPcEftSCYGWy8o20u2hzTkkW3KW9wlsDRIXICFXVIsHeSDwz+aVSudkyJHjfaS
|
||||
aLNb5pPovE7MRj8tDbp55scaSqhEcOe3m1ZlwlCeeXvD7RLKr3xhBKbGEqlJAjFq
|
||||
RNGzuqylqyJVBLScNHC7Lcf4n6pKr1yPGOeLePOUrIwtj0ynHUcBfeMuCVCsIKL8
|
||||
vy/oNwlDrZaAMfu5QQslzEf87KY1QgtI6Ppii+tzbmVx1ZxnlaCKqiuwlgBoi/5r
|
||||
AgMBAAGjUDBOMB0GA1UdDgQWBBRDhbGjnXEUouE9wNFS2k9PtgYYjDAfBgNVHSME
|
||||
GDAWgBRDhbGjnXEUouE9wNFS2k9PtgYYjDAMBgNVHRMEBTADAQH/MA0GCSqGSIb3
|
||||
DQEBCwUAA4IBAQDRUh5+JFLEALXQkhPfwrVf4sCXTwLMwVujTPo3NMbhpWiP4cnn
|
||||
XHGCD5V57bBwjeD6NSrczDIdnN9uTJyFmLNVFMZBguEIeZfLUJLJ6w1ZhfgciX1D
|
||||
9djyyo6eclkHvi+aPZKfzgMmc5BvHcjyUyS5MzI23kUW6WXUDn3IDIUKrfaH9Mjc
|
||||
/d4DDZVKQCYrLoBL+XO7pEHUY0u9XZVYWEavQ5tSN8XY1SDrO0yGUpRWET0ltubE
|
||||
zV7W0LOhuoVCiemboc5H8+njBjCis8obAo1XMmDZzW189L9GPFxHNWlka+KlajZB
|
||||
tMo90PooZYEOw1rTUrzHb+VZY/tYIAAomGZ0
|
||||
-----END CERTIFICATE-----
|
||||
@ -1,22 +0,0 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDkjCCAnqgAwIBAgIJAK/bIUIlE36LMA0GCSqGSIb3DQEBCwUAMFIxCzAJBgNV
|
||||
BAYTAkNOMSQwIgYDVQQDDBtVbmJsb2NrTmV0ZWFzZU11c2ljIFJvb3QgQ0ExHTAb
|
||||
BgNVBAoMFEdpdEh1Yi5jb20gQG5vbmRhbmVlMB4XDTIwMDUxNjE3MTIxM1oXDTIx
|
||||
MDUxNjE3MTIxM1owezELMAkGA1UEBhMCQ04xETAPBgNVBAcMCEhhbmd6aG91MSww
|
||||
KgYDVQQKDCNOZXRFYXNlIChIYW5nemhvdSkgTmV0d29yayBDby4sIEx0ZDERMA8G
|
||||
A1UECwwISVQgRGVwdC4xGDAWBgNVBAMMDyoubXVzaWMuMTYzLmNvbTCCASIwDQYJ
|
||||
KoZIhvcNAQEBBQADggEPADCCAQoCggEBALobECypwEoe8VqM/FJvBRR3p2T+ZWdi
|
||||
MSPrwfiRJr5p7OMtWBlLveCBV85+R3feidYbQTXlvVTdToY+GN6mFE1x6zG2dvLD
|
||||
s4UuRnipmvGcFYhIRTX8J4AJiN8VMtW0TNXscRMudpz/FAVtsRrggRaThYg4f/rI
|
||||
oAPMqKMsS4JoYhxs9ED6E6/tpj3XmSg1ekaXhgacYSYHeyxizZwoOFVCLH3TG5sF
|
||||
sD6CYNnukYol8bR+VRpvHftIYss5Yz+DyyhYEAMJm1CfQo+xoGR3D0ozbT3hUnzm
|
||||
fEoOhmSp3sALrFVE4iJSuajoh2/3xhmcyi3xZdWyq4F8hpb+URyaoW0CAwEAAaNC
|
||||
MEAwEwYDVR0lBAwwCgYIKwYBBQUHAwEwKQYDVR0RBCIwIIINbXVzaWMuMTYzLmNv
|
||||
bYIPKi5tdXNpYy4xNjMuY29tMA0GCSqGSIb3DQEBCwUAA4IBAQB+zW0o1169aGQI
|
||||
7GA/8BQ769svpkpdy/lfvkokapFjzoxLTBQhjMo9rqzmGOwr9ksePwQqSDXn685W
|
||||
mKnEl0CzhBrKnL5x3gHus8bg591xpW+01xAFXSyLITOfMJqMEdY7ylymkm0XZ3aN
|
||||
vm+yFdP1fr/bZNw6Wrprg3i7eGhj7TdBXRA96usVgBcnCkC1SzEZfnDZsKl9o8Xx
|
||||
TSOpvzIMSaD7++Bp7BdzA5oCCydv2c++zV/sgCPIr26Jq8UQac+qQP5SMlYyGbAl
|
||||
vIQRRZyfQ4fPonYDnEPHWFCMyBkQIN39LMhDRsUgn8bT0rnP91xkNAd9S4VWbNDA
|
||||
5TMiQy3F
|
||||
-----END CERTIFICATE-----
|
||||
@ -1,27 +0,0 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEowIBAAKCAQEAuhsQLKnASh7xWoz8Um8FFHenZP5lZ2IxI+vB+JEmvmns4y1Y
|
||||
GUu94IFXzn5Hd96J1htBNeW9VN1Ohj4Y3qYUTXHrMbZ28sOzhS5GeKma8ZwViEhF
|
||||
NfwngAmI3xUy1bRM1exxEy52nP8UBW2xGuCBFpOFiDh/+sigA8yooyxLgmhiHGz0
|
||||
QPoTr+2mPdeZKDV6RpeGBpxhJgd7LGLNnCg4VUIsfdMbmwWwPoJg2e6RiiXxtH5V
|
||||
Gm8d+0hiyzljP4PLKFgQAwmbUJ9Cj7GgZHcPSjNtPeFSfOZ8Sg6GZKnewAusVUTi
|
||||
IlK5qOiHb/fGGZzKLfFl1bKrgXyGlv5RHJqhbQIDAQABAoIBAEmAvtalBMlBh1mY
|
||||
LV/xcTQwPfDpeOtoILhrOOUPjxnNhD4FfrIe9BNjgmaQAXIadp4VjZ/X6PtHnOfw
|
||||
RqpJNeOQhq/PvRMMsC59pF+rvQKH/wkgYhV8Ta2IFoLlQHqfB2nGRLKquzYumJ28
|
||||
QSK4YMOl6CtxBTrrWiemAUTRDdGm8tARiipJH1SEJrS6d/NoRoJx2vixFgD2eS6X
|
||||
bjnhGjIzvX/w5FWjctqj+SFITP1UI62b6DyWsPOkoosKNteK+Ulz+K6ZFvOx7day
|
||||
XgUoTcVpwCVr2dVGhJtOrbKPcl1jYCYHJAHwzUZND4x4yftm1mnnsi3bthYqbtHQ
|
||||
vxLE9YECgYEA9hiZxwiVvLjSe1xT/D75HbB8S1XSnwzpMmqgzStguxCQ0Qg5yiLI
|
||||
UKRDY8UZvEDV4i2bQGy7mk8lFvX1q2z7Q30+dtT9r2N9a6ujMk5RMfo2BZg/poI6
|
||||
yDWe2tKUg9cTwfgni4TutLOYkpz3VDPIQHs3k2mpNh7f+8X4RIybDqkCgYEAwZhp
|
||||
uWMV38Bb0WytswHXL1dRuwBskKqALUBY61dtXkyBuocj8AuRRxfxfZpgJRrHFxDX
|
||||
O9bQ2nxpVlwKsR6DJDUdxU3+kvwyPfseU5XUBey8WdkuAKD7cKZOHMhFVWccks0U
|
||||
YJzykNrxB+rGTiwVKa0MOhipuJ7boerwwaN2SyUCgYBP9Ow5o4tq9q3EUNoksZ0k
|
||||
zUuE+oxlCr/VlplKL9bM0HQMxlxoVWa59LTEfKyA4pvbUbAIfYtydlZ5oE5CdTUp
|
||||
105tM4R88Jk2W1y5ooJ093OH29CKW/OXSvyi4hpIv592vRa0GOupoFRpBkDBhdWB
|
||||
RcdnyMOmht+FIOwp8XkLiQKBgAUK3j4Y6ZnxXbLfvMp70soF4TgYs7s05a/IDEjc
|
||||
9xlMrthX6sS22GrcocqeucBdqS/dnW2Ok9QNB4VbUl/4pnvL8mGQPYBAl2Jr5wdQ
|
||||
ULxyxRkmAf+8MbBmdIRlZwDpdaIRO2Wk0OCbA0osgEvK9CYovrfIqqsHYDsgbnLs
|
||||
ugkNAoGBAJok06BN05caPXXLQ2pMwI/7mjcZFjcOMxSloYi7LFkxlyvoTqReAeSa
|
||||
yOb6W/7obS1X8ms/EAkqiyzJuPtNZJCW/nvV0iCoZ/NxLuyHnFaO344GBAweol+S
|
||||
Jx0MY8KuDCyeGErc2xdz/yr3ld2PSTq71dhBluGyba2YX+peJ2Yv
|
||||
-----END RSA PRIVATE KEY-----
|
||||
@ -1,54 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt
|
||||
# <https://immortalwrt.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=UnblockNeteaseMusic
|
||||
PKG_VERSION:=0.25.3
|
||||
PKG_RELEASE:=6
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/nondanee/UnblockNeteaseMusic.git
|
||||
PKG_SOURCE_DATE:=2020-12-22
|
||||
PKG_SOURCE_VERSION:=b8d5f4b4fe59cef9c021b99f3cf2606d99fa4790
|
||||
PKG_MIRROR_HASH:=bd7fa102415ae8dbcd22829fce5ad0cd358a0869547c30f10271389e6c698317
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILE:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/UnblockNeteaseMusic
|
||||
SECTION:=multimedia
|
||||
CATEGORY:=Multimedia
|
||||
TITLE:=Revive Netease Cloud Music (NodeJS)
|
||||
URL:=https://github.com/nondanee/UnblockNeteaseMusic
|
||||
DEPENDS:=+node +libopenssl
|
||||
PKGARCH:=all
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
xzcat $(DL_DIR)/$(PKG_SOURCE) | $(TAR) -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
echo -e $(PKG_VERSION) > $(PKG_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/core_ver
|
||||
echo -e $(PKG_SOURCE_VERSION) > $(PKG_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/local_ver
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
true
|
||||
endef
|
||||
|
||||
define Package/UnblockNeteaseMusic/install
|
||||
$(INSTALL_DIR) $(1)/usr/share/UnblockNeteaseMusic
|
||||
$(CP) $(PKG_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/* $(1)/usr/share/UnblockNeteaseMusic
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,UnblockNeteaseMusic))
|
||||
@ -1,73 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2015-2016 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=adbyby
|
||||
PKG_VERSION:=2.7
|
||||
PKG_RELEASE:=2
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/adbyby
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Powerful adblock module to block ad.
|
||||
DEPENDS:=@(i386||x86_64||arm||aarch64||mipsel||mips)
|
||||
URL:=http://www.adbyby.com/
|
||||
endef
|
||||
|
||||
define Package/adbyby/description
|
||||
Adbyby is a powerful adblock module to block ad,just like adblock.
|
||||
endef
|
||||
|
||||
ifeq ($(ARCH),i386)
|
||||
ADBYBY_DIR:=x86
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),x86_64)
|
||||
ADBYBY_DIR:=amd64
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),arm)
|
||||
ADBYBY_DIR:=armv7
|
||||
ifeq ($(CONFIG_HAS_FPU),)
|
||||
ADBYBY_DIR:=arm
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),aarch64)
|
||||
ADBYBY_DIR:=armv7
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),mips)
|
||||
ADBYBY_DIR:=mips
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),mipsel)
|
||||
ADBYBY_DIR:=mipsle
|
||||
endif
|
||||
|
||||
define Build/Compile
|
||||
true
|
||||
endef
|
||||
|
||||
define Package/adbyby/install
|
||||
$(INSTALL_DIR) $(1)/usr/share/adbyby
|
||||
$(INSTALL_BIN) ./files/adbyby.sh $(1)/usr/share/adbyby/
|
||||
$(INSTALL_CONF) ./files/adhook.ini $(1)/usr/share/adbyby/
|
||||
$(INSTALL_CONF) ./files/user.action $(1)/usr/share/adbyby/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/share/adbyby/data
|
||||
$(INSTALL_DATA) ./files/data/* $(1)/usr/share/adbyby/data/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/share/adbyby/doc
|
||||
$(INSTALL_DATA) ./files/doc/* $(1)/usr/share/adbyby/doc/
|
||||
|
||||
$(INSTALL_BIN) ./files/$(ADBYBY_DIR)/adbyby $(1)/usr/share/adbyby/adbyby
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,adbyby))
|
||||
@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
PROG_PATH=/usr/share/adbyby
|
||||
err=0
|
||||
until [ $err -ge 5 ]; do
|
||||
if [ -n "$(pgrep $PROG_PATH/adbyby)" ]; then
|
||||
iptables-save | grep ADBYBY >/dev/null || \
|
||||
/etc/init.d/adbyby add_rule
|
||||
sleep 10
|
||||
err=0
|
||||
else
|
||||
$PROG_PATH/adbyby --no-daemon &>/dev/null &
|
||||
sleep 1
|
||||
err=$((err+1))
|
||||
fi
|
||||
done
|
||||
/etc/init.d/adbyby del_rule
|
||||
@ -1,14 +0,0 @@
|
||||
[cfg]
|
||||
### 2.1 ###
|
||||
listen-address=0.0.0.0:8118
|
||||
buffer-limit=1024
|
||||
keep-alive-timeout=30
|
||||
socket-timeout=60
|
||||
### 2.5 ###
|
||||
max_client_connections=0
|
||||
### 2.6 ###
|
||||
stack_size=200
|
||||
auto_restart=0
|
||||
### 2.7 ###
|
||||
debug=0
|
||||
ipset=0
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,25 +0,0 @@
|
||||
! -----¸üÐÂʱ¼ä: 2018-10-08 23:07:52 by:xwhyc-----
|
||||
.php?ad=
|
||||
/99rejs/js
|
||||
/agetsou.js^
|
||||
/c@*!25.js|$script
|
||||
/cococ-66/$script
|
||||
/defaultts.tc.qq.com/*.ts?index=0&start=0&
|
||||
/defaultts.tc.qq.com/*.ts?index=0&start=0&end=*&ver=4
|
||||
/gg_js/
|
||||
/imgs.js?t=
|
||||
/js/adtop.js|
|
||||
/js/guanggao_gg.js?d=
|
||||
/js/sss/ad.js
|
||||
/static/js/aall.js
|
||||
/unionjs/$script
|
||||
/variety.tc.qq.com/*.mp4^*fmt=hd
|
||||
/variety.tc.qq.com/*.mp4^*fmt=shd
|
||||
/video.dispatch.tc.qq.com/*.mp4^*sdtfrom=
|
||||
/view/image/QT_HY.jpg?t=
|
||||
/view/js/slade.js|$script
|
||||
/vlive.qqvideo.tc.qq.com/*.mp4^*fmt=hd
|
||||
/vlive.qqvideo.tc.qq.com/*.mp4^*fmt=shd
|
||||
/vmind.qqvideo.tc.qq.com/*.mp4^*sdtfrom=
|
||||
/vmindhls.tc.qq.com/*ugc=0&ga=0&gv=0&start=
|
||||
/zzhzgg.js
|
||||
@ -1,15 +0,0 @@
|
||||
! ------------------------------ ADByby 自定义过滤语法简表---------------------------------
|
||||
! -------------- 规则基于abp规则,并进行了字符替换部分的扩展-----------------------------
|
||||
! ABP规则请参考https://adblockplus.org/zh_CN/filters,下面为大致摘要
|
||||
! "!" 为行注释符,注释行以该符号起始作为一行注释语义,用于规则描述
|
||||
! "*" 为字符通配符,能够匹配0长度或任意长度的字符串,该通配符不能与正则语法混用。
|
||||
! "^" 为分隔符,可以是除了字母、数字或者 _ - . % 之外的任何字符。
|
||||
! "|" 为管线符号,来表示地址的最前端或最末端
|
||||
! "||" 为子域通配符,方便匹配主域名下的所有子域。
|
||||
! "~" 为排除标识符,通配符能过滤大多数广告,但同时存在误杀, 可以通过排除标识符修正误杀链接。
|
||||
! "##" 为元素选择器标识符,后面跟需要隐藏元素的CSS样式例如 #ad_id .ad_class
|
||||
!! 元素隐藏暂不支持全局规则和排除规则
|
||||
!! 字符替换扩展
|
||||
! 文本替换选择器标识符,后面跟需要替换的文本数据,格式:$s@模式字符串@替换后的文本@
|
||||
! 支持通配符*和?
|
||||
! -------------------------------------------------------------------------------------------
|
||||
@ -1,30 +0,0 @@
|
||||
! -----更新时间: 2018-10-08 23:06:11 by:xwhyc-----------------------------------------------
|
||||
! -----广告反馈:http://www.adbyby.com/help.htm QQ群: 79547134(满), 364066294(满),470705224(满),534897434,438394572--------------
|
||||
|
||||
|
||||
!-------------------------------------------
|
||||
/showadv/
|
||||
3199.cn###ad640,[id^="ad0"]
|
||||
76fengyun.com###down_box{display:block!important;}.gggg,.ggao
|
||||
9553.com##[class="zm"]
|
||||
962.net##.show_ad,.g-962-ad
|
||||
amazon.cn##.adv-float-div
|
||||
downsx.rocks##.adbox,.Left-ad3_fixed,.google-ad2_fixed
|
||||
edu-acc.cn###doyoo_monitor
|
||||
fx678.com##[class^="adv-"]
|
||||
||76fengyun.com/body22233.js
|
||||
||76fengyun.com/file/$s@onclick="window.open('*');startWait();"@onclick="window.open(document.getElementById('downpage_link').href);startWait();"@
|
||||
||atanx.alicdn.com/t/tanxssp.js?_v=
|
||||
||biquguan.com/guan/$script
|
||||
||djv99sxoqpv11.cloudfront.net
|
||||
||jmxlaser.com
|
||||
||jump2.bdimg.com/p/$s@<div class="l_post l_post_bright j_l_post clearfix ?????????? "@<div style="display:none"@
|
||||
||nxkycx.com
|
||||
||res.jklan.cn/wp-content/themes/tt/js/system.js?ver=$s@function goto()@function xxx()@
|
||||
||tieba.com/p/$s@<div class="l_post l_post_bright j_l_post clearfix ?????????? "@<div style="display:none"@
|
||||
||ychap.com
|
||||
!-----------------------
|
||||
/qkostn.js|
|
||||
|http://mark.l.qq.com/fcgi-bin/get_video_mark_all*&strAdParam=
|
||||
!---------adbyby---------
|
||||
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
@ -1,10 +0,0 @@
|
||||
;¸üйæÔòurl,dir,size,reverse,reverse
|
||||
http://update.adbyby.com/rule3/lazy.jpg \data\lazy.txt 385337 4 0
|
||||
http://update.adbyby.com/rule3/video.jpg \data\video.txt 1028 4 0
|
||||
http://update.adbyby.com/rule3/user.action \user.action 512 5 0
|
||||
http://update.adbyby.com/rule3/clean.ini \data\clean.ini 2167 0 0
|
||||
http://update.adbyby.com/rule3/adclear.ini \data\adclear.ini 4901 0 0
|
||||
https://github.com/gchangchen/suho/raw/master/adhook.dll \adhook.dll 117248 0 0 2.4.3.2
|
||||
https://github.com/gchangchen/suho/raw/master/adhook64.dll \adhook64.dll 142848 0 0 2.4.3.2
|
||||
https://github.com/gchangchen/suho/raw/master/adbyby.exe \adbyby.exe 1004183 1 0 2.4.4.0
|
||||
|
||||
Binary file not shown.
@ -1,102 +0,0 @@
|
||||
# Copyright (C) 2021 ImmortalWrt
|
||||
# <https://immortalwrt.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=aMule
|
||||
PKG_VERSION:=2.3.2
|
||||
PKG_RELEASE:=5
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/amule-project/amule.git
|
||||
PKG_SOURCE_DATE:=2021-01-30
|
||||
PKG_SOURCE_VERSION:=c3a1018329633234ac941055b64a43b9e2df7fad
|
||||
PKG_MIRROR_HASH:=f03b60e909346c4d984aeb9cf3a115b5b43fa6158ee01ed41b99e7217b436bb7
|
||||
|
||||
PKG_CONFIG_DEPEDS:= CONFIG_AMULE_CRYPTOPP_STATIC_LINKING
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_BUILD_DEPENDS:=libcryptopp libgd
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
|
||||
define Package/amule
|
||||
SUBMENU:=P2P
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=A multi-platform eMule-like ed2k client
|
||||
URL:=http://www.amule.org/
|
||||
DEPENDS:=+libpng +libpthread +libncurses +libreadline +libwxbase +libupnp +libbfd \
|
||||
$(ICONV_DEPENDS) $(INTL_DEPENDS) +!AMULE_CRYPTOPP_STATIC_LINKING:libcryptopp
|
||||
endef
|
||||
|
||||
define Package/amule/config
|
||||
config AMULE_CRYPTOPP_STATIC_LINKING
|
||||
bool "Link libcryptopp statically"
|
||||
default n
|
||||
endef
|
||||
|
||||
TARGET_LDFLAGS+= -liconv
|
||||
|
||||
CONFIGURE_ARGS+= \
|
||||
--disable-static \
|
||||
--disable-rpath \
|
||||
--with-gnu-ld \
|
||||
--disable-ccache \
|
||||
--disable-optimize \
|
||||
--disable-profile \
|
||||
--disable-monolithic \
|
||||
--enable-amule-daemon \
|
||||
--enable-amulecmd \
|
||||
--enable-webserver \
|
||||
--disable-amule-gui \
|
||||
--disable-cas \
|
||||
--disable-wxcas \
|
||||
--disable-ed2k \
|
||||
--disable-alc \
|
||||
--disable-alcc \
|
||||
--disable-fileview \
|
||||
--disable-plasmamule \
|
||||
--without-wxdebug \
|
||||
--enable-dlp \
|
||||
--enable-upnp \
|
||||
--with-zlib="$(STAGING_DIR)/usr" \
|
||||
--with-gdlib-prefix="$(STAGING_DIR)/usr" \
|
||||
--with-libpng-prefix="$(STAGING_DIR)/usr" \
|
||||
--with-wx-prefix="$(STAGING_DIR)/usr" \
|
||||
--with-crypto-prefix="$(STAGING_DIR)/usr" \
|
||||
--with-libiconv-prefix="$(ICONV_PREFIX)" \
|
||||
--with-libintl-prefix="$(INTL_PREFIX)" \
|
||||
--with-libupnp-prefix="$(STAGING_DIR)/usr" \
|
||||
--without-x \
|
||||
--disable-debug
|
||||
|
||||
MAKE_FLAGS += HOSTCC="$(HOSTCC)"
|
||||
|
||||
define Build/Configure
|
||||
cd $(PKG_BUILD_DIR); $(SHELL) autogen.sh
|
||||
$(call Build/Configure/Default)
|
||||
ifeq ($(CONFIG_AMULE_CRYPTOPP_STATIC_LINKING),y)
|
||||
$(SED) 's;^CRYPTOPP_LIBS.*;CRYPTOPP_LIBS \= "$(STAGING_DIR)/usr/lib/libcryptopp.a";g' \
|
||||
$(PKG_BUILD_DIR)/src/Makefile
|
||||
endif
|
||||
endef
|
||||
|
||||
define Package/amule/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/amulecmd $(1)/usr/bin/amulecmd
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/amuled $(1)/usr/bin/amuled
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/amuleweb $(1)/usr/bin/amuleweb
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/share
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/share/amule $(1)/usr/share/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,amule))
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,22 +0,0 @@
|
||||
--- a/m4/libupnp.m4
|
||||
+++ b/m4/libupnp.m4
|
||||
@@ -57,7 +57,6 @@ dnl Test for --with-libupnp-prefix
|
||||
])
|
||||
|
||||
dnl Check for libupnp >= MIN_LIBUPNP_VERSION
|
||||
- AS_IF([test $cross_compiling = no], [
|
||||
AC_MSG_CHECKING([for libupnp version >= MIN_LIBUPNP_VERSION])
|
||||
AS_IF([test -n "$PKG_CONFIG"], [
|
||||
AS_IF([$PKG_CONFIG libupnp --exists], [
|
||||
@@ -84,11 +83,6 @@ dnl Check for libupnp >= MIN_LIBUPNP_VER
|
||||
])
|
||||
AC_MSG_RESULT([$result$resultstr])
|
||||
libupnp_error="libupnp >= MIN_LIBUPNP_VERSION not found$resultstr"
|
||||
- ], [
|
||||
-dnl Currently cross-compilation with libupnp is not supported.
|
||||
- result=no
|
||||
- libupnp_error="cross compiling"
|
||||
- ])
|
||||
|
||||
dnl Execute the right action.
|
||||
AS_IF([test ${result:-no} = yes], [$2], [$3])
|
||||
@ -1,47 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt
|
||||
# <https://immortalwrt.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=antileech
|
||||
PKG_VERSION:=2.3.2
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_BUILD_DEPENDS:=libgd
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
|
||||
define Package/antileech
|
||||
SUBMENU:=P2P
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=AntiLeech for amule
|
||||
URL:=http://www.amule.org/
|
||||
DEPENDS:=+libc +amule +libwxbase
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
$(SED) "s:^AC_CHECK_PROG.WXCONFIG,.*::g" $(PKG_BUILD_DIR)/configure.ac
|
||||
$(SED) "s:wx-config --cppflags:$(STAGING_DIR)/usr/bin/wx-config --cppflags:g" $(PKG_BUILD_DIR)/configure.ac
|
||||
|
||||
cd $(PKG_BUILD_DIR); $(SHELL) ./autogen.sh
|
||||
$(call Build/Configure/Default)
|
||||
endef
|
||||
|
||||
MAKE_FLAGS += HOSTCC="$(HOSTCC)"
|
||||
|
||||
define Package/antileech/install
|
||||
$(INSTALL_DIR) $(1)/usr/share/amule
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/share/amule/libantiLeech.so* $(1)/usr/share/amule/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,antileech))
|
||||
@ -1,63 +0,0 @@
|
||||
/**
|
||||
* Author: Bill Lee<bill.lee.y@gmail.com>
|
||||
* License: GNU GPL
|
||||
*/
|
||||
//---------------------
|
||||
#ifndef CSTRING_WX_H
|
||||
#define CSTRING_WX_H
|
||||
|
||||
//#include <wx/wx.h>
|
||||
#include <wx/string.h>
|
||||
|
||||
class CString : public wxString{
|
||||
public:
|
||||
CString(){}
|
||||
CString(wxChar c, size_t n=1): wxString(c, n){}
|
||||
CString(const wxChar* str): wxString(str){}
|
||||
CString(const wxString& str): wxString(str){}
|
||||
CString(const CString& str): wxString(str){}
|
||||
//---------------------
|
||||
CString& operator=(const wxChar* str){
|
||||
wxString::operator=(str);
|
||||
return *this;
|
||||
}
|
||||
//operator*() from wxString;
|
||||
size_t GetLength()const{ return Length(); }
|
||||
wxChar GetAt(size_t nIndex)const{ return GetChar(nIndex); }
|
||||
//IsEmpty() from wxString;
|
||||
CString& TrimLeft(wxChar c){
|
||||
size_t pos = find_first_not_of(c);
|
||||
if(pos == 0)
|
||||
return *this;
|
||||
erase(0, pos);
|
||||
return *this;
|
||||
}
|
||||
CString& TrimRight(wxChar c){
|
||||
size_t pos = find_last_not_of(c) + 1;
|
||||
if(pos == Length())
|
||||
return *this;
|
||||
erase(pos, Length() - pos);
|
||||
return *this;
|
||||
}
|
||||
CString Trim(){
|
||||
CString ret(*this);
|
||||
ret.wxString::Trim(false); /* wxString::Trim(bool fromright = true) */
|
||||
ret.wxString::Trim(true);
|
||||
return ret;
|
||||
}
|
||||
//Find(wxChar) and Find(wxChar*) from wxString;
|
||||
int Find(const CString& str)const{ return wxString::Find(str.c_str()); }
|
||||
int ReverseFind(const wxChar c)const{ return wxString::Find(c, true); }
|
||||
int ReverseFind(const wxChar* str)const{ return rfind(str); }
|
||||
int ReverseFind(const CString& str)const{ return rfind(str); }
|
||||
CString Right(size_t len)const{ return wxString::Right(len); }
|
||||
CString Left(size_t len)const{ return wxString::Left(len); }
|
||||
#if wxCHECK_VERSION(2, 9, 0)
|
||||
CString Mid(size_t first, size_t count = wxString::npos)const{
|
||||
#else
|
||||
CString Mid(size_t first, size_t count = wxSTRING_MAXLEN)const{
|
||||
#endif
|
||||
return wxString::Mid(first, count);
|
||||
}
|
||||
};
|
||||
#endif
|
||||
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* =====================================================================================
|
||||
*
|
||||
* Filename: Interface.cpp
|
||||
*
|
||||
* Description: A part of aMule DLP
|
||||
*
|
||||
* Created: 2011-02-24 19:49
|
||||
*
|
||||
* Author: Bill Lee , bill.lee.y@gmail.com
|
||||
*
|
||||
* Copyright (c) 2011, Bill Lee
|
||||
* License: GNU General Public License
|
||||
*
|
||||
* =====================================================================================
|
||||
*/
|
||||
|
||||
/* ##### HEADER FILE INCLUDES ################################################### */
|
||||
#include "antiLeech.h"
|
||||
|
||||
/* ##### FUNCTION DEFINITIONS - EXPORTED FUNCTIONS ############################ */
|
||||
extern "C" IantiLeech* createAntiLeechInstant(){
|
||||
return new CantiLeech;
|
||||
}
|
||||
extern "C" int destoryAntiLeechInstant(IantiLeech* ptr){
|
||||
delete ptr;
|
||||
return 0;
|
||||
}
|
||||
@ -1,16 +0,0 @@
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
pkgdir = $(datadir)/amule
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
pkg_LTLIBRARIES = libantiLeech.la
|
||||
libantiLeech_la_CPPFLAGS = ${ANTILEECH_CPPFLAGS}
|
||||
libantiLeech_la_LDFLAGS = ${ANTILEECH_LDFLAGS} -module -avoid-version --no-la-files
|
||||
libantiLeech_la_SOURCES = \
|
||||
antiLeech.h \
|
||||
antiLeech_wx.h \
|
||||
CString_wx.h \
|
||||
antiLeech.cpp \
|
||||
antiLeech_wx.cpp \
|
||||
Interface.cpp
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,161 +0,0 @@
|
||||
#ifndef ANTILEECH_H
|
||||
#define ANTILEECH_H
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "antiLeech_wx.h"
|
||||
#include "CString_wx.h"
|
||||
|
||||
class IantiLeech
|
||||
{
|
||||
public:
|
||||
virtual ~IantiLeech(){}; /* Bill Lee: Not be used currently */
|
||||
//BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD,LPVOID);
|
||||
virtual DWORD GetDLPVersion() = 0;
|
||||
//old versions to keep compatible
|
||||
/* //drop old version support
|
||||
virtual LPCTSTR DLPCheckModstring(LPCTSTR modversion, LPCTSTR clientversion);
|
||||
virtual LPCTSTR DLPCheckUsername(LPCTSTR username);
|
||||
virtual LPCTSTR DLPCheckNameAndHash(CString username, CString& userhash);
|
||||
*/
|
||||
//new versions
|
||||
virtual LPCTSTR DLPCheckModstring_Hard(LPCTSTR modversion, LPCTSTR clientversion) = 0;
|
||||
virtual LPCTSTR DLPCheckModstring_Soft(LPCTSTR modversion, LPCTSTR clientversion) = 0;
|
||||
virtual LPCTSTR DLPCheckUsername_Hard(LPCTSTR username) = 0;
|
||||
virtual LPCTSTR DLPCheckUsername_Soft(LPCTSTR username) = 0;
|
||||
virtual LPCTSTR DLPCheckNameAndHashAndMod(const CString& username, const CString& userhash, const CString& modversion) = 0;
|
||||
virtual LPCTSTR DLPCheckMessageSpam(LPCTSTR messagetext) = 0;
|
||||
|
||||
|
||||
virtual LPCTSTR DLPCheckUserhash(const PBYTE userhash) = 0;
|
||||
|
||||
|
||||
virtual LPCTSTR DLPCheckHelloTag(UINT tagnumber) = 0;
|
||||
virtual LPCTSTR DLPCheckInfoTag(UINT tagnumber) = 0;
|
||||
|
||||
//void TestFunc();
|
||||
|
||||
//Bill Lee: no need in interface abstract class
|
||||
//private:
|
||||
// static bool IsTypicalHex (const CString& addon);
|
||||
};
|
||||
|
||||
//Bill Lee: never call delete on IantiLeech, use destoryAntiLeechInstat instead.
|
||||
extern "C" IantiLeech* createAntiLeechInstant();
|
||||
extern "C" int destoryAntiLeechInstant(IantiLeech*);
|
||||
|
||||
class CantiLeech: public IantiLeech
|
||||
{
|
||||
public:
|
||||
//BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD,LPVOID);
|
||||
virtual DWORD GetDLPVersion(){ return DLPVersion; }
|
||||
//old versions to keep compatible
|
||||
/* //drop old version support
|
||||
virtual LPCTSTR DLPCheckModstring(LPCTSTR modversion, LPCTSTR clientversion);
|
||||
virtual LPCTSTR DLPCheckUsername(LPCTSTR username);
|
||||
virtual LPCTSTR DLPCheckNameAndHash(CString username, CString& userhash);
|
||||
*/
|
||||
//new versions
|
||||
virtual LPCTSTR DLPCheckModstring_Hard(LPCTSTR modversion, LPCTSTR clientversion);
|
||||
virtual LPCTSTR DLPCheckModstring_Soft(LPCTSTR modversion, LPCTSTR clientversion);
|
||||
virtual LPCTSTR DLPCheckUsername_Hard(LPCTSTR username);
|
||||
virtual LPCTSTR DLPCheckUsername_Soft(LPCTSTR username);
|
||||
virtual LPCTSTR DLPCheckNameAndHashAndMod(const CString& username, const CString& userhash, const CString& modversion);
|
||||
virtual LPCTSTR DLPCheckMessageSpam(LPCTSTR messagetext);
|
||||
|
||||
|
||||
virtual LPCTSTR DLPCheckUserhash(const PBYTE userhash);
|
||||
|
||||
|
||||
virtual LPCTSTR DLPCheckHelloTag(UINT tagnumber);
|
||||
virtual LPCTSTR DLPCheckInfoTag(UINT tagnumber);
|
||||
|
||||
//void TestFunc();
|
||||
|
||||
private:
|
||||
static const DWORD DLPVersion;
|
||||
static bool IsTypicalHex (const CString& addon);
|
||||
};
|
||||
|
||||
//<<< new tags from eMule 0.04x
|
||||
#define CT_UNKNOWNx0 0x00 // Hybrid Horde protocol
|
||||
#define CT_UNKNOWNx12 0x12 // http://www.haspepapa-welt.de (DodgeBoards)
|
||||
#define CT_UNKNOWNx13 0x13 // http://www.haspepapa-welt.de (DodgeBoards)
|
||||
#define CT_UNKNOWNx14 0x14 // http://www.haspepapa-welt.de (DodgeBoards)
|
||||
#define CT_UNKNOWNx15 0x15 // http://www.haspepapa-welt.de (DodgeBoards) & DarkMule |eVorte|X|
|
||||
#define CT_UNKNOWNx16 0x16 // http://www.haspepapa-welt.de (DodgeBoards)
|
||||
#define CT_UNKNOWNx17 0x17 // http://www.haspepapa-welt.de (DodgeBoards)
|
||||
#define CT_UNKNOWNx4D 0x4D // pimp my mule (00de)
|
||||
#define CT_UNKNOWNxE6 0xE6 // http://www.haspepapa-welt.de
|
||||
#define CT_UNKNOWNx22 0x22 // DarkMule |eVorte|X|
|
||||
#define CT_UNKNOWNx5D 0x5D // md4
|
||||
#define CT_UNKNOWNx63 0x63 // ?
|
||||
#define CT_UNKNOWNx64 0x64 // ?
|
||||
#define CT_UNKNOWNx69 0x69 // eMuleReactor //Xman don't use this, it's webcache!
|
||||
#define CT_UNKNOWNx6B 0x6B // md4
|
||||
#define CT_UNKNOWNx6C 0x6C // md4
|
||||
#define CT_UNKNOWNx74 0x74 // md4
|
||||
#define CT_UNKNOWNx76 0x76 // www.donkey2002.to
|
||||
#define CT_UNKNOWNx79 0x79 // Bionic
|
||||
#define CT_UNKNOWNx7A 0x7A // NewDarkMule
|
||||
#define CT_UNKNOWNx83 0x83 // Fusspi
|
||||
#define CT_UNKNOWNx87 0x87 // md4
|
||||
#define CT_UNKNOWNx88 0x88 // DarkMule v6 |eVorte|X|
|
||||
#define CT_UNKNOWNx8c 0x8c // eMule v0.27c [LSD7c]
|
||||
#define CT_UNKNOWNx8d 0x8d // unknown Leecher - (client version:60)
|
||||
#define CT_UNKNOWNx94 0x94 // 00.de community //Xman 20.08.05
|
||||
#define CT_UNKNOWNx97 0x97 // Emulereactor Community Mod
|
||||
#define CT_UNKNOWNx98 0x98 // Emulereactor Community Mod
|
||||
#define CT_UNKNOWNx99 0x99 // eMule v0.26d [RAMMSTEIN 8b]
|
||||
#define CT_UNKNOWNx9C 0x9C // Emulereactor Community Mod
|
||||
#define CT_UNKNOWNxbb 0xbb // emule.de (client version:60)
|
||||
#define CT_UNKNOWNxc4 0xc4 //MD5 Community from new bionic - hello
|
||||
#define CT_UNKNOWNxC8 0xc8 // MD5 Community from new bionic - hello //Xman x4
|
||||
#define CT_UNKNOWNxCA 0xCA // NewDarkMule
|
||||
#define CT_UNKNOWNxCD 0xCD // www.donkey2002.to
|
||||
#define CT_UNKNOWNxCE 0xCE // FRZ community //Xman 20.08.05
|
||||
#define CT_UNKNOWNxCF 0xCF // FRZ community //Xman 20.08.05
|
||||
#define CT_UNKNOWNxDA 0xDA // Emulereactor Community Mod
|
||||
#define CT_UNKNOWNxEC 0xec // SpeedMule and clones //Xman x4
|
||||
#define CT_UNKNOWNxF0 0xF0 // Emulereactor Community Mod
|
||||
#define CT_UNKNOWNxF4 0xF4 // Emulereactor Community Mod
|
||||
#define CT_UNKNOWNxD2 0xD2 // Chinese Leecher //SquallATF
|
||||
//#define CT_UNKNOWNx85 0x85 // viper-israel.org and eChanblardNext //zz_fly, viper become good
|
||||
|
||||
#define CT_FRIENDSHARING 0x66 //eWombat [SNAFU]
|
||||
#define CT_DARK 0x54 //eWombat [SNAFU]
|
||||
#define FRIENDSHARING_ID 0x5F73F1A0 // Magic Key, DO NOT CHANGE!
|
||||
|
||||
// unknown eMule tags
|
||||
#define ET_MOD_UNKNOWNx12 0x12 // http://www.haspepapa-welt.de
|
||||
#define ET_MOD_UNKNOWNx13 0x13 // http://www.haspepapa-welt.de
|
||||
#define ET_MOD_UNKNOWNx14 0x14 // http://www.haspepapa-welt.de
|
||||
#define ET_MOD_UNKNOWNx17 0x17 // http://www.haspepapa-welt.de
|
||||
#define ET_MOD_UNKNOWNx2F 0x2F // eMule v0.30 [OMEGA v.07 Heiko]
|
||||
#define ET_MOD_UNKNOWNx30 0x30 // aMule 1.2.0
|
||||
#define ET_MOD_UNKNOWNx36 0x36 // eMule v0.26
|
||||
#define ET_MOD_UNKNOWNx3C 0x3C // enkeyDev.6 / LamerzChoice 9.9a
|
||||
#define ET_MOD_UNKNOWNx41 0x41 // CrewMod (pre-release mod based on Plus) identification
|
||||
#define ET_MOD_UNKNOWNx42 0x42 // CrewMod (pre-release mod based on Plus) key verification
|
||||
#define ET_MOD_UNKNOWNx43 0x43 // CrewMod (pre-release mod based on Plus) version info
|
||||
#define ET_MOD_UNKNOWNx50 0x50 // Bionic 0.20 Beta]
|
||||
#define ET_MOD_UNKNOWNx59 0x59 // emule 0.40 / eMule v0.30 [LSD.12e]
|
||||
#define ET_MOD_UNKNOWNx5B 0x5B // eMule v0.26
|
||||
#define ET_MOD_UNKNOWNx60 0x60 // eMule v0.30a Hunter.6 + eMule v0.26
|
||||
#define ET_MOD_UNKNOWNx64 0x64 // LSD.9dT / Athlazan(0.29c)Alpha.3
|
||||
#define ET_MOD_UNKNOWNx76 0x76 // http://www.haspepapa-welt.de (DodgeBoards)
|
||||
#define ET_MOD_UNKNOWNx84 0x84 // eChanblardv3.2
|
||||
#define ET_MOD_UNKNOWNx85 0x85 // ?
|
||||
#define ET_MOD_UNKNOWNx86 0x86 // ?
|
||||
#define ET_MOD_UNKNOWNx93 0x93 // ?
|
||||
#define ET_MOD_UNKNOWNxA6 0xA6 // eMule v0.26
|
||||
#define ET_MOD_UNKNOWNxB1 0xB1 // Bionic 0.20 Beta]
|
||||
#define ET_MOD_UNKNOWNxB4 0xB4 // Bionic 0.20 Beta]
|
||||
#define ET_MOD_UNKNOWNxC8 0xC8 // Bionic 0.20 Beta]
|
||||
#define ET_MOD_UNKNOWNxC9 0xC9 // Bionic 0.20 Beta]
|
||||
#define ET_MOD_UNKNOWNxDA 0xDA // Rumata (rus)(Plus v1f) - leecher mod?
|
||||
//>>> eWombat [SNAFU_V3]
|
||||
|
||||
#undef __declspec
|
||||
#endif
|
||||
@ -1,25 +0,0 @@
|
||||
//Author: greensea <gs@bbxy.net>
|
||||
#include "antiLeech_wx.h" //Modified by Bill Lee.
|
||||
|
||||
//Bug fixed by Orzogc Lee
|
||||
LPCTSTR StrStrI(LPCTSTR haystack, LPCTSTR needle){
|
||||
//Bill Lee: allocate wchar array on the stack
|
||||
wchar_t haystacki[512];
|
||||
wchar_t needlei[512];
|
||||
int i = 0;
|
||||
do{
|
||||
haystacki[i] = towlower(haystack[i]);
|
||||
if(i == 511)
|
||||
break;
|
||||
}while(haystack[i++]); //As haystacki is allocated on the stack, it wans't set 0. So the NULL needs to be copy.
|
||||
i = 0;
|
||||
do{
|
||||
needlei[i] = towlower(needle[i]);
|
||||
if(i == 511)
|
||||
break;
|
||||
}while(needle[i++]);
|
||||
const wchar_t* ret = wcsstr(haystacki, needlei);
|
||||
if(ret != NULL)
|
||||
ret = ret - haystacki + haystack;
|
||||
return ret;
|
||||
}
|
||||
@ -1,54 +0,0 @@
|
||||
#ifndef ANTILEECH_WX_H
|
||||
#define ANTILEECH_WX_H
|
||||
|
||||
#include <wx/defs.h>
|
||||
#include <string.h>
|
||||
#include <wctype.h> // for towlower()
|
||||
|
||||
#define LPCTSTR const wxChar*
|
||||
#define BOOL bool
|
||||
//#define _T(var) wxT(var) //defined in wxWidgets
|
||||
#define DWORD wxUint32
|
||||
#define UINT wxUint16
|
||||
#define WINAPI
|
||||
#define HINSTANCE
|
||||
#define LPVOID void*
|
||||
#define PBYTE unsigned char*
|
||||
#define TCHAR wxChar
|
||||
#define _TINT wxInt32
|
||||
#define SSIZE_T ptrdiff_t
|
||||
|
||||
#define StrCmpI _tcsicmp
|
||||
#define _tcsicmp _wcsicmp
|
||||
|
||||
#define _istdigit(var) iswdigit(var)
|
||||
#define _istcntrl(var) iswcntrl(var)
|
||||
#define _istpunct(var) iswpunct(var)
|
||||
#define _istspace(var) iswspace(var)
|
||||
#define _istxdigit(var) iswxdigit(var)
|
||||
inline float _tstof(const wchar_t* str){
|
||||
wchar_t** ptail = NULL;
|
||||
return wcstof(str, ptail);
|
||||
}
|
||||
//This function is not used. by Orzogc Lee
|
||||
//But I think there is no need to removing, linker will remove it.
|
||||
/*
|
||||
inline void tolowers(wxChar* str){
|
||||
int i = 0;
|
||||
do{
|
||||
str[i] = towlower(str[i]);
|
||||
}while(str[++i]);
|
||||
}
|
||||
*/
|
||||
#define _tcsstr(haystack, needle) wcsstr(haystack, needle)
|
||||
#define _tcslen(var) wcslen(var)
|
||||
#define StrStr(a, b) wcsstr(a, b)
|
||||
#define StrStrIW(a, b) StrStrI(a, b)
|
||||
|
||||
LPCTSTR StrStrI(LPCTSTR haystack, LPCTSTR needle);
|
||||
//Bill Lee: I think inlining this function make no senses, because it is a very large operation.
|
||||
|
||||
#define _wcsicmp(a, b) wcscasecmp(a, b)
|
||||
#define StrCmpIW(a, b) wcscasecmp(a, b)
|
||||
|
||||
#endif
|
||||
@ -1,8 +0,0 @@
|
||||
mkdir -pv m4
|
||||
libtoolize
|
||||
aclocal
|
||||
aclocal -I m4
|
||||
automake --add-missing --copy
|
||||
autoconf
|
||||
|
||||
|
||||
@ -1,44 +0,0 @@
|
||||
# -*- Autoconf -*-
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
# Copyright (C) 2011 Bill Lee <bill.lee.y@gmail.com>
|
||||
# License: GNU GPL v3 or any later version released by Free Software Foundation
|
||||
|
||||
#AC_PREREQ([2.65])
|
||||
AC_INIT([antiLeech], [44], [https://github.com/persmule/amule-dlp/issues])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AM_INIT_AUTOMAKE()
|
||||
AC_CONFIG_SRCDIR([antiLeech.cpp])
|
||||
#AC_CONFIG_HEADERS([config.h])
|
||||
|
||||
# Checks for programs.
|
||||
AC_PROG_CXX
|
||||
AC_PROG_CC
|
||||
AC_PROG_CPP
|
||||
AC_PROG_MAKE_SET
|
||||
AM_DISABLE_STATIC
|
||||
AC_PROG_LIBTOOL
|
||||
|
||||
#Check for wx-config
|
||||
|
||||
AC_CHECK_PROG(WXCONFIG, [wx-config], [wx-config])
|
||||
ANTILEECH_CPPFLAGS=$(wx-config --cppflags)
|
||||
|
||||
AC_SUBST(ANTILEECH_CPPFLAGS)
|
||||
|
||||
# Checks for libraries.
|
||||
ANTILEECH_LDFLAGS=
|
||||
|
||||
AC_SUBST(ANTILEECH_LDFLAGS)
|
||||
|
||||
# Checks for header files.
|
||||
AC_CHECK_HEADERS([string.h], [wx/string.h], [wx/defs.h])
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_HEADER_STDBOOL
|
||||
AC_C_INLINE
|
||||
AC_TYPE_SIZE_T
|
||||
|
||||
# Checks for library functions.
|
||||
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
AC_OUTPUT
|
||||
@ -1,61 +0,0 @@
|
||||
--- antiLeech.cpp.win 2016-02-15 19:31:18.748711749 +0800
|
||||
+++ antiLeech.cpp 2016-02-15 20:49:25.691484626 +0800
|
||||
@@ -17,8 +17,11 @@
|
||||
//Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
-#include <atlstr.h>
|
||||
+#include "CString_wx.h"
|
||||
#include "antiLeech.h"
|
||||
+#define __declspec(var) CantiLeech::
|
||||
+#define SPECIAL_DLP_VERSION
|
||||
+#define ALL_VERYCD_MOD
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
@@ -51,7 +54,10 @@ LPCTSTR apszSnafuTag[]=
|
||||
//,_T("[eChanblardNext]") //21 zz_fly
|
||||
};
|
||||
|
||||
+const DWORD CantiLeech::DLPVersion = 4405;
|
||||
|
||||
+//deactivate M$WIN-specific codes
|
||||
+#if 0
|
||||
BOOL WINAPI DllMain (
|
||||
HANDLE hModule,
|
||||
DWORD dwFunction,
|
||||
@@ -74,6 +80,7 @@ void __declspec(dllexport) TestFunc()
|
||||
{
|
||||
::MessageBox(NULL,_T("Inside the DLL!"),_T("Nix"),0);
|
||||
}
|
||||
+#endif
|
||||
|
||||
//old versions just to keep compatible
|
||||
/* //drop old version support
|
||||
@@ -285,7 +292,7 @@ LPCTSTR __declspec(dllexport) DLPCheckNa
|
||||
*/
|
||||
//end old version ------------------------------------------
|
||||
|
||||
-bool IsTypicalHex(CString& addon)
|
||||
+bool CantiLeech::IsTypicalHex(const CString& addon)
|
||||
{
|
||||
if(addon.GetLength()>25 || addon.GetLength()<5)
|
||||
return false;
|
||||
@@ -1244,7 +1251,7 @@ LPCTSTR __declspec(dllexport) DLPCheckUs
|
||||
return NULL;
|
||||
}
|
||||
|
||||
-LPCTSTR __declspec(dllexport) DLPCheckNameAndHashAndMod(CString username, CString& userhash, CString& modversion)
|
||||
+LPCTSTR __declspec(dllexport) DLPCheckNameAndHashAndMod(const CString& username, const CString& userhash, const CString& modversion)
|
||||
{
|
||||
if(username.IsEmpty() || userhash.IsEmpty())
|
||||
return NULL;
|
||||
@@ -1309,7 +1316,7 @@ LPCTSTR __declspec(dllexport) DLPCheckNa
|
||||
|
||||
//Check for aedit
|
||||
//remark: a unmodded emule can't send a space at last sign
|
||||
- if(modversion.IsEmpty() && username.Right(1)==32)
|
||||
+ if(modversion.IsEmpty() && username.Right(1)==_T(" "))
|
||||
return _T("AEdit");
|
||||
|
||||
//Check for Hex-Modstring
|
||||
@ -1,41 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2018 TDT AG <development@tdt.de>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See https://www.gnu.org/licenses/gpl-2.0.txt for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=proto-bonding
|
||||
PKG_VERSION:=2018-06-11
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
PKG_LICENSE_FILES:=
|
||||
|
||||
PKG_MAINTAINER:=Helge Mader <ma@dev.tdt.de>
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/proto-bonding
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Link Aggregation (Channel Bonding) proto handler
|
||||
DEPENDS:=+kmod-bonding
|
||||
endef
|
||||
|
||||
define Package/proto-bonding/description
|
||||
This package contains the channel bonding proto handler for netifd
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/proto-bonding/install
|
||||
$(INSTALL_DIR) $(1)/lib/netifd/proto/
|
||||
$(INSTALL_BIN) ./files/lib/netifd/proto/bonding.sh \
|
||||
$(1)/lib/netifd/proto/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,proto-bonding))
|
||||
@ -1,211 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2018 TDT AG <development@tdt.de>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See https://www.gnu.org/licenses/gpl-2.0.txt for more information.
|
||||
#
|
||||
|
||||
. /lib/functions.sh
|
||||
. ../netifd-proto.sh
|
||||
|
||||
init_proto "$@"
|
||||
|
||||
INCLUDE_ONLY=1
|
||||
|
||||
BONDING_MASTERS="/sys/class/net/bonding_masters"
|
||||
|
||||
set_driver_values() {
|
||||
local varname
|
||||
|
||||
for varname in "$@"; do
|
||||
local value
|
||||
json_get_var value "$varname"
|
||||
|
||||
[ -n "$value" ] && echo "$value" > /sys/class/net/"$link"/bonding/"$varname"
|
||||
done
|
||||
}
|
||||
|
||||
proto_bonding_init_config() {
|
||||
no_device=1
|
||||
available=1
|
||||
|
||||
proto_config_add_string "ifname"
|
||||
|
||||
proto_config_add_string "ipaddr"
|
||||
proto_config_add_string "netmask"
|
||||
|
||||
proto_config_add_string "bonding_policy"
|
||||
proto_config_add_string "link_monitoring"
|
||||
proto_config_add_string "slaves"
|
||||
proto_config_add_string "all_slaves_active"
|
||||
|
||||
proto_config_add_string "min_links"
|
||||
proto_config_add_string "ad_actor_sys_prio"
|
||||
proto_config_add_string "ad_actor_system"
|
||||
proto_config_add_string "ad_select"
|
||||
proto_config_add_string "lacp_rate"
|
||||
proto_config_add_string "packets_per_slave"
|
||||
proto_config_add_string "xmit_hash_policy"
|
||||
proto_config_add_string "primary"
|
||||
proto_config_add_string "primary_reselect"
|
||||
proto_config_add_string "lp_interval"
|
||||
proto_config_add_string "tlb_dynamic_lb"
|
||||
proto_config_add_string "resend_igmp"
|
||||
proto_config_add_string "fail_over_mac"
|
||||
proto_config_add_string "num_grat_arp__num_unsol_na"
|
||||
|
||||
proto_config_add_string "arp_interval"
|
||||
proto_config_add_string "arp_ip_target"
|
||||
proto_config_add_string "arp_all_targets"
|
||||
proto_config_add_string "arp_validate"
|
||||
|
||||
proto_config_add_string "miimon"
|
||||
proto_config_add_string "downdelay"
|
||||
proto_config_add_string "updelay"
|
||||
proto_config_add_string "use_carrier"
|
||||
}
|
||||
|
||||
proto_bonding_setup() {
|
||||
local cfg="$1"
|
||||
local link="bonding-$cfg"
|
||||
|
||||
# Check for loaded kernel bonding driver (/sys/class/net/bonding_masters exists)
|
||||
[ -f "$BONDING_MASTERS" ] || {
|
||||
echo "$cfg" "setup: bonding_masters does not exist in sysfs (kernel module not loaded?)"
|
||||
proto_notify_error "$cfg" "setup: bonding_masters does not exist in sysfs (kernel module not loaded?)"
|
||||
proto_block_restart "$cfg"
|
||||
return
|
||||
}
|
||||
|
||||
# Add bonding interface to system
|
||||
echo "+$link" > "$BONDING_MASTERS"
|
||||
|
||||
# Set bonding policy (with corresponding parameters)
|
||||
local bonding_policy
|
||||
json_get_vars bonding_policy
|
||||
|
||||
case "$bonding_policy" in
|
||||
|
||||
802.3ad)
|
||||
echo "$bonding_policy" > /sys/class/net/"$link"/bonding/mode
|
||||
set_driver_values min_links ad_actor_sys_prio ad_actor_system ad_select lacp_rate
|
||||
;;
|
||||
|
||||
balance-rr)
|
||||
echo "$bonding_policy" > /sys/class/net/"$link"/bonding/mode
|
||||
set_driver_values packets_per_slave xmit_hash_policy
|
||||
;;
|
||||
|
||||
balance-tlb)
|
||||
echo "$bonding_policy" > /sys/class/net/"$link"/bonding/mode
|
||||
set_driver_values primary primary_reselect lp_interval tlb_dynamic_lb resend_igmp xmit_hash_policy
|
||||
;;
|
||||
|
||||
balance-alb)
|
||||
echo "$bonding_policy" > /sys/class/net/"$link"/bonding/mode
|
||||
set_driver_values primary primary_reselect lp_interval tlb_dynamic_lb resend_igmp xmit_hash_policy
|
||||
;;
|
||||
|
||||
active-backup)
|
||||
echo "$bonding_policy" > /sys/class/net/"$link"/bonding/mode
|
||||
set_driver_values primary primary_reselect fail_over_mac num_grat_arp__num_unsol_na xmit_hash_policy
|
||||
;;
|
||||
esac
|
||||
|
||||
# Set link monitoring (with corresponding parameters)
|
||||
local link_monitoring
|
||||
json_get_vars link_monitoring
|
||||
|
||||
case "$link_monitoring" in
|
||||
|
||||
arp)
|
||||
local arp_interval arp_ip_target arp_all_targets arp_validate
|
||||
json_get_vars arp_interval arp_ip_target arp_all_targets arp_validate
|
||||
|
||||
[ -n "$arp_interval" -a "$arp_interval" != 0 ] && echo "$arp_interval" > /sys/class/net/"$link"/bonding/arp_interval
|
||||
|
||||
IFS=' '
|
||||
for target in $arp_ip_target; do
|
||||
echo "+$target" > /sys/class/net/"$link"/bonding/arp_ip_target
|
||||
done
|
||||
|
||||
[ -n "$arp_all_targets" ] && echo "$arp_all_targets" > /sys/class/net/"$link"/bonding/arp_all_targets
|
||||
[ -n "$arp_validate" ] && echo "$arp_validate" > /sys/class/net/"$link"/bonding/arp_validate
|
||||
;;
|
||||
|
||||
mii)
|
||||
local miimon downdelay updelay use_carrier
|
||||
json_get_vars miimon downdelay updelay use_carrier
|
||||
|
||||
[ -n "$miimon" -a "$miimon" != 0 ] && echo "$miimon" > /sys/class/net/"$link"/bonding/miimon
|
||||
[ -n "$downdelay" ] && echo "$downdelay" > /sys/class/net/"$link"/bonding/downdelay
|
||||
[ -n "$updelay" ] && echo "$updelay" > /sys/class/net/"$link"/bonding/updelay
|
||||
[ -n "$use_carrier" ] && echo "$use_carrier" > /sys/class/net/"$link"/bonding/use_carrier
|
||||
;;
|
||||
esac
|
||||
|
||||
# Add slaves to bonding interface
|
||||
local slaves
|
||||
json_get_vars slaves
|
||||
|
||||
for slave in $slaves; do
|
||||
|
||||
if [ "$(cat /proc/net/dev |grep "$slave")" == "" ]; then
|
||||
echo "$cfg" "ERROR IN CONFIGURATION - $slave: No such device"
|
||||
proto_notify_error "$cfg" "ERROR IN CONFIGURATION - $slave: No such device"
|
||||
proto_block_restart "$cfg"
|
||||
return
|
||||
fi
|
||||
|
||||
ifconfig "$slave" down
|
||||
|
||||
sleep 1
|
||||
|
||||
echo "+$slave" > /sys/class/net/"$link"/bonding/slaves
|
||||
|
||||
ifconfig "$slave" up
|
||||
done
|
||||
|
||||
[ -n "$all_slaves_active" ] && echo "$all_slaves_active" > /sys/class/net/"$link"/bonding/all_slaves_active
|
||||
|
||||
local ipaddr netmask
|
||||
json_get_vars ipaddr netmask
|
||||
|
||||
# ATTENTION
|
||||
#All json vars have to be read before the line below, as the
|
||||
# json object will be overwritten by proto_init_update
|
||||
# ATTENTION
|
||||
|
||||
proto_init_update "$link" 1
|
||||
|
||||
# For static configuration we _MUST_ have an IP address
|
||||
[ -z "$ipaddr" ] && {
|
||||
echo "$cfg" "INVALID LOCAL ADDRESS"
|
||||
proto_notify_error "$cfg" "INVALID_LOCAL_ADDRESS"
|
||||
proto_block_restart "$cfg"
|
||||
return
|
||||
}
|
||||
|
||||
proto_add_ipv4_address "$ipaddr" "$netmask"
|
||||
|
||||
proto_send_update "$cfg"
|
||||
}
|
||||
|
||||
proto_bonding_teardown() {
|
||||
local cfg="$1"
|
||||
local link="bonding-$cfg"
|
||||
|
||||
# Check for loaded kernel bonding driver (/sys/class/net/bonding_masters exists)
|
||||
[ -f "$BONDING_MASTERS" ] || {
|
||||
echo "$cfg" "teardown: bonding_masters does not exist in sysfs (kernel module not loaded?)"
|
||||
proto_notify_error "$cfg" "teardown: bonding_masters does not exist in sysfs (kernel module not loaded?)"
|
||||
proto_block_restart "$cfg"
|
||||
return
|
||||
}
|
||||
|
||||
echo "-$link" > /sys/class/net/bonding_masters
|
||||
logger "bonding_teardown($1): $2"
|
||||
}
|
||||
|
||||
add_protocol bonding
|
||||
@ -1,41 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=csstidy
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=https://github.com/jow-/csstidy-cpp.git
|
||||
PKG_SOURCE_DATE:=2018-12-20
|
||||
PKG_SOURCE_VERSION:=1d5620149ae35c0d49fb2014d4e63a23ecfb6f69
|
||||
PKG_MIRROR_HASH:=3210d475f6ae966d4dfcd3e1f7fcbf0ad9507a37878d50de015ffe795c1d160e
|
||||
|
||||
PKG_LICENSE:=LGPL-2.1
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
HOST_BUILD_PARALLEL:=1
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/csstidy
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=CSSTidy parser and optimiser
|
||||
DEPENDS:=+libstdcpp
|
||||
endef
|
||||
|
||||
define Package/csstidy/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/csstidy/csstidy $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
|
||||
define Host/Install
|
||||
$(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin/
|
||||
$(INSTALL_BIN) $(HOST_BUILD_DIR)/csstidy/csstidy $(1)/bin/
|
||||
endef
|
||||
|
||||
$(eval $(call HostBuild))
|
||||
$(eval $(call BuildPackage,csstidy))
|
||||
@ -1,72 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ddns-scripts_aliyun
|
||||
PKG_VERSION:=1.0.3
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_MAINTAINER:=Sense <sensec@gmail.com>
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=IP Addresses and Names
|
||||
TITLE:=DDNS extension for AliYun.com
|
||||
PKGARCH:=all
|
||||
DEPENDS:=+ddns-scripts +wget-ssl +openssl-util
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
Dynamic DNS Client scripts extension for AliYun.com
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(CP) ./*.sh $(PKG_BUILD_DIR)
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/preinst
|
||||
#!/bin/sh
|
||||
# if NOT run buildroot then stop service
|
||||
[ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1
|
||||
exit 0 # suppress errors
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ddns
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/update_aliyun_com.sh $(1)/usr/lib/ddns
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/postinst
|
||||
#!/bin/sh
|
||||
# remove old services file entries
|
||||
/bin/sed -i '/aliyun\.com/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1
|
||||
/bin/sed -i '/aliyun\.com/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6 >/dev/null 2>&1
|
||||
# and create new
|
||||
printf "%s\\t\\t%s\\n" '"aliyun.com"' '"update_aliyun_com.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services
|
||||
printf "%s\\t\\t%s\\n" '"aliyun.com"' '"update_aliyun_com.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services_ipv6
|
||||
# on real system restart service if enabled
|
||||
[ -z "$${IPKG_INSTROOT}" ] && {
|
||||
/etc/init.d/ddns enabled && \
|
||||
/etc/init.d/ddns start >/dev/null 2>&1
|
||||
}
|
||||
exit 0 # suppress errors
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/prerm
|
||||
#!/bin/sh
|
||||
# if NOT run buildroot then stop service
|
||||
[ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1
|
||||
# remove services file entries
|
||||
/bin/sed -i '/aliyun\.com/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1
|
||||
/bin/sed -i '/aliyun\.com/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6 >/dev/null 2>&1
|
||||
exit 0 # suppress errors
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
@ -1,247 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# 用于阿里云解析的DNS更新脚本
|
||||
# 2017-2018 Sense <sensec at gmail dot com>
|
||||
# 阿里云解析API文档 https://help.aliyun.com/document_detail/29739.html
|
||||
#
|
||||
# 本脚本由 dynamic_dns_functions.sh 内的函数 send_update() 调用
|
||||
#
|
||||
# 需要在 /etc/config/ddns 中设置的选项
|
||||
# option username - 阿里云API访问账号 Access Key ID。可通过 aliyun.com 帐号管理的 accesskeys 获取, 或者访问 https://ak-console.aliyun.com
|
||||
# option password - 阿里云API访问密钥 Access Key Secret
|
||||
# option domain - 完整的域名。建议主机与域名之间使用 @符号 分隔,否则将以第一个 .符号 之前的内容作为主机名
|
||||
#
|
||||
|
||||
# 检查传入参数
|
||||
[ -z "$username" ] && write_log 14 "配置错误!保存阿里云API访问账号的'用户名'不能为空"
|
||||
[ -z "$password" ] && write_log 14 "配置错误!保存阿里云API访问密钥的'密码'不能为空"
|
||||
|
||||
# 检查外部调用工具
|
||||
[ -n "$WGET_SSL" ] || write_log 13 "使用阿里云API需要 GNU Wget 支持,请先安装"
|
||||
command -v sed >/dev/null 2>&1 || write_log 13 "使用阿里云API需要 sed 支持,请先安装"
|
||||
command -v openssl >/dev/null 2>&1 || write_log 13 "使用阿里云API需要 openssl-util 支持,请先安装"
|
||||
|
||||
# 包含用于解析 JSON 格式返回值的函数
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
# 变量声明
|
||||
local __HOST __DOMAIN __TYPE __URLBASE __CMDBASE __URLARGS __SEPARATOR __RECID
|
||||
[ $use_https -eq 0 ] && __URLBASE="http://alidns.aliyuncs.com/" || __URLBASE="https://alidns.aliyuncs.com/"
|
||||
__SEPARATOR="&"
|
||||
|
||||
# 从 $domain 分离主机和域名
|
||||
[ "${domain:0:2}" == "@." ] && domain="${domain/./}" # 主域名处理
|
||||
[ "$domain" == "${domain/@/}" ] && domain="${domain/./@}" # 未找到分隔符,兼容常用域名格式
|
||||
__HOST="${domain%%@*}"
|
||||
__DOMAIN="${domain#*@}"
|
||||
[ -z "$__HOST" -o "$__HOST" == "$__DOMAIN" ] && __HOST="@"
|
||||
|
||||
# 设置记录类型
|
||||
[ $use_ipv6 -eq 0 ] && __TYPE="A" || __TYPE="AAAA"
|
||||
|
||||
# 构造基本通信命令
|
||||
build_command() {
|
||||
__CMDBASE="$WGET_SSL --no-hsts -nv -t 1 -O $DATFILE -o $ERRFILE"
|
||||
# 绑定用于通信的主机/IP
|
||||
if [ -n "$bind_network" ]; then
|
||||
local bind_ip run_prog
|
||||
[ $use_ipv6 -eq 0 ] && run_prog="network_get_ipaddr" || run_prog="network_get_ipaddr6"
|
||||
eval "$run_prog bind_ip $bind_network" || \
|
||||
write_log 13 "无法使用 '$run_prog $bind_network' 获取本地IP地址 - 错误代码: '$?'"
|
||||
write_log 7 "强制使用IP '$bind_ip' 通信"
|
||||
__CMDBASE="$__CMDBASE --bind-address=$bind_ip"
|
||||
fi
|
||||
# 强制设定IP版本
|
||||
if [ $force_ipversion -eq 1 ]; then
|
||||
[ $use_ipv6 -eq 0 ] && __CMDBASE="$__CMDBASE -4" || __CMDBASE="$__CMDBASE -6"
|
||||
fi
|
||||
# 设置CA证书参数
|
||||
if [ $use_https -eq 1 ]; then
|
||||
if [ "$cacert" = "IGNORE" ]; then
|
||||
__CMDBASE="$__CMDBASE --no-check-certificate"
|
||||
elif [ -f "$cacert" ]; then
|
||||
__CMDBASE="$__CMDBASE --ca-certificate=${cacert}"
|
||||
elif [ -d "$cacert" ]; then
|
||||
__CMDBASE="$__CMDBASE --ca-directory=${cacert}"
|
||||
elif [ -n "$cacert" ]; then
|
||||
write_log 14 "在 '$cacert' 中未找到用于 HTTPS 通信的有效证书"
|
||||
fi
|
||||
fi
|
||||
# 如果没有设置,禁用代理 (这可能是 .wgetrc 或环境设置错误)
|
||||
[ -z "$proxy" ] && __CMDBASE="$__CMDBASE --no-proxy"
|
||||
}
|
||||
|
||||
# 用于阿里云API的通信函数
|
||||
aliyun_transfer() {
|
||||
local __PARAM=$*
|
||||
local __CNT=0
|
||||
local __RUNPROG __ERR PID_SLEEP
|
||||
|
||||
[ $# -eq 0 ] && write_log 12 "'aliyun_transfer()' 出错 - 参数数量错误"
|
||||
|
||||
while : ; do
|
||||
build_Request $__PARAM
|
||||
__RUNPROG="$__CMDBASE '${__URLBASE}?${__URLARGS}'"
|
||||
|
||||
write_log 7 "#> $__RUNPROG"
|
||||
eval $__RUNPROG
|
||||
__ERR=$?
|
||||
[ $__ERR -eq 0 ] && return 0
|
||||
|
||||
write_log 3 "wget 错误代码: '$__ERR'"
|
||||
write_log 7 "$(cat $ERRFILE)"
|
||||
|
||||
if [ $VERBOSE -gt 1 ]; then
|
||||
write_log 4 "传输失败 - 详细模式: $VERBOSE - 出错后不再重试"
|
||||
return 1
|
||||
fi
|
||||
|
||||
__CNT=$(( $__CNT + 1 ))
|
||||
[ $retry_count -gt 0 -a $__CNT -gt $retry_count ] && \
|
||||
write_log 14 "$retry_count 次重试后传输还是失败"
|
||||
|
||||
write_log 4 "传输失败 - $__CNT/$retry_count 在 $RETRY_SECONDS 秒后重试"
|
||||
sleep $RETRY_SECONDS &
|
||||
PID_SLEEP=$!
|
||||
wait $PID_SLEEP
|
||||
PID_SLEEP=0
|
||||
done
|
||||
}
|
||||
|
||||
# 百分号编码
|
||||
percentEncode() {
|
||||
if [ -z "${1//[A-Za-z0-9_.~-]/}" ]; then
|
||||
echo -n "$1"
|
||||
else
|
||||
local string=$1; local i=0; local ret chr
|
||||
while [ $i -lt ${#string} ]; do
|
||||
chr=${string:$i:1}
|
||||
[ -z "${chr#[^A-Za-z0-9_.~-]}" ] && chr=$(printf '%%%02X' "'$chr")
|
||||
ret="$ret$chr"
|
||||
i=$(( $i + 1 ))
|
||||
done
|
||||
echo -n "$ret"
|
||||
fi
|
||||
}
|
||||
|
||||
# 构造阿里云解析请求参数
|
||||
build_Request() {
|
||||
local args=$*; local string
|
||||
local HTTP_METHOD="GET"
|
||||
|
||||
# 添加请求参数
|
||||
__URLARGS=
|
||||
for string in $args; do
|
||||
case "${string%%=*}" in
|
||||
Format|TTL|Version|AccessKeyId|SignatureMethod|Timestamp|SignatureVersion|SignatureNonce|Signature) ;; # 过滤公共参数
|
||||
*) __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}");;
|
||||
esac
|
||||
done
|
||||
__URLARGS="${__URLARGS:1}"
|
||||
|
||||
# 附加公共参数
|
||||
string="Format=JSON"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
|
||||
string="TTL=600";__URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
|
||||
string="Version=2015-01-09"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
|
||||
string="AccessKeyId=$username"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
|
||||
string="SignatureMethod=HMAC-SHA1"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
|
||||
string="Timestamp="$(date -u '+%Y-%m-%dT%H:%M:%SZ'); __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
|
||||
string="SignatureVersion=1.0"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
|
||||
string="SignatureNonce="$(cat '/proc/sys/kernel/random/uuid'); __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
|
||||
|
||||
# 对请求参数进行排序,用于生成签名
|
||||
string=$(echo -n "$__URLARGS" | sed 's/\'"${__SEPARATOR}"'/\n/g' | sort | sed ':label; N; s/\n/\'"${__SEPARATOR}"'/g; b label')
|
||||
# 构造用于计算签名的字符串
|
||||
string="${HTTP_METHOD}${__SEPARATOR}"$(percentEncode "/")"${__SEPARATOR}"$(percentEncode "$string")
|
||||
# 字符串计算签名HMAC值
|
||||
local signature=$(echo -n "$string" | openssl dgst -sha1 -hmac "${password}&" -binary)
|
||||
# HMAC值编码成字符串,得到签名值
|
||||
signature=$(echo -n "$signature" | openssl base64)
|
||||
|
||||
# 附加签名参数
|
||||
string="Signature=$signature"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
|
||||
}
|
||||
|
||||
# 添加解析记录
|
||||
add_domain() {
|
||||
local value
|
||||
aliyun_transfer "Action=AddDomainRecord" "DomainName=${__DOMAIN}" "RR=${__HOST}" "Type=${__TYPE}" "Value=${__IP}" || write_log 14 "服务器通信失败"
|
||||
json_cleanup; json_load "$(cat "$DATFILE" 2> /dev/null)" >/dev/null 2>&1
|
||||
json_get_var value "RecordId"
|
||||
[ -z "$value" ] && write_log 14 "添加新解析记录失败"
|
||||
write_log 7 "添加新解析记录成功"
|
||||
return 0
|
||||
}
|
||||
|
||||
# 修改解析记录
|
||||
update_domain() {
|
||||
local value
|
||||
aliyun_transfer "Action=UpdateDomainRecord" "RecordId=${__RECID}" "RR=${__HOST}" "Type=${__TYPE}" "Value=${__IP}" || write_log 14 "服务器通信失败"
|
||||
json_cleanup; json_load "$(cat "$DATFILE" 2> /dev/null)" >/dev/null 2>&1
|
||||
json_get_var value "RecordId"
|
||||
[ -z "$value" ] && write_log 14 "修改解析记录失败"
|
||||
write_log 7 "修改解析记录成功"
|
||||
return 0
|
||||
}
|
||||
|
||||
# 启用解析记录
|
||||
enable_domain() {
|
||||
local value
|
||||
aliyun_transfer "Action=SetDomainRecordStatus" "RecordId=${__RECID}" "Status=Enable" || write_log 14 "服务器通信失败"
|
||||
json_cleanup; json_load "$(cat "$DATFILE" 2> /dev/null)" >/dev/null 2>&1
|
||||
json_get_var value "Status"
|
||||
[ "$value" != "Enable" ] && write_log 14 "启用解析记录失败"
|
||||
write_log 7 "启用解析记录成功"
|
||||
return 0
|
||||
}
|
||||
|
||||
# 获取子域名解析记录列表
|
||||
describe_domain() {
|
||||
local count value; local ret=0
|
||||
aliyun_transfer "Action=DescribeSubDomainRecords" "SubDomain=${__HOST}.${__DOMAIN}" || write_log 14 "服务器通信失败"
|
||||
write_log 7 "获取到解析记录: $(cat "$DATFILE" 2> /dev/null)"
|
||||
json_cleanup; json_load "$(cat "$DATFILE" 2> /dev/null)" >/dev/null 2>&1
|
||||
json_get_var count "TotalCount"
|
||||
if [ $count -eq 0 ]; then
|
||||
write_log 7 "解析记录不存在"
|
||||
ret=1
|
||||
else
|
||||
local i=1;
|
||||
while [ $i -le $count ]; do
|
||||
json_cleanup; json_load "$(cat "$DATFILE" 2> /dev/null)" >/dev/null 2>&1
|
||||
json_select "DomainRecords" >/dev/null 2>&1
|
||||
json_select "Record" >/dev/null 2>&1
|
||||
json_select $i >/dev/null 2>&1
|
||||
i=$(( $i + 1 ))
|
||||
json_get_var value "Type"
|
||||
if [ "$value" != "${__TYPE}" ]; then
|
||||
write_log 7 "当前解析类型: ${__TYPE}, 获得不匹配类型: $value"
|
||||
ret=1; continue
|
||||
else
|
||||
ret=0
|
||||
json_get_var __RECID "RecordId"
|
||||
write_log 7 "获得解析记录ID: ${__RECID}, 类型: $value"
|
||||
json_get_var value "Locked"
|
||||
[ $value -ne 0 ] && write_log 14 "解析记录被锁定"
|
||||
json_get_var value "Status"
|
||||
[ "$value" != "ENABLE" ] && ret=$(( $ret | 2 )) && write_log 7 "解析记录被禁用"
|
||||
json_get_var value "Value"
|
||||
[ "$value" != "${__IP}" ] && ret=$(( $ret | 4 )) && write_log 7 "地址需要修改"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
return $ret
|
||||
}
|
||||
|
||||
build_command
|
||||
describe_domain
|
||||
ret=$?
|
||||
if [ $ret -eq 1 ]; then
|
||||
sleep 3 && add_domain
|
||||
else
|
||||
[ $(( $ret & 2 )) -ne 0 ] && sleep 3 && enable_domain
|
||||
[ $(( $ret & 4 )) -ne 0 ] && sleep 3 && update_domain
|
||||
fi
|
||||
|
||||
return 0
|
||||
@ -1,78 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ddns-scripts_dnspod
|
||||
PKG_VERSION:=1.0.2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_MAINTAINER:=Small_5
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=IP Addresses and Names
|
||||
TITLE:=DDNS extension for Dnspod.com/Dnspod.cn
|
||||
PKGARCH:=all
|
||||
DEPENDS:=+ddns-scripts +wget-ssl +ca-certificates
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
Dynamic DNS Client scripts extension for Dnspod.com/Dnspod.cn
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(CP) ./*.sh $(PKG_BUILD_DIR)
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/preinst
|
||||
#!/bin/sh
|
||||
# if NOT run buildroot then stop service
|
||||
[ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1
|
||||
exit 0 # suppress errors
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ddns
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/*.sh $(1)/usr/lib/ddns
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/postinst
|
||||
#!/bin/sh
|
||||
# remove old services file entries
|
||||
/bin/sed -i '/dnspod\.com/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1
|
||||
/bin/sed -i '/dnspod\.cn/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1
|
||||
/bin/sed -i '/dnspod\.com/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6 >/dev/null 2>&1
|
||||
/bin/sed -i '/dnspod\.cn/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6 >/dev/null 2>&1
|
||||
# and create new
|
||||
printf "%s\\t\\t%s\\n" '"dnspod.com"' '"update_dnspod_com.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services
|
||||
printf "%s\\t\\t%s\\n" '"dnspod.cn"' '"update_dnspod_cn.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services
|
||||
printf "%s\\t\\t%s\\n" '"dnspod.com"' '"update_dnspod_com.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services_ipv6
|
||||
printf "%s\\t\\t%s\\n" '"dnspod.cn"' '"update_dnspod_cn.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services_ipv6
|
||||
# on real system restart service if enabled
|
||||
[ -z "$${IPKG_INSTROOT}" ] && {
|
||||
/etc/init.d/ddns enabled && \
|
||||
/etc/init.d/ddns start >/dev/null 2>&1
|
||||
}
|
||||
exit 0 # suppress errors
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/prerm
|
||||
#!/bin/sh
|
||||
# if NOT run buildroot then stop service
|
||||
[ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1
|
||||
# remove services file entries
|
||||
/bin/sed -i '/dnspod\.com/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1
|
||||
/bin/sed -i '/dnspod\.cn/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1
|
||||
/bin/sed -i '/dnspod\.com/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6 >/dev/null 2>&1
|
||||
/bin/sed -i '/dnspod\.cn/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6 >/dev/null 2>&1
|
||||
exit 0 # suppress errors
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
@ -1,154 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
#检查传入参数
|
||||
[ -z "$username" ] && write_log 14 "Configuration error! [User name] cannot be empty"
|
||||
[ -z "$password" ] && write_log 14 "Configuration error! [Password] cannot be empty"
|
||||
|
||||
#检查外部调用工具
|
||||
[ -n "$WGET_SSL" ] || write_log 13 "GNU Wget support is required to use dnspod API. Please install first"
|
||||
|
||||
# 变量声明
|
||||
local __URLBASE __HOST __DOMAIN __TYPE __CMDBASE __POST __POST1 __RECIP __RECID __value __TTL
|
||||
__URLBASE="https://dnsapi.cn/"
|
||||
|
||||
# 从 $domain 分离主机和域名
|
||||
[ "${domain:0:2}" == "@." ] && domain="${domain/./}" # 主域名处理
|
||||
[ "$domain" == "${domain/@/}" ] && domain="${domain/./@}" # 未找到分隔符,兼容常用域名格式
|
||||
__HOST="${domain%%@*}"
|
||||
__DOMAIN="${domain#*@}"
|
||||
[ -z "$__HOST" -o "$__HOST" == "$__DOMAIN" ] && __HOST="@"
|
||||
|
||||
# 设置记录类型
|
||||
[ $use_ipv6 -eq 0 ] && __TYPE="A" || __TYPE="AAAA"
|
||||
|
||||
# 构造基本通信命令
|
||||
build_command() {
|
||||
__CMDBASE="$WGET_SSL --no-hsts -nv -t 1 -O $DATFILE -o $ERRFILE"
|
||||
# 绑定用于通信的主机/IP
|
||||
if [ -n "$bind_network" ]; then
|
||||
local bind_ip run_prog
|
||||
[ $use_ipv6 -eq 0 ] && run_prog="network_get_ipaddr" || run_prog="network_get_ipaddr6"
|
||||
eval "$run_prog bind_ip $bind_network" || \
|
||||
write_log 13 "Unable to get local IP address with '$run_prog $ bind_network' - error code: '$?'"
|
||||
write_log 7 "Forced use of IP '$bind_ip' communication"
|
||||
__CMDBASE="$__CMDBASE --bind-address=$bind_ip"
|
||||
fi
|
||||
# 强制设定IP版本
|
||||
if [ $force_ipversion -eq 1 ]; then
|
||||
[ $use_ipv6 -eq 0 ] && __CMDBASE="$__CMDBASE -4" || __CMDBASE="$__CMDBASE -6"
|
||||
fi
|
||||
# 设置CA证书参数
|
||||
if [ $use_https -eq 1 ]; then
|
||||
if [ "$cacert" = "IGNORE" ]; then
|
||||
__CMDBASE="$__CMDBASE --no-check-certificate"
|
||||
elif [ -f "$cacert" ]; then
|
||||
__CMDBASE="$__CMDBASE --ca-certificate=${cacert}"
|
||||
elif [ -d "$cacert" ]; then
|
||||
__CMDBASE="$__CMDBASE --ca-directory=${cacert}"
|
||||
elif [ -n "$cacert" ]; then
|
||||
write_log 14 "A valid certificate for HTTPS communication was not found in '$cacert'"
|
||||
fi
|
||||
fi
|
||||
# 如果没有设置,禁用代理 (这可能是 .wgetrc 或环境设置错误)
|
||||
[ -z "$proxy" ] && __CMDBASE="$__CMDBASE --no-proxy"
|
||||
__CMDBASE="$__CMDBASE --post-data"
|
||||
}
|
||||
|
||||
# 用于Dnspod API的通信函数
|
||||
dnspod_transfer() {
|
||||
local __A=$1
|
||||
local __CNT=0
|
||||
local __ERR=0
|
||||
local __B PID_SLEEP
|
||||
case "$__A" in
|
||||
0)
|
||||
__B="$__CMDBASE '$__POST' ${__URLBASE}Record.List"
|
||||
;;
|
||||
1)
|
||||
__B="$__CMDBASE '$__POST1' ${__URLBASE}Record.Create"
|
||||
;;
|
||||
2)
|
||||
__B="$__CMDBASE '$__POST1&record_id=$__RECID&ttl=$__TTL' ${__URLBASE}Record.Modify"
|
||||
;;
|
||||
esac
|
||||
|
||||
while : ; do
|
||||
write_log 7 "#> $__B"
|
||||
eval $__B
|
||||
__ERR=`jsonfilter -i $DATFILE -e "@.status.code"`
|
||||
|
||||
[ $__ERR -eq 1 ] && return 0
|
||||
[ $__A -eq 0 ] && [ $__ERR -eq 10 ] && return 0
|
||||
write_log 3 "Error message:[$(jsonfilter -i $DATFILE -e "@.status.message")]"
|
||||
|
||||
if [ $VERBOSE -gt 1 ]; then
|
||||
write_log 4 "Transfer failed - detailed mode: $VERBOSE - Do not try again after an error"
|
||||
return 1
|
||||
fi
|
||||
|
||||
__CNT=$(( $__CNT + 1 ))
|
||||
[ $retry_count -gt 0 -a $__CNT -gt $retry_count ] && write_log 14 "Transfer failed after $retry_count retries"
|
||||
|
||||
write_log 4 "Transfer failed - $__CNT Try again in $RETRY_SECONDS seconds"
|
||||
sleep $RETRY_SECONDS &
|
||||
PID_SLEEP=$!
|
||||
wait $PID_SLEEP
|
||||
PID_SLEEP=0
|
||||
done
|
||||
}
|
||||
|
||||
#添加解析记录
|
||||
add_domain() {
|
||||
dnspod_transfer 1
|
||||
write_log 7 "Add new parsing record [${__HOST}.${__DOMAIN}],[type:$__TYPE],[ip:$__IP] successfully!"
|
||||
return 0
|
||||
}
|
||||
|
||||
#修改解析记录
|
||||
update_domain() {
|
||||
dnspod_transfer 2
|
||||
write_log 7 "Modify new parsing record [${__HOST}.${__DOMAIN}],[type:$__TYPE],[ip:$__IP],[TTL:$__TTL] successfully!"
|
||||
return 0
|
||||
}
|
||||
|
||||
#获取域名解析记录
|
||||
describe_domain() {
|
||||
ret=0
|
||||
__POST="login_token=$username,$password&format=json&domain=$__DOMAIN&sub_domain=$__HOST&record_type=$__TYPE"
|
||||
__POST1="$__POST&value=$__IP&record_type=$__TYPE&record_line_id=0"
|
||||
dnspod_transfer 0
|
||||
__TMP=`jsonfilter -i $DATFILE -e "@.records[@.type!='NS']"`
|
||||
__value=`jsonfilter -s "$__TMP" -e "@.name"`
|
||||
if [ "$__value" == "" ]; then
|
||||
write_log 7 "Parsing record:[${__HOST}.${__DOMAIN}] does not exist"
|
||||
ret=1
|
||||
else
|
||||
__RECID=`jsonfilter -s "$__TMP" -e "@.id"`
|
||||
__value=`jsonfilter -s "$__TMP" -e "@.type"`
|
||||
__TTL=`jsonfilter -s "$__TMP" -e "@.ttl"`
|
||||
write_log 7 "Get parsing recordID:[$__RECID]"
|
||||
if [ "$__value" != "$__TYPE" ]; then
|
||||
write_log 7 "Current parsing [type:$__TYPE], get mismatched [type:$__value]"
|
||||
write_log 7 "Address needs to be modified, local address:[$__IP]"
|
||||
ret=2
|
||||
else
|
||||
__RECIP=`jsonfilter -s "$__TMP" -e "@.value"`
|
||||
if [ "$__RECIP" != "$__IP" ]; then
|
||||
write_log 7 "Address needs to be modified, local address:[$__IP]"
|
||||
ret=2
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
build_command
|
||||
describe_domain
|
||||
if [ $ret == 1 ];then
|
||||
sleep 3 && add_domain
|
||||
elif [ $ret == 2 ];then
|
||||
sleep 3 && update_domain
|
||||
else
|
||||
write_log 7 "Local IP:[$__IP] parsing records IP:[$__RECIP] address does not need to be modified"
|
||||
fi
|
||||
|
||||
return 0
|
||||
@ -1,164 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
#检查传入参数
|
||||
[ -z "$username" ] && write_log 14 "Configuration error! [User name] cannot be empty"
|
||||
[ -z "$password" ] && write_log 14 "Configuration error! [Password] cannot be empty"
|
||||
|
||||
#检查外部调用工具
|
||||
[ -n "$WGET_SSL" ] || write_log 13 "GNU Wget support is required to use Alibaba Cloud API. Please install first"
|
||||
|
||||
# 变量声明
|
||||
local __URLBASE __HOST __DOMAIN __TYPE __CMDBASE __TOKEN __POST __POST1 __RECIP __RECID __value __TTL
|
||||
__URLBASE="https://api.dnspod.com/"
|
||||
|
||||
# 从 $domain 分离主机和域名
|
||||
[ "${domain:0:2}" == "@." ] && domain="${domain/./}" # 主域名处理
|
||||
[ "$domain" == "${domain/@/}" ] && domain="${domain/./@}" # 未找到分隔符,兼容常用域名格式
|
||||
__HOST="${domain%%@*}"
|
||||
__DOMAIN="${domain#*@}"
|
||||
[ -z "$__HOST" -o "$__HOST" == "$__DOMAIN" ] && __HOST="@"
|
||||
|
||||
# 设置记录类型
|
||||
[ $use_ipv6 -eq 0 ] && __TYPE="A" || __TYPE="AAAA"
|
||||
|
||||
# 构造基本通信命令
|
||||
build_command() {
|
||||
__CMDBASE="$WGET_SSL --no-hsts -nv -t 1 -O $DATFILE -o $ERRFILE"
|
||||
# 绑定用于通信的主机/IP
|
||||
if [ -n "$bind_network" ]; then
|
||||
local bind_ip run_prog
|
||||
[ $use_ipv6 -eq 0 ] && run_prog="network_get_ipaddr" || run_prog="network_get_ipaddr6"
|
||||
eval "$run_prog bind_ip $bind_network" || \
|
||||
write_log 13 "Unable to get local IP address with '$run_prog $ bind_network' - error code: '$?'"
|
||||
write_log 7 "Forced use of IP '$bind_ip' communication"
|
||||
__CMDBASE="$__CMDBASE --bind-address=$bind_ip"
|
||||
fi
|
||||
# 强制设定IP版本
|
||||
if [ $force_ipversion -eq 1 ]; then
|
||||
[ $use_ipv6 -eq 0 ] && __CMDBASE="$__CMDBASE -4" || __CMDBASE="$__CMDBASE -6"
|
||||
fi
|
||||
# 设置CA证书参数
|
||||
if [ $use_https -eq 1 ]; then
|
||||
if [ "$cacert" = "IGNORE" ]; then
|
||||
__CMDBASE="$__CMDBASE --no-check-certificate"
|
||||
elif [ -f "$cacert" ]; then
|
||||
__CMDBASE="$__CMDBASE --ca-certificate=${cacert}"
|
||||
elif [ -d "$cacert" ]; then
|
||||
__CMDBASE="$__CMDBASE --ca-directory=${cacert}"
|
||||
elif [ -n "$cacert" ]; then
|
||||
write_log 14 "A valid certificate for HTTPS communication was not found in '$cacert'"
|
||||
fi
|
||||
fi
|
||||
# 如果没有设置,禁用代理 (这可能是 .wgetrc 或环境设置错误)
|
||||
[ -z "$proxy" ] && __CMDBASE="$__CMDBASE --no-proxy"
|
||||
__CMDBASE="$__CMDBASE --post-data"
|
||||
}
|
||||
|
||||
# 用于Dnspod API的通信函数
|
||||
dnspod_transfer() {
|
||||
local __A=$1
|
||||
local __CNT=0
|
||||
local __ERR=0
|
||||
local __B __C PID_SLEEP
|
||||
case "$__A" in
|
||||
0)
|
||||
__B="$__CMDBASE 'login_email=$username&login_password=$password&format=json' ${__URLBASE}Auth"
|
||||
__C=$__B
|
||||
;;
|
||||
1)
|
||||
__B="$__CMDBASE '$__POST' ${__URLBASE}Record.List"
|
||||
__C=1
|
||||
;;
|
||||
2)
|
||||
__B="$__CMDBASE '$__POST1' ${__URLBASE}Record.Create"
|
||||
__C=1
|
||||
;;
|
||||
3)
|
||||
__B="$__CMDBASE '$__POST1&record_id=$__RECID&ttl=$__TTL' ${__URLBASE}Record.Modify"
|
||||
__C=1
|
||||
;;
|
||||
esac
|
||||
|
||||
while : ; do
|
||||
[ $__C -eq 1 ] && __C=$(echo -e "$__B" | sed -e "s/${__TOKEN#*,}/***PW***/g")
|
||||
write_log 7 "#> $__C"
|
||||
eval $__B
|
||||
__ERR=`jsonfilter -i $DATFILE -e "@.status.code"`
|
||||
|
||||
[ $__ERR -eq 1 ] && return 0
|
||||
[ $__A -eq 1 ] && [ $__ERR -eq 10 ] && return 0
|
||||
write_log 3 "Error message:[$(jsonfilter -i $DATFILE -e "@.status.message")]"
|
||||
|
||||
if [ $VERBOSE -gt 1 ]; then
|
||||
write_log 4 "Transfer failed - detailed mode: $VERBOSE - Do not try again after an error"
|
||||
return 1
|
||||
fi
|
||||
|
||||
__CNT=$(( $__CNT + 1 ))
|
||||
[ $retry_count -gt 0 -a $__CNT -gt $retry_count ] && write_log 14 "Transfer failed after $retry_count retries"
|
||||
|
||||
write_log 4 "Transfer failed - $__CNT Try again in $RETRY_SECONDS seconds"
|
||||
sleep $RETRY_SECONDS &
|
||||
PID_SLEEP=$!
|
||||
wait $PID_SLEEP
|
||||
PID_SLEEP=0
|
||||
done
|
||||
}
|
||||
|
||||
#添加解析记录
|
||||
add_domain() {
|
||||
dnspod_transfer 2
|
||||
write_log 7 "Add new parsing record [${__HOST}.${__DOMAIN}],[type:$__TYPE],[ip:$__IP] successfully!"
|
||||
return 0
|
||||
}
|
||||
|
||||
#修改解析记录
|
||||
update_domain() {
|
||||
dnspod_transfer 3
|
||||
write_log 7 "Modify new parsing record [${__HOST}.${__DOMAIN}],[type:$__TYPE],[ip:$__IP],[TTL:$__TTL] successfully!"
|
||||
return 0
|
||||
}
|
||||
|
||||
#获取域名解析记录
|
||||
describe_domain() {
|
||||
ret=0
|
||||
dnspod_transfer 0
|
||||
__TOKEN=`jsonfilter -i $DATFILE -e "@.user_token"`
|
||||
__POST="user_token=$__TOKEN&format=json&domain=$__DOMAIN&sub_domain=$__HOST"
|
||||
__POST1="$__POST&value=$__IP&record_type=$__TYPE&record_line=default"
|
||||
dnspod_transfer 1
|
||||
__TMP=`jsonfilter -i $DATFILE -e "@.records[@.type!='NS']"`
|
||||
__value=`jsonfilter -s "$__TMP" -e "@.name"`
|
||||
if [ "$__value" == "" ]; then
|
||||
write_log 7 "Parsing record:[${__HOST}.${__DOMAIN}] does not exist"
|
||||
ret=1
|
||||
else
|
||||
__RECID=`jsonfilter -s "$__TMP" -e "@.id"`
|
||||
__value=`jsonfilter -s "$__TMP" -e "@.type"`
|
||||
__TTL=`jsonfilter -s "$__TMP" -e "@.ttl"`
|
||||
write_log 7 "Get parsing recordID:[$__RECID]"
|
||||
if [ "$__value" != "$__TYPE" ]; then
|
||||
write_log 7 "Current parsing [type:$__TYPE], get mismatched [type:$__value]"
|
||||
write_log 7 "Address needs to be modified, local address:[$__IP]"
|
||||
ret=2
|
||||
else
|
||||
__RECIP=`jsonfilter -s "$__TMP" -e "@.value"`
|
||||
if [ "$__RECIP" != "$__IP" ]; then
|
||||
write_log 7 "Address needs to be modified, local address:[$__IP]"
|
||||
ret=2
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
build_command
|
||||
describe_domain
|
||||
if [ $ret == 1 ];then
|
||||
sleep 3 && add_domain
|
||||
elif [ $ret == 2 ];then
|
||||
sleep 3 && update_domain
|
||||
else
|
||||
write_log 7 "Local IP:[$__IP] parsing records IP:[$__RECIP] address does not need to be modified"
|
||||
fi
|
||||
|
||||
return 0
|
||||
@ -1,61 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt
|
||||
# <https://immortalwrt.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dnsforwarder
|
||||
PKG_VERSION:=6.1.15
|
||||
PKG_RELEASE:=11
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/1715173329/dnsforwarder.git
|
||||
PKG_SOURCE_DATE:=2018-06-26
|
||||
PKG_SOURCE_VERSION:=587e61ae4d75dc976f538088b715a3c8ee26c144
|
||||
PKG_MIRROR_HASH:=7c141040ae384d254d90b3c3ee502d87330c9fdcd201ff29a669336a27b176d4
|
||||
|
||||
PKG_LICENSE:=GPL-3.0
|
||||
PKG_LICENSE_FILE:=LICENSE
|
||||
PKG_MAINTAINER:=Dennis <openwrt@tossp.com>
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/dnsforwarder
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=A simple DNS forwarder
|
||||
URL:=https://github.com/holmium/dnsforwarder
|
||||
DEPENDS:=+coreutils +coreutils-base64 +dnsmasq-full +libpthread +wget-ssl
|
||||
endef
|
||||
|
||||
define Package/dnsforwarder/description
|
||||
Forwarding queries to customized domains (and their subdomains) to specified servers
|
||||
over a specified protocol (UDP or TCP). non-standard ports are supported.
|
||||
endef
|
||||
|
||||
CONFIGURE_ARGS+= --enable-downloader=wget
|
||||
|
||||
define Package/dnsforwarder/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dnsforwarder $(1)/usr/bin/dnsforwarder
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) files/etc/config/dnsforwarder $(1)/etc/config/dnsforwarder
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) files/etc/init.d/dnsforwarder $(1)/etc/init.d/dnsforwarder
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/dnsforwarder
|
||||
$(INSTALL_CONF) files/etc/dnsforwarder/gfw.txt $(1)/etc/dnsforwarder/gfw.txt
|
||||
$(INSTALL_DIR) $(1)/usr/share/dnsforwarder
|
||||
$(INSTALL_BIN) files/usr/share/dnsforwarder/gfwlist.sh $(1)/usr/share/dnsforwarder/gfwlist.sh
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,dnsforwarder))
|
||||
@ -1,79 +0,0 @@
|
||||
|
||||
config arguments
|
||||
option enabled '0'
|
||||
option addr '127.0.0.1:5053'
|
||||
|
||||
config config
|
||||
option cache 'true'
|
||||
option cache_size '102400'
|
||||
option cache_ignore 'false'
|
||||
option gfw 'true'
|
||||
list block_ip '74.125.127.102'
|
||||
list block_ip '74.125.155.102'
|
||||
list block_ip '74.125.39.102'
|
||||
list block_ip '74.125.39.113'
|
||||
list block_ip '209.85.229.138'
|
||||
list block_ip '128.121.126.139'
|
||||
list block_ip '159.106.121.75'
|
||||
list block_ip '169.132.13.103'
|
||||
list block_ip '192.67.198.6'
|
||||
list block_ip '202.106.1.2'
|
||||
list block_ip '202.181.7.85'
|
||||
list block_ip '203.161.230.171'
|
||||
list block_ip '203.98.7.65'
|
||||
list block_ip '207.12.88.98'
|
||||
list block_ip '208.56.31.43'
|
||||
list block_ip '209.145.54.50'
|
||||
list block_ip '209.220.30.174'
|
||||
list block_ip '209.36.73.33'
|
||||
list block_ip '211.94.66.147'
|
||||
list block_ip '213.169.251.35'
|
||||
list block_ip '216.221.188.182'
|
||||
list block_ip '216.234.179.13'
|
||||
list block_ip '243.185.187.39'
|
||||
list block_ip '37.61.54.158'
|
||||
list block_ip '4.36.66.178'
|
||||
list block_ip '46.82.174.68'
|
||||
list block_ip '59.24.3.173'
|
||||
list block_ip '64.33.88.161'
|
||||
list block_ip '64.33.99.47'
|
||||
list block_ip '64.66.163.251'
|
||||
list block_ip '65.104.202.252'
|
||||
list block_ip '65.160.219.113'
|
||||
list block_ip '66.45.252.237'
|
||||
list block_ip '69.55.52.253'
|
||||
list block_ip '72.14.205.104'
|
||||
list block_ip '72.14.205.99'
|
||||
list block_ip '78.16.49.15'
|
||||
list block_ip '8.7.198.45'
|
||||
list block_ip '93.46.8.89'
|
||||
list block_ip '37.61.54.158'
|
||||
list block_ip '243.185.187.39'
|
||||
list block_ip '190.93.247.4'
|
||||
list block_ip '190.93.246.4'
|
||||
list block_ip '190.93.245.4'
|
||||
list block_ip '190.93.244.4'
|
||||
list block_ip '65.49.2.178'
|
||||
list block_ip '189.163.17.5'
|
||||
list block_ip '23.89.5.60'
|
||||
list block_ip '49.2.123.56'
|
||||
list block_ip '54.76.135.1'
|
||||
list block_ip '77.4.7.92'
|
||||
list block_ip '118.5.49.6'
|
||||
list block_ip '159.24.3.173'
|
||||
list block_ip '188.5.4.96'
|
||||
list block_ip '197.4.4.12'
|
||||
list block_ip '220.250.64.24'
|
||||
list block_ip '243.185.187.30'
|
||||
list block_ip '249.129.46.48'
|
||||
list block_ip '253.157.14.165'
|
||||
option block_ipv6 'false'
|
||||
list cache_control 'tossp.com $orig'
|
||||
list cache_control '* fixed 3600'
|
||||
option log 'false'
|
||||
list udp_group '9.9.9.9,119.29.29.29,223.5.5.5,114.114.114.114 * on'
|
||||
option block_negative_resp 'true'
|
||||
list udp_local '0.0.0.0:5053'
|
||||
list udp_local '[::0]:5053'
|
||||
option domain_statistic 'false'
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,262 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=60
|
||||
|
||||
extra_command "makeconfig"
|
||||
extra_command "makegfwlist"
|
||||
extra_command "health"
|
||||
|
||||
CRON_FILE=/etc/crontabs/root
|
||||
PID_PATH=/var/run/dnsforwarder
|
||||
PID_FILE=${PID_PATH}/dns.pid
|
||||
DNSFORWARDER_CONF=/tmp/dnsforwarder.conf
|
||||
|
||||
add_cron()
|
||||
{
|
||||
sed -i '/dnsforwarder/d' $CRON_FILE
|
||||
echo '*/5 * * * * /etc/init.d/dnsforwarder health' >> $CRON_FILE
|
||||
echo '0 1 * * 0 /etc/init.d/dnsforwarder makegfwlist' >> $CRON_FILE
|
||||
crontab $CRON_FILE
|
||||
}
|
||||
|
||||
del_cron()
|
||||
{
|
||||
sed -i '/dnsforwarder/d' $CRON_FILE
|
||||
/etc/init.d/cron restart
|
||||
}
|
||||
|
||||
fixturboacc(){
|
||||
dns=$(uci get turboacc.config.dns_caching 2>/dev/null)
|
||||
if [ $dns -eq 1 ]; then
|
||||
uci set turboacc.config.dns_caching=0 && uci commit turboacc
|
||||
/etc/init.d/turboacc restart
|
||||
fi
|
||||
}
|
||||
|
||||
makelist() {
|
||||
[ -z "$2" ] && return
|
||||
local i
|
||||
local t="$1"; shift
|
||||
for i in "$@"
|
||||
do
|
||||
echo "$t $i"
|
||||
done
|
||||
}
|
||||
|
||||
health(){
|
||||
rm /var/log/dnsforwarder.log.* 2>/dev/null
|
||||
local pid=$(cat ${PID_FILE} 2>/dev/null)
|
||||
if [ -n "${pid}" -a -d /proc/$pid ]; then
|
||||
echo "[health] process exists ${pid}"
|
||||
else
|
||||
echo "[health] Dnsforwarder is not running ${pid}"
|
||||
start
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
makegfwlist(){
|
||||
local GFW_FILE='/etc/dnsforwarder/gfw.txt'
|
||||
local GFW_TMP_FILE='/tmp/dnsforwarder-gfw.old'
|
||||
local TSTIME=`date '+%Y-%m-%d %H:%M:%S'`
|
||||
touch ${GFW_TMP_FILE}
|
||||
cat /etc/config/gfw.list 2>/dev/null > /tmp/edf.ts
|
||||
cat /etc/dnsmasq.ssr/gfw_base.conf 2>/dev/null | awk -F '/' '{print $2}' | sed 's/^.//g' >> /tmp/edf.ts
|
||||
cat /etc/dnsmasq.ssr/gfw_list.conf 2>/dev/null | awk -F '/' '{print $2}' | sed 's/^.//g' >> /tmp/edf.ts
|
||||
sort /tmp/edf.ts | uniq > /tmp/edf.ts
|
||||
/usr/share/dnsforwarder/gfwlist.sh -i -l -o /tmp/dnsforwarder-gfw.tmp --extra-domain-file /tmp/edf.ts
|
||||
if [ $? != 0 ]; then
|
||||
echo 'Failed to fetch gfwlist'
|
||||
logger -t Failed to fetch gfwlist
|
||||
return 2
|
||||
fi
|
||||
local gfw=$(cat /tmp/dnsforwarder-gfw.tmp)
|
||||
echo "# GenerationAt TS_BUILD_TIME" > ${GFW_TMP_FILE}.new
|
||||
echo "protocol tcp" >> ${GFW_TMP_FILE}.new
|
||||
echo "server 8.8.8.8,8.8.4.4,1.1.1.1,1.0.0.1,208.67.222.222,208.67.220.220,209.244.0.3,209.244.0.4,8.26.56.26,8.20.247.20,156.154.70.1,156.154.71.1,199.85.126.10" >> ${GFW_TMP_FILE}.new
|
||||
echo -e 'proxy no\n\n\n' >> ${GFW_TMP_FILE}.new
|
||||
echo "${gfw}" >> ${GFW_TMP_FILE}.new
|
||||
if [ "`cat ${GFW_TMP_FILE}.new | md5sum`" == "`cat ${GFW_TMP_FILE} | md5sum`" ]; then
|
||||
printf "[\e[32m%s\e[0m]\n" "hold"
|
||||
else
|
||||
cp ${GFW_TMP_FILE}.new ${GFW_TMP_FILE}
|
||||
cp ${GFW_TMP_FILE} ${GFW_FILE}
|
||||
sed -i "s/TS_BUILD_TIME/${TSTIME}/g" ${GFW_FILE}
|
||||
printf "[\e[33m%s\e[0m]" "PID"
|
||||
restart
|
||||
fi
|
||||
}
|
||||
|
||||
makeconfig () {
|
||||
config_load dnsforwarder
|
||||
|
||||
local log=$(uci get dnsforwarder.@config[0].log 2>/dev/null)
|
||||
local log_size=$(uci get dnsforwarder.@config[0].log_size 2>/dev/null)
|
||||
|
||||
local gfw=$(uci get dnsforwarder.@config[0].gfw 2>/dev/null)
|
||||
|
||||
local udp_local=$(uci -d ',' get dnsforwarder.@config[0].udp_local 2>/dev/null)
|
||||
local udp_local_list=$(uci get dnsforwarder.@config[0].udp_local 2>/dev/null)
|
||||
local tcp_group=$(uci get dnsforwarder.@config[0].tcp_group 2>/dev/null)
|
||||
local udp_group=$(uci get dnsforwarder.@config[0].udp_group 2>/dev/null)
|
||||
local group_file=$(uci get dnsforwarder.@config[0].group_file 2>/dev/null)
|
||||
local block_ip=$(uci -d ',' get dnsforwarder.@config[0].block_ip 2>/dev/null)
|
||||
local ip_substituting=$(uci -d ',' get dnsforwarder.@config[0].ip_substituting 2>/dev/null)
|
||||
local block_negative_resp=$(uci get dnsforwarder.@config[0].block_negative_resp 2>/dev/null)
|
||||
local append_host=$(uci get dnsforwarder.@config[0].append_host 2>/dev/null)
|
||||
local block_ipv6=$(uci get dnsforwarder.@config[0].block_ipv6 2>/dev/null)
|
||||
|
||||
local cache=$(uci get dnsforwarder.@config[0].cache 2>/dev/null)
|
||||
local cache_size=$(uci get dnsforwarder.@config[0].cache_size 2>/dev/null)
|
||||
local cache_ignore=$(uci get dnsforwarder.@config[0].cache_ignore 2>/dev/null)
|
||||
local cache_control=$(uci get dnsforwarder.@config[0].cache_control 2>/dev/null)
|
||||
|
||||
local domain_statistic=$(uci get dnsforwarder.@config[0].domain_statistic 2>/dev/null)
|
||||
local udp_local_addr=$(uci get dnsforwarder.@arguments[0].addr 2>/dev/null)
|
||||
udp_local_addr=${udp_local_addr/:/#}
|
||||
|
||||
echo "LogOn ${log}" > $DNSFORWARDER_CONF
|
||||
if [ $log = "true" ]; then
|
||||
rm /var/log/dnsforwarder.log.* 2>/dev/null
|
||||
echo '' > /var/log/dnsforwarder.log
|
||||
echo "LogFileThresholdLength ${log_size}" >> $DNSFORWARDER_CONF
|
||||
echo "LogFileFolder /var/log" >> $DNSFORWARDER_CONF
|
||||
fi
|
||||
|
||||
[ -n "$udp_local" ] && echo "UDPLocal ${udp_local}" >> $DNSFORWARDER_CONF
|
||||
[ -n "$udp_local_addr" ] && eval "makelist 'server=' $udp_local_addr" > /tmp/dnsmasq.dnsforwarder.conf
|
||||
sed -i "s/ //g" /tmp/dnsmasq.dnsforwarder.conf
|
||||
|
||||
eval "makelist 'TCPGroup' $tcp_group" >> $DNSFORWARDER_CONF
|
||||
eval "makelist 'UDPGroup' $udp_group" >> $DNSFORWARDER_CONF
|
||||
eval "makelist 'GroupFile' $group_file" >> $DNSFORWARDER_CONF
|
||||
|
||||
if [ $gfw = "true" ]; then
|
||||
echo 'GroupFile /etc/dnsforwarder/gfw.txt' >> $DNSFORWARDER_CONF
|
||||
fi
|
||||
|
||||
echo "BlockIP ${block_ip}" >> $DNSFORWARDER_CONF
|
||||
eval "makelist 'IPSubstituting' $ip_substituting" >> $DNSFORWARDER_CONF
|
||||
echo "BlockNegativeResponse ${block_negative_resp}" >> $DNSFORWARDER_CONF
|
||||
eval "makelist 'AppendHosts' $append_host" >> $DNSFORWARDER_CONF
|
||||
echo "BlockIpv6WhenIpv4Exists ${block_ipv6}" >> $DNSFORWARDER_CONF
|
||||
|
||||
echo "UseCache ${cache}" >> $DNSFORWARDER_CONF
|
||||
if [ $cache = "true" ]; then
|
||||
echo "CacheSize ${cache_size}" >> $DNSFORWARDER_CONF
|
||||
echo "MemoryCache false" >> $DNSFORWARDER_CONF
|
||||
echo "CacheFile /tmp/dnsforwarder.cache" >> $DNSFORWARDER_CONF
|
||||
echo "IgnoreTTL ${cache_ignore}" >> $DNSFORWARDER_CONF
|
||||
eval "makelist 'CacheControl' $cache_control" >> $DNSFORWARDER_CONF
|
||||
echo "ReloadCache true" >> $DNSFORWARDER_CONF
|
||||
echo "OverwriteCache true" >> $DNSFORWARDER_CONF
|
||||
fi
|
||||
echo "DomainStatistic ${domain_statistic}" >> $DNSFORWARDER_CONF
|
||||
if [ $domain_statistic = "true" ]; then
|
||||
touch /tmp/dnsforwarder-statistic.html
|
||||
mkdir -p /root/.dnsforwarder
|
||||
rm /root/.dnsforwarder/statistic.html 2 > /dev/null
|
||||
ln -s /tmp/dnsforwarder-statistic.html /root/.dnsforwarder/statistic.html
|
||||
local domain_statistic_tag='<!-- TS DNSFORWARDER -->'
|
||||
echo "DomainStatisticTempletFile /tmp/dnsforwarder-statistic.html" >> $DNSFORWARDER_CONF
|
||||
echo "StatisticInsertionPosition ${domain_statistic_tag}" >> $DNSFORWARDER_CONF
|
||||
echo "StatisticUpdateInterval 60" >> $DNSFORWARDER_CONF
|
||||
echo "${domain_statistic_tag}" > /tmp/dnsforwarder-statistic.html
|
||||
fi
|
||||
}
|
||||
|
||||
start()
|
||||
{
|
||||
echo luci for dnsforwarder
|
||||
local vt_enabled=$(uci get dnsforwarder.@arguments[0].enabled 2>/dev/null)
|
||||
if [ $vt_enabled = 0 ]; then
|
||||
echo dnsforwarder is not enabled
|
||||
exit
|
||||
fi
|
||||
makeconfig
|
||||
fixturboacc
|
||||
dnsforwarder -f $DNSFORWARDER_CONF -d
|
||||
sleep 10
|
||||
mkdir -p ${PID_PATH}
|
||||
pid=$(ps | awk '$5 ~ /\[dnsforwarder\]/ {print $1}')
|
||||
echo "dnsforwarder running pid is ${pid}"
|
||||
logger -t The pid of dnsforwarder is ${PID_FILE} ${pid}
|
||||
echo ${pid} > ${PID_FILE}
|
||||
/etc/init.d/dnsforwarder enable
|
||||
local dnsmasq=$(uci get dnsforwarder.@arguments[0].dnsmasq 2>/dev/null)
|
||||
local addr=$(uci get dnsforwarder.@arguments[0].addr 2>/dev/null)
|
||||
[ -n "${addr}" ] && addr=${addr/:/#}
|
||||
|
||||
if [ "${dnsmasq}" = "1" ]; then
|
||||
uci delete dhcp.@dnsmasq[0].server 2>/dev/null
|
||||
# uci add_list dhcp.@dnsmasq[0].server=$addr
|
||||
uci delete dhcp.@dnsmasq[0].resolvfile 2>/dev/null
|
||||
uci set dhcp.@dnsmasq[0].noresolv=1
|
||||
uci set dhcp.@dnsmasq[0].serversfile=/tmp/dnsmasq.dnsforwarder.conf
|
||||
uci commit dhcp
|
||||
/etc/init.d/dnsmasq restart
|
||||
fi
|
||||
local dnsmasq_server_addr=$(uci get dhcp.@dnsmasq[0].server 2>/dev/null)
|
||||
if [ -n "${dnsmasq_server_addr}" ]; then
|
||||
uci set dhcp.@dnsmasq[0].noresolv=1
|
||||
uci commit dhcp
|
||||
/etc/init.d/dnsmasq restart
|
||||
fi
|
||||
add_cron
|
||||
}
|
||||
|
||||
stop()
|
||||
{
|
||||
del_cron
|
||||
logger -t stopping dnsforwarder
|
||||
local addr=$(uci get dnsforwarder.@arguments[0].addr 2>/dev/null)
|
||||
local dnsmasq=$(uci get dnsforwarder.@arguments[0].dnsmasq 2>/dev/null)
|
||||
addr=${addr/:/#}
|
||||
if [ "${dnsmasq}" = "1" ]; then
|
||||
uci del_list dhcp.@dnsmasq[0].server=$addr 2>/dev/null
|
||||
fi
|
||||
uci set dhcp.@dnsmasq[0].resolvfile=/tmp/resolv.conf.d/resolv.conf.auto 2>/dev/null
|
||||
uci delete dhcp.@dnsmasq[0].noresolv 2>/dev/null
|
||||
uci delete dhcp.@dnsmasq[0].serversfile 2>/dev/null
|
||||
uci commit dhcp
|
||||
/etc/init.d/dnsmasq restart
|
||||
[ -e ${PID_FILE} ] && {
|
||||
pid=$(cat ${PID_FILE})
|
||||
logger -t killing dnsforwarder pid ${pid}
|
||||
echo killing dnsforwarder pid ${pid}
|
||||
kill ${pid}
|
||||
rm -f ${PID_FILE}
|
||||
} || {
|
||||
logger -t Cannot find dnsforwarder pid file
|
||||
}
|
||||
}
|
||||
|
||||
restart()
|
||||
{
|
||||
pid=$(cat ${PID_FILE} 2>/dev/null)
|
||||
echo Dnsforwarder pid file is ${pid}
|
||||
[ -n "$pid" ] && {
|
||||
echo stopping pid ${pid}
|
||||
logger -t There is dnsforwarder pid ${pid}
|
||||
stop
|
||||
} || {
|
||||
logger -t Dnsforwarder is not running
|
||||
}
|
||||
sleep 7
|
||||
local vt_enabled=$(uci get dnsforwarder.@arguments[0].enabled 2>/dev/null)
|
||||
echo dnsforwarder status is ${vt_enabled}
|
||||
logger -t Dnsforwarder is initializing enabled is ${vt_enabled}
|
||||
if [ ${vt_enabled} = 1 ]; then
|
||||
[ -n "$pid" ] && {
|
||||
logger -t There is dnsforwarder pid ${pid}
|
||||
stop
|
||||
} || {
|
||||
logger -t Dnsforwarder is not running
|
||||
}
|
||||
|
||||
logger -t Restarting dnsforwarder
|
||||
start
|
||||
else
|
||||
/etc/init.d/dnsforwarder disable
|
||||
fi
|
||||
}
|
||||
@ -1,313 +0,0 @@
|
||||
#/bin/sh
|
||||
|
||||
# Name: gfwlist2dnsmasq.sh
|
||||
# Desription: A shell script which convert gfwlist into dnsmasq rules.
|
||||
# Version: 0.8.0 (2017.12.25)
|
||||
# Author: Cokebar Chi
|
||||
# Website: https://github.com/cokebar
|
||||
|
||||
_green() {
|
||||
printf '\033[1;31;32m'
|
||||
printf -- "%b" "$1"
|
||||
printf '\033[0m'
|
||||
}
|
||||
|
||||
_red() {
|
||||
printf '\033[1;31;31m'
|
||||
printf -- "%b" "$1"
|
||||
printf '\033[0m'
|
||||
}
|
||||
|
||||
_yellow() {
|
||||
printf '\033[1;31;33m'
|
||||
printf -- "%b" "$1"
|
||||
printf '\033[0m'
|
||||
}
|
||||
|
||||
usage() {
|
||||
cat <<-EOF
|
||||
|
||||
Name: gfwlist2dnsmasq.sh
|
||||
Desription: A shell script which convert gfwlist into dnsmasq rules.
|
||||
Version: 0.8.0 (2017.12.25)
|
||||
Author: Cokebar Chi
|
||||
Website: https://github.com/cokebar
|
||||
|
||||
Usage: sh gfwlist2dnsmasq.sh [options] -o FILE
|
||||
Valid options are:
|
||||
-d, --dns <dns_ip>
|
||||
DNS IP address for the GfwList Domains (Default: 127.0.0.1)
|
||||
-p, --port <dns_port>
|
||||
DNS Port for the GfwList Domains (Default: 5353)
|
||||
-s, --ipset <ipset_name>
|
||||
Ipset name for the GfwList domains
|
||||
(If not given, ipset rules will not be generated.)
|
||||
-o, --output <FILE>
|
||||
/path/to/output_filename
|
||||
-i, --insecure
|
||||
Force bypass certificate validation (insecure)
|
||||
-l, --domain-list
|
||||
Convert Gfwlist into domain list instead of dnsmasq rules
|
||||
(If this option is set, DNS IP/Port & ipset are not needed)
|
||||
--exclude-domain-file <FILE>
|
||||
Delete specific domains in the result from a domain list text file
|
||||
Please put one domain per line
|
||||
--extra-domain-file <FILE>
|
||||
Include extra domains to the result from a domain list text file
|
||||
This file will be processed after the exclude-domain-file
|
||||
Please put one domain per line
|
||||
-h, --help
|
||||
Usage
|
||||
EOF
|
||||
exit $1
|
||||
}
|
||||
|
||||
clean_and_exit(){
|
||||
# Clean up temp files
|
||||
printf 'Cleaning up... '
|
||||
rm -rf $TMP_DIR
|
||||
_green 'Done\n\n'
|
||||
[ $1 -eq 0 ] && _green 'Job Finished.\n\n' || _red 'Exit with Error code '$1'.\n'
|
||||
exit $1
|
||||
}
|
||||
|
||||
check_depends(){
|
||||
which sed base64 curl >/dev/null
|
||||
if [ $? != 0 ]; then
|
||||
_red 'Error: Missing Dependency.\nPlease check whether you have the following binaries on you system:\nwhich, sed, base64, curl.\n'
|
||||
exit 3
|
||||
fi
|
||||
|
||||
SYS_KERNEL=`uname -s`
|
||||
if [ $SYS_KERNEL = "Darwin" -o $SYS_KERNEL = "FreeBSD" ]; then
|
||||
BASE64_DECODE='base64 -D'
|
||||
SED_ERES='sed -E'
|
||||
else
|
||||
BASE64_DECODE='base64 -d'
|
||||
SED_ERES='sed -r'
|
||||
fi
|
||||
}
|
||||
|
||||
get_args(){
|
||||
OUT_TYPE='DNSMASQ_RULES'
|
||||
DNS_IP='127.0.0.1'
|
||||
DNS_PORT='5353'
|
||||
IPSET_NAME=''
|
||||
FILE_FULLPATH=''
|
||||
CURL_EXTARG=''
|
||||
WITH_IPSET=0
|
||||
EXTRA_DOMAIN_FILE=''
|
||||
EXCLUDE_DOMAIN_FILE=''
|
||||
IPV4_PATTERN='^((2[0-4][0-9]|25[0-5]|[01]?[0-9][0-9]?)\.){3}(2[0-4][0-9]|25[0-5]|[01]?[0-9][0-9]?)$'
|
||||
IPV6_PATTERN='^((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:)))(%.+)?$'
|
||||
|
||||
while [ ${#} -gt 0 ]; do
|
||||
case "${1}" in
|
||||
--help | -h)
|
||||
usage 0
|
||||
;;
|
||||
--domain-list | -l)
|
||||
OUT_TYPE='DOMAIN_LIST'
|
||||
;;
|
||||
--insecure | -i)
|
||||
CURL_EXTARG='--insecure'
|
||||
;;
|
||||
--dns | -d)
|
||||
DNS_IP="$2"
|
||||
shift
|
||||
;;
|
||||
--port | -p)
|
||||
DNS_PORT="$2"
|
||||
shift
|
||||
;;
|
||||
--ipset | -s)
|
||||
IPSET_NAME="$2"
|
||||
shift
|
||||
;;
|
||||
--output | -o)
|
||||
OUT_FILE="$2"
|
||||
shift
|
||||
;;
|
||||
--extra-domain-file)
|
||||
EXTRA_DOMAIN_FILE="$2"
|
||||
shift
|
||||
;;
|
||||
--exclude-domain-file)
|
||||
EXCLUDE_DOMAIN_FILE="$2"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
_red "Invalid argument: $1"
|
||||
usage 1
|
||||
;;
|
||||
esac
|
||||
shift 1
|
||||
done
|
||||
|
||||
# Check path & file name
|
||||
if [ -z $OUT_FILE ]; then
|
||||
_red 'Error: Please specify the path to the output file(using -o/--output argument).\n'
|
||||
exit 1
|
||||
else
|
||||
if [ -z ${OUT_FILE##*/} ]; then
|
||||
_red 'Error: '$OUT_FILE' is a path, not a file.\n'
|
||||
exit 1
|
||||
else
|
||||
if [ ${OUT_FILE}a != ${OUT_FILE%/*}a ] && [ ! -d ${OUT_FILE%/*} ]; then
|
||||
_red 'Error: Folder do not exist: '${OUT_FILE%/*}'\n'
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $OUT_TYPE = 'DNSMASQ_RULES' ]; then
|
||||
# Check DNS IP
|
||||
IPV4_TEST=$(echo $DNS_IP | grep -E $IPV4_PATTERN)
|
||||
IPV6_TEST=$(echo $DNS_IP | grep -E $IPV6_PATTERN)
|
||||
if [ "$IPV4_TEST" != "$DNS_IP" -a "$IPV6_TEST" != "$DNS_IP" ]; then
|
||||
_red 'Error: Please enter a valid DNS server IP address.\n'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check DNS port
|
||||
if [ $DNS_PORT -lt 1 -o $DNS_PORT -gt 65535 ]; then
|
||||
_red 'Error: Please enter a valid DNS server port.\n'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check ipset name
|
||||
if [ -z $IPSET_NAME ]; then
|
||||
WITH_IPSET=0
|
||||
else
|
||||
IPSET_TEST=$(echo $IPSET_NAME | grep -E '^\w+$')
|
||||
if [ "$IPSET_TEST" != "$IPSET_NAME" ]; then
|
||||
_red 'Error: Please enter a valid IP set name.\n'
|
||||
exit 1
|
||||
else
|
||||
WITH_IPSET=1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -z $EXTRA_DOMAIN_FILE ] && [ ! -f $EXTRA_DOMAIN_FILE ]; then
|
||||
_yellow 'WARNING:\nExtra domain file does not exist, ignored.\n\n'
|
||||
EXTRA_DOMAIN_FILE=''
|
||||
fi
|
||||
|
||||
if [ ! -z $EXCLUDE_DOMAIN_FILE ] && [ ! -f $EXCLUDE_DOMAIN_FILE ]; then
|
||||
_yellow 'WARNING:\nExclude domain file does not exist, ignored.\n\n'
|
||||
EXCLUDE_DOMAIN_FILE=''
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
process(){
|
||||
# Set Global Var
|
||||
BASE_URL='https://github.com/gfwlist/gfwlist/raw/master/gfwlist.txt'
|
||||
TMP_DIR=`mktemp -d /tmp/gfwlist2dnsmasq.XXXXXX`
|
||||
BASE64_FILE="$TMP_DIR/base64.txt"
|
||||
GFWLIST_FILE="$TMP_DIR/gfwlist.txt"
|
||||
DOMAIN_TEMP_FILE="$TMP_DIR/gfwlist2domain.tmp"
|
||||
DOMAIN_FILE="$TMP_DIR/gfwlist2domain.txt"
|
||||
CONF_TMP_FILE="$TMP_DIR/gfwlist.conf.tmp"
|
||||
OUT_TMP_FILE="$TMP_DIR/gfwlist.out.tmp"
|
||||
|
||||
# Fetch GfwList and decode it into plain text
|
||||
printf 'Fetching GfwList... '
|
||||
local tscurl='curl -L --connect-timeout 5 -m 300 --retry 3 --retry-delay 1'
|
||||
$tscurl $CURL_EXTARG -o$BASE64_FILE $BASE_URL \
|
||||
|| $tscurl $CURL_EXTARG -o$BASE64_FILE https://gitlab.com/gfwlist/gfwlist/raw/master/gfwlist.txt \
|
||||
|| $tscurl $CURL_EXTARG -o$BASE64_FILE https://git.tuxfamily.org/gfwlist/gfwlist.git/plain/gfwlist.txt \
|
||||
|| $tscurl $CURL_EXTARG -o$BASE64_FILE https://pagure.io/gfwlist/raw/master/f/gfwlist.txt \
|
||||
|| $tscurl $CURL_EXTARG -o$BASE64_FILE http://repo.or.cz/gfwlist.git/blob_plain/HEAD:/gfwlist.txt \
|
||||
|| $tscurl $CURL_EXTARG -o$BASE64_FILE https://bitbucket.org/gfwlist/gfwlist/raw/HEAD/gfwlist.txt \
|
||||
|| $tscurl $CURL_EXTARG -o$BASE64_FILE $BASE_URL
|
||||
if [ $? != 0 ]; then
|
||||
_red '\nFailed to fetch gfwlist.txt. Please check your Internet connection.\n'
|
||||
clean_and_exit 2
|
||||
fi
|
||||
$BASE64_DECODE $BASE64_FILE > $GFWLIST_FILE || ( _red 'Failed to decode gfwlist.txt. Quit.\n'; clean_and_exit 2 )
|
||||
_green 'Done.\n\n'
|
||||
|
||||
# Convert
|
||||
IGNORE_PATTERN='^\!|\[|^@@|(https?://){0,1}[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+'
|
||||
HEAD_FILTER_PATTERN='s#^(\|\|?)?(https?://)?##g'
|
||||
TAIL_FILTER_PATTERN='s#/.*$|%2F.*$##g'
|
||||
DOMAIN_PATTERN='([a-zA-Z0-9][-a-zA-Z0-9]*(\.[a-zA-Z0-9][-a-zA-Z0-9]*)+)'
|
||||
HANDLE_WILDCARD_PATTERN='s#^(([a-zA-Z0-9]*\*[-a-zA-Z0-9]*)?(\.))?([a-zA-Z0-9][-a-zA-Z0-9]*(\.[a-zA-Z0-9][-a-zA-Z0-9]*)+)(\*)?#\4#g'
|
||||
|
||||
printf 'Converting GfwList to ' && _green $OUT_TYPE && printf ' ...\n'
|
||||
_yellow '\nWARNING:\nThe following lines in GfwList contain regex, and might be ignored:\n\n'
|
||||
cat $GFWLIST_FILE | grep -n '^/.*$'
|
||||
_yellow "\nThis script will try to convert some of the regex rules. But you should know this may not be a equivalent conversion.\nIf there's regex rules which this script do not deal with, you should add the domain manually to the list.\n\n"
|
||||
grep -vE $IGNORE_PATTERN $GFWLIST_FILE | $SED_ERES $HEAD_FILTER_PATTERN | $SED_ERES $TAIL_FILTER_PATTERN | grep -E $DOMAIN_PATTERN | $SED_ERES $HANDLE_WILDCARD_PATTERN > $DOMAIN_TEMP_FILE
|
||||
|
||||
printf 'google.com\ngoogle.ad\ngoogle.ae\ngoogle.com.af\ngoogle.com.ag\ngoogle.com.ai\ngoogle.al\ngoogle.am\ngoogle.co.ao\ngoogle.com.ar\ngoogle.as\ngoogle.at\ngoogle.com.au\ngoogle.az\ngoogle.ba\ngoogle.com.bd\ngoogle.be\ngoogle.bf\ngoogle.bg\ngoogle.com.bh\ngoogle.bi\ngoogle.bj\ngoogle.com.bn\ngoogle.com.bo\ngoogle.com.br\ngoogle.bs\ngoogle.bt\ngoogle.co.bw\ngoogle.by\ngoogle.com.bz\ngoogle.ca\ngoogle.cd\ngoogle.cf\ngoogle.cg\ngoogle.ch\ngoogle.ci\ngoogle.co.ck\ngoogle.cl\ngoogle.cm\ngoogle.cn\ngoogle.com.co\ngoogle.co.cr\ngoogle.com.cu\ngoogle.cv\ngoogle.com.cy\ngoogle.cz\ngoogle.de\ngoogle.dj\ngoogle.dk\ngoogle.dm\ngoogle.com.do\ngoogle.dz\ngoogle.com.ec\ngoogle.ee\ngoogle.com.eg\ngoogle.es\ngoogle.com.et\ngoogle.fi\ngoogle.com.fj\ngoogle.fm\ngoogle.fr\ngoogle.ga\ngoogle.ge\ngoogle.gg\ngoogle.com.gh\ngoogle.com.gi\ngoogle.gl\ngoogle.gm\ngoogle.gp\ngoogle.gr\ngoogle.com.gt\ngoogle.gy\ngoogle.com.hk\ngoogle.hn\ngoogle.hr\ngoogle.ht\ngoogle.hu\ngoogle.co.id\ngoogle.ie\ngoogle.co.il\ngoogle.im\ngoogle.co.in\ngoogle.iq\ngoogle.is\ngoogle.it\ngoogle.je\ngoogle.com.jm\ngoogle.jo\ngoogle.co.jp\ngoogle.co.ke\ngoogle.com.kh\ngoogle.ki\ngoogle.kg\ngoogle.co.kr\ngoogle.com.kw\ngoogle.kz\ngoogle.la\ngoogle.com.lb\ngoogle.li\ngoogle.lk\ngoogle.co.ls\ngoogle.lt\ngoogle.lu\ngoogle.lv\ngoogle.com.ly\ngoogle.co.ma\ngoogle.md\ngoogle.me\ngoogle.mg\ngoogle.mk\ngoogle.ml\ngoogle.com.mm\ngoogle.mn\ngoogle.ms\ngoogle.com.mt\ngoogle.mu\ngoogle.mv\ngoogle.mw\ngoogle.com.mx\ngoogle.com.my\ngoogle.co.mz\ngoogle.com.na\ngoogle.com.nf\ngoogle.com.ng\ngoogle.com.ni\ngoogle.ne\ngoogle.nl\ngoogle.no\ngoogle.com.np\ngoogle.nr\ngoogle.nu\ngoogle.co.nz\ngoogle.com.om\ngoogle.com.pa\ngoogle.com.pe\ngoogle.com.pg\ngoogle.com.ph\ngoogle.com.pk\ngoogle.pl\ngoogle.pn\ngoogle.com.pr\ngoogle.ps\ngoogle.pt\ngoogle.com.py\ngoogle.com.qa\ngoogle.ro\ngoogle.ru\ngoogle.rw\ngoogle.com.sa\ngoogle.com.sb\ngoogle.sc\ngoogle.se\ngoogle.com.sg\ngoogle.sh\ngoogle.si\ngoogle.sk\ngoogle.com.sl\ngoogle.sn\ngoogle.so\ngoogle.sm\ngoogle.sr\ngoogle.st\ngoogle.com.sv\ngoogle.td\ngoogle.tg\ngoogle.co.th\ngoogle.com.tj\ngoogle.tk\ngoogle.tl\ngoogle.tm\ngoogle.tn\ngoogle.to\ngoogle.com.tr\ngoogle.tt\ngoogle.com.tw\ngoogle.co.tz\ngoogle.com.ua\ngoogle.co.ug\ngoogle.co.uk\ngoogle.com.uy\ngoogle.co.uz\ngoogle.com.vc\ngoogle.co.ve\ngoogle.vg\ngoogle.co.vi\ngoogle.com.vn\ngoogle.vu\ngoogle.ws\ngoogle.rs\ngoogle.co.za\ngoogle.co.zm\ngoogle.co.zw\ngoogle.cat\n' >> $DOMAIN_TEMP_FILE
|
||||
printf 'Google search domains... ' && _green 'Added\n'
|
||||
|
||||
# Add blogspot domains
|
||||
printf 'blogspot.ca\nblogspot.co.uk\nblogspot.com\nblogspot.com.ar\nblogspot.com.au\nblogspot.com.br\nblogspot.com.by\nblogspot.com.co\nblogspot.com.cy\nblogspot.com.ee\nblogspot.com.eg\nblogspot.com.es\nblogspot.com.mt\nblogspot.com.ng\nblogspot.com.tr\nblogspot.com.uy\nblogspot.de\nblogspot.gr\nblogspot.in\nblogspot.mx\nblogspot.ch\nblogspot.fr\nblogspot.ie\nblogspot.it\nblogspot.pt\nblogspot.ro\nblogspot.sg\nblogspot.be\nblogspot.no\nblogspot.se\nblogspot.jp\nblogspot.in\nblogspot.ae\nblogspot.al\nblogspot.am\nblogspot.ba\nblogspot.bg\nblogspot.ch\nblogspot.cl\nblogspot.cz\nblogspot.dk\nblogspot.fi\nblogspot.gr\nblogspot.hk\nblogspot.hr\nblogspot.hu\nblogspot.ie\nblogspot.is\nblogspot.kr\nblogspot.li\nblogspot.lt\nblogspot.lu\nblogspot.md\nblogspot.mk\nblogspot.my\nblogspot.nl\nblogspot.no\nblogspot.pe\nblogspot.qa\nblogspot.ro\nblogspot.ru\nblogspot.se\nblogspot.sg\nblogspot.si\nblogspot.sk\nblogspot.sn\nblogspot.tw\nblogspot.ug\nblogspot.cat\n' >> $DOMAIN_TEMP_FILE
|
||||
printf 'Blogspot domains... ' && _green 'Added\n'
|
||||
|
||||
# Add twimg.edgesuite.net
|
||||
printf 'twimg.edgesuite.net\n' >> $DOMAIN_TEMP_FILE
|
||||
printf 'twimg.edgesuite.net... ' && _green 'Added\n'
|
||||
|
||||
# Delete exclude domains
|
||||
if [ ! -z $EXCLUDE_DOMAIN_FILE ]; then
|
||||
for line in $(cat $EXCLUDE_DOMAIN_FILE)
|
||||
do
|
||||
cat $DOMAIN_TEMP_FILE | grep -vF -f $EXCLUDE_DOMAIN_FILE > $DOMAIN_FILE
|
||||
done
|
||||
printf 'Domains in exclude domain file '$EXCLUDE_DOMAIN_FILE'... ' && _green 'Deleted\n'
|
||||
else
|
||||
cat $DOMAIN_TEMP_FILE > $DOMAIN_FILE
|
||||
fi
|
||||
|
||||
# Add extra domains
|
||||
if [ ! -z $EXTRA_DOMAIN_FILE ]; then
|
||||
cat $EXTRA_DOMAIN_FILE >> $DOMAIN_FILE
|
||||
printf 'Extra domain file '$EXTRA_DOMAIN_FILE'... ' && _green 'Added\n'
|
||||
fi
|
||||
|
||||
if [ $OUT_TYPE = 'DNSMASQ_RULES' ]; then
|
||||
# Convert domains into dnsmasq rules
|
||||
if [ $WITH_IPSET -eq 1 ]; then
|
||||
_green 'Ipset rules included.'
|
||||
sort -u $DOMAIN_FILE | $SED_ERES 's#(.+)#server=/\1/'$DNS_IP'\#'$DNS_PORT'\
|
||||
ipset=/\1/'$IPSET_NAME'#g' > $CONF_TMP_FILE
|
||||
else
|
||||
_green 'Ipset rules not included.'
|
||||
sort -u $DOMAIN_FILE | $SED_ERES 's#(.+)#server=/\1/'$DNS_IP'\#'$DNS_PORT'#g' > $CONF_TMP_FILE
|
||||
fi
|
||||
|
||||
# Generate output file
|
||||
echo '# dnsmasq rules generated by gfwlist' > $OUT_TMP_FILE
|
||||
echo "# Last Updated on $(date "+%Y-%m-%d %H:%M:%S")" >> $OUT_TMP_FILE
|
||||
echo '# ' >> $OUT_TMP_FILE
|
||||
cat $CONF_TMP_FILE >> $OUT_TMP_FILE
|
||||
cp $OUT_TMP_FILE $OUT_FILE
|
||||
else
|
||||
sort -u $DOMAIN_FILE > $OUT_TMP_FILE
|
||||
fi
|
||||
|
||||
cp $OUT_TMP_FILE $OUT_FILE
|
||||
printf '\nConverting GfwList to '$OUT_TYPE'... ' && _green 'Done\n\n'
|
||||
|
||||
# Clean up
|
||||
clean_and_exit 0
|
||||
}
|
||||
|
||||
main() {
|
||||
if [ -z "$1" ]; then
|
||||
usage 0
|
||||
else
|
||||
check_depends
|
||||
get_args "$@"
|
||||
_green '\nJob Started.\n\n'
|
||||
process
|
||||
fi
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@ -1,39 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2015-2016 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dsmboot
|
||||
PKG_VERSION:=5.2
|
||||
PKG_RELEASE:=5967.1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/dsmboot
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Synology DSM pxeboot from TFTP
|
||||
endef
|
||||
|
||||
define Package/dsmboot/description
|
||||
DSM 5.2 boot from TFTP
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
true
|
||||
endef
|
||||
|
||||
define Package/dsmboot/install
|
||||
$(INSTALL_DIR) $(1)/root
|
||||
$(CP) ./files/dsm.iso $(1)/root/
|
||||
$(CP) ./files/menu.lst $(1)/root/
|
||||
$(CP) ./files/pxelinux.0 $(1)/root/
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) ./files/dsmboot $(1)/etc/uci-defaults/yyy-dsmboot
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,dsmboot))
|
||||
Binary file not shown.
@ -1,10 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
set dhcp.@dnsmasq[0].enable_tftp='1'
|
||||
set dhcp.@dnsmasq[0].dhcp_boot='pxelinux.0'
|
||||
set dhcp.@dnsmasq[0].tftp_root='/root'
|
||||
commit dhcp
|
||||
EOF
|
||||
|
||||
exit 0
|
||||
@ -1,9 +0,0 @@
|
||||
default 0
|
||||
timeout 0
|
||||
fallback 0
|
||||
|
||||
title Synology DSM
|
||||
map --mem (pd)/dsm.iso (hd32)
|
||||
map --hook
|
||||
chainloader (hd32)
|
||||
|
||||
Binary file not shown.
@ -1,68 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2019 Xingwang Liao
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=frp
|
||||
PKG_VERSION:=0.36.2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/fatedier/frp/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=b9dca438385ddbbcc4c7dade3d5e940e1b61b27dd45a012876eaaa41ec2da2a9
|
||||
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_MAINTAINER:=Xingwang Liao <kuoruan@gmail.com>
|
||||
|
||||
PKG_BUILD_DEPENDS:=golang/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
GO_PKG:=github.com/fatedier/frp
|
||||
GO_PKG_BUILD_PKG:=github.com/fatedier/frp/cmd/...
|
||||
|
||||
GO_PKG_LDFLAGS:=-s -w
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
|
||||
|
||||
define frp/templates
|
||||
define Package/$(1)
|
||||
TITLE:=A fast reverse proxy ($(1))
|
||||
URL:=https://github.com/fatedier/frp
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Web Servers/Proxies
|
||||
DEPENDS:=$$(GO_ARCH_DEPENDS)
|
||||
endef
|
||||
|
||||
define Package/$(1)/description
|
||||
frp is a fast reverse proxy to help you expose a local server behind a NAT or firewall
|
||||
to the internet. As of now, it supports tcp & udp, as well as http and https protocols,
|
||||
where requests can be forwarded to internal services by domain name.
|
||||
|
||||
This package contains the $(1).
|
||||
endef
|
||||
|
||||
define Package/$(1)/install
|
||||
$$(call GoPackage/Package/Install/Bin,$$(PKG_INSTALL_DIR))
|
||||
|
||||
$$(INSTALL_DIR) $$(1)/usr/bin
|
||||
$$(INSTALL_BIN) $$(PKG_INSTALL_DIR)/usr/bin/$(1) $$(1)/usr/bin/
|
||||
|
||||
$(STAGING_DIR_HOST)/bin/upx --lzma --best $$(1)/usr/bin/$(1)
|
||||
endef
|
||||
endef
|
||||
|
||||
FRP_COMPONENTS:=frpc frps
|
||||
|
||||
$(foreach component,$(FRP_COMPONENTS), \
|
||||
$(eval $(call frp/templates,$(component))) \
|
||||
$(eval $(call GoBinPackage,$(component))) \
|
||||
$(eval $(call BuildPackage,$(component))) \
|
||||
)
|
||||
@ -1,54 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2020 Lean <coolsnowwolf@gmail.com>
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt
|
||||
# <https://immortalwrt.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=gmediarender
|
||||
PKG_VERSION:=0.0.8
|
||||
PKG_RELEASE=2
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/hzeller/gmrender-resurrect.git
|
||||
PKG_SOURCE_DATE:=2021-01-15
|
||||
PKG_SOURCE_VERSION:=7cd74525e89a1dcd8869b8f6f67f2565afa59abe
|
||||
PKG_MIRROR_HASH:=98514528690a6bcf0d6611c12f1dd498e795943085e916501f5442c19d98e162
|
||||
|
||||
PKG_REMOVE_FILES:=autogen.sh aclocal.m4
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
|
||||
define Package/gmediarender
|
||||
SECTION:=multimedia
|
||||
CATEGORY:=Multimedia
|
||||
TITLE:=A Headless UPnP Renderer
|
||||
DEPENDS:=+glib2 +gstreamer1 +libgstreamer1 +gstreamer1-libs +libupnp
|
||||
endef
|
||||
|
||||
define Package/gmediarender/description
|
||||
gmediarender implements the server component that provides UPnP
|
||||
controllers a means to render media content (audio, video and images)
|
||||
from a UPnP media server.
|
||||
endef
|
||||
|
||||
CONFIGURE_ARGS+= \
|
||||
CFLAGS="$(TARGET_CFLAGS) -std=gnu99" \
|
||||
--with-build-cc="$(HOSTCC)" \
|
||||
--prefix="\usr"
|
||||
|
||||
define Package/gmediarender/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gmediarender $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,gmediarender))
|
||||
@ -1,41 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2015 Justin Liu
|
||||
# Author: Justin Liu <rssnsj@gmail.com>
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ipset-lists
|
||||
PKG_VERSION:=20181104
|
||||
PKG_RELEASE:=2
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/ipset-lists
|
||||
CATEGORY:=Network
|
||||
TITLE:=Service for IPSET address tables
|
||||
MAINTAINER:=Justin Liu <rssnsj@gmail.com>
|
||||
DEPENDS:=+ipset
|
||||
endef
|
||||
|
||||
define Package/ipset-lists/conffiles
|
||||
/etc/gfwlist/china-banned
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
true
|
||||
endef
|
||||
|
||||
define Package/ipset-lists/install
|
||||
$(CP) files/* $(1)/
|
||||
endef
|
||||
|
||||
define Package/ipset-lists/postinst
|
||||
#!/bin/sh
|
||||
if [ -e /etc/openwrt_release ]; then
|
||||
/etc/init.d/ipset.sh restart
|
||||
/etc/init.d/ipset.sh enable || :
|
||||
fi
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ipset-lists))
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,95 +0,0 @@
|
||||
v.youku.com
|
||||
api.youku.com
|
||||
v2.tudou.com
|
||||
www.tudou.com
|
||||
s.plcloud.music.qq.com
|
||||
i.y.qq.com
|
||||
hot.vrs.sohu.com
|
||||
live.tv.sohu.com
|
||||
pad.tv.sohu.com
|
||||
my.tv.sohu.com
|
||||
hot.vrs.letv.com
|
||||
data.video.qiyi.com
|
||||
cache.video.qiyi.com
|
||||
cache.vip.qiyi.com
|
||||
vv.video.qq.com
|
||||
tt.video.qq.com
|
||||
ice.video.qq.com
|
||||
tjsa.video.qq.com
|
||||
a10.video.qq.com
|
||||
xyy.video.qq.com
|
||||
vcq.video.qq.com
|
||||
vsh.video.qq.com
|
||||
vbj.video.qq.com
|
||||
bobo.video.qq.com
|
||||
flvs.video.qq.com
|
||||
bkvv.video.qq.com
|
||||
info.zb.qq.com
|
||||
geo.js.kankan.xunlei.com
|
||||
web-play.pptv.com
|
||||
web-play.pplive.cn
|
||||
dyn.ugc.pps.tv
|
||||
v.pps.tv
|
||||
inner.kandian.com
|
||||
ipservice.163.com
|
||||
so.open.163.com
|
||||
zb.s.qq.com
|
||||
ip.kankan.xunlei.com
|
||||
vxml.56.com
|
||||
music.sina.com.cn
|
||||
play.baidu.com
|
||||
v.iask.com
|
||||
tv.weibo.com
|
||||
wtv.v.iask.com
|
||||
video.sina.com.cn
|
||||
www.yinyuetai.com
|
||||
api.letv.com
|
||||
live.gslb.letv.com
|
||||
static.itv.letv.com
|
||||
ip.apps.cntv.cn
|
||||
vdn.apps.cntv.cn
|
||||
vdn.live.cntv.cn
|
||||
vip.sports.cntv.cn
|
||||
a.play.api.3g.youku.com
|
||||
i.play.api.3g.youku.com
|
||||
api.3g.youku.com
|
||||
tv.api.3g.youku.com
|
||||
play.api.3g.youku.com
|
||||
play.api.3g.tudou.com
|
||||
tv.api.3g.tudou.com
|
||||
api.3g.tudou.com
|
||||
api.tv.sohu.com
|
||||
access.tv.sohu.com
|
||||
iface.iqiyi.com
|
||||
iface2.iqiyi.com
|
||||
cache.m.iqiyi.com
|
||||
dynamic.app.m.letv.com
|
||||
dynamic.meizi.app.m.letv.com
|
||||
dynamic.search.app.m.letv.com
|
||||
dynamic.live.app.m.letv.com
|
||||
listso.m.areainfo.ppstream.com
|
||||
epg.api.pptv.com
|
||||
play.api.pptv.com
|
||||
m.letv.com
|
||||
interface.bilibili.com
|
||||
3g.music.qq.com
|
||||
mqqplayer.3g.qq.com
|
||||
proxy.music.qq.com
|
||||
proxymc.qq.com
|
||||
ip2.kugou.com
|
||||
ip.kugou.com
|
||||
client.api.ttpod.com
|
||||
mobi.kuwo.cn
|
||||
mobilefeedback.kugou.com
|
||||
tingapi.ting.baidu.com
|
||||
music.baidu.com
|
||||
serviceinfo.sdk.duomi.com
|
||||
music.163.com
|
||||
www.xiami.com
|
||||
spark.api.xiami.com
|
||||
iplocation.geo.qiyi.com
|
||||
sns.video.qq.com
|
||||
v5.pc.duomi.com
|
||||
tms.is.ysten.com
|
||||
internal.check.duokanbox.com
|
||||
openapi.youku.com
|
||||
@ -1,28 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2014 Justin Liu <rssnsj@gmail.com>
|
||||
|
||||
START=21
|
||||
|
||||
start()
|
||||
{
|
||||
local file
|
||||
for file in /etc/ipset/*; do
|
||||
[ -f $file ] || continue
|
||||
ipset restore < $file
|
||||
done
|
||||
}
|
||||
|
||||
stop()
|
||||
{
|
||||
local file
|
||||
for file in /etc/ipset/*; do
|
||||
[ -f $file ] || continue
|
||||
ipset destroy `basename $file`
|
||||
done
|
||||
}
|
||||
|
||||
restart()
|
||||
{
|
||||
stop >/dev/null 2>&1
|
||||
start
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,6 +0,0 @@
|
||||
create local hash:net family inet hashsize 1024 maxelem 65536
|
||||
add local 10.0.0.0/8
|
||||
add local 127.0.0.0/8
|
||||
add local 172.16.0.0/12
|
||||
add local 192.168.0.0/16
|
||||
add local 224.0.0.0/3
|
||||
@ -1,8 +0,0 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8"
|
||||
|
||||
msgid "Domain Lists Settings"
|
||||
msgstr "域名列表设置"
|
||||
|
||||
msgid "Domain Lists"
|
||||
msgstr "域名列表"
|
||||
@ -1,3 +0,0 @@
|
||||
update:
|
||||
./gen-china-routes.sh > ../files/etc/ipset/china
|
||||
./gen-gfwlist.sh > ../files/etc/gfwlist/china-banned
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,83 +0,0 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
#
|
||||
# Script for generating China IPv4 route table by merging APNIC.net data and IPIP.net data
|
||||
#
|
||||
|
||||
china_routes_ipip()
|
||||
{
|
||||
[ -f ipip.txt ] || wget -4 https://cdn.jsdelivr.net/gh/17mon/china_ip_list/china_ip_list.txt -O ipip.txt >&2 || exit 1
|
||||
cat ipip.txt | xargs netmask | awk '{print $1}'
|
||||
}
|
||||
|
||||
china_routes_apnic()
|
||||
{
|
||||
[ -f apnic.txt ] || wget -4 http://ftp.apnic.net/stats/apnic/delegated-apnic-latest -O apnic.txt >&2 || exit 1
|
||||
|
||||
cat apnic.txt | awk -F'|' -vc=CN '
|
||||
function tobits(c) { for(n=0; c>=2; c/=2) n++; return 32-n; }
|
||||
$2==c&&$3=="ipv4" { printf("%s/%d\n", $4, tobits($5)) }' |
|
||||
xargs netmask | awk '{print $1}'
|
||||
}
|
||||
|
||||
china_routes_merged()
|
||||
{
|
||||
[ -x ./ipv4-merger ] || gcc ipv4_merger.c -o ipv4-merger >&2
|
||||
|
||||
china_routes_apnic > china.apnic
|
||||
china_routes_ipip > china.ipip
|
||||
|
||||
# Merge them together
|
||||
cat china.apnic china.ipip | ./ipv4-merger | sed 's/\-/:/g' |
|
||||
xargs netmask | awk '{print $1}' | awk -F/ '$2<=24' > china.merged
|
||||
|
||||
cat china.merged
|
||||
}
|
||||
|
||||
# $1: ipset name
|
||||
convert_routes_to_ipset()
|
||||
{
|
||||
local ipset_name="$1"
|
||||
echo "create $ipset_name hash:net family inet hashsize 1024 maxelem 65536"
|
||||
awk -vt="$ipset_name" '{ printf("add %s %s\n", t, $0) }'
|
||||
}
|
||||
|
||||
generate_china_ipset()
|
||||
{
|
||||
china_routes_merged | convert_routes_to_ipset china
|
||||
}
|
||||
|
||||
generate_inverted_china_routes()
|
||||
{
|
||||
(
|
||||
china_routes_merged
|
||||
echo 0.0.0.0/8 10.0.0.0/8 100.64.0.0/10 127.0.0.0/8 172.16.0.0/12 192.168.0.0/16 224.0.0.0/3
|
||||
) |
|
||||
xargs netmask -r | awk '{print $1}' |
|
||||
awk -F- '
|
||||
function iptoint(ip) { split(ip,arr,"."); n=0; for(i=1;i<=4;i++) n=n*256+arr[i]; return n; }
|
||||
function inttoip(n) { a=int(n/16777216); b=int(n%16777216/65536); c=int(n%65536/256); d=n%256; return a "." b "." c "." d; }
|
||||
BEGIN { st=0 }
|
||||
{ x=st; y=iptoint($1); st=iptoint($2)+1; if(y>x) { print inttoip(x) ":" inttoip(y-1); } }' |
|
||||
xargs netmask | awk '{print $1}'
|
||||
}
|
||||
|
||||
##
|
||||
case "$1" in
|
||||
"")
|
||||
generate_china_ipset
|
||||
;;
|
||||
-c)
|
||||
china_routes_merged
|
||||
;;
|
||||
-r)
|
||||
generate_inverted_china_routes
|
||||
;;
|
||||
*)
|
||||
echo "Usage:"
|
||||
echo " $0 generate China routes in ipset format"
|
||||
echo " $0 -c generate China routes in IP/prefix format"
|
||||
echo " $0 -r generate invert China routes"
|
||||
;;
|
||||
*)
|
||||
esac
|
||||
@ -1,27 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
generate_china_banned()
|
||||
{
|
||||
if [ ! -f gfwlist.txt ]; then
|
||||
wget https://cdn.jsdelivr.net/gh/gfwlist/gfwlist/gfwlist.txt -O gfwlist.b64 >&2
|
||||
cat gfwlist.b64 | base64 -d > gfwlist.txt
|
||||
rm -f gfwlist.b64
|
||||
fi
|
||||
|
||||
cat gfwlist.txt base-gfwlist.txt | sort -u |
|
||||
sed 's#!.\+##; s#|##g; s#@##g; s#http:\/\/##; s#https:\/\/##;' |
|
||||
sed '/\*/d; /apple\.com/d; /sina\.cn/d; /sina\.com\.cn/d; /baidu\.com/d; /qq\.com/d' |
|
||||
sed '/^[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+$/d' |
|
||||
grep '^[0-9a-zA-Z\.-]\+$' | grep '\.' | sed 's#^\.\+##' | rev | sort -u |
|
||||
awk '
|
||||
BEGIN { prev = "________"; } {
|
||||
cur = $0;
|
||||
if (index(cur, prev) == 1 && substr(cur, 1 + length(prev) ,1) == ".") {
|
||||
} else {
|
||||
print cur;
|
||||
prev = cur;
|
||||
}
|
||||
}' | rev | sort -u
|
||||
}
|
||||
|
||||
generate_china_banned
|
||||
@ -1,338 +0,0 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
typedef u_int32_t u32;
|
||||
typedef int bool;
|
||||
#define true 1
|
||||
#define false 0
|
||||
typedef unsigned gfp_t;
|
||||
|
||||
static inline char *ipv4_hltos(u32 u, char *s)
|
||||
{
|
||||
static char ss[20];
|
||||
if (!s)
|
||||
s = ss;
|
||||
sprintf(s, "%d.%d.%d.%d",
|
||||
(int)(u >> 24) & 0xff, (int)(u >> 16) & 0xff,
|
||||
(int)(u >> 8) & 0xff, (int)u & 0xff );
|
||||
return s;
|
||||
}
|
||||
|
||||
static inline u32 ipv4_stohl(const char *s)
|
||||
{
|
||||
int u[4];
|
||||
if (sscanf(s, "%d.%d.%d.%d", &u[0], &u[1], &u[2], &u[3]) == 4) {
|
||||
return (((u32)u[0] & 0xff) << 24) |
|
||||
(((u32)u[1] & 0xff) << 16) |
|
||||
(((u32)u[2] & 0xff) << 8) |
|
||||
(((u32)u[3] & 0xff));
|
||||
} else
|
||||
return 0xffffffff;
|
||||
}
|
||||
|
||||
static inline bool is_ipv4_addr(const char *s)
|
||||
{
|
||||
int u[4];
|
||||
if (sscanf(s, "%d.%d.%d.%d", &u[0], &u[1], &u[2], &u[3]) == 4)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
struct ipv4_range {
|
||||
u32 start;
|
||||
u32 end;
|
||||
};
|
||||
|
||||
struct sa_open_data {
|
||||
struct ipv4_range *tmp_base;
|
||||
size_t tmp_size;
|
||||
size_t tmp_length;
|
||||
int errors;
|
||||
};
|
||||
|
||||
static int __touch_tmp_base(struct sa_open_data *od, gfp_t gfp)
|
||||
{
|
||||
if (!od->tmp_base) {
|
||||
/**
|
||||
* Allocate a temporary table with twice the size of the previous
|
||||
* table or at least 100, on which new entries can be inserted.
|
||||
*/
|
||||
if (od->tmp_size < 100)
|
||||
od->tmp_size = 100;
|
||||
od->tmp_base = (struct ipv4_range *)malloc(
|
||||
sizeof(struct ipv4_range) * od->tmp_size /*, gfp*/ );
|
||||
if (!od->tmp_base) {
|
||||
fprintf(stderr,
|
||||
"salist: cannot allocate the temporary list for enlarging it.\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
od->tmp_length = 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ipv4_list_add_range(struct sa_open_data *od, u32 start,
|
||||
u32 end, gfp_t gfp)
|
||||
{
|
||||
struct ipv4_range *cur;
|
||||
int ret;
|
||||
|
||||
/* Ignore a new range if it or a larger range already exists */
|
||||
//if (salist_check_ipv4(od->table, start, end))
|
||||
// return 0;
|
||||
|
||||
if ((ret = __touch_tmp_base(od, gfp)) < 0)
|
||||
return ret;
|
||||
|
||||
/* Check if the size is efficient. Enlarge it if needed. */
|
||||
if (od->tmp_length + 1 >= od->tmp_size) {
|
||||
size_t old_size = od->tmp_size;
|
||||
struct ipv4_range *old_base = od->tmp_base;
|
||||
|
||||
od->tmp_size *= 2;
|
||||
od->tmp_base = (struct ipv4_range *)realloc(od->tmp_base,
|
||||
sizeof(struct ipv4_range) * od->tmp_size);
|
||||
if (!od->tmp_base) {
|
||||
od->tmp_size = old_size;
|
||||
od->tmp_base = old_base;
|
||||
return -ENOMEM;
|
||||
}
|
||||
}
|
||||
|
||||
cur = &od->tmp_base[od->tmp_length++];
|
||||
cur->start = start;
|
||||
cur->end = end;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int ipv4_list_add_netmask(struct sa_open_data *od,
|
||||
u32 net, u32 net_mask, gfp_t gfp)
|
||||
{
|
||||
u32 start = net & net_mask;
|
||||
u32 end = net | ~net_mask;
|
||||
|
||||
return ipv4_list_add_range(od, start, end, gfp);
|
||||
}
|
||||
|
||||
static int ipv4_list_add_net(struct sa_open_data *od, u32 net,
|
||||
int net_bits, gfp_t gfp)
|
||||
{
|
||||
u32 net_mask;
|
||||
|
||||
if(net_bits == 0)
|
||||
net_mask = 0x00000000;
|
||||
else
|
||||
net_mask = ~(((u32)1 << (32 - net_bits)) - 1);
|
||||
//printf("%d: %08x, %08x\n", net_bits, net_mask, net_size);
|
||||
|
||||
return ipv4_list_add_netmask(od, net, net_mask, gfp);
|
||||
}
|
||||
|
||||
static int salist_cmd_parse(struct sa_open_data *od, char *cmd, gfp_t gfp)
|
||||
{
|
||||
char *a1 = NULL, *a2 = NULL;
|
||||
char *sep;
|
||||
char sc;
|
||||
int n = 32;
|
||||
|
||||
/* Case 3: Append an item */
|
||||
|
||||
/* Check IP description part: network segment or range? */
|
||||
if ((sep = strchr(cmd, '/'))) { }
|
||||
else if ((sep = strchr(cmd, '-'))) { }
|
||||
else if ((sep = strchr(cmd, ':'))) { }
|
||||
|
||||
if (sep) {
|
||||
/* Describes a subnet or range. */
|
||||
sc = *sep;
|
||||
*sep = '\0';
|
||||
|
||||
a1 = cmd;
|
||||
a2 = sep + 1;
|
||||
|
||||
if (*a2 == '\0') {
|
||||
fprintf(stderr, "Nothing after '%c'.\n", sc);
|
||||
return -EINVAL;
|
||||
}
|
||||
} else {
|
||||
/* Describes a single IP. */
|
||||
sc = '\0';
|
||||
a1 = cmd;
|
||||
}
|
||||
|
||||
switch (sc) {
|
||||
case '/':
|
||||
/* 10.10.20.0/24 */
|
||||
/* ------------------------------------ */
|
||||
if (is_ipv4_addr(a2)) {
|
||||
ipv4_list_add_netmask(od, ipv4_stohl(a1), ipv4_stohl(a2), gfp);
|
||||
} else {
|
||||
sscanf(a2, "%d", &n);
|
||||
ipv4_list_add_net(od, ipv4_stohl(a1), n, gfp);
|
||||
}
|
||||
/* ------------------------------------ */
|
||||
break;
|
||||
case ':':
|
||||
case '-':
|
||||
/* 10.10.20.0-10.20.0.255 */
|
||||
/* ------------------------------------ */
|
||||
ipv4_list_add_range(od, ipv4_stohl(a1), ipv4_stohl(a2), gfp);
|
||||
/* ------------------------------------ */
|
||||
break;
|
||||
default:
|
||||
if (is_ipv4_addr(a1)) {
|
||||
/* Single IP address. */
|
||||
u32 ip = ipv4_stohl(a1);
|
||||
/* ------------------------------------ */
|
||||
ipv4_list_add_range(od, ip, ip, gfp);
|
||||
/* ------------------------------------ */
|
||||
} else {
|
||||
fprintf(stderr, "Invalid IP address '%s'.\n", a1);
|
||||
return -EINVAL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ipv4_range_sort_cmp(const void *a, const void *b)
|
||||
{
|
||||
struct ipv4_range *ra = (struct ipv4_range *)a;
|
||||
struct ipv4_range *rb = (struct ipv4_range *)b;
|
||||
|
||||
if (ra->start > rb->start) {
|
||||
return 1;
|
||||
} else if (ra->start < rb->start) {
|
||||
return -1;
|
||||
} else if (ra->end > rb->end) {
|
||||
return 1;
|
||||
} else if (ra->end < rb->end) {
|
||||
return -1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void ipv4_range_swap(void *a, void *b, int size)
|
||||
{
|
||||
struct ipv4_range *ra = (struct ipv4_range *)a;
|
||||
struct ipv4_range *rb = (struct ipv4_range *)b;
|
||||
struct ipv4_range tmp;
|
||||
tmp = *ra;
|
||||
*ra = *rb;
|
||||
*rb = tmp;
|
||||
}
|
||||
|
||||
static struct sa_open_data *salist_open(void)
|
||||
{
|
||||
struct sa_open_data *od = NULL;
|
||||
|
||||
od = (struct sa_open_data *)malloc(sizeof(*od));
|
||||
if (!od) {
|
||||
fprintf(stderr, "salist: cannot allocate sa_open_data.\n");
|
||||
return NULL;
|
||||
}
|
||||
memset(od, 0, sizeof(*od));
|
||||
od->errors = 0;
|
||||
|
||||
return od;
|
||||
}
|
||||
|
||||
static int salist_close(struct sa_open_data *od)
|
||||
{
|
||||
size_t ri, wi;
|
||||
struct ipv4_range *old_base;
|
||||
|
||||
/* Flush the table if any modification has been done */
|
||||
if (od->tmp_base) {
|
||||
/* Sort the table and merge entries as many as possible. */
|
||||
if (od->tmp_length >= 2) {
|
||||
qsort(od->tmp_base, od->tmp_length, sizeof(struct ipv4_range),
|
||||
ipv4_range_sort_cmp);
|
||||
|
||||
for (wi = 0, ri = 1; ri < od->tmp_length; ri++) {
|
||||
/* NOTICE: 0xffffffff + 1 ? */
|
||||
if (od->tmp_base[wi].end == (u32)(-1)) {
|
||||
/* Nothing */
|
||||
} else if (od->tmp_base[ri].start <= od->tmp_base[wi].end + 1) {
|
||||
/* The two ranges overlap, so merge the 2nd to the 1st one */
|
||||
if (od->tmp_base[ri].end > od->tmp_base[wi].end)
|
||||
od->tmp_base[wi].end = od->tmp_base[ri].end;
|
||||
} else {
|
||||
wi++;
|
||||
if (wi < ri)
|
||||
od->tmp_base[wi] = od->tmp_base[ri];
|
||||
}
|
||||
}
|
||||
|
||||
od->tmp_length = wi + 1;
|
||||
}
|
||||
|
||||
/* Reduce the size */
|
||||
if (od->tmp_length < od->tmp_size) {
|
||||
struct ipv4_range *__tmp = od->tmp_base;
|
||||
od->tmp_base = (struct ipv4_range *)malloc(
|
||||
sizeof(struct ipv4_range) * (od->tmp_length ? od->tmp_length : 1));
|
||||
if (od->tmp_base) {
|
||||
memcpy(od->tmp_base, __tmp,
|
||||
sizeof(struct ipv4_range) * od->tmp_length);
|
||||
free(__tmp);
|
||||
} else {
|
||||
fprintf(stderr, "[%s:%d] Failed to allocate temporary table.\n",
|
||||
__FUNCTION__, __LINE__);
|
||||
/* If failed to allocate new memory, do not reduce it. */
|
||||
od->tmp_base = __tmp;
|
||||
}
|
||||
}
|
||||
|
||||
/* Dump the table instead */
|
||||
}
|
||||
|
||||
if (od->errors) {
|
||||
fprintf(stderr, "[%s] %d errors detected during table operation.\n",
|
||||
__FUNCTION__, od->errors);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void sa_open_data_dump(struct sa_open_data *od)
|
||||
{
|
||||
size_t i;
|
||||
char s1[20], s2[20];
|
||||
|
||||
for (i = 0; i < od->tmp_length; i++) {
|
||||
printf("%s-%s\n", ipv4_hltos(od->tmp_base[i].start, s1),
|
||||
ipv4_hltos(od->tmp_base[i].end, s2));
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
struct sa_open_data *od;
|
||||
char lbuf[128];
|
||||
|
||||
od = salist_open();
|
||||
|
||||
while (fgets(lbuf, sizeof(lbuf), stdin)) {
|
||||
size_t llen = strlen(lbuf);
|
||||
if (llen > 0 && lbuf[llen - 1] == '\n')
|
||||
lbuf[--llen] = '\0';
|
||||
if (llen > 0 && lbuf[llen - 1] == '\r')
|
||||
lbuf[--llen] = '\0';
|
||||
if (llen == 0)
|
||||
continue;
|
||||
salist_cmd_parse(od, lbuf, 0);
|
||||
}
|
||||
|
||||
salist_close(od);
|
||||
|
||||
sa_open_data_dump(od);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1,67 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2019 Xingwang Liao
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=kcptun
|
||||
PKG_VERSION:=20210103
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/xtaci/kcptun/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=0821b61b92041b764a1d621f750c1c693d913eed43051d3c109bd303d8f02472
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILES:=LICENSE.md
|
||||
PKG_MAINTAINER:=Xingwang Liao <kuoruan@gmail.com>
|
||||
|
||||
PKG_BUILD_DEPENDS:=golang/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
GO_PKG:=github.com/xtaci/kcptun
|
||||
|
||||
GO_PKG_LDFLAGS:=-s -w -X 'main.VERSION=$(PKG_VERSION)-$(PKG_RELEASE) for OpenWrt'
|
||||
|
||||
# Can't use GO_PKG_LDFLAGS_X to define X args with space
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
|
||||
|
||||
define Package/kcptun/Default
|
||||
define Package/kcptun-$(1)
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Web Servers/Proxies
|
||||
DEPENDS:=$$(GO_ARCH_DEPENDS)
|
||||
TITLE:=Simple UDP Tunnel Based On KCP ($1)
|
||||
URL:=https://github.com/xtaci/kcptun
|
||||
endef
|
||||
|
||||
define Package/kcptun-$(1)/description
|
||||
A Stable & Secure Tunnel Based On KCP with N:M Multiplexing.
|
||||
|
||||
This package contains the kcptun $(1).
|
||||
endef
|
||||
|
||||
define Package/kcptun-$(1)/install
|
||||
$$(call GoPackage/Package/Install/Bin,$$(PKG_INSTALL_DIR))
|
||||
|
||||
$(STAGING_DIR_HOST)/bin/upx --lzma --best $$(PKG_INSTALL_DIR)/usr/bin/$(1)
|
||||
|
||||
$$(INSTALL_DIR) $$(1)/usr/bin
|
||||
$$(INSTALL_BIN) $$(PKG_INSTALL_DIR)/usr/bin/$(1) $$(1)/usr/bin/kcptun-$(1)
|
||||
endef
|
||||
endef
|
||||
|
||||
KCPTUN_COMPONENTS:=client server
|
||||
|
||||
$(foreach component,$(KCPTUN_COMPONENTS), \
|
||||
$(eval $(call Package/kcptun/Default,$(component))) \
|
||||
$(eval $(call GoBinPackage,kcptun-$(component))) \
|
||||
$(eval $(call BuildPackage,kcptun-$(component))) \
|
||||
)
|
||||
@ -1,58 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt
|
||||
# <https://immortalwrt.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libcryptopp
|
||||
PKG_VERSION:=8.3.0
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE:=cryptopp$(subst .,,$(PKG_VERSION)).zip
|
||||
PKG_SOURCE_URL:=https://www.cryptopp.com/
|
||||
PKG_HASH:=db38a15a6b1c337c665e2ebeb731dd0754b05e45504897d0f2fe4ae9f5ee589a
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
UNZIP_CMD:=unzip -q -d $(PKG_BUILD_DIR) $(DL_DIR)/$(PKG_SOURCE)
|
||||
|
||||
define Package/libcryptopp
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=Crypto++ is library for creating C++ programs which use cryptographic algorithms
|
||||
URL:=https://packages.debian.org/sid/libcrypto++-dev
|
||||
DEPENDS:=+libpthread +libstdcpp
|
||||
endef
|
||||
|
||||
define Package/package/libcryptopp
|
||||
Crypto++ is library for creating C++ programs which use cryptographic algorithms.
|
||||
The library uses a Pipes & Filters architecture with heavy use of templates and
|
||||
abstract base classes.
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
$(Build/Prepare/Default)
|
||||
cd $(PKG_BUILD_DIR); rm -f GNUmakefile GNUmakefile-cross
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include/cryptopp
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/cryptopp/* $(1)/usr/include/cryptopp/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libcryptopp.{a,so*} $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libcryptopp/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libcryptopp.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libcryptopp))
|
||||
@ -1,592 +0,0 @@
|
||||
## Makefile.am - Autotools configuration file for Crypto++.
|
||||
## written and placed in public domain by Jeffrey Walton.
|
||||
## based on Debian Makefile.am by László Böszörményi.
|
||||
##
|
||||
## The GNUmakefile can generate the list of lib headers, lib sources,
|
||||
## test headers and test sources. Generate the list of files with
|
||||
## 'make sources'. Remove the SIMD files for libothers_la_SOURCES.
|
||||
## Thanks to steeldriver on U&L.SE for help with the sed.
|
||||
##
|
||||
## make sources | sed 's|cryptlib.cpp cpu.cpp integer.cpp ||g' | \
|
||||
## sed -e 's|[[:alnum:]]*_simd.cpp ||g' | \
|
||||
## sed -e 's|[[:alnum:]]*_sse.cpp ||g' | \
|
||||
## sed -e 's|[[:alnum:]]*_avx.cpp ||g' | \
|
||||
## sed -e 's|[[:alnum:]]*_armv4.cpp ||g' | \
|
||||
## sed -e 's|ppc_power[[:alnum:]]*.cpp ||g' | \
|
||||
## fold -s -w 72
|
||||
##
|
||||
## The command `make sources | sed ... | fold` will create the source file
|
||||
## list that can be used with `libothers_la_SOURCES` below.
|
||||
##
|
||||
## The list of header files can be built with 'make sources', too.
|
||||
##
|
||||
## make sources | sed -e 's|[[:alnum:]]*_armv4.h ||g' \
|
||||
## fold -s -w 72
|
||||
##
|
||||
## Note: configure.ac deletes GNUmakefile. You can get it back with:
|
||||
##
|
||||
## git checkout GNUmakefile
|
||||
##
|
||||
|
||||
## Automake does not support "specific flags for certain source files"
|
||||
## natively, so we hack it. The hack include building 20 or so
|
||||
## libraries and then combining them into an archive or shared object.
|
||||
## Also see https://lists.gnu.org/archive/html/automake/2017-11/msg00000.html
|
||||
## https://www.gnu.org/software/automake/manual/html_node/Per_002dObject-Flags.html.
|
||||
##
|
||||
## Visit the link below for the original Debian Autotools files
|
||||
## https://sources.debian.net/src/libcrypto++/5.6.4-8/debian/autotools/
|
||||
##
|
||||
|
||||
## TODO:
|
||||
##
|
||||
## - Figure out how to include TestPrograms/ in the dist tarball
|
||||
## TestPrograms/ is unique because it is included in dist tarball but not installed
|
||||
##
|
||||
## - Figure out what's going on with DragonFly and dependencies
|
||||
##
|
||||
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
AM_DEFAULT_SOURCE_EXT = .cpp
|
||||
|
||||
## libcryptopp.la is created from disjoint libraries due to object file
|
||||
## ordering and per-object file flags requirements. libcryptopp.la is
|
||||
## named as the primary library, and the object files with special needs
|
||||
## are listed as EXTRA_LTLIBRARIES. Also see
|
||||
## https://lists.gnu.org/archive/html/automake/2017-11/msg00000.html.
|
||||
|
||||
lib_LTLIBRARIES = \
|
||||
libcryptopp.la
|
||||
|
||||
EXTRA_LTLIBRARIES = \
|
||||
libcryptlib.la \
|
||||
libcpu.la \
|
||||
libinteger.la \
|
||||
libaria_simd.la \
|
||||
libblake2s_simd.la \
|
||||
libblake2b_simd.la \
|
||||
libchacha_simd.la \
|
||||
libchacha_avx.la \
|
||||
libcham_simd.la \
|
||||
libcrc_simd.la \
|
||||
libdonna_sse.la \
|
||||
libgcm_simd.la \
|
||||
libgf2n_simd.la \
|
||||
libkeccak_simd.la \
|
||||
liblea_simd.la \
|
||||
libneon_simd.la \
|
||||
libppc_simd.la \
|
||||
libppc_power7.la \
|
||||
libppc_power8.la \
|
||||
libppc_power9.la \
|
||||
librijndael_simd.la \
|
||||
libsha_simd.la \
|
||||
libshacal2_simd.la \
|
||||
libsimon128_simd.la \
|
||||
libspeck128_simd.la \
|
||||
libsm4_simd.la \
|
||||
libsse_simd.la
|
||||
|
||||
## ARMv7-a AES and SHA by Andy Polyakov
|
||||
if CRYPTOGAMS_ARM_SOURCES
|
||||
EXTRA_LTLIBRARIES += libaes_armv4.la
|
||||
EXTRA_LTLIBRARIES += libsha1_armv4.la
|
||||
EXTRA_LTLIBRARIES += libsha256_armv4.la
|
||||
EXTRA_LTLIBRARIES += libsha512_armv4.la
|
||||
endif
|
||||
|
||||
## The remainder of the source files
|
||||
EXTRA_LTLIBRARIES += libothers.la
|
||||
|
||||
## libcryptopp_la_SOURCES is empty because we need to create the library
|
||||
## artifact from disjoint libraries due to object file ordering and
|
||||
## per-object file flags requriements. Actually, the adhoc.cpp file is
|
||||
## due to an automake issue of assuming C sources when the list is empty.
|
||||
## https://lists.gnu.org/archive/html/automake/2017-11/msg00000.html.
|
||||
|
||||
libcryptopp_la_SOURCES = \
|
||||
adhoc.cpp
|
||||
|
||||
## Don't use EXTRA_ prefix for libcryptopp_la_LIBADD. It breaks Solaris.
|
||||
|
||||
libcryptopp_la_LIBADD = \
|
||||
$(libcryptlib_la_OBJECTS) \
|
||||
$(libcpu_la_OBJECTS) \
|
||||
$(libinteger_la_OBJECTS) \
|
||||
$(libaria_simd_la_OBJECTS) \
|
||||
$(libblake2s_simd_la_OBJECTS) \
|
||||
$(libblake2b_simd_la_OBJECTS) \
|
||||
$(libchacha_simd_la_OBJECTS) \
|
||||
$(libchacha_avx_la_OBJECTS) \
|
||||
$(libcham_simd_la_OBJECTS) \
|
||||
$(libcrc_simd_la_OBJECTS) \
|
||||
$(libdonna_sse_la_OBJECTS) \
|
||||
$(libgcm_simd_la_OBJECTS) \
|
||||
$(libgf2n_simd_la_OBJECTS) \
|
||||
$(libkeccak_simd_la_OBJECTS) \
|
||||
$(liblea_simd_la_OBJECTS) \
|
||||
$(libneon_simd_la_OBJECTS) \
|
||||
$(libppc_simd_la_OBJECTS) \
|
||||
$(libppc_power7_la_OBJECTS) \
|
||||
$(libppc_power8_la_OBJECTS) \
|
||||
$(libppc_power9_la_OBJECTS) \
|
||||
$(librijndael_simd_la_OBJECTS) \
|
||||
$(libsha_simd_la_OBJECTS) \
|
||||
$(libshacal2_simd_la_OBJECTS) \
|
||||
$(libsimon128_simd_la_OBJECTS) \
|
||||
$(libspeck128_simd_la_OBJECTS) \
|
||||
$(libsm4_simd_la_OBJECTS) \
|
||||
$(libsse_simd_la_OBJECTS)
|
||||
|
||||
## ARMv7-a AES and SHA by Andy Polyakov
|
||||
if CRYPTOGAMS_ARM_SOURCES
|
||||
libcryptopp_la_LIBADD += $(libaes_armv4_la_OBJECTS)
|
||||
libcryptopp_la_LIBADD += $(libsha1_armv4_la_OBJECTS)
|
||||
libcryptopp_la_LIBADD += $(libsha256_armv4_la_OBJECTS)
|
||||
libcryptopp_la_LIBADD += $(libsha512_armv4_la_OBJECTS)
|
||||
endif
|
||||
|
||||
## cpufeatures library on Android
|
||||
if ANDROID_CPU_FEATURES
|
||||
libcryptopp_la_LIBADD += $(libcpu_features_la_OBJECTS)
|
||||
endif
|
||||
|
||||
## The remainder of the object files
|
||||
libcryptopp_la_LIBADD += $(libothers_la_OBJECTS)
|
||||
|
||||
## Don't use EXTRA_ prefix for libcryptopp_la_DEPENDENCIES. It breaks Solaris.
|
||||
|
||||
libcryptopp_la_DEPENDENCIES = \
|
||||
$(libcryptlib_la_OBJECTS) \
|
||||
$(libcpu_la_OBJECTS) \
|
||||
$(libinteger_la_OBJECTS) \
|
||||
$(libaria_simd_la_OBJECTS) \
|
||||
$(libblake2s_simd_la_OBJECTS) \
|
||||
$(libblake2b_simd_la_OBJECTS) \
|
||||
$(libchacha_simd_la_OBJECTS) \
|
||||
$(libchacha_avx_la_OBJECTS) \
|
||||
$(libcham_simd_la_OBJECTS) \
|
||||
$(libcrc_simd_la_OBJECTS) \
|
||||
$(libdonna_sse_la_OBJECTS) \
|
||||
$(libkeccak_simd_la_OBJECTS) \
|
||||
$(liblea_simd_la_OBJECTS) \
|
||||
$(libgcm_simd_la_OBJECTS) \
|
||||
$(libgf2n_simd_la_OBJECTS) \
|
||||
$(libneon_simd_la_OBJECTS) \
|
||||
$(libppc_simd_la_OBJECTS) \
|
||||
$(libppc_power7_la_OBJECTS) \
|
||||
$(libppc_power8_la_OBJECTS) \
|
||||
$(libppc_power9_la_OBJECTS) \
|
||||
$(librijndael_simd_la_OBJECTS) \
|
||||
$(libsha_simd_la_OBJECTS) \
|
||||
$(libshacal2_simd_la_OBJECTS) \
|
||||
$(libsimon128_simd_la_OBJECTS) \
|
||||
$(libspeck128_simd_la_OBJECTS) \
|
||||
$(libsm4_simd_la_OBJECTS) \
|
||||
$(libsse_simd_la_OBJECTS)
|
||||
|
||||
## ARMv7-a AES and SHA by Andy Polyakov
|
||||
if CRYPTOGAMS_ARM_SOURCES
|
||||
libcryptopp_la_DEPENDENCIES += $(libaes_armv4_la_OBJECTS)
|
||||
libcryptopp_la_DEPENDENCIES += $(libsha1_armv4_la_OBJECTS)
|
||||
libcryptopp_la_DEPENDENCIES += $(libsha256_armv4_la_OBJECTS)
|
||||
libcryptopp_la_DEPENDENCIES += $(libsha512_armv4_la_OBJECTS)
|
||||
endif
|
||||
|
||||
## cpufeatures library on Android
|
||||
if ANDROID_CPU_FEATURES
|
||||
libcryptopp_la_DEPENDENCIES += $(libcpu_features_la_OBJECTS)
|
||||
endif
|
||||
|
||||
## The remainder of the object files
|
||||
libcryptopp_la_DEPENDENCIES += $(libothers_la_OBJECTS)
|
||||
|
||||
## Man, did Autotools fuck this up royally...
|
||||
## https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
|
||||
libcryptopp_la_LDFLAGS = $(AM_LDFLAGS) -release 8.3.0 -version-info 8:3
|
||||
|
||||
## Source files with special needs
|
||||
libcryptlib_la_SOURCES = cryptlib.cpp
|
||||
libcryptlib_la_CXXFLAGS = $(AM_CXXFLAGS)
|
||||
|
||||
libcpu_la_SOURCES = cpu.cpp
|
||||
libcpu_la_CXXFLAGS = $(AM_CXXFLAGS)
|
||||
|
||||
libinteger_la_SOURCES = integer.cpp
|
||||
libinteger_la_CXXFLAGS = $(AM_CXXFLAGS)
|
||||
|
||||
libaria_simd_la_SOURCES = aria_simd.cpp
|
||||
libaria_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_ARIA_FLAG)
|
||||
|
||||
libblake2s_simd_la_SOURCES = blake2s_simd.cpp
|
||||
libblake2s_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_BLAKE2S_FLAG)
|
||||
|
||||
libblake2b_simd_la_SOURCES = blake2b_simd.cpp
|
||||
libblake2b_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_BLAKE2B_FLAG)
|
||||
|
||||
libchacha_simd_la_SOURCES = chacha_simd.cpp
|
||||
libchacha_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_CHACHA_FLAG)
|
||||
|
||||
libchacha_avx_la_SOURCES = chacha_avx.cpp
|
||||
libchacha_avx_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_CHACHA_AVX2_FLAG)
|
||||
|
||||
libcham_simd_la_SOURCES = cham_simd.cpp
|
||||
libcham_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_CHAM_FLAG)
|
||||
|
||||
libcrc_simd_la_SOURCES = crc_simd.cpp
|
||||
libcrc_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_CRC_FLAG)
|
||||
|
||||
libdonna_sse_la_SOURCES = donna_sse.cpp
|
||||
libdonna_sse_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_DONNA_FLAG)
|
||||
|
||||
libgcm_simd_la_SOURCES = gcm_simd.cpp
|
||||
libgcm_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_GCM_FLAG)
|
||||
|
||||
libgf2n_simd_la_SOURCES = gf2n_simd.cpp
|
||||
libgf2n_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_GF2N_FLAG)
|
||||
|
||||
libkeccak_simd_la_SOURCES = keccak_simd.cpp
|
||||
libkeccak_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_KECCAK_FLAG)
|
||||
|
||||
liblea_simd_la_SOURCES = lea_simd.cpp
|
||||
liblea_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_LEA_FLAG)
|
||||
|
||||
libneon_simd_la_SOURCES = neon_simd.cpp
|
||||
libneon_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_NEON_FLAG)
|
||||
|
||||
libppc_simd_la_SOURCES = ppc_simd.cpp
|
||||
libppc_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_ALTIVEC_FLAG)
|
||||
|
||||
libppc_power7_la_SOURCES = ppc_power7.cpp
|
||||
libppc_power7_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_POWER7_FLAG)
|
||||
|
||||
libppc_power8_la_SOURCES = ppc_power8.cpp
|
||||
libppc_power8_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_POWER8_FLAG)
|
||||
|
||||
# Do not use CRYPTOPP_POWER9_FLAG. See https://github.com/weidai11/cryptopp/issues/986
|
||||
libppc_power9_la_SOURCES = ppc_power9.cpp
|
||||
# libppc_power9_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_POWER9_FLAG)
|
||||
libppc_power9_la_CXXFLAGS = $(AM_CXXFLAGS)
|
||||
|
||||
librijndael_simd_la_SOURCES = rijndael_simd.cpp
|
||||
librijndael_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_AES_FLAG)
|
||||
|
||||
libsha_simd_la_SOURCES = sha_simd.cpp
|
||||
libsha_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_SHA_FLAG)
|
||||
|
||||
libshacal2_simd_la_SOURCES = shacal2_simd.cpp
|
||||
libshacal2_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_SHA_FLAG)
|
||||
|
||||
libsimon128_simd_la_SOURCES = simon128_simd.cpp
|
||||
libsimon128_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_SIMON128_FLAG)
|
||||
|
||||
libspeck128_simd_la_SOURCES = speck128_simd.cpp
|
||||
libspeck128_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_SPECK128_FLAG)
|
||||
|
||||
libsm4_simd_la_SOURCES = sm4_simd.cpp
|
||||
libsm4_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_SM4_FLAG)
|
||||
|
||||
libsse_simd_la_SOURCES = sse_simd.cpp
|
||||
libsse_simd_la_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTOPP_SSE2_FLAG)
|
||||
|
||||
## ARMv7-a AES and SHA by Andy Polyakov
|
||||
## Also see https://stackoverflow.com/q/51575580/608639
|
||||
if CRYPTOGAMS_ARM_SOURCES
|
||||
libaes_armv4_la_SOURCES = aes_armv4.S
|
||||
libsha1_armv4_la_SOURCES = sha1_armv4.S
|
||||
libsha256_armv4_la_SOURCES = sha256_armv4.S
|
||||
libsha512_armv4_la_SOURCES = sha512_armv4.S
|
||||
libaes_armv4_la_CCASFLAGS = $(AM_CXXFLAGS) $(CRYPTOPGAMS_ARMV4_THUMB_FLAG)
|
||||
libsha1_armv4_la_CCASFLAGS = $(AM_CXXFLAGS) $(CRYPTOPGAMS_ARMV4_FLAG)
|
||||
libsha256_armv4_la_CCASFLAGS = $(AM_CXXFLAGS) $(CRYPTOPGAMS_ARMV4_FLAG)
|
||||
libsha512_armv4_la_CCASFLAGS = $(AM_CXXFLAGS) $(CRYPTOPGAMS_ARMV4_FLAG)
|
||||
endif
|
||||
|
||||
## cpufeatures library on Android
|
||||
if ANDROID_CPU_FEATURES
|
||||
libcpu_features_la_SOURCES = cpu-features.c
|
||||
endif
|
||||
|
||||
# This is the list of remaining sources files that don't need special order
|
||||
# and don't need special flags. It is formed by removing cryptlib.cpp,
|
||||
# cpu.cpp, integer.cpp, *_avx.cpp and *_simd.cpp files. It is sorted in
|
||||
# alphabetical order for deterministic builds.
|
||||
|
||||
# To build this list, see the head notes.
|
||||
libothers_la_SOURCES = \
|
||||
3way.cpp adler32.cpp algebra.cpp algparam.cpp allocate.cpp arc4.cpp \
|
||||
aria.cpp ariatab.cpp asn.cpp authenc.cpp base32.cpp base64.cpp \
|
||||
basecode.cpp bfinit.cpp blake2.cpp blowfish.cpp blumshub.cpp \
|
||||
camellia.cpp cast.cpp casts.cpp cbcmac.cpp ccm.cpp chacha.cpp \
|
||||
chachapoly.cpp cham.cpp channels.cpp cmac.cpp crc.cpp darn.cpp \
|
||||
default.cpp des.cpp dessp.cpp dh.cpp dh2.cpp dll.cpp donna_32.cpp \
|
||||
donna_64.cpp dsa.cpp eax.cpp ec2n.cpp eccrypto.cpp ecp.cpp elgamal.cpp \
|
||||
emsa2.cpp eprecomp.cpp esign.cpp files.cpp filters.cpp fips140.cpp \
|
||||
fipstest.cpp gcm.cpp gf256.cpp gf2_32.cpp gf2n.cpp gfpcrypt.cpp \
|
||||
gost.cpp gzip.cpp hc128.cpp hc256.cpp hex.cpp hight.cpp hmac.cpp \
|
||||
hrtimer.cpp ida.cpp idea.cpp iterhash.cpp kalyna.cpp kalynatab.cpp \
|
||||
keccak.cpp keccak_core.cpp lea.cpp luc.cpp mars.cpp marss.cpp md2.cpp \
|
||||
md4.cpp md5.cpp misc.cpp modes.cpp mqueue.cpp mqv.cpp nbtheory.cpp \
|
||||
oaep.cpp osrng.cpp padlkrng.cpp panama.cpp pkcspad.cpp poly1305.cpp \
|
||||
polynomi.cpp pssr.cpp pubkey.cpp queue.cpp rabbit.cpp rabin.cpp \
|
||||
randpool.cpp rc2.cpp rc5.cpp rc6.cpp rdrand.cpp rdtables.cpp \
|
||||
rijndael.cpp ripemd.cpp rng.cpp rsa.cpp rw.cpp safer.cpp salsa.cpp \
|
||||
scrypt.cpp seal.cpp seed.cpp serpent.cpp sha.cpp sha3.cpp shacal2.cpp \
|
||||
shake.cpp shark.cpp sharkbox.cpp simeck.cpp simon.cpp skipjack.cpp \
|
||||
sm3.cpp sm4.cpp sosemanuk.cpp speck.cpp square.cpp squaretb.cpp \
|
||||
strciphr.cpp tea.cpp tftables.cpp threefish.cpp tiger.cpp tigertab.cpp \
|
||||
ttmac.cpp tweetnacl.cpp twofish.cpp vmac.cpp wake.cpp whrlpool.cpp \
|
||||
xed25519.cpp xtr.cpp xtrcrypt.cpp xts.cpp zdeflate.cpp zinflate.cpp \
|
||||
zlib.cpp
|
||||
|
||||
# To build this list, see the head notes.
|
||||
pkginclude_HEADERS = \
|
||||
3way.h adler32.h adv_simd.h aes.h algebra.h algparam.h allocate.h \
|
||||
arc4.h argnames.h aria.h arm_simd.h asn.h authenc.h base32.h base64.h \
|
||||
basecode.h blake2.h blowfish.h blumshub.h camellia.h cast.h cbcmac.h \
|
||||
ccm.h chacha.h chachapoly.h cham.h channels.h cmac.h config.h \
|
||||
config_align.h config_asm.h config_cpu.h config_cxx.h config_dll.h \
|
||||
config_int.h config_misc.h config_ns.h config_os.h config_ver.h cpu.h \
|
||||
crc.h cryptlib.h darn.h default.h des.h dh.h dh2.h dll.h dmac.h donna.h \
|
||||
donna_32.h donna_64.h donna_sse.h drbg.h dsa.h eax.h ec2n.h eccrypto.h \
|
||||
ecp.h ecpoint.h elgamal.h emsa2.h eprecomp.h esign.h fhmqv.h files.h \
|
||||
filters.h fips140.h fltrimpl.h gcm.h gf256.h gf2_32.h gf2n.h gfpcrypt.h \
|
||||
gost.h gzip.h hashfwd.h hc128.h hc256.h hex.h hight.h hkdf.h hmac.h \
|
||||
hmqv.h hrtimer.h ida.h idea.h integer.h iterhash.h kalyna.h keccak.h \
|
||||
lea.h local.h lubyrack.h luc.h mars.h md2.h md4.h md5.h mdc.h \
|
||||
mersenne.h misc.h modarith.h modes.h modexppc.h mqueue.h mqv.h \
|
||||
naclite.h nbtheory.h nr.h oaep.h oids.h osrng.h ossig.h padlkrng.h \
|
||||
panama.h pch.h pkcspad.h poly1305.h polynomi.h ppc_simd.h pssr.h \
|
||||
pubkey.h pwdbased.h queue.h rabbit.h rabin.h randpool.h rc2.h rc5.h \
|
||||
rc6.h rdrand.h rijndael.h ripemd.h rng.h rsa.h rw.h safer.h salsa.h \
|
||||
scrypt.h seal.h secblock.h secblockfwd.h seckey.h seed.h serpent.h \
|
||||
serpentp.h sha.h sha3.h shacal2.h shake.h shark.h simeck.h simon.h \
|
||||
simple.h siphash.h skipjack.h sm3.h sm4.h smartptr.h sosemanuk.h \
|
||||
speck.h square.h stdcpp.h strciphr.h tea.h threefish.h tiger.h trap.h \
|
||||
trunhash.h ttmac.h tweetnacl.h twofish.h vmac.h wake.h whrlpool.h \
|
||||
words.h xed25519.h xtr.h xtrcrypt.h xts.h zdeflate.h zinflate.h zlib.h
|
||||
|
||||
noinst_HEADERS = \
|
||||
local.h \
|
||||
bench.h \
|
||||
factory.h \
|
||||
resource.h \
|
||||
validate.h \
|
||||
aes_armv4.h \
|
||||
sha1_armv4.h \
|
||||
sha256_armv4.h \
|
||||
sha512_armv4.h
|
||||
|
||||
bin_PROGRAMS = cryptest$(EXEEXT)
|
||||
|
||||
cryptest_CXXFLAGS = $(AM_CXXFLAGS) $(CRYPTEST_CXXFLAGS) -DCRYPTOPP_DATA_DIR='"${pkgdatadir}/"'
|
||||
cryptest_SOURCES = \
|
||||
test.cpp bench1.cpp bench2.cpp bench3.cpp datatest.cpp \
|
||||
dlltest.cpp fipsalgt.cpp validat0.cpp validat1.cpp validat2.cpp \
|
||||
validat3.cpp validat4.cpp validat5.cpp validat6.cpp validat7.cpp \
|
||||
validat8.cpp validat9.cpp validat10.cpp regtest1.cpp regtest2.cpp \
|
||||
regtest3.cpp regtest4.cpp
|
||||
|
||||
nodist_cryptest_SOURCES = adhoc.cpp
|
||||
cryptest_LDADD = $(lib_LTLIBRARIES)
|
||||
|
||||
CLEANFILES = adhoc.cpp
|
||||
|
||||
## Copy the TestVectors/ and TestData/ to ${pkgdatadir}.
|
||||
## TestPrograms/ is included in the tarball but not installed.
|
||||
## https://www.gnu.org/software/automake/manual/html_node/Data.html
|
||||
|
||||
# Create with 'ls TestVectors/*.dat'. These files get installed.
|
||||
testdata_FILES = \
|
||||
TestData/3desval.dat TestData/fhmqv160.dat TestData/rc2val.dat \
|
||||
TestData/3wayval.dat TestData/fhmqv256.dat TestData/rc5val.dat \
|
||||
TestData/aria.dat TestData/fhmqv384.dat TestData/rc6val.dat \
|
||||
TestData/camellia.dat TestData/fhmqv512.dat TestData/rijndael.dat \
|
||||
TestData/cast128v.dat TestData/gostval.dat TestData/rsa1024.dat \
|
||||
TestData/cast256v.dat TestData/hmqv160.dat TestData/rsa2048a.dat \
|
||||
TestData/defdmac1.bin TestData/hmqv256.dat TestData/rsa2048.dat \
|
||||
TestData/defdmac2.bin TestData/hmqv384.dat TestData/rsa400pb.dat \
|
||||
TestData/descert.dat TestData/hmqv512.dat TestData/rsa400pv.dat \
|
||||
TestData/dh1024.dat TestData/ideaval.dat TestData/rsa512a.dat \
|
||||
TestData/dh2048.dat TestData/luc1024.dat TestData/rw1024.dat \
|
||||
TestData/dlie1024.dat TestData/luc2048.dat TestData/rw2048.dat \
|
||||
TestData/dlie2048.dat TestData/lucc1024.dat TestData/saferval.dat \
|
||||
TestData/dsa1024b.dat TestData/lucc512.dat TestData/serpentv.dat \
|
||||
TestData/dsa1024.dat TestData/lucd1024.dat TestData/shacal2v.dat \
|
||||
TestData/dsa512.dat TestData/lucd512.dat TestData/sharkval.dat \
|
||||
TestData/ecies_p160.dat TestData/lucs1024.dat TestData/skipjack.dat \
|
||||
TestData/ecies_t163.dat TestData/lucs512.dat TestData/squareva.dat \
|
||||
TestData/ed25519.dat TestData/marsval.dat TestData/twofishv.dat \
|
||||
TestData/ed25519v0.dat TestData/mqv1024.dat TestData/usage.dat \
|
||||
TestData/ed25519v1.dat TestData/mqv2048.dat TestData/x25519.dat \
|
||||
TestData/elgc1024.dat TestData/nr1024.dat TestData/x25519v0.dat \
|
||||
TestData/esig1023.dat TestData/nr2048.dat TestData/x25519v1.dat \
|
||||
TestData/esig1536.dat TestData/rabi1024.dat TestData/xtrdh171.dat \
|
||||
TestData/esig2046.dat TestData/rabi2048.dat TestData/xtrdh342.dat
|
||||
|
||||
# Create with 'ls TestVectors/*.txt'. These files get installed.
|
||||
testvector_FILES = \
|
||||
TestVectors/aead.txt TestVectors/rsa_pss.txt \
|
||||
TestVectors/aes.txt TestVectors/rw.txt \
|
||||
TestVectors/all.txt TestVectors/salsa.txt \
|
||||
TestVectors/aria.txt TestVectors/seal.txt \
|
||||
TestVectors/blake2b.txt TestVectors/seed.txt \
|
||||
TestVectors/blake2s.txt TestVectors/sha1_160_fips_180.txt \
|
||||
TestVectors/blake2.txt TestVectors/sha1_fips_180.txt \
|
||||
TestVectors/camellia.txt TestVectors/sha2_224_fips_180.txt \
|
||||
TestVectors/ccm.txt TestVectors/sha2_256_fips_180.txt \
|
||||
TestVectors/chacha20poly1305.txt TestVectors/sha2_384_fips_180.txt \
|
||||
TestVectors/chacha_tls.txt TestVectors/sha2_512_fips_180.txt \
|
||||
TestVectors/chacha.txt TestVectors/sha2_fips_180.txt \
|
||||
TestVectors/cham.txt TestVectors/sha2.txt \
|
||||
TestVectors/cmac.txt TestVectors/sha3_224_fips_202.txt \
|
||||
TestVectors/dlies.txt TestVectors/sha3_256_fips_202.txt \
|
||||
TestVectors/dsa_1363.txt TestVectors/sha3_384_fips_202.txt \
|
||||
TestVectors/dsa_rfc6979.txt TestVectors/sha3_512_fips_202.txt \
|
||||
TestVectors/dsa.txt TestVectors/sha3_fips_202.txt \
|
||||
TestVectors/eax.txt TestVectors/sha3.txt \
|
||||
TestVectors/esign.txt TestVectors/shacal2.txt \
|
||||
TestVectors/gcm.txt TestVectors/shake.txt \
|
||||
TestVectors/hc128.txt TestVectors/sha.txt \
|
||||
TestVectors/hc256.txt TestVectors/simeck.txt \
|
||||
TestVectors/hight.txt TestVectors/simon.txt \
|
||||
TestVectors/hkdf.txt TestVectors/siphash.txt \
|
||||
TestVectors/hmac.txt TestVectors/skipjack.txt \
|
||||
TestVectors/kalyna.txt TestVectors/sm3.txt \
|
||||
TestVectors/keccak.txt TestVectors/sm4.txt \
|
||||
TestVectors/lea.txt TestVectors/sosemanuk.txt \
|
||||
TestVectors/mars.txt TestVectors/speck.txt \
|
||||
TestVectors/nr.txt TestVectors/tea.txt \
|
||||
TestVectors/panama.txt TestVectors/threefish.txt \
|
||||
TestVectors/poly1305aes.txt TestVectors/ttmac.txt \
|
||||
TestVectors/poly1305_tls.txt TestVectors/vmac.txt \
|
||||
TestVectors/rabbit.txt TestVectors/wake.txt \
|
||||
TestVectors/Readme.txt TestVectors/whrlpool.txt \
|
||||
TestVectors/rsa_oaep.txt TestVectors/xchacha.txt \
|
||||
TestVectors/rsa_pkcs1_1_5.txt TestVectors/xts.txt
|
||||
|
||||
# Create with 'ls TestPrograms/test_*.cxx'. These files do not get installed.
|
||||
# They exist so the feature tests can be run from the configure directory.
|
||||
testprogs_FILES= \
|
||||
TestPrograms/test_32bit.cxx
|
||||
TestPrograms/test_64bit.cxx
|
||||
TestPrograms/test_arm_acle_header.cxx
|
||||
TestPrograms/test_arm_aes.cxx
|
||||
TestPrograms/test_arm_asimd.cxx
|
||||
TestPrograms/test_arm_crc.cxx
|
||||
TestPrograms/test_arm_neon.cxx
|
||||
TestPrograms/test_arm_neon_header.cxx
|
||||
TestPrograms/test_arm_pmull.cxx
|
||||
TestPrograms/test_arm_sha1.cxx
|
||||
TestPrograms/test_arm_sha256.cxx
|
||||
TestPrograms/test_arm_sha3.cxx
|
||||
TestPrograms/test_arm_sha512.cxx
|
||||
TestPrograms/test_arm_sm3.cxx
|
||||
TestPrograms/test_arm_sm4.cxx
|
||||
TestPrograms/test_asm_mixed.cxx
|
||||
TestPrograms/test_cxx11_alignas.cxx
|
||||
TestPrograms/test_cxx11_alignof.cxx
|
||||
TestPrograms/test_cxx11_assert.cxx
|
||||
TestPrograms/test_cxx11_atomic.cxx
|
||||
TestPrograms/test_cxx11_auto.cxx
|
||||
TestPrograms/test_cxx11_constexpr.cxx
|
||||
TestPrograms/test_cxx11.cxx
|
||||
TestPrograms/test_cxx11_deletefn.cxx
|
||||
TestPrograms/test_cxx11_enumtype.cxx
|
||||
TestPrograms/test_cxx11_initializer.cxx
|
||||
TestPrograms/test_cxx11_lambda.cxx
|
||||
TestPrograms/test_cxx11_noexcept.cxx
|
||||
TestPrograms/test_cxx11_nullptr.cxx
|
||||
TestPrograms/test_cxx11_staticinit.cxx
|
||||
TestPrograms/test_cxx11_sync.cxx
|
||||
TestPrograms/test_cxx11_vartemplates.cxx
|
||||
TestPrograms/test_cxx14.cxx
|
||||
TestPrograms/test_cxx17_assert.cxx
|
||||
TestPrograms/test_cxx17.cxx
|
||||
TestPrograms/test_cxx17_exceptions.cxx
|
||||
TestPrograms/test_cxx98_exception.cxx
|
||||
TestPrograms/test_cxx.cxx
|
||||
TestPrograms/test_glibc.cxx
|
||||
TestPrograms/test_newlib.cxx
|
||||
TestPrograms/test_ppc_aes.cxx
|
||||
TestPrograms/test_ppc_altivec.cxx
|
||||
TestPrograms/test_ppc_power7.cxx
|
||||
TestPrograms/test_ppc_power8.cxx
|
||||
TestPrograms/test_ppc_power9.cxx
|
||||
TestPrograms/test_ppc_sha.cxx
|
||||
TestPrograms/test_ppc_vmull.cxx
|
||||
TestPrograms/test_pthreads.cxx
|
||||
TestPrograms/test_x86_aes.cxx
|
||||
TestPrograms/test_x86_avx2.cxx
|
||||
TestPrograms/test_x86_avx512.cxx
|
||||
TestPrograms/test_x86_avx.cxx
|
||||
TestPrograms/test_x86_clmul.cxx
|
||||
TestPrograms/test_x86_cpuid.cxx
|
||||
TestPrograms/test_x86_rdrand.cxx
|
||||
TestPrograms/test_x86_rdseed.cxx
|
||||
TestPrograms/test_x86_sha.cxx
|
||||
TestPrograms/test_x86_sse2.cxx
|
||||
TestPrograms/test_x86_sse3.cxx
|
||||
TestPrograms/test_x86_sse41.cxx
|
||||
TestPrograms/test_x86_sse42.cxx
|
||||
TestPrograms/test_x86_ssse3.cxx
|
||||
TestPrograms/test_x86_via_aes.cxx
|
||||
TestPrograms/test_x86_via_rng.cxx
|
||||
TestPrograms/test_x86_via_sha.cxx
|
||||
|
||||
nobase_dist_pkgdata_DATA = \
|
||||
$(testdata_FILES) \
|
||||
$(testvector_FILES)
|
||||
|
||||
# Can't seem to get this to work, despite the fiddling attempts.
|
||||
# https://www.gnu.org/software/automake/manual/html_node/Uniform.html and
|
||||
# https://www.gnu.org/software/automake/manual/html_node/Program-and-Library-Variables.html
|
||||
#nobase_noinst_data_DATA = \
|
||||
# $(testprogs_FILES)
|
||||
|
||||
# Workaround Automake bug. We can't seem to include the TestProgram/ data
|
||||
# in the tarball without installation using their Uniform Naming Scheme
|
||||
# https://www.gnu.org/software/automake/manual/html_node/Uniform.html and
|
||||
# https://www.gnu.org/software/automake/manual/html_node/Program-and-Library-Variables.html
|
||||
dist-hook:
|
||||
chmod -R u+w $(distdir)
|
||||
cp -r TestPrograms/ $(distdir)
|
||||
rm -f $(distdir)/TestPrograms/dump2def.cxx
|
||||
|
||||
## Automake bug workaround. If libcryptopp_la_SOURCES is an empty list, Automake assumes
|
||||
## C source files and drives link through the C compiler. We provide the empty adhoc.cpp
|
||||
## to get things back on course, so adhoc.cpp must always be copied.
|
||||
|
||||
adhoc.cpp:
|
||||
cp adhoc.cpp.proto adhoc.cpp
|
||||
touch adhoc.cpp
|
||||
|
||||
## Remove doc directory if present
|
||||
distclean-local:
|
||||
-rm -rf html-docs doxyfile.stamp
|
||||
|
||||
## Automake does not properly uninstall the library test data and vectors
|
||||
uninstall-hook:
|
||||
-rm -rf ${pkgdatadir}
|
||||
-rm -rf ${pkghtmldir}
|
||||
|
||||
## Doxygen is available but not built by default
|
||||
## TODO: copy docs to ${pkghtmldir} if built
|
||||
if CRYPTOPP_DOXYGEN_AVAILABLE
|
||||
|
||||
## PHONY targets. Automake can only handle one of them...
|
||||
.PHONY: doc docs html htmldoc checkout reset
|
||||
|
||||
doc docs html htmldoc:
|
||||
$(DOXYGEN) Doxyfile -d CRYPTOPP_DOXYGEN_PROCESSING
|
||||
|
||||
endif
|
||||
|
||||
# Restore GNUmakefile
|
||||
checkout:
|
||||
git checkout master -f
|
||||
|
||||
# Restore GNUmakefile
|
||||
reset:
|
||||
git reset --hard HEAD
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,31 +0,0 @@
|
||||
## libcryptopp.pc.in - Autotools package configuration file for Crypto++.
|
||||
## written and placed in public domain by Jeffrey Walton.
|
||||
## based on Debian package configuration by László Böszörményi.
|
||||
##
|
||||
|
||||
## libdir=@libdir@ is not working as expected for Fedora, Solaris,
|
||||
## and other 64-bit OSes that use library directories like /lib64,
|
||||
## /usr/lib64, /lib/amd64 and friends. Also see:
|
||||
## * https://stackoverflow.com/q/47124066/608639
|
||||
## * https://stackoverflow.com/q/46847939/608639 and
|
||||
## * https://bugzilla.redhat.com/show_bug.cgi?id=1510073.
|
||||
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: @PACKAGE_NAME@
|
||||
Description: free C++ class library of cryptographic schemes
|
||||
Authors: originally written by Wei Dai
|
||||
Maintainers: the Crypto++ community
|
||||
URL: @PACKAGE_URL@
|
||||
Version: @PACKAGE_VERSION@
|
||||
Bug-Report: @PACKAGE_BUGREPORT@
|
||||
Requires:
|
||||
|
||||
## These flags are mostly broken. We cannot record user choices,
|
||||
## and then have user programs use the same flags later.
|
||||
## https://lists.freedesktop.org/archives/pkg-config/2017-November/001087.html
|
||||
Cflags: -I${includedir}
|
||||
Libs: -L${libdir} -lcryptopp
|
||||
@ -1,47 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt
|
||||
# <https://immortalwrt.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=microsocks
|
||||
PKG_VERSION=1.0.2
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/rofl0r/microsocks/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=5ece77c283e71f73b9530da46302fdb4f72a0ae139aa734c07fe532407a6211a
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
PKG_MAINTAINER:=lean
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/microsocks
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Web Servers/Proxies
|
||||
TITLE:=tiny, portable SOCKS5 server with very moderate resource usage
|
||||
URL:=https://github.com/rofl0r/microsocks
|
||||
DEPENDS:=+libpthread
|
||||
endef
|
||||
|
||||
define Package/microsocks/description
|
||||
A SOCKS5 service that you can run on your remote boxes to tunnel connections
|
||||
through them, if for some reason SSH doesn't cut it for you.
|
||||
endef
|
||||
|
||||
define Package/microsocks/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/bin/microsocks $(1)/usr/bin/microsocks
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,microsocks))
|
||||
@ -1,88 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2020 - ntop.org and contributors
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt
|
||||
# <https://immortalwrt.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=n2n
|
||||
PKG_VERSION:=2.8
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/ntop/n2n/tar.gz/$(PKG_VERSION)?
|
||||
PKG_HASH:=ad9ab95a79dcf6b412c36489f50de54bb54417b5cea854eb54722b6cb8f0fd04
|
||||
|
||||
PKG_LICENSE:=GPL-3.0
|
||||
PKG_LICENSE_FILE:=LICENSE
|
||||
PKG_MAINTAINER:=Emanuele Faranda <faranda@ntop.org>
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/n2n/template
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=VPN
|
||||
TITLE:=N2N Peer-to-peer VPN
|
||||
URL:=http://www.ntop.org/n2n
|
||||
endef
|
||||
|
||||
define Package/n2n-edge
|
||||
$(call Package/n2n/template)
|
||||
TITLE+= client (edge node)
|
||||
DEPENDS+=+kmod-tun +resolveip +libopenssl +libcap +libzstd
|
||||
endef
|
||||
|
||||
define Package/n2n-supernode
|
||||
$(call Package/n2n/template)
|
||||
TITLE+= server (supernode)
|
||||
DEPENDS+=+libcap
|
||||
endef
|
||||
|
||||
define Package/n2n-edge/description
|
||||
The client node for the N2N infrastructure
|
||||
endef
|
||||
|
||||
define Package/n2n-supernode/description
|
||||
The supernode for the N2N infrastructure
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
( cd $(PKG_BUILD_DIR); ./autogen.sh )
|
||||
$(call Build/Configure/Default)
|
||||
endef
|
||||
|
||||
define Package/n2n-edge/conffiles
|
||||
/etc/config/n2n-edge.conf
|
||||
endef
|
||||
|
||||
define Package/n2n-supernode/conffiles
|
||||
/etc/config/n2n-supernode.conf
|
||||
endef
|
||||
|
||||
define Package/n2n-edge/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/edge $(1)/usr/bin/
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) ./files/n2n_v2.config $(1)/etc/config/n2n_v2
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/n2n_v2.init $(1)/etc/init.d/n2n_v2
|
||||
endef
|
||||
|
||||
define Package/n2n-supernode/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/supernode $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,n2n-edge))
|
||||
$(eval $(call BuildPackage,n2n-supernode))
|
||||
@ -1,22 +0,0 @@
|
||||
config edge
|
||||
option enabled '0'
|
||||
option tunname 'n2n0'
|
||||
option mode 'static'
|
||||
option ipaddr '10.0.0.100'
|
||||
option prefix '24'
|
||||
option mtu '1290'
|
||||
option supernode '1.2.3.4'
|
||||
option port '1234'
|
||||
option community 'example'
|
||||
option key 'password'
|
||||
option route '1'
|
||||
|
||||
config supernode
|
||||
option enabled '0'
|
||||
option port '1235'
|
||||
|
||||
config route
|
||||
option enabled '0'
|
||||
option ip '192.168.2.0'
|
||||
option mask '24'
|
||||
option gw '10.0.0.200'
|
||||
@ -1,91 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2008-2020 OpenWrt.org
|
||||
|
||||
START=99
|
||||
|
||||
start_instance() {
|
||||
local cfg="$1"
|
||||
|
||||
config_get type "$cfg" TYPE
|
||||
|
||||
case "$type" in
|
||||
edge)
|
||||
config_get_bool enabled "$cfg" 'enabled' '0'
|
||||
[ "$enabled" = "0" ] && return 1
|
||||
config_get tunname "$cfg" 'tunname'
|
||||
config_get mode "$cfg" 'mode'
|
||||
config_get ipaddr "$cfg" 'ipaddr'
|
||||
config_get prefix "$cfg" 'prefix'
|
||||
config_get mtu "$cfg" 'mtu'
|
||||
config_get supernode "$cfg" 'supernode'
|
||||
config_get port "$cfg" 'port'
|
||||
config_get second_supernode "$cfg" 'second_supernode'
|
||||
config_get second_port "$cfg" 'second_port'
|
||||
config_get community "$cfg" 'community'
|
||||
config_get key "$cfg" 'key'
|
||||
config_get_bool route "$cfg" 'route' '0'
|
||||
address="$ipaddr"
|
||||
supernode_bak=""
|
||||
[ "$second_supernode" -a "$second_port" ] && supernode_bak=" -l ${second_supernode}:${second_port}"
|
||||
[ "$route" = "1" ] && args='-r'
|
||||
[ "$mode" = 'dhcp' ] && address='0.0.0.0'
|
||||
[ "-$mtu" != "-" ] && mtu="-M $mtu"
|
||||
eval "$(ipcalc.sh "$ipaddr/$prefix")"
|
||||
netmask="$NETMASK"
|
||||
/usr/bin/edge -u 0 -g 0 -d $tunname -a ${mode}:${address} -s $netmask -c $community $([ -n "$key" ] && echo -k $key) -l ${supernode}:${port}$supernode_bak $args $mtu
|
||||
iptables -I FORWARD -i "$tunname" -j ACCEPT -m comment --comment 'n2n edge eth'
|
||||
iptables -I FORWARD -o "$tunname" -j ACCEPT -m comment --comment 'n2n edge eth'
|
||||
iptables -t nat -I POSTROUTING -o "$tunname" -j MASQUERADE -m comment --comment 'n2n edge net'
|
||||
;;
|
||||
supernode)
|
||||
config_get_bool enabled "$cfg" 'enabled' '0'
|
||||
[ "$enabled" = "0" ] && return 1
|
||||
config_get port "$cfg" 'port'
|
||||
/usr/bin/supernode -l $port &
|
||||
iptables -I INPUT -p udp --dport $port -j ACCEPT -m comment --comment 'n2n supernode port'
|
||||
;;
|
||||
route)
|
||||
config_get_bool enabled "$cfg" 'enabled' '0'
|
||||
[ "$enabled" = "0" ] && return 1
|
||||
config_get ip "$cfg" 'ip'
|
||||
config_get mask "$cfg" 'mask'
|
||||
config_get gw "$cfg" 'gw'
|
||||
route add -net $ip/$mask gw $gw
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
stop_instance() {
|
||||
local cfg="$1"
|
||||
|
||||
config_get type "$cfg" TYPE
|
||||
|
||||
case "$type" in
|
||||
edge)
|
||||
config_get tunname "$cfg" 'tunname'
|
||||
iptables -D FORWARD -i "$tunname" -j ACCEPT -m comment --comment 'n2n edge eth' 2>/dev/null
|
||||
iptables -D FORWARD -o "$tunname" -j ACCEPT -m comment --comment 'n2n edge eth' 2>/dev/null
|
||||
iptables -t nat -D POSTROUTING -o "$tunname" -j MASQUERADE -m comment --comment 'n2n edge net' 2>/dev/null
|
||||
killall -9 edge
|
||||
;;
|
||||
supernode)
|
||||
config_get port "$cfg" 'port'
|
||||
iptables -D INPUT -p udp --dport $port -j ACCEPT -m comment --comment 'n2n supernode port' 2>/dev/null
|
||||
ps | grep supernode | grep -v grep 2>&1 >/dev/null && killall -9 supernode
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
start() {
|
||||
config_load 'n2n_v2'
|
||||
config_foreach start_instance 'edge'
|
||||
config_foreach start_instance 'supernode'
|
||||
sleep 2
|
||||
config_foreach start_instance 'route'
|
||||
}
|
||||
|
||||
stop() {
|
||||
config_load 'n2n_v2'
|
||||
config_foreach stop_instance 'edge'
|
||||
config_foreach stop_instance 'supernode'
|
||||
}
|
||||
@ -1,59 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2018 rosysong@rosinson.com
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=nft-qos
|
||||
PKG_VERSION:=1.0.6
|
||||
PKG_RELEASE:=1
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
PKG_MAINTAINER:=Rosy Song <rosysong@rosinson.com>
|
||||
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/nft-qos
|
||||
SECTION:=utils
|
||||
CATEGORY:=Base system
|
||||
DEPENDS:=+nftables-nojson +kmod-nft-netdev +kmod-nft-bridge
|
||||
TITLE:=QoS scripts over nftables
|
||||
PKGARCH:=all
|
||||
endef
|
||||
|
||||
define Package/nft-qos/description
|
||||
This package provides implementation for qos over nftables.
|
||||
Currently, static/dynamic qos and traffic shaping are supported.
|
||||
endef
|
||||
|
||||
define Package/nft-qos/conffiles
|
||||
/etc/config/nft-qos
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/nft-qos/install
|
||||
$(INSTALL_DIR) $(1)/lib/nft-qos
|
||||
$(INSTALL_DATA) ./files/lib/* $(1)/lib/nft-qos/
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) ./files/nft-qos.config $(1)/etc/config/nft-qos
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/nft-qos.init $(1)/etc/init.d/nft-qos
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/dhcp
|
||||
$(INSTALL_BIN) ./files/nft-qos-monitor.hotplug $(1)/etc/hotplug.d/dhcp/00-nft-qos-monitor
|
||||
$(INSTALL_BIN) ./files/nft-qos-dynamic.hotplug $(1)/etc/hotplug.d/dhcp/01-nft-qos-dynamic
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,nft-qos))
|
||||
@ -1,93 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2018 rosysong@rosinson.com
|
||||
#
|
||||
|
||||
# for uci_validate_section()
|
||||
. /lib/functions/procd.sh
|
||||
|
||||
NFT_QOS_HAS_BRIDGE=
|
||||
NFT_QOS_INET_FAMILY=ip
|
||||
NFT_QOS_SCRIPT_TEXT=
|
||||
NFT_QOS_SCRIPT_FILE=/tmp/qos.nft
|
||||
|
||||
qosdef_appendx() { # <string to be appended>
|
||||
NFT_QOS_SCRIPT_TEXT="$NFT_QOS_SCRIPT_TEXT""$1"
|
||||
}
|
||||
|
||||
qosdef_append_chain_def() { # <type> <hook> <priority> <policy>
|
||||
qosdef_appendx "\t\ttype $1 hook $2 priority $3; policy $4;\n"
|
||||
}
|
||||
|
||||
qosdef_append_chain_ingress() { # <type> <device> <priority> <policy>
|
||||
qosdef_appendx "\t\ttype $1 hook ingress device $2 priority $3; policy $4;\n"
|
||||
}
|
||||
|
||||
# qosdef_append_rule_{MATCH}_{STATEMENT}
|
||||
qosdef_append_rule_ip_limit() { # <ipaddr> <operator> <unit> <rate>
|
||||
local ipaddr=$1
|
||||
local operator=$2
|
||||
local unit=$3
|
||||
local rate=$4
|
||||
|
||||
qosdef_appendx \
|
||||
"\t\tip $operator $ipaddr limit rate over $rate $unit/second drop\n"
|
||||
}
|
||||
|
||||
# qosdef_append_rule_{MATCH}_{POLICY}
|
||||
qosdef_append_rule_ip_policy() { # <operator> <ipaddr> <policy>
|
||||
qosdef_appendx "\t\tip $1 $2 $3\n"
|
||||
}
|
||||
|
||||
_handle_limit_whitelist() { # <value> <chain>
|
||||
local ipaddr=$1
|
||||
local operator
|
||||
|
||||
[ -z "$ipaddr" ] && return
|
||||
|
||||
case "$2" in
|
||||
download) operator="daddr";;
|
||||
upload) operator="saddr";;
|
||||
esac
|
||||
|
||||
qosdef_append_rule_ip_policy $operator $ipaddr accept
|
||||
}
|
||||
|
||||
qosdef_append_rule_limit_whitelist() { # <chain>
|
||||
config_list_foreach default limit_whitelist _handle_limit_whitelist $1
|
||||
}
|
||||
|
||||
qosdef_flush_table() { # <family> <table>
|
||||
nft flush table $1 $2 2>/dev/null
|
||||
}
|
||||
|
||||
qosdef_remove_table() { # <family> <table>
|
||||
nft delete table $1 $2 2>/dev/null
|
||||
}
|
||||
|
||||
qosdef_init_header() { # add header for nft script
|
||||
qosdef_appendx "#!/usr/sbin/nft -f\n"
|
||||
qosdef_appendx "# Copyright (C) 2018 rosysong@rosinson.com\n"
|
||||
qosdef_appendx "#\n\n"
|
||||
}
|
||||
|
||||
qosdef_init_env() {
|
||||
# check interface type of lan
|
||||
local lt="$(uci_get "network.lan.type")"
|
||||
[ "$lt" = "bridge" ] && export NFT_QOS_HAS_BRIDGE="y"
|
||||
|
||||
# check if ipv6 support
|
||||
[ -e /proc/sys/net/ipv6 ] && export NFT_QOS_INET_FAMILY="inet"
|
||||
}
|
||||
|
||||
qosdef_clean_cache() {
|
||||
rm -f $NFT_QOS_SCRIPT_FILE
|
||||
}
|
||||
|
||||
qosdef_init_done() {
|
||||
echo -e $NFT_QOS_SCRIPT_TEXT > $NFT_QOS_SCRIPT_FILE 2>/dev/null
|
||||
}
|
||||
|
||||
qosdef_start() {
|
||||
nft -f $NFT_QOS_SCRIPT_FILE 2>/dev/null
|
||||
}
|
||||
@ -1,90 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2018 rosysong@rosinson.com
|
||||
#
|
||||
|
||||
. /lib/nft-qos/core.sh
|
||||
|
||||
qosdef_validate_dynamic() {
|
||||
uci_load_validate nft-qos default "$1" "$2" \
|
||||
'limit_enable:bool:0' \
|
||||
'limit_type:maxlength(8)' \
|
||||
'dynamic_bw_up:uinteger:100' \
|
||||
'dynamic_bw_down:uinteger:100'
|
||||
}
|
||||
|
||||
# return average rate for dhcp leases
|
||||
qosdef_dynamic_rate() { # <bandwidth>
|
||||
local c=0 c6=0
|
||||
|
||||
[ ! -e /tmp/dhcp.leases -a \
|
||||
! -e /var/dhcp6.leases ] && return
|
||||
|
||||
[ -e /tmp/dhcp.leases ] && \
|
||||
c=$(wc -l < /tmp/dhcp.leases 2>/dev/null)
|
||||
[ -e /var/dhcp6.leases ] && \
|
||||
c6=$(wc -l < /var/dhcp6.leases 2>/dev/null)
|
||||
[ $c -eq 0 -a $c6 -eq 0 ] && \
|
||||
{ echo 12500; return; }
|
||||
|
||||
echo $(($1 / ($c + $c6)))
|
||||
}
|
||||
|
||||
qosdef_append_chain_dym() { # <hook> <name> <bandwidth>
|
||||
local cidr cidr6
|
||||
local operator rate
|
||||
local hook=$1 name=$2 bandwidth=$3
|
||||
|
||||
config_get cidr default 'dynamic_cidr'
|
||||
config_get cidr6 default 'dynamic_cidr6'
|
||||
|
||||
[ -z "$cidr" -a -z "$cidr6" ] && return
|
||||
|
||||
case "$2" in
|
||||
download) operator=daddr;;
|
||||
upload) operator=saddr;;
|
||||
esac
|
||||
|
||||
rate=$(qosdef_dynamic_rate $bandwidth)
|
||||
|
||||
qosdef_appendx "\tchain $name {\n"
|
||||
qosdef_append_chain_def filter $hook 0 accept
|
||||
qosdef_append_rule_limit_whitelist $name
|
||||
[ -n "$cidr" ] && \
|
||||
qosdef_append_rule_ip_limit $cidr $operator kbytes $rate
|
||||
[ -n "$cidr6" ] && \
|
||||
qosdef_append_rule_ip_limit $cidr6 $operator kbytes $rate
|
||||
qosdef_appendx "\t}\n"
|
||||
}
|
||||
|
||||
qosdef_flush_dynamic() {
|
||||
qosdef_flush_table "$NFT_QOS_INET_FAMILY" nft-qos-dynamic
|
||||
}
|
||||
|
||||
# init dynamic qos
|
||||
qosdef_init_dynamic() {
|
||||
local hook_ul="prerouting" hook_dl="postrouting"
|
||||
|
||||
[ "$2" = 0 ] || {
|
||||
logger -t nft-qos-dynamic "validation failed"
|
||||
return 1
|
||||
}
|
||||
|
||||
[ $limit_enable -eq 0 -o \
|
||||
"$limit_type" = "static" ] && return 1
|
||||
|
||||
# Transfer mbits/s to mbytes/s
|
||||
# e.g. 100,000 kbits == 12,500 kbytes
|
||||
dynamic_bw_up=$(($dynamic_bw_up * 1000 / 8))
|
||||
dynamic_bw_down=$(($dynamic_bw_down * 1000 / 8))
|
||||
|
||||
[ -z "$NFT_QOS_HAS_BRIDGE" ] && {
|
||||
hook_ul="postrouting"
|
||||
hook_dl="prerouting"
|
||||
}
|
||||
|
||||
qosdef_appendx "table $NFT_QOS_INET_FAMILY nft-qos-dynamic {\n"
|
||||
qosdef_append_chain_dym $hook_ul upload $dynamic_bw_up
|
||||
qosdef_append_chain_dym $hook_dl download $dynamic_bw_down
|
||||
qosdef_appendx "}\n"
|
||||
}
|
||||
@ -1,39 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2018 rosysong@rosinson.com
|
||||
#
|
||||
|
||||
. /lib/nft-qos/core.sh
|
||||
|
||||
qosdef_monitor_get_ip_handle() { # <family> <chain> <ip>
|
||||
echo $(nft list chain $1 nft-qos-monitor $2 -a 2>/dev/null | grep $3 | awk '{print $11}')
|
||||
}
|
||||
|
||||
qosdef_monitor_add() { # <mac> <ip> <hostname>
|
||||
handle_dl=$(qosdef_monitor_get_ip_handle $NFT_QOS_INET_FAMILY download $2)
|
||||
[ -z "$handle_dl" ] && nft add rule $NFT_QOS_INET_FAMILY nft-qos-monitor download ip daddr $2 counter
|
||||
handle_ul=$(qosdef_monitor_get_ip_handle $NFT_QOS_INET_FAMILY upload $2)
|
||||
[ -z "$handle_ul" ] && nft add rule $NFT_QOS_INET_FAMILY nft-qos-monitor upload ip saddr $2 counter
|
||||
}
|
||||
|
||||
qosdef_monitor_del() { # <mac> <ip> <hostname>
|
||||
local handle_dl handle_ul
|
||||
handle_dl=$(qosdef_monitor_get_ip_handle $NFT_QOS_INET_FAMILY download $2)
|
||||
handle_ul=$(qosdef_monitor_get_ip_handle $NFT_QOS_INET_FAMILY upload $2)
|
||||
[ -n "$handle_dl" ] && nft delete handle $handle_dl
|
||||
[ -n "$handle_ul" ] && nft delete handle $handle_ul
|
||||
}
|
||||
|
||||
# init qos monitor
|
||||
qosdef_init_monitor() {
|
||||
local hook_ul="prerouting" hook_dl="postrouting"
|
||||
|
||||
[ -z "$NFT_QOS_HAS_BRIDGE" ] && {
|
||||
hook_ul="postrouting"
|
||||
hook_dl="prerouting"
|
||||
}
|
||||
|
||||
nft add table $NFT_QOS_INET_FAMILY nft-qos-monitor
|
||||
nft add chain $NFT_QOS_INET_FAMILY nft-qos-monitor upload { type filter hook $hook_ul priority 0\; }
|
||||
nft add chain $NFT_QOS_INET_FAMILY nft-qos-monitor download { type filter hook $hook_dl priority 0\; }
|
||||
}
|
||||
@ -1,93 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2018 rosysong@rosinson.com
|
||||
#
|
||||
|
||||
. /lib/functions/network.sh
|
||||
. /lib/nft-qos/core.sh
|
||||
|
||||
P1=""; P2=""; P3=""; P4=""; P5=""; P6="";
|
||||
P7=""; P8=""; P9=""; P10=""; P11="";
|
||||
|
||||
qosdef_validate_priority() {
|
||||
uci_load_validate nft-qos default "$1" "$2" \
|
||||
'priority_enable:bool:0' \
|
||||
'priority_netdev:maxlength(8)'
|
||||
}
|
||||
|
||||
_qosdef_handle_protox() { # <priority> <rule>
|
||||
case "$1" in
|
||||
-400) P1="$P1""$2";;
|
||||
-300) P2="$P2""$2";;
|
||||
-225) P3="$P3""$2";;
|
||||
-200) P4="$P4""$2";;
|
||||
-150) P5="$P5""$2";;
|
||||
-100) P6="$P6""$2";;
|
||||
0) P7="$P7""$2";;
|
||||
50) P8="$P8""$2";;
|
||||
100) P9="$P9""$2";;
|
||||
225) P10="$P10""$2";;
|
||||
300) P11="$P11""$2";;
|
||||
esac
|
||||
}
|
||||
|
||||
qosdef_handle_protox() { # <section>
|
||||
local proto prio srv
|
||||
|
||||
config_get proto $1 'protocol'
|
||||
config_get prio $1 'priority'
|
||||
config_get srv $1 'service'
|
||||
|
||||
[ -z "$proto" -o \
|
||||
-z "$prio" -o \
|
||||
-z "$srv" ] && return
|
||||
|
||||
_qosdef_handle_protox $prio \
|
||||
"\t\t$proto dport { $srv } accept\n"
|
||||
}
|
||||
|
||||
qosdef_append_rule_protox() { # <section>
|
||||
config_foreach qosdef_handle_protox $1
|
||||
qosdef_appendx \
|
||||
"${P1}${P2}${P3}${P4}${P5}${P6}${P7}${P8}${P9}${P10}${P11}"
|
||||
}
|
||||
|
||||
qosdef_append_chain_priority() { # <name> <section> <device>
|
||||
local name=$1 device=$3
|
||||
|
||||
qosdef_appendx "\tchain $name {\n"
|
||||
qosdef_append_chain_ingress filter $device 0 accept
|
||||
qosdef_append_rule_protox $2
|
||||
qosdef_appendx "\t}\n"
|
||||
}
|
||||
|
||||
qosdef_remove_priority() {
|
||||
qosdef_remove_table netdev nft-qos-priority
|
||||
}
|
||||
|
||||
# init traffic priority
|
||||
qosdef_init_priority() {
|
||||
local ifname="br-lan"
|
||||
|
||||
[ "$2" = 0 ] || {
|
||||
logger -t nft-qos-priority "validation failed"
|
||||
return 1
|
||||
}
|
||||
|
||||
[ $priority_enable -eq 0 ] && return 1
|
||||
|
||||
case "$priority_netdev" in
|
||||
lan) [ "$(uci_get network.lan.type)" != "bridge" ] && {
|
||||
network_get_device ifname "$priority_netdev" || \
|
||||
ifname="$(uci_get network.lan.ifname)"
|
||||
}
|
||||
;;
|
||||
wan*) network_get_device ifname "$priority_netdev" || \
|
||||
ifname="$(uci_get network.$priority_netdev.ifname)"
|
||||
;;
|
||||
esac
|
||||
|
||||
qosdef_appendx "table netdev nft-qos-priority {\n"
|
||||
qosdef_append_chain_priority filter priority $ifname
|
||||
qosdef_appendx "}\n"
|
||||
}
|
||||
@ -1,74 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2018 rosysong@rosinson.com
|
||||
#
|
||||
|
||||
. /lib/nft-qos/core.sh
|
||||
|
||||
qosdef_validate_static() {
|
||||
uci_load_validate nft-qos default "$1" "$2" \
|
||||
'limit_enable:bool:0' \
|
||||
'limit_type:maxlength(8)' \
|
||||
'static_unit_dl:string:kbytes' \
|
||||
'static_unit_ul:string:kbytes' \
|
||||
'static_rate_dl:uinteger:50' \
|
||||
'static_rate_ul:uinteger:50'
|
||||
}
|
||||
|
||||
# append rule for static qos
|
||||
qosdef_append_rule_sta() { # <section> <operator> <default-unit> <default-rate>
|
||||
local ipaddr unit rate
|
||||
local operator=$2
|
||||
|
||||
config_get ipaddr $1 ipaddr
|
||||
config_get unit $1 unit $3
|
||||
config_get rate $1 rate $4
|
||||
|
||||
[ -z "$ipaddr" ] && return
|
||||
|
||||
qosdef_append_rule_ip_limit $ipaddr $operator $unit $rate
|
||||
}
|
||||
|
||||
# append chain for static qos
|
||||
qosdef_append_chain_sta() { # <hook> <name> <section> <unit> <rate>
|
||||
local hook=$1 name=$2
|
||||
local config=$3 operator
|
||||
|
||||
case "$name" in
|
||||
download) operator="daddr";;
|
||||
upload) operator="saddr";;
|
||||
esac
|
||||
|
||||
qosdef_appendx "\tchain $name {\n"
|
||||
qosdef_append_chain_def filter $hook 0 accept
|
||||
qosdef_append_rule_limit_whitelist $name
|
||||
config_foreach qosdef_append_rule_sta $config $operator $4 $5
|
||||
qosdef_appendx "\t}\n"
|
||||
}
|
||||
|
||||
qosdef_flush_static() {
|
||||
qosdef_flush_table "$NFT_QOS_INET_FAMILY" nft-qos-static
|
||||
}
|
||||
|
||||
# static limit rate init
|
||||
qosdef_init_static() {
|
||||
local hook_ul="prerouting" hook_dl="postrouting"
|
||||
|
||||
[ "$2" = 0 ] || {
|
||||
logger -t nft-qos-static "validation failed"
|
||||
return 1
|
||||
}
|
||||
|
||||
[ $limit_enable -eq 0 -o \
|
||||
$limit_type = "dynamic" ] && return 1
|
||||
|
||||
[ -z "$NFT_QOS_HAS_BRIDGE" ] && {
|
||||
hook_ul="postrouting"
|
||||
hook_dl="prerouting"
|
||||
}
|
||||
|
||||
qosdef_appendx "table $NFT_QOS_INET_FAMILY nft-qos-static {\n"
|
||||
qosdef_append_chain_sta $hook_ul upload upload $static_unit_ul $static_rate_ul
|
||||
qosdef_append_chain_sta $hook_dl download download $static_unit_dl $static_rate_dl
|
||||
qosdef_appendx "}\n"
|
||||
}
|
||||
@ -1,36 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright 2018 rosysong@rosinson.com
|
||||
#
|
||||
|
||||
export initscript="nft-qos-dynamic"
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/nft-qos/core.sh
|
||||
. /lib/nft-qos/dynamic.sh
|
||||
|
||||
NFT_QOS_DYNAMIC_ON=
|
||||
|
||||
qosdef_check_if_dynamic() {
|
||||
[ $limit_enable -eq 1 -a \
|
||||
"$limit_type" = "dynamic" ] && \
|
||||
NFT_QOS_DYNAMIC_ON="y"
|
||||
}
|
||||
|
||||
|
||||
logger -t nft-qos-dynamic "ACTION=$ACTION, MACADDR=$MACADDR, IPADDR=$IPADDR, HOSTNAME=$HOSTNAME"
|
||||
|
||||
case "$ACTION" in
|
||||
add | update | remove)
|
||||
qosdef_validate_dynamic default qosdef_check_if_dynamic
|
||||
[ -z "$NFT_QOS_DYNAMIC_ON" ] && return
|
||||
|
||||
qosdef_init_env
|
||||
qosdef_flush_dynamic
|
||||
|
||||
qosdef_init_header
|
||||
qosdef_validate_dynamic default qosdef_init_dynamic
|
||||
qosdef_init_done
|
||||
qosdef_start
|
||||
;;
|
||||
esac
|
||||
@ -1,23 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright 2018 rosysong@rosinson.com
|
||||
#
|
||||
|
||||
export initscript="nft-qos-monitor"
|
||||
|
||||
. /lib/nft-qos/monitor.sh
|
||||
|
||||
logger -t nft-qos-monitor "ACTION=$ACTION, MACADDR=$MACADDR, IPADDR=$IPADDR, HOSTNAME=$HOSTNAME"
|
||||
|
||||
case "$ACTION" in
|
||||
add | update)
|
||||
qosdef_init_env
|
||||
qosdef_init_monitor
|
||||
qosdef_monitor_add $MACADDR $IPADDR $HOSTNAME
|
||||
;;
|
||||
remove)
|
||||
qosdef_init_env
|
||||
qosdef_init_monitor
|
||||
qosdef_monitor_del $MACADDR $IPADDR $HOSTNAME
|
||||
;;
|
||||
esac
|
||||
@ -1,107 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2018 rosysong@rosinson.com
|
||||
#
|
||||
# This is the sample for nft-qos configuration file,
|
||||
# which will generate a nftables script in /tmp/qos.nft
|
||||
#
|
||||
|
||||
# Getting Started
|
||||
# Official site :
|
||||
# https://netfilter.org/projects/nftables/index.html
|
||||
# What is nftables :
|
||||
# https://wiki.nftables.org/wiki-nftables/index.php/Main_Page
|
||||
#
|
||||
|
||||
# Basic Operations
|
||||
# Configuring Tables :
|
||||
# https://wiki.nftables.org/wiki-nftables/index.php/Configuring_tables
|
||||
# Configuring Chains :
|
||||
# https://wiki.nftables.org/wiki-nftables/index.php/Configuring_chains
|
||||
# Configuring Rules :
|
||||
# https://wiki.nftables.org/wiki-nftables/index.php/Simple_rule_management
|
||||
# Quick Reference (recommended) :
|
||||
# https://wiki.nftables.org/wiki-nftables/index.php/Quick_reference-nftables_in_10_minutes
|
||||
# https://netfilter.org/projects/nftables/manpage.html
|
||||
#
|
||||
|
||||
config default default
|
||||
# Enable Flag for limit rate
|
||||
option limit_enable '1'
|
||||
|
||||
# Options for enable Static QoS (rate limit)
|
||||
option limit_type 'static'
|
||||
# Options for Static QoS (rate limit)
|
||||
option static_unit_dl 'kbytes'
|
||||
option static_unit_ul 'kbytes'
|
||||
option static_rate_dl '50'
|
||||
option static_rate_ul '50'
|
||||
|
||||
# Options for enable Dynamic QoS
|
||||
# This option can not compatible with Static QoS
|
||||
# option limit_type 'dynamic'
|
||||
|
||||
# For Dynamic QoS Samples (unit of bandwidth is Mbps):
|
||||
option dynamic_cidr '192.168.1.0/24'
|
||||
option dynamic_cidr6 'AAAA:BBBB::1/64'
|
||||
option dynamic_bw_up '100'
|
||||
option dynamic_bw_down '100'
|
||||
|
||||
# White list for static/dynamic limit
|
||||
# list limit_whitelist '192.168.1.225'
|
||||
# list limit_whitelist '192.168.1.0/24'
|
||||
# list limit_whitelist 'ABCD:CDEF::1/64'
|
||||
|
||||
# Options for Traffic Priority
|
||||
option priority_enable '0'
|
||||
option priority_netdev 'lan'
|
||||
|
||||
|
||||
#
|
||||
# For Static QoS Rate Limit Samples :
|
||||
#
|
||||
# For Download :
|
||||
#config download
|
||||
# option hostname 'My PC'
|
||||
# option unit 'kbytes'
|
||||
# option ipaddr '192.168.1.224'
|
||||
# option rate '128'
|
||||
#
|
||||
# For Upload :
|
||||
#config upload
|
||||
# option hostname 'office-pc'
|
||||
# option unit 'mbytes'
|
||||
# option ipaddr 'ABCD:FFED::1/64'
|
||||
# option rate '1024'
|
||||
#
|
||||
#
|
||||
# Traffic Priority Samples :
|
||||
#
|
||||
# protocol : tcp, udp, udplite, sctp, dccp, tcp is default
|
||||
# priority : integer between 1-11, 1 is default and the highest
|
||||
# service : you can input a integer or service name,
|
||||
# e.g. '22', '11-22', 'telnet', 'ssh, http, ftp', etc
|
||||
#
|
||||
#config priority
|
||||
# option protocol 'tcp'
|
||||
# option priority '-400'
|
||||
# option service '23'
|
||||
# option comment '?'
|
||||
#
|
||||
#config priority
|
||||
# option protocol 'udp'
|
||||
# option priority '-400'
|
||||
# option service 'https'
|
||||
# option comment '?'
|
||||
#
|
||||
#config priority
|
||||
# option protocol 'dccp'
|
||||
# option priority '0'
|
||||
# option service '22-35'
|
||||
# option comment '?'
|
||||
#
|
||||
#config priority
|
||||
# option protocol 'dccp'
|
||||
# option priority '300'
|
||||
# option service 'ftp,ssh,http'
|
||||
# option comment '?'
|
||||
#
|
||||
@ -1,47 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
#
|
||||
# Copyright (C) 2018 rosysong@rosinson.com
|
||||
#
|
||||
|
||||
. /lib/nft-qos/core.sh
|
||||
. /lib/nft-qos/monitor.sh
|
||||
. /lib/nft-qos/dynamic.sh
|
||||
. /lib/nft-qos/static.sh
|
||||
. /lib/nft-qos/priority.sh
|
||||
|
||||
START=99
|
||||
USE_PROCD=1
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger nft-qos
|
||||
|
||||
procd_open_validate
|
||||
qosdef_validate_dynamic
|
||||
qosdef_validate_static
|
||||
qosdef_validate_priority
|
||||
procd_close_validate
|
||||
}
|
||||
|
||||
start_service() {
|
||||
config_load nft-qos
|
||||
|
||||
qosdef_init_env
|
||||
qosdef_flush_static
|
||||
qosdef_flush_dynamic
|
||||
qosdef_remove_priority
|
||||
|
||||
qosdef_init_header
|
||||
qosdef_init_monitor
|
||||
qosdef_validate_dynamic default qosdef_init_dynamic
|
||||
qosdef_validate_static default qosdef_init_static
|
||||
qosdef_validate_priority default qosdef_init_priority
|
||||
qosdef_init_done
|
||||
qosdef_start
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
qosdef_flush_dynamic
|
||||
qosdef_flush_static
|
||||
qosdef_remove_priority
|
||||
qosdef_clean_cache
|
||||
}
|
||||
@ -1,38 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt
|
||||
# <https://immortalwrt.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=pandownload-fake-server
|
||||
PKG_VERSION:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/pandownload-fake-server
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Download Manager
|
||||
TITLE:=pandownload-fake-server
|
||||
PKGARCH:=all
|
||||
endef
|
||||
|
||||
define Package/pandownload-fake-server/description
|
||||
Fake server for Pandownload.
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
true
|
||||
endef
|
||||
|
||||
define Package/pandownload-fake-server/install
|
||||
$(INSTALL_DIR) $(1)/www
|
||||
$(CP) ./files/* $(1)/www/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,pandownload-fake-server))
|
||||
@ -1 +0,0 @@
|
||||
{"srecord":{"autoQuery":true},"loginurl":{"url":"http:\/\/pandownload.com\/bdlogin.html"},"wke":"http:\/\/dl.pandownload.club\/dl\/node-190312.dll","pcscfg":{"appid":250528,"ua":"","ct":0},"flag":1,"ad":{"url":"https:\/\/pandownload.com\/donate.html","image":"http:\/\/pandownload.com\/images\/donate.png","attribute":"width=\"88\" height=\"100\" padding=\"0,0,5,0\"","rand":100},"bdc":["aF5yaHQQfQt3E3lxdHdjVmF4f3hae3JsfFxIbGxbW152FHF0anpdW3R5UHR1H1hxdwdoTGRMcXR1THsRbF92XXJbdmpveF93Yl9TE3dod3tYaXYIc1oRXGZKbVR1aGkGcV57dmleen1wEAYEdnV9BXF3BQFxd3sCaGh2BHB0BgdpW3F2c3pbAXF3ewJoaAYEcHQGBHZ1fQVxdwUBcXd7AmhoBgRwdAYEdnV9BXF3BQFxd3sCaGgGBHB0BgR2dX0FcXcFAXF3ewJoaAYEcHQGBHZ1fQVxdwUBcXd7AmhoBgRwdAYEdnV9BXF3BQFxd3sCaGgGBHB0BgRpB21SYXYFFH0UDmpben5afkgCdmsFAH9ydxMIflxqEnUHWxVpdgUTcwdsTH0UcBBpdndddV1+XWh2altzWlpLaVxbWH1cXEh1XWMXfAZ5FnR0fV99aXlcagZrWHUHaRZ9EXVJcnRTXH1MYhB9BlFddVoNDw=="],"timestamp":1586998638,"code":0,"message":"success"}
|
||||
@ -1 +0,0 @@
|
||||
{"version":"2.2.2","url":"https:\/\/dl1.cnponer.com\/files\/PanDownload_v2.2.2.zip","web":"https:\/\/www.lanzous.com\/i8ua9na","detail":"\u66f4\u65b0\u65f6\u95f4: 2020-01-24\n\u66f4\u65b0\u5185\u5bb9:\n1. \u754c\u9762\u4f18\u5316\n2. bug\u4fee\u590d","md5":"13d3da755509afe3be8f7fc191a50cbd","code":0,"message":"success"}
|
||||
@ -1 +0,0 @@
|
||||
{"scripts":[{"name":"search_pandown.lua","remove":true},{"name":"search_ncckl.lua","remove":true},{"name":"search_quzhuanpan.lua","remove":true},{"name":"anime_01.lua","remove":true},{"name":"anime_02.lua","remove":true},{"name":"anime_dilidili.lua","remove":true},{"name":"anime","remove":true},{"name":"s","id":2,"url":"http:\/\/pandownload.com\/static\/scripts\/s008","md5":"8dfd9a6c08d06bec27ae358f315cca8f"},{"name":"download_pcs.lua","id":1000,"url":"http:\/\/pandownload.com\/static\/scripts\/download_pcs.lua","md5":"38770cd3e9bcd62f7212941b51ca1378"},{"name":"default","id":0,"url":"http:\/\/pandownload.com\/static\/scripts\/default_0.6.7_3fee3733","md5":"a1124f076924209d0322078000cdc882","key":"568729a30cee34aec0e6fc7a6e303272"}],"code":0,"message":"success"}
|
||||
@ -1,60 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt
|
||||
# <https://immortalwrt.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=pdnsd
|
||||
PKG_VERSION:=1.2.9b-par
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/shadowsocks/pdnsd.git
|
||||
PKG_SOURCE_DATE:=2012-04-26
|
||||
PKG_SOURCE_VERSION:=a8e46ccba7b0fa2230d6c42ab6dcd92926f6c21d
|
||||
PKG_MIRROR_HASH:=e3e9c56cf91b12d8db73def2c247be2f726a052bed012f7a1e48946375f8e478
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/pdnsd-alt
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Web Servers/Proxies
|
||||
DEPENDS:=+libpthread
|
||||
TITLE:=Proxy DNS Server
|
||||
endef
|
||||
|
||||
define Package/pdnsd-alt/description
|
||||
pdnsd, is an IPv6 capable proxy DNS server with permanent caching (the cache
|
||||
contents are written to hard disk on exit) that is designed to cope with
|
||||
unreachable or down DNS servers (for example in dial-in networking).
|
||||
|
||||
pdnsd can be used with applications that do dns lookups, eg on startup, and
|
||||
can't be configured to change that behaviour, to prevent the often
|
||||
minute-long hangs (or even crashes) that result from stalled dns queries.
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
--with-cachedir=/var/pdnsd \
|
||||
--with-target=Linux
|
||||
|
||||
define Package/pdnsd-alt/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/pdnsd $(1)/usr/sbin/pdnsd
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/pdnsd-ctl $(1)/usr/sbin/pdnsd-ctl
|
||||
|
||||
#$(INSTALL_DIR) $(1)/etc
|
||||
#$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/pdnsd.conf.sample $(1)/etc/pdnsd.conf
|
||||
#$(INSTALL_DIR) $(1)/etc/init.d
|
||||
#$(INSTALL_BIN) ./files/pdnsd.init $(1)/etc/init.d/pdnsd
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,pdnsd-alt))
|
||||
@ -1,46 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=65
|
||||
NAME=pdnsd
|
||||
DESC="proxy DNS server"
|
||||
|
||||
DAEMON=/usr/sbin/pdnsd
|
||||
PID_FILE=/var/run/$NAME.pid
|
||||
CACHEDIR=/var/pdnsd
|
||||
CACHE=$CACHEDIR/pdnsd.cache
|
||||
|
||||
USER=nobody
|
||||
GROUP=nogroup
|
||||
|
||||
start() {
|
||||
echo -n "Starting $DESC: $NAME"
|
||||
|
||||
gen_cache
|
||||
|
||||
$DAEMON --daemon -p $PID_FILE
|
||||
echo " ."
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo -n "Stopping $DESC: $NAME"
|
||||
kill `cat $PID_FILE` > /dev/null 2>&1
|
||||
rm -rf $PID_FILE
|
||||
echo " ."
|
||||
}
|
||||
|
||||
restart() {
|
||||
echo "Restarting $DESC: $NAME... "
|
||||
stop
|
||||
sleep 2
|
||||
start
|
||||
}
|
||||
|
||||
gen_cache()
|
||||
{
|
||||
if ! test -f "$CACHE"; then
|
||||
mkdir -p `dirname $CACHE`
|
||||
dd if=/dev/zero of="$CACHE" bs=1 count=4 2> /dev/null
|
||||
chown -R $USER.$GROUP $CACHEDIR
|
||||
fi
|
||||
}
|
||||
|
||||
@ -1,37 +0,0 @@
|
||||
--- a/src/main.c
|
||||
+++ b/src/main.c
|
||||
@@ -219,6 +219,16 @@ static int check_ipv6()
|
||||
*/
|
||||
int main(int argc,char *argv[])
|
||||
{
|
||||
+#if DEBUG>0
|
||||
+ {
|
||||
+ int err;
|
||||
+ /* Generate a key for storing our thread id's */
|
||||
+ if ((err=pthread_key_create(&thrid_key, NULL)) != 0) {
|
||||
+ log_error("pthread_key_create failed: %s",strerror(err));
|
||||
+ _exit(1);
|
||||
+ }
|
||||
+ }
|
||||
+#endif
|
||||
int i,sig,pfd=-1; /* Initialized to inhibit compiler warning */
|
||||
|
||||
main_thrid=pthread_self();
|
||||
@@ -626,17 +636,6 @@ int main(int argc,char *argv[])
|
||||
pthread_sigmask(SIG_BLOCK,&sigs_msk,NULL);
|
||||
#endif
|
||||
|
||||
-#if DEBUG>0
|
||||
- {
|
||||
- int err;
|
||||
- /* Generate a key for storing our thread id's */
|
||||
- if ((err=pthread_key_create(&thrid_key, NULL)) != 0) {
|
||||
- log_error("pthread_key_create failed: %s",strerror(err));
|
||||
- _exit(1);
|
||||
- }
|
||||
- }
|
||||
-#endif
|
||||
-
|
||||
{
|
||||
#if DEBUG>0
|
||||
int thrdsucc=1;
|
||||
@ -1,63 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2011-2015 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:=polarssl
|
||||
PKG_VERSION:=1.3.22
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_NAME:=mbedtls
|
||||
PKG_SOURCE:=$(PKG_SOURCE_NAME)-$(PKG_VERSION)-gpl.tgz
|
||||
PKG_SOURCE_URL:=https://tls.mbed.org/download/
|
||||
PKG_HASH:=ded041aa4acf9a3e4d0c85bf334b0860135da996e75afdcc3abf22f403d14457
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-or-later
|
||||
PKG_LICENSE_FILE:=LICENSE
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_NAME)-$(PKG_VERSION)
|
||||
PKG_USE_MIPS16:=0
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
CMAKE_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
define Package/libpolarssl
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
SUBMENU:=SSL
|
||||
TITLE:=Embedded SSL
|
||||
URL:=http://polarssl.org/
|
||||
ABI_VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
|
||||
endef
|
||||
|
||||
define Package/libpolarssl/description
|
||||
The aim of the PolarSSL project is to provide a quality, open-source
|
||||
cryptographic library written in C and targeted at embedded systems.
|
||||
|
||||
This package contains the PolarSSL library.
|
||||
endef
|
||||
|
||||
CMAKE_OPTIONS += \
|
||||
-DCMAKE_BUILD_TYPE:String="Release" \
|
||||
-DUSE_SHARED_MBEDTLS_LIBRARY:Bool=ON \
|
||||
-DENABLE_TESTING:Bool=OFF \
|
||||
-DENABLE_PROGRAMS:Bool=OFF \
|
||||
|
||||
define Build/InstallDev
|
||||
$(Build/InstallDev/cmake)
|
||||
$(LN) libmbedtls.so.$(PKG_VERSION) $(1)/usr/lib/libpolarssl.so
|
||||
endef
|
||||
|
||||
define Package/libpolarssl/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libmbedtls.so.* $(1)/usr/lib/
|
||||
$(LN) libmbedtls.so.$(PKG_VERSION) $(1)/usr/lib/libpolarssl.so
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libpolarssl))
|
||||
@ -1,252 +0,0 @@
|
||||
--- a/include/polarssl/config.h
|
||||
+++ b/include/polarssl/config.h
|
||||
@@ -441,8 +441,8 @@
|
||||
* Requires: POLARSSL_HMAC_DRBG_C
|
||||
*
|
||||
* Comment this macro to disable deterministic ECDSA.
|
||||
- */
|
||||
#define POLARSSL_ECDSA_DETERMINISTIC
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_KEY_EXCHANGE_PSK_ENABLED
|
||||
@@ -463,8 +463,8 @@
|
||||
* TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256
|
||||
* TLS_PSK_WITH_3DES_EDE_CBC_SHA
|
||||
* TLS_PSK_WITH_RC4_128_SHA
|
||||
- */
|
||||
#define POLARSSL_KEY_EXCHANGE_PSK_ENABLED
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED
|
||||
@@ -487,8 +487,8 @@
|
||||
* TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
|
||||
* TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA
|
||||
* TLS_DHE_PSK_WITH_RC4_128_SHA
|
||||
- */
|
||||
#define POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED
|
||||
@@ -507,8 +507,8 @@
|
||||
* TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256
|
||||
* TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA
|
||||
* TLS_ECDHE_PSK_WITH_RC4_128_SHA
|
||||
- */
|
||||
#define POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED
|
||||
@@ -532,8 +532,8 @@
|
||||
* TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256
|
||||
* TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA
|
||||
* TLS_RSA_PSK_WITH_RC4_128_SHA
|
||||
- */
|
||||
#define POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_KEY_EXCHANGE_RSA_ENABLED
|
||||
@@ -611,8 +611,8 @@
|
||||
* TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
|
||||
* TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
|
||||
* TLS_ECDHE_RSA_WITH_RC4_128_SHA
|
||||
- */
|
||||
#define POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
|
||||
@@ -635,8 +635,8 @@
|
||||
* TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
|
||||
* TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
|
||||
* TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
|
||||
- */
|
||||
#define POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
|
||||
@@ -659,8 +659,8 @@
|
||||
* TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
|
||||
* TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
|
||||
* TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
|
||||
- */
|
||||
#define POLARSSL_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_KEY_EXCHANGE_ECDH_RSA_ENABLED
|
||||
@@ -683,8 +683,8 @@
|
||||
* TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384
|
||||
* TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256
|
||||
* TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384
|
||||
- */
|
||||
#define POLARSSL_KEY_EXCHANGE_ECDH_RSA_ENABLED
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_PK_PARSE_EC_EXTENDED
|
||||
@@ -844,8 +844,8 @@
|
||||
* \def POLARSSL_SELF_TEST
|
||||
*
|
||||
* Enable the checkup functions (*_self_test).
|
||||
- */
|
||||
#define POLARSSL_SELF_TEST
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_SSL_ALL_ALERT_MESSAGES
|
||||
@@ -1148,8 +1148,8 @@
|
||||
* Requires: POLARSSL_VERSION_C
|
||||
*
|
||||
* Comment this to disable run-time checking and save ROM space
|
||||
- */
|
||||
#define POLARSSL_VERSION_FEATURES
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_X509_ALLOW_EXTENSIONS_NON_V3
|
||||
@@ -1483,8 +1483,8 @@
|
||||
* TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384
|
||||
* TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256
|
||||
* TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256
|
||||
- */
|
||||
#define POLARSSL_CAMELLIA_C
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_CCM_C
|
||||
@@ -1511,8 +1511,8 @@
|
||||
* Requires: POLARSSL_PEM_PARSE_C
|
||||
*
|
||||
* This module is used for testing (ssl_client/server).
|
||||
- */
|
||||
#define POLARSSL_CERTS_C
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_CIPHER_C
|
||||
@@ -1551,8 +1551,8 @@
|
||||
* library/ssl_tls.c
|
||||
*
|
||||
* This module provides debugging functions.
|
||||
- */
|
||||
#define POLARSSL_DEBUG_C
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_DES_C
|
||||
@@ -1610,8 +1610,8 @@
|
||||
* ECDHE-ECDSA, ECDHE-RSA, DHE-PSK
|
||||
*
|
||||
* Requires: POLARSSL_ECP_C
|
||||
- */
|
||||
#define POLARSSL_ECDH_C
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_ECDSA_C
|
||||
@@ -1625,8 +1625,8 @@
|
||||
* ECDHE-ECDSA
|
||||
*
|
||||
* Requires: POLARSSL_ECP_C, POLARSSL_ASN1_WRITE_C, POLARSSL_ASN1_PARSE_C
|
||||
- */
|
||||
#define POLARSSL_ECDSA_C
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_ECP_C
|
||||
@@ -1638,8 +1638,8 @@
|
||||
* library/ecdsa.c
|
||||
*
|
||||
* Requires: POLARSSL_BIGNUM_C and at least one POLARSSL_ECP_DP_XXX_ENABLED
|
||||
- */
|
||||
#define POLARSSL_ECP_C
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_ENTROPY_C
|
||||
@@ -1678,8 +1678,8 @@
|
||||
*
|
||||
* This module enables the AES-GCM and CAMELLIA-GCM ciphersuites, if other
|
||||
* requisites are enabled as well.
|
||||
- */
|
||||
#define POLARSSL_GCM_C
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_HAVEGE_C
|
||||
@@ -1715,8 +1715,8 @@
|
||||
* Requires: POLARSSL_MD_C
|
||||
*
|
||||
* Uncomment to enable the HMAC_DRBG random number geerator.
|
||||
- */
|
||||
#define POLARSSL_HMAC_DRBG_C
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_MD_C
|
||||
@@ -1859,8 +1859,8 @@
|
||||
* Requires: POLARSSL_HAVE_ASM
|
||||
*
|
||||
* This modules adds support for the VIA PadLock on x86.
|
||||
- */
|
||||
#define POLARSSL_PADLOCK_C
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_PBKDF2_C
|
||||
@@ -2025,8 +2025,8 @@
|
||||
* Module: library/ripemd160.c
|
||||
* Caller: library/md.c
|
||||
*
|
||||
- */
|
||||
#define POLARSSL_RIPEMD160_C
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_RSA_C
|
||||
@@ -2110,8 +2110,8 @@
|
||||
* Caller:
|
||||
*
|
||||
* Requires: POLARSSL_SSL_CACHE_C
|
||||
- */
|
||||
#define POLARSSL_SSL_CACHE_C
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_SSL_CLI_C
|
||||
@@ -2187,8 +2187,8 @@
|
||||
* Caller: library/havege.c
|
||||
*
|
||||
* This module is used by the HAVEGE random number generator.
|
||||
- */
|
||||
#define POLARSSL_TIMING_C
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_VERSION_C
|
||||
@@ -2198,8 +2198,8 @@
|
||||
* Module: library/version.c
|
||||
*
|
||||
* This module provides run-time version information.
|
||||
- */
|
||||
#define POLARSSL_VERSION_C
|
||||
+ */
|
||||
|
||||
/**
|
||||
* \def POLARSSL_X509_USE_C
|
||||
@@ -2308,8 +2308,8 @@
|
||||
*
|
||||
* Module: library/xtea.c
|
||||
* Caller:
|
||||
- */
|
||||
#define POLARSSL_XTEA_C
|
||||
+ */
|
||||
|
||||
/* \} name SECTION: mbed TLS modules */
|
||||
|
||||
@ -1,51 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt
|
||||
# <https://immortalwrt.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ps3netsrv
|
||||
PKG_VERSION:=20200610
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/jhonathanc/ps3netsrv/tar.gz/$(PKG_VERSION)?
|
||||
PKG_HASH:=e456a8edbca7cac95b5396cab71c9bba26e5c838fe4751fffe12b483b5bb4030
|
||||
|
||||
PKG_LICENSE:=GPLv3
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
PKG_MAINTAINER:=JCorrea
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/ps3netsrv
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=File Transfer
|
||||
TITLE:=PS3 Game Server
|
||||
URL:=https://github.com/jhonathanc/ps3netsrv-openwrt
|
||||
DEPENDS:=+libpthread +libstdcpp
|
||||
endef
|
||||
|
||||
define Package/ps3netsrv/description
|
||||
ps3netsrv allows you to stream games and ISOs over the network to your CFW PlayStation(R) 3 system.
|
||||
This may be useful if you have a modified PS3, and your router has storage options.
|
||||
endef
|
||||
|
||||
define Package/ps3netsrv/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ps3netsrv $(1)/usr/bin
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) ./files/ps3netsrv.config $(1)/etc/config/ps3netsrv
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/ps3netsrv.init $(1)/etc/init.d/ps3netsrv
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ps3netsrv))
|
||||
@ -1,5 +0,0 @@
|
||||
config ps3netsrv 'main'
|
||||
option enabled '0'
|
||||
option user 'root'
|
||||
option dir '/root'
|
||||
option port '38008'
|
||||
@ -1,83 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
USE_PROCD=1
|
||||
|
||||
NAME=ps3netsrv
|
||||
PROG=/usr/bin/ps3netsrv
|
||||
|
||||
_info() {
|
||||
logger -p daemon.info -t "$NAME" "$*"
|
||||
}
|
||||
|
||||
_err() {
|
||||
logger -p daemon.err -t "$NAME" "$*"
|
||||
}
|
||||
|
||||
_change_owner() {
|
||||
local u="$1"; shift
|
||||
|
||||
local d
|
||||
for d in "$@"; do
|
||||
if [ -f "$d" ]; then
|
||||
chown "$u" "$d" 2>/dev/null || return 1
|
||||
elif [ -d "$d" ]; then
|
||||
chown -R "$u" "$d" 2>/dev/null || return 1
|
||||
fi
|
||||
done
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
ps3netsrv_validate() {
|
||||
uci_validate_section "$NAME" ps3netsrv "$1" \
|
||||
'enabled:bool:0' \
|
||||
'dir:string:/root' \
|
||||
'user:string' \
|
||||
'port:range(1024,65535)'
|
||||
}
|
||||
|
||||
ps3netsrv_start() {
|
||||
local section="$1"
|
||||
ps3netsrv_validate "$section" || { _err "Validation failed."; return 1; }
|
||||
|
||||
[ "$enabled" = "1" ] || { _info "Instance \"${section}\" disabled."; return 1; }
|
||||
[ -n "$dir" ] || { _err "Please set PS3 Game dir."; return 1; }
|
||||
[ -n "$port" ] || { _err "Please set bind port."; return 1; }
|
||||
[ -d "$dir" ] || { _err "Please create PS3 Game dir first."; return 1; }
|
||||
|
||||
if [ -n "$user" ]; then
|
||||
if ( user_exists "$user" && _change_owner "$user" "$log" ); then
|
||||
_info "ps3netsrv will run as user '${user}'."
|
||||
if [ "$user" != "root" ]; then
|
||||
_info "Please make sure user '${user}' has read access to directory: ${dir}"
|
||||
fi
|
||||
else
|
||||
_info "Set run user to '${user}' failed, default user will be used."
|
||||
user=
|
||||
fi
|
||||
fi
|
||||
|
||||
procd_open_instance "${NAME}.${section}"
|
||||
procd_set_param command "$PROG" "$dir" "$port"
|
||||
|
||||
procd_set_param respawn
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
|
||||
[ -n "$user" ] && \
|
||||
procd_set_param user "$user"
|
||||
|
||||
procd_add_jail "${NAME}.${section}" log
|
||||
procd_add_jail_mount "$dir"
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "$NAME"
|
||||
}
|
||||
|
||||
start_service() {
|
||||
config_load "$NAME"
|
||||
config_foreach ps3netsrv_start "ps3netsrv"
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
--- a/include/compat.h
|
||||
+++ b/include/compat.h
|
||||
@@ -57,7 +57,7 @@ typedef int socklen_t;
|
||||
|
||||
#else
|
||||
|
||||
-#include <sys/errno.h>
|
||||
+#include <errno.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/tcp.h>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user