mirror of
https://github.com/kiddin9/openwrt-packages.git
synced 2025-01-09 05:57:32 +08:00
🔥 Sync 2024-08-15 20:32:28
This commit is contained in:
parent
fec3c2ebdf
commit
a920c6258c
@ -9,14 +9,14 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=accel-ppp
|
||||
PKG_RELEASE:=6
|
||||
PKG_RELEASE:=7
|
||||
PKG_VERSION:=1.13.0
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=https://github.com/accel-ppp/accel-ppp.git
|
||||
PKG_SOURCE_VERSION:=dbffa39b4304f1be5e099f056a9e5001c3100393
|
||||
|
||||
PKG_MAINTAINER:=Alex Paraskeva <sim201010@gmail.com>
|
||||
PKG_MAINTAINER:=Konstantine Shevlakov <shevlakov@132lan.ru>
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
@ -26,6 +26,7 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=net
|
||||
@ -35,13 +36,14 @@ define Package/$(PKG_NAME)
|
||||
endef
|
||||
|
||||
CMAKE_OPTIONS += \
|
||||
-DBUILD_DRIVER=FALSE \
|
||||
-DBUILD_IPOE_DRIVER=TRUE \
|
||||
-DBUILD_VLAN_MON_DRIVER=TRUE \
|
||||
-DKDIR=$(LINUX_DIR) \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DLOG_PGSQL=FALSE \
|
||||
-DSHAPER=TRUE \
|
||||
-DRADIUS=TRUE \
|
||||
-DRADIUS=FALSE \
|
||||
-DNETSNMP=FALSE \
|
||||
-DLOG_FILE=TRUE \
|
||||
-DLIB_SUFFIX= \
|
||||
@ -50,15 +52,32 @@ CMAKE_BINARY_DIR := $(PKG_BUILD_DIR)/build
|
||||
TARGET_CFLAGS += -I$(STAGING_DIR)/opt/include -D_GNU_SOURCE -g -O2 -Wno-incompatible-pointer-types
|
||||
TARGET_LDFLAGS += -lpthread -latomic -lucontext
|
||||
|
||||
define KernelPackage/$(PKG_NAME)-ipoe
|
||||
SUBMENU:= Accel-PPP kernel modules
|
||||
TITLE:=Accel-PPP IPoE kernel module
|
||||
DEPENDS:=+accel-ppp
|
||||
FILES:=$(CMAKE_BINARY_DIR)/drivers/ipoe/driver/ipoe.ko
|
||||
AUTOLOAD:=$(call AutoProbe,ipoe)
|
||||
endef
|
||||
|
||||
define KernelPackage/$(PKG_NAME)-vlan-mon
|
||||
SUBMENU:=Accel-PPP kernel modules
|
||||
TITLE:=Accel-PPP vlan-mon kernel module
|
||||
DEPENDS:=+accel-ppp
|
||||
FILES:=$(CMAKE_BINARY_DIR)/drivers/vlan_mon/driver/vlan_mon.ko
|
||||
AUTOLOAD:=$(call AutoProbe,vlan_mon)
|
||||
endef
|
||||
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) \
|
||||
$(1)/usr/sbin \
|
||||
$(1)/usr/bin \
|
||||
$(1)/usr/lib \
|
||||
$(1)/usr/lib/accel-ppp \
|
||||
$(1)/usr/share/accel-ppp \
|
||||
$(1)/usr/share/accel-ppp/radius \
|
||||
$(1)/usr/share/accel-ppp/l2tp \
|
||||
$(1)/usr/lib/accel-ppp \
|
||||
$(1)/etc/init.d \
|
||||
$(1)/etc/accel-ppp
|
||||
|
||||
@ -74,10 +93,6 @@ define Package/$(PKG_NAME)/install
|
||||
$(PKG_INSTALL_DIR)/usr/lib/accel-ppp/*.so \
|
||||
$(1)/usr/lib/accel-ppp/
|
||||
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_INSTALL_DIR)/usr/share/accel-ppp/radius/dictionary.* \
|
||||
$(1)/usr/share/accel-ppp/radius/
|
||||
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_INSTALL_DIR)/usr/share/accel-ppp/l2tp/dictionary.* \
|
||||
$(1)/usr/share/accel-ppp/l2tp/
|
||||
@ -93,13 +108,17 @@ define Package/$(PKG_NAME)/install
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/postinst
|
||||
if [ -f /usr/lib/accel-ppp/libtriton.so ]; then
|
||||
ln -s /usr/lib/accel-ppp/libtriton.so /usr/lib/
|
||||
fi
|
||||
for l in $$(ls -1 /usr/lib/accel-ppp/); do
|
||||
ln -s /usr/lib/accel-ppp/$$l /usr/lib/
|
||||
done
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/prerm
|
||||
rm -rf /usr/lib/libtriton.so
|
||||
for l in $$(ls -1 /usr/lib/accel-ppp/); do
|
||||
rm -f /usr/lib/$$l
|
||||
done
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
$(eval $(call KernelPackage,$(PKG_NAME)-ipoe))
|
||||
$(eval $(call KernelPackage,$(PKG_NAME)-vlan-mon))
|
||||
|
@ -1,21 +1,23 @@
|
||||
[modules]
|
||||
connlimit
|
||||
log_file
|
||||
#log_syslog
|
||||
#log_tcp
|
||||
#log_pgsql
|
||||
|
||||
pptp
|
||||
l2tp
|
||||
# L2TP not Work!
|
||||
#l2tp
|
||||
sstp
|
||||
#pppoe
|
||||
#ipoe
|
||||
|
||||
auth_mschap_v2
|
||||
auth_mschap_v1
|
||||
auth_chap_md5
|
||||
auth_pap
|
||||
#auth_mschap_v1
|
||||
#auth_chap_md5
|
||||
#auth_pap
|
||||
|
||||
radius
|
||||
#chap-secrets
|
||||
chap-secrets
|
||||
|
||||
ippool
|
||||
|
||||
@ -24,52 +26,61 @@ pppd_compat
|
||||
#shaper
|
||||
#net-snmp
|
||||
#logwtmp
|
||||
#connlimit
|
||||
|
||||
#ipv6_nd
|
||||
#ipv6_dhcp
|
||||
#ipv6pool
|
||||
|
||||
#net-accel-dp
|
||||
|
||||
[core]
|
||||
log-error=/var/log/accel-ppp/core.log
|
||||
log-error=/tmp/accel-ppp-core.log
|
||||
thread-count=4
|
||||
|
||||
[common]
|
||||
#single-session=replace
|
||||
#single-session-ignore-case=0
|
||||
#sid-case=upper
|
||||
#sid-source=seq
|
||||
#max-sessions=1000
|
||||
#max-starting=0
|
||||
#check-ip=0
|
||||
#nl-snd-buffer=32768
|
||||
#nl-rcv-buffer=1048576
|
||||
|
||||
[ppp]
|
||||
verbose=1
|
||||
min-mtu=1280
|
||||
mtu=1400
|
||||
mru=1400
|
||||
#accomp=deny
|
||||
#pcomp=deny
|
||||
accomp=deny
|
||||
pcomp=deny
|
||||
#ccp=0
|
||||
#check-ip=0
|
||||
#mppe=require
|
||||
mppe=require
|
||||
ipv4=require
|
||||
ipv6=deny
|
||||
ipv6-intf-id=0:0:0:1
|
||||
ipv6-peer-intf-id=0:0:0:2
|
||||
ipv6-accept-peer-intf-id=1
|
||||
lcp-echo-interval=20
|
||||
#lcp-echo-failure=3
|
||||
lcp-echo-failure=3
|
||||
lcp-echo-timeout=120
|
||||
unit-cache=1
|
||||
#unit-preallocate=1
|
||||
|
||||
[auth]
|
||||
#timeout=5
|
||||
#interval=0
|
||||
#max-failure=3
|
||||
#any-login=0
|
||||
#noauth=0
|
||||
#challenge-name=accel-ppp
|
||||
|
||||
[pptp]
|
||||
verbose=1
|
||||
#echo-interval=30
|
||||
ip-pool=pool3
|
||||
#ipv6-pool=pptp
|
||||
#ipv6-pool-delegate=pptp
|
||||
ifname=pptp%d
|
||||
|
||||
[pppoe]
|
||||
verbose=1
|
||||
@ -81,11 +92,14 @@ called-sid=mac
|
||||
#tr101=1
|
||||
#padi-limit=0
|
||||
#ip-pool=pppoe
|
||||
#ipv6-pool=pppoe
|
||||
#ipv6-pool-delegate=pppoe
|
||||
#ifname=pppoe%d
|
||||
#sid-uppercase=0
|
||||
#vlan-mon=eth0,10-200
|
||||
#vlan-timeout=60
|
||||
#vlan-name=%I.%N
|
||||
#interface=eth1,padi-limit=1000,net=accel-dp
|
||||
#interface=eth1,padi-limit=1000
|
||||
interface=eth0
|
||||
|
||||
[l2tp]
|
||||
@ -103,13 +117,40 @@ verbose=1
|
||||
#dataseq=allow
|
||||
#reorder-timeout=0
|
||||
#ip-pool=l2tp
|
||||
#ipv6-pool=l2tp
|
||||
#ipv6-pool-delegate=l2tp
|
||||
#ifname=l2tp%d
|
||||
|
||||
[sstp]
|
||||
verbose=2
|
||||
#cert-hash-proto=sha1,sha256
|
||||
#cert-hash-sha1=
|
||||
#cert-hash-sha256=
|
||||
#accept=ssl,proxy
|
||||
#ssl-protocol=tls1,tls1.1,tls1.2,tls1.3
|
||||
#ssl-dhparam=/etc/ssl/dhparam.pem
|
||||
#ssl-ecdh-curve=prime256v1
|
||||
#ssl-ciphers=DEFAULT
|
||||
#ssl-prefer-server-ciphers=0
|
||||
#ssl-ca-file=/etc/ssl/sstp-ca.crt
|
||||
#ssl-pemfile=/etc/ssl/sstp-cert.pem
|
||||
#ssl-keyfile=/etc/ssl/sstp-key.pem
|
||||
#host-name=domain.tld
|
||||
#http-error=allow
|
||||
#timeout=60
|
||||
#hello-interval=60
|
||||
#ip-pool=sstp
|
||||
#ipv6-pool=sstp
|
||||
#ipv6-pool-delegate=sstp
|
||||
ifname=sstp%d
|
||||
|
||||
[ipoe]
|
||||
verbose=1
|
||||
username=ifname
|
||||
#password=username
|
||||
lease-time=600
|
||||
renew-time=600
|
||||
#renew-time=300
|
||||
#rebind-time=525
|
||||
max-lease-time=3600
|
||||
#unit-cache=1000
|
||||
#l4-redirect-table=4
|
||||
@ -120,17 +161,20 @@ shared=0
|
||||
ifcfg=1
|
||||
mode=L2
|
||||
start=dhcpv4
|
||||
#start=UP
|
||||
#start=up
|
||||
#ip-unnumbered=1
|
||||
#proxy-arp=0
|
||||
#nat=0
|
||||
#proto=100
|
||||
#relay=10.10.10.10
|
||||
#vendor=Custom
|
||||
#weight=0
|
||||
#attr-dhcp-client-ip=DHCP-Client-IP-Address
|
||||
#attr-dhcp-router-ip=DHCP-Router-IP-Address
|
||||
#attr-dhcp-mask=DHCP-Mask
|
||||
#attr-dhcp-lease-time=DHCP-Lease-Time
|
||||
#attr-dhcp-renew-time=DHCP-Renewal-Time
|
||||
#attr-dhcp-rebind-time=DHCP-Rebinding-Time
|
||||
#attr-dhcp-opt82=DHCP-Option82
|
||||
#attr-dhcp-opt82-remote-id=DHCP-Agent-Remote-Id
|
||||
#attr-dhcp-opt82-circuit-id=DHCP-Agent-Circuit-Id
|
||||
@ -143,6 +187,8 @@ start=dhcpv4
|
||||
#vlan-timeout=60
|
||||
#vlan-name=%I.%N
|
||||
#ip-pool=ipoe
|
||||
#ipv6-pool=ipoe
|
||||
#ipv6-pool-delegate=ipoe
|
||||
#idle-timeout=0
|
||||
#session-timeout=0
|
||||
#soft-terminate=0
|
||||
@ -151,7 +197,6 @@ start=dhcpv4
|
||||
#local-net=192.168.0.0/16
|
||||
interface=eth0
|
||||
|
||||
|
||||
[dns]
|
||||
#dns1=172.16.0.1
|
||||
#dns2=172.16.1.1
|
||||
@ -172,11 +217,17 @@ verbose=1
|
||||
#max-try=3
|
||||
#acct-timeout=120
|
||||
#acct-delay-time=0
|
||||
#acct-delay-start=0
|
||||
#acct-on=0
|
||||
#acct-interim-interval=0
|
||||
#acct-interim-jitter=0
|
||||
#default-realm=
|
||||
#strip-realm=0
|
||||
#attr-tunnel-type=My-Tunnel-Type
|
||||
#nas-port-id-in-req=1
|
||||
|
||||
[client-ip-range]
|
||||
10.0.0.0/8
|
||||
0.0.0.0/0
|
||||
|
||||
[ip-pool]
|
||||
gw-ip-address=192.168.0.1
|
||||
@ -187,12 +238,13 @@ attr=Framed-Pool
|
||||
192.168.1.1-255,name=pool1
|
||||
192.168.2.1-255,name=pool2
|
||||
192.168.3.1-255,name=pool3
|
||||
192.168.4.1-255,name=pool4,next=pool1
|
||||
192.168.4.0/24
|
||||
|
||||
[log]
|
||||
log-file=/var/log/accel-ppp/accel-ppp.log
|
||||
log-emerg=/var/log/accel-ppp/emerg.log
|
||||
log-fail-file=/var/log/accel-ppp/auth-fail.log
|
||||
log-file=/tmp/accel-ppp.log
|
||||
log-emerg=/tmpaccel-ppp-emerg.log
|
||||
log-fail-file=/tmp/accel-ppp-auth-fail.log
|
||||
#log-debug=/dev/stdout
|
||||
#syslog=accel-pppd,daemon
|
||||
#log-tcp=127.0.0.1:3000
|
||||
@ -201,19 +253,20 @@ copy=1
|
||||
#per-user-dir=per_user
|
||||
#per-session-dir=per_session
|
||||
#per-session=1
|
||||
level=3
|
||||
level=7
|
||||
|
||||
[log-pgsql]
|
||||
conninfo=user=log
|
||||
log-table=log
|
||||
|
||||
[pppd-compat]
|
||||
verbose=1
|
||||
#ip-pre-up=/etc/ppp/ip-pre-up
|
||||
ip-up=/etc/ppp/ip-up
|
||||
ip-down=/etc/ppp/ip-down
|
||||
ip-change=/etc/ppp/ip-change
|
||||
#ip-change=/etc/ppp/ip-change
|
||||
radattr-prefix=/var/run/radattr
|
||||
verbose=1
|
||||
#fork-limit=16
|
||||
|
||||
[chap-secrets]
|
||||
gw-ip-address=192.168.100.1
|
||||
@ -239,6 +292,7 @@ down-limiter=tbf
|
||||
#leaf-qdisc=fq_codel [limit PACKETS] [flows NUMBER] [target TIME] [interval TIME] [quantum BYTES] [[no]ecn]
|
||||
#rate-multiplier=1
|
||||
#fwmark=1
|
||||
#rate-limit=2048/1024
|
||||
verbose=1
|
||||
|
||||
[cli]
|
||||
@ -246,6 +300,7 @@ verbose=1
|
||||
telnet=127.0.0.1:2000
|
||||
tcp=127.0.0.1:2001
|
||||
#password=123
|
||||
#sessions-columns=ifname,username,ip,ip6,ip6-dp,type,state,uptime,uptime-raw,calling-sid,called-sid,sid,comp,inbound-if,service-name,rx-bytes,tx-bytes,rx-bytes-raw,tx-bytes-raw,rx-pkts,tx-pkts,netns,vrf
|
||||
|
||||
[snmp]
|
||||
master=0
|
||||
@ -257,8 +312,16 @@ burst=3
|
||||
timeout=60
|
||||
|
||||
[ipv6-pool]
|
||||
#gw-ip6-address=fc00:0:1::1
|
||||
#vendor=
|
||||
#attr-prefix=Delegated-IPv6-Prefix-Pool
|
||||
#attr-address=Stateful-IPv6-Address-Pool
|
||||
fc00:0:1::/48,64
|
||||
fc00:0:2::/48,64,name=pool1
|
||||
fc00:0:3::/48,64,name=pool2,next=pool1
|
||||
delegate=fc00:1::/36,48
|
||||
delegate=fc00:2::/36,48,name=pool3
|
||||
delegate=fc00:3::/36,48,name=pool4,next=pool3
|
||||
|
||||
[ipv6-dns]
|
||||
#fc00:1::1
|
||||
@ -272,6 +335,3 @@ verbose=1
|
||||
pref-lifetime=604800
|
||||
valid-lifetime=2592000
|
||||
route-via-gw=1
|
||||
|
||||
[accel-dp]
|
||||
socket=/var/run/accel-dp.sock
|
||||
|
@ -6,11 +6,16 @@ USE_PROCD=1
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command /usr/sbin/accel-pppd -d -c /etc/accel-ppp/accel-ppp.conf
|
||||
procd_set_param command /usr/sbin/accel-pppd -d -c /etc/accel-ppp/accel-ppp.conf -p /var/run/accel-pppd.pid
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
stop_service(){
|
||||
killall -3 accel-pppd >/dev/null 2>&1
|
||||
rm -rf /var/run/accel-pppd.pid
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
procd_send_signal accel-ppp
|
||||
}
|
||||
|
@ -1,27 +1,53 @@
|
||||
--- a/accel-pppd/ctrl/ipoe/arp.c
|
||||
+++ b/accel-pppd/ctrl/ipoe/arp.c
|
||||
@@ -13,7 +13,6 @@
|
||||
Index: accel-ppp-1.13.0/accel-pppd/ctrl/ipoe/arp.c
|
||||
===================================================================
|
||||
--- accel-ppp-1.13.0.orig/accel-pppd/ctrl/ipoe/arp.c
|
||||
+++ accel-ppp-1.13.0/accel-pppd/ctrl/ipoe/arp.c
|
||||
@@ -13,8 +13,8 @@
|
||||
#include <netinet/ip.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/ioctl.h>
|
||||
-#include <linux/if_arp.h>
|
||||
#include <linux/if_packet.h>
|
||||
-#include <linux/if_packet.h>
|
||||
+#include <net/if_arp.h>
|
||||
+#include <netpacket/packet.h>
|
||||
|
||||
#include "list.h"
|
||||
#include "triton.h"
|
||||
--- a/accel-pppd/ctrl/ipoe/ipoe.c.orig
|
||||
+++ b/accel-pppd/ctrl/ipoe/ipoe.c
|
||||
@@ -15,7 +15,6 @@
|
||||
Index: accel-ppp-1.13.0/accel-pppd/ctrl/ipoe/ipoe.c
|
||||
===================================================================
|
||||
--- accel-ppp-1.13.0.orig/accel-pppd/ctrl/ipoe/ipoe.c
|
||||
+++ accel-ppp-1.13.0/accel-pppd/ctrl/ipoe/ipoe.c
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <sys/socket.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <linux/if.h>
|
||||
-#include <linux/if_arp.h>
|
||||
+#include <net/if_arp.h>
|
||||
#include <linux/route.h>
|
||||
|
||||
#include <pcre.h>
|
||||
--- a/accel-pppd/ctrl/pppoe/pppoe.c
|
||||
+++ b/accel-pppd/ctrl/pppoe/pppoe.c
|
||||
@@ -11,7 +11,6 @@
|
||||
Index: accel-ppp-1.13.0/accel-pppd/ctrl/l2tp/l2tp.c
|
||||
===================================================================
|
||||
--- accel-ppp-1.13.0.orig/accel-pppd/ctrl/l2tp/l2tp.c
|
||||
+++ accel-ppp-1.13.0/accel-pppd/ctrl/l2tp/l2tp.c
|
||||
@@ -853,7 +853,7 @@ static void l2tp_tunnel_free_sessions(st
|
||||
void *sessions = conn->sessions;
|
||||
|
||||
conn->sessions = NULL;
|
||||
- tdestroy(sessions, (__free_fn_t)l2tp_session_free);
|
||||
+ tdestroy(sessions, (void (*) (void *))l2tp_session_free);
|
||||
/* Let l2tp_session_free() handle the session counter and
|
||||
* the reference held by the tunnel.
|
||||
*/
|
||||
Index: accel-ppp-1.13.0/accel-pppd/ctrl/pppoe/pppoe.c
|
||||
===================================================================
|
||||
--- accel-ppp-1.13.0.orig/accel-pppd/ctrl/pppoe/pppoe.c
|
||||
+++ accel-ppp-1.13.0/accel-pppd/ctrl/pppoe/pppoe.c
|
||||
@@ -8,10 +8,10 @@
|
||||
#include <fcntl.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/ioctl.h>
|
||||
+#include <linux/sockios.h>
|
||||
#include <net/ethernet.h>
|
||||
#include <netpacket/packet.h>
|
||||
#include <arpa/inet.h>
|
||||
@ -29,8 +55,29 @@
|
||||
|
||||
#include "crypto.h"
|
||||
|
||||
--- a/accel-pppd/include/ap_session.h
|
||||
+++ b/accel-pppd/include/ap_session.h
|
||||
Index: accel-ppp-1.13.0/accel-pppd/ifcfg.c
|
||||
===================================================================
|
||||
--- accel-ppp-1.13.0.orig/accel-pppd/ifcfg.c
|
||||
+++ accel-ppp-1.13.0/accel-pppd/ifcfg.c
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/ioctl.h>
|
||||
+#include <linux/sockios.h>
|
||||
#include <linux/route.h>
|
||||
#include "linux_ppp.h"
|
||||
|
||||
@@ -376,4 +377,4 @@ int __export ap_session_vrf(struct ap_se
|
||||
|
||||
return 0;
|
||||
}
|
||||
-#endif
|
||||
\ No newline at end of file
|
||||
+#endif
|
||||
Index: accel-ppp-1.13.0/accel-pppd/include/ap_session.h
|
||||
===================================================================
|
||||
--- accel-ppp-1.13.0.orig/accel-pppd/include/ap_session.h
|
||||
+++ accel-ppp-1.13.0/accel-pppd/include/ap_session.h
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "triton.h"
|
||||
@ -39,8 +86,66 @@
|
||||
|
||||
//#define AP_SESSIONID_LEN 16
|
||||
#define AP_IFNAME_LEN 16
|
||||
--- a/accel-pppd/session_backup.c
|
||||
+++ b/accel-pppd/session_backup.c
|
||||
@@ -124,9 +125,9 @@ struct ap_session
|
||||
|
||||
struct ap_session_stat
|
||||
{
|
||||
- unsigned int active;
|
||||
- unsigned int starting;
|
||||
- unsigned int finishing;
|
||||
+ uint32_t active;
|
||||
+ uint32_t starting;
|
||||
+ uint32_t finishing;
|
||||
};
|
||||
|
||||
|
||||
Index: accel-ppp-1.13.0/accel-pppd/ppp/ppp.c
|
||||
===================================================================
|
||||
--- accel-ppp-1.13.0.orig/accel-pppd/ppp/ppp.c
|
||||
+++ accel-ppp-1.13.0/accel-pppd/ppp/ppp.c
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <signal.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/ioctl.h>
|
||||
+#include <linux/sockios.h>
|
||||
#include "linux_ppp.h"
|
||||
|
||||
#include "crypto.h"
|
||||
Index: accel-ppp-1.13.0/accel-pppd/session.c
|
||||
===================================================================
|
||||
--- accel-ppp-1.13.0.orig/accel-pppd/session.c
|
||||
+++ accel-ppp-1.13.0/accel-pppd/session.c
|
||||
@@ -105,7 +105,7 @@ int __export ap_session_starting(struct
|
||||
ses->state = AP_STATE_STARTING;
|
||||
}
|
||||
|
||||
- __sync_add_and_fetch(&ap_session_stat.starting, 1);
|
||||
+ __sync_add_and_fetch_4(&ap_session_stat.starting, 1);
|
||||
|
||||
pthread_rwlock_wrlock(&ses_lock);
|
||||
list_add_tail(&ses->entry, &ses_list);
|
||||
@@ -296,7 +296,7 @@ void __export ap_session_terminate(struc
|
||||
else
|
||||
__sync_sub_and_fetch(&ap_session_stat.starting, 1);
|
||||
|
||||
- __sync_add_and_fetch(&ap_session_stat.finishing, 1);
|
||||
+ __sync_add_and_fetch_4(&ap_session_stat.finishing, 1);
|
||||
ses->terminating = 1;
|
||||
ses->state = AP_STATE_FINISHING;
|
||||
|
||||
@@ -354,7 +354,7 @@ static void generate_sessionid(struct ap
|
||||
sid = ++seq;
|
||||
spin_unlock(&seq_lock);
|
||||
#else
|
||||
- sid = __sync_add_and_fetch(&seq, 1);
|
||||
+ sid = __sync_add_and_fetch_4(&seq, 1);
|
||||
#endif
|
||||
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
Index: accel-ppp-1.13.0/accel-pppd/session_backup.c
|
||||
===================================================================
|
||||
--- accel-ppp-1.13.0.orig/accel-pppd/session_backup.c
|
||||
+++ accel-ppp-1.13.0/accel-pppd/session_backup.c
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <unistd.h>
|
||||
#include <netinet/in.h>
|
||||
|
@ -1,11 +0,0 @@
|
||||
--- a/accel-pppd/ctrl/l2tp/l2tp.c
|
||||
+++ b/accel-pppd/ctrl/l2tp/l2tp.c
|
||||
@@ -853,7 +853,7 @@ static void l2tp_tunnel_free_sessions(st
|
||||
void *sessions = conn->sessions;
|
||||
|
||||
conn->sessions = NULL;
|
||||
- tdestroy(sessions, (__free_fn_t)l2tp_session_free);
|
||||
+ tdestroy(sessions, l2tp_session_free);
|
||||
/* Let l2tp_session_free() handle the session counter and
|
||||
* the reference held by the tunnel.
|
||||
*/
|
@ -314,6 +314,11 @@ o=s:taboption("dnshost", Value,"host_domain",translate("Domain"))
|
||||
o.rmempty=true
|
||||
o:depends("HOST_enabled", 1)
|
||||
|
||||
s:tab("mosdns", translate("MosDNS"))
|
||||
o=s:taboption("mosdns", Flag, "MosDNS_enabled",translate("MosDNS Enabled"))
|
||||
o=s:taboption("mosdns", Flag, "openclash_restart",translate("OpenClash Restart"))
|
||||
o:depends("MosDNS_enabled", 1)
|
||||
|
||||
e=m:section(TypedSection,"global",translate("Best IP"))
|
||||
e.anonymous=true
|
||||
local a="/usr/share/cloudflarespeedtestresult.txt"
|
||||
|
@ -219,3 +219,9 @@ msgstr "启用HOST"
|
||||
|
||||
msgid "Domain"
|
||||
msgstr "域名"
|
||||
|
||||
msgid "MosDNS Enabled"
|
||||
msgstr "写入 MosDNS"
|
||||
|
||||
msgid "OpenClash Restart"
|
||||
msgstr "重启 OpenClash"
|
||||
|
@ -219,3 +219,9 @@ msgstr "启用HOST"
|
||||
|
||||
msgid "Domain"
|
||||
msgstr "域名"
|
||||
|
||||
msgid "MosDNS Enabled"
|
||||
msgstr "写入 MosDNS"
|
||||
|
||||
msgid "OpenClash Restart"
|
||||
msgstr "重启 OpenClash"
|
||||
|
@ -27,7 +27,7 @@ echolog() {
|
||||
|
||||
function read_config(){
|
||||
get_global_config "enabled" "speed" "custome_url" "threads" "custome_cors_enabled" "custome_cron" "t" "tp" "dt" "dn" "dd" "tl" "tll" "ipv6_enabled" "advanced" "proxy_mode"
|
||||
get_servers_config "ssr_services" "ssr_enabled" "passwall_enabled" "passwall_services" "passwall2_enabled" "passwall2_services" "bypass_enabled" "bypass_services" "vssr_enabled" "vssr_services" "DNS_enabled" "HOST_enabled"
|
||||
get_servers_config "ssr_services" "ssr_enabled" "passwall_enabled" "passwall_services" "passwall2_enabled" "passwall2_services" "bypass_enabled" "bypass_services" "vssr_enabled" "vssr_services" "DNS_enabled" "HOST_enabled" "MosDNS_enabled" "openclash_restart"
|
||||
}
|
||||
|
||||
function appinit(){
|
||||
@ -130,6 +130,19 @@ function speed_test(){
|
||||
/etc/init.d/bypass restart
|
||||
fi
|
||||
|
||||
if [ "x${MosDNS_enabled}" == "x1" ] ;then
|
||||
if [ -n "$(grep 'option cloudflare' /etc/config/mosdns)" ]
|
||||
then
|
||||
sed -i".bak" "/option cloudflare/d" /etc/config/mosdns
|
||||
fi
|
||||
sed -i '/^$/d' /etc/config/mosdns && echo -e "\toption cloudflare '0'" >> /etc/config/mosdns
|
||||
|
||||
/etc/init.d/mosdns restart &>/dev/null
|
||||
if [ "x${openclash_restart}" == "x1" ] ;then
|
||||
/etc/init.d/openclash restart &>/dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
echo $command >> $LOG_FILE 2>&1
|
||||
echolog "-----------start----------"
|
||||
$command >> $LOG_FILE 2>&1
|
||||
@ -144,6 +157,7 @@ function ip_replace(){
|
||||
echolog "CloudflareST 测速结果 IP 数量为 0,跳过下面步骤..."
|
||||
else
|
||||
host_ip
|
||||
mosdns_ip
|
||||
alidns_ip
|
||||
ssr_best_ip
|
||||
vssr_best_ip
|
||||
@ -174,6 +188,26 @@ function host_ip() {
|
||||
fi
|
||||
}
|
||||
|
||||
function mosdns_ip() {
|
||||
if [ "x${MosDNS_enabled}" == "x1" ] ;then
|
||||
if [ -n "$(grep 'option cloudflare' /etc/config/mosdns)" ]
|
||||
then
|
||||
sed -i".bak" "/option cloudflare/d" /etc/config/mosdns
|
||||
fi
|
||||
if [ -n "$(grep 'list cloudflare_ip' /etc/config/mosdns)" ]
|
||||
then
|
||||
sed -i".bak" "/list cloudflare_ip/d" /etc/config/mosdns
|
||||
fi
|
||||
sed -i '/^$/d' /etc/config/mosdns && echo -e "\toption cloudflare '1'\n\tlist cloudflare_ip '$bestip'" >> /etc/config/mosdns
|
||||
|
||||
/etc/init.d/mosdns restart &>/dev/null
|
||||
if [ "x${openclash_restart}" == "x1" ] ;then
|
||||
/etc/init.d/openclash restart &>/dev/null
|
||||
fi
|
||||
echolog "MosDNS 写入完成"
|
||||
fi
|
||||
}
|
||||
|
||||
function passwall_best_ip(){
|
||||
if [ "x${passwall_enabled}" == "x1" ] ;then
|
||||
echolog "设置passwall IP"
|
||||
|
@ -37,6 +37,12 @@ function renderStatus(isRunning) {
|
||||
}
|
||||
|
||||
return view.extend({
|
||||
load: function() {
|
||||
return Promise.all([
|
||||
L.resolveDefault(fs.exec('/usr/bin/mosdns', ['version']), null),
|
||||
]);
|
||||
},
|
||||
|
||||
handleFlushCache: function (m, section_id, ev) {
|
||||
return fs.exec('/usr/share/mosdns/mosdns.sh', ['flush'])
|
||||
.then(function (lazy_cache) {
|
||||
@ -49,10 +55,14 @@ return view.extend({
|
||||
});
|
||||
},
|
||||
|
||||
render: function () {
|
||||
var m, s, o;
|
||||
render: function (basic) {
|
||||
var m, s, o, v;
|
||||
v = '';
|
||||
|
||||
m = new form.Map('mosdns', _('MosDNS'),
|
||||
if (basic[0] && basic[0].code === 0) {
|
||||
v = basic[0].stdout.trim();
|
||||
}
|
||||
m = new form.Map('mosdns', _('MosDNS') + ' ' + v,
|
||||
_('MosDNS is a plugin-based DNS forwarder/traffic splitter.'));
|
||||
|
||||
s = m.section(form.TypedSection);
|
||||
|
@ -14,6 +14,7 @@
|
||||
"/etc/mosdns/rule/redirect.txt": [ "read" ],
|
||||
"/etc/mosdns/rule/streaming.txt": [ "read" ],
|
||||
"/etc/mosdns/rule/whitelist.txt": [ "read" ],
|
||||
"/usr/bin/mosdns": [ "exec" ],
|
||||
"/usr/share/mosdns/mosdns.sh": [ "exec" ]
|
||||
},
|
||||
"ubus": {
|
||||
|
@ -101,11 +101,15 @@ return view.extend({
|
||||
o.default = o.disabled;
|
||||
o.rmempty = false;
|
||||
|
||||
o = s.option(form.Value, 'def_tcp_stun', _('Default ') + _('TCP STUN ') + _('Server'));
|
||||
o = s.option(form.Value, 'def_tcp_stun', _('Default ') + _('TCP STUN ') + _('Server'),
|
||||
_('Available server <a href="%s" target="_blank">references</a>')
|
||||
.format(_('https://github.com/muink/rfc5780-stun-server/blob/master/valid_hosts_rfc5780.txt')));
|
||||
o.datatype = 'or(hostname, hostport)';
|
||||
o.rmempty = false;
|
||||
|
||||
o = s.option(form.Value, 'def_udp_stun', _('Default ') + _('UDP STUN ') + _('Server'));
|
||||
o = s.option(form.Value, 'def_udp_stun', _('Default ') + _('UDP STUN ') + _('Server'),
|
||||
_('Available server <a href="%s" target="_blank">references</a>')
|
||||
.format(_('https://github.com/muink/rfc5780-stun-server/blob/master/valid_hosts_rfc5780_tcp.txt')));
|
||||
o.datatype = 'or(hostname, hostport)';
|
||||
o.rmempty = false;
|
||||
|
||||
@ -521,9 +525,9 @@ return view.extend({
|
||||
|
||||
o = s.taboption('notify', form.DynamicList, 'notify_tokens', _('Tokens'),
|
||||
_('The KEY required by the script above. ' +
|
||||
'See <a href="%s" target="_blank">%s*</a> for the format of KEY required by each script. ' +
|
||||
'See <a href="%s" target="_blank">%s</a> for the format of KEY required by each script. ' +
|
||||
'Add multiple entries here in KEY=VAL shell variable format to supply multiple KEY variables.')
|
||||
.format('https://github.com/muink/openwrt-natmapt/tree/master/files/notify/'));
|
||||
.format('https://github.com/muink/openwrt-natmapt/tree/master/files/notify/', _('<code># All external tokens required</code> Field')));
|
||||
o.datatype = 'list(string)';
|
||||
o.placeholder = 'KEY=VAL';
|
||||
o.rmempty = true;
|
||||
@ -557,9 +561,9 @@ return view.extend({
|
||||
|
||||
o = s.taboption('ddns', form.DynamicList, 'ddns_tokens', _('Tokens'),
|
||||
_('The KEY required by the script above. ' +
|
||||
'See <a href="%s" target="_blank">%s*</a> for the format of KEY required by each script. ' +
|
||||
'See <a href="%s" target="_blank">%s</a> for the format of KEY required by each script. ' +
|
||||
'Add multiple entries here in KEY=VAL shell variable format to supply multiple KEY variables.')
|
||||
.format('https://github.com/muink/openwrt-natmapt/tree/master/files/ddns/'));
|
||||
.format('https://github.com/muink/openwrt-natmapt/tree/master/files/ddns/', _('<code># All external tokens required</code> Field')));
|
||||
o.datatype = 'list(string)';
|
||||
o.placeholder = 'KEY=VAL';
|
||||
o.rmempty = true;
|
||||
|
@ -18,6 +18,11 @@ msgstr "(此装置默认 LAN)"
|
||||
msgid "(This device default Wan)"
|
||||
msgstr "(此装置默认 WAN)"
|
||||
|
||||
#: applications/luci-app-natmapt/htdocs/luci-static/resources/view/natmap.js:530
|
||||
#: applications/luci-app-natmapt/htdocs/luci-static/resources/view/natmap.js:566
|
||||
msgid "<code># All external tokens required</code> Field"
|
||||
msgstr "<code># All external tokens required</code> 字段"
|
||||
|
||||
#: applications/luci-app-natmapt/htdocs/luci-static/resources/view/natmap.js:562
|
||||
msgid "A Record"
|
||||
msgstr "A 记录"
|
||||
@ -30,6 +35,11 @@ msgstr "AAAA 记录"
|
||||
msgid "Active NATMap Portmap"
|
||||
msgstr "活动的 NATMap 端口映射"
|
||||
|
||||
#: applications/luci-app-natmapt/htdocs/luci-static/resources/view/natmap.js:105
|
||||
#: applications/luci-app-natmapt/htdocs/luci-static/resources/view/natmap.js:111
|
||||
msgid "Available server <a href=\"%s\" target=\"_blank\">references</a>"
|
||||
msgstr "可用的服务器<a href=\"%s\" target=\"_blank\">参考</a>"
|
||||
|
||||
#: applications/luci-app-natmapt/htdocs/luci-static/resources/view/natmap.js:304
|
||||
msgid "Bind port"
|
||||
msgstr "绑定端口"
|
||||
@ -243,7 +253,7 @@ msgstr "密码"
|
||||
msgid ""
|
||||
"Please check <a href=\"%s\"><b>Firewall Rules</b></a> to avoid port "
|
||||
"conflicts.</br>"
|
||||
msgstr "请检查<a href=\"%s\"><b>防火墙规则</b></a>以避免端口冲突"
|
||||
msgstr "请检查<a href=\"%s\"><b>防火墙规则</b></a>以避免端口冲突</br>"
|
||||
|
||||
#: applications/luci-app-natmapt/htdocs/luci-static/resources/view/natmap.js:362
|
||||
msgid "Port forwarding session idle timeout in seconds"
|
||||
@ -338,11 +348,11 @@ msgstr "DNAT 方法不支持在 IPv6 下使用"
|
||||
#: applications/luci-app-natmapt/htdocs/luci-static/resources/view/natmap.js:553
|
||||
msgid ""
|
||||
"The KEY required by the script above. See <a href=\"%s\" "
|
||||
"target=\"_blank\">%s*</a> for the format of KEY required by each script. Add "
|
||||
"target=\"_blank\">%s</a> for the format of KEY required by each script. Add "
|
||||
"multiple entries here in KEY=VAL shell variable format to supply multiple "
|
||||
"KEY variables."
|
||||
msgstr ""
|
||||
"上面脚本所需的 KEY。请查看 <a href=\"%s\" target=\"_blank\">%s*</a> 以获得对"
|
||||
"上面脚本所需的 KEY。请查看 <a href=\"%s\" target=\"_blank\">%s</a> 以获得对"
|
||||
"应脚本所需的 KEY 列表。请输入格式为 KEY=VAL 的多个 KEY 条目"
|
||||
|
||||
#: applications/luci-app-natmapt/htdocs/luci-static/resources/view/status/include/72_natmap.js:83
|
||||
|
@ -18,6 +18,11 @@ msgstr "(本裝置默認 LAN)"
|
||||
msgid "(This device default Wan)"
|
||||
msgstr "(本裝置默認 WAN)"
|
||||
|
||||
#: applications/luci-app-natmapt/htdocs/luci-static/resources/view/natmap.js:530
|
||||
#: applications/luci-app-natmapt/htdocs/luci-static/resources/view/natmap.js:566
|
||||
msgid "<code># All external tokens required</code> Field"
|
||||
msgstr "<code># All external tokens required</code> 字段"
|
||||
|
||||
#: applications/luci-app-natmapt/htdocs/luci-static/resources/view/natmap.js:562
|
||||
msgid "A Record"
|
||||
msgstr "A 記錄"
|
||||
@ -30,6 +35,11 @@ msgstr "AAAA 記錄"
|
||||
msgid "Active NATMap Portmap"
|
||||
msgstr "活動的 NATMap 埠映射"
|
||||
|
||||
#: applications/luci-app-natmapt/htdocs/luci-static/resources/view/natmap.js:105
|
||||
#: applications/luci-app-natmapt/htdocs/luci-static/resources/view/natmap.js:111
|
||||
msgid "Available server <a href=\"%s\" target=\"_blank\">references</a>"
|
||||
msgstr "可用的伺服器<a href=\"%s\" target=\"_blank\">參考</a>"
|
||||
|
||||
#: applications/luci-app-natmapt/htdocs/luci-static/resources/view/natmap.js:304
|
||||
msgid "Bind port"
|
||||
msgstr "綁定埠"
|
||||
@ -243,7 +253,7 @@ msgstr "密碼"
|
||||
msgid ""
|
||||
"Please check <a href=\"%s\"><b>Firewall Rules</b></a> to avoid port "
|
||||
"conflicts.</br>"
|
||||
msgstr "請檢查<a href=\"%s\"><b>防火牆規則</b></a>以避免埠衝突"
|
||||
msgstr "請檢查<a href=\"%s\"><b>防火牆規則</b></a>以避免埠衝突</br>"
|
||||
|
||||
#: applications/luci-app-natmapt/htdocs/luci-static/resources/view/natmap.js:362
|
||||
msgid "Port forwarding session idle timeout in seconds"
|
||||
@ -338,11 +348,11 @@ msgstr "DNAT 方法不支援在 IPv6 下使用"
|
||||
#: applications/luci-app-natmapt/htdocs/luci-static/resources/view/natmap.js:553
|
||||
msgid ""
|
||||
"The KEY required by the script above. See <a href=\"%s\" "
|
||||
"target=\"_blank\">%s*</a> for the format of KEY required by each script. Add "
|
||||
"target=\"_blank\">%s</a> for the format of KEY required by each script. Add "
|
||||
"multiple entries here in KEY=VAL shell variable format to supply multiple "
|
||||
"KEY variables."
|
||||
msgstr ""
|
||||
"上面腳本所需的 KEY。請參閱 <a href=\"%s\" target=\"_blank\">%s*</a> 以獲得對"
|
||||
"上面腳本所需的 KEY。請參閱 <a href=\"%s\" target=\"_blank\">%s</a> 以獲得對"
|
||||
"應腳本所需的 KEY 清單。請輸入格式為 KEY=VAL 的多個 KEY 條目"
|
||||
|
||||
#: applications/luci-app-natmapt/htdocs/luci-static/resources/view/status/include/72_natmap.js:83
|
||||
|
@ -118,9 +118,6 @@ return view.extend({
|
||||
o.placeholder = 'packagesync';
|
||||
o.rmempty = false;
|
||||
o.validate = function(section, value) {
|
||||
if (value == null || value == '' || value == 'ignore')
|
||||
return _('Expecting: non-empty value');
|
||||
|
||||
if (usedname.length)
|
||||
for (var i = 0; i < usedname.length; i++)
|
||||
if (usedname[i] == value)
|
||||
@ -273,9 +270,6 @@ return view.extend({
|
||||
o.datatype = 'uciname';
|
||||
o.rmempty = false;
|
||||
o.validate = function(section_id, value) {
|
||||
if (value == null || value == '' || value == 'ignore')
|
||||
return _('Expecting: non-empty value');
|
||||
|
||||
let ss = uci.sections(conf, release);
|
||||
for (var i = 0; i < ss.length; i++) {
|
||||
let sid = ss[i]['.name'];
|
||||
@ -304,11 +298,6 @@ return view.extend({
|
||||
|
||||
o = s.option(form.Value, 'version', _('Version'));
|
||||
o.rmempty = false;
|
||||
o.validate = function(section, value) {
|
||||
if (value == null || value == '' || value == 'ignore')
|
||||
return _('Expecting: non-empty value');
|
||||
return true;
|
||||
};
|
||||
|
||||
if (releaseslist.length) {
|
||||
for (var i = 0; i < releaseslist.length; i++)
|
||||
@ -318,11 +307,6 @@ return view.extend({
|
||||
o = s.option(form.Value, 'target', _('Target'));
|
||||
o.placeholder = 'x86/64';
|
||||
o.rmempty = false;
|
||||
o.validate = function(section, value) {
|
||||
if (value == null || value == '' || value == 'ignore')
|
||||
return _('Expecting: non-empty value');
|
||||
return true;
|
||||
};
|
||||
|
||||
if (targetslist.length) {
|
||||
for (var i = 0; i < targetslist.length; i++)
|
||||
@ -336,11 +320,6 @@ return view.extend({
|
||||
|
||||
o = s.option(form.Value, 'pkgarch', _('Arch'));
|
||||
o.rmempty = false;
|
||||
o.validate = function(section, value) {
|
||||
if (value == null || value == '' || value == 'ignore')
|
||||
return _('Expecting: non-empty value');
|
||||
return true;
|
||||
};
|
||||
|
||||
if (pkgarchslist.length) {
|
||||
for (var i = 0; i < pkgarchslist.length; i++)
|
||||
|
Loading…
Reference in New Issue
Block a user