update my package and stable fix

This commit is contained in:
coolsnowwolf 2017-09-12 21:52:20 +08:00
parent 082e6215b7
commit ace9961e9f
467 changed files with 65295 additions and 342 deletions

View File

@ -0,0 +1,121 @@
#
# Copyright (c) 2014 The Linux Foundation. All rights reserved.
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted, provided that the
# above copyright notice and this permission notice appear in all copies.
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=shortcut-fe
PKG_RELEASE:=1
include $(INCLUDE_DIR)/package.mk
define KernelPackage/shortcut-fe
SECTION:=kernel
CATEGORY:=Kernel modules
SUBMENU:=Network Support
DEPENDS:=@IPV6
TITLE:=Kernel driver for SFE
FILES:=$(PKG_BUILD_DIR)/shortcut-fe.ko $(PKG_BUILD_DIR)/shortcut-fe-ipv6.ko
KCONFIG:=CONFIG_NF_CONNTRACK_EVENTS=y CONFIG_SHORTCUT_FE=y
AUTOLOAD:=$(call AutoProbe,shortcut-fe shortcut-fe-ipv6)
endef
define KernelPackage/shortcut-fe/Description
Shortcut is an in-Linux-kernel IP packet forwarding engine.
endef
define KernelPackage/shortcut-fe-cm
SECTION:=kernel
CATEGORY:=Kernel modules
SUBMENU:=Network Support
DEPENDS:=+kmod-ipt-conntrack +kmod-shortcut-fe
TITLE:=Kernel driver for SFE
FILES:=$(PKG_BUILD_DIR)/shortcut-fe-cm.ko
KCONFIG:=CONFIG_NF_CONNTRACK_CHAIN_EVENTS=y CONFIG_NF_CONNTRACK_MARK=y
AUTOLOAD:=$(call AutoProbe,shortcut-fe-cm)
endef
define KernelPackage/shortcut-fe-cm/Description
Simple connection manager for the Shortcut forwarding engine.
endef
define KernelPackage/fast-classifier
SECTION:=kernel
CATEGORY:=Kernel modules
SUBMENU:=Network Support
DEPENDS:=+kmod-ipt-conntrack +kmod-shortcut-fe
TITLE:=Kernel driver for FAST Classifier
FILES:=$(PKG_BUILD_DIR)/fast-classifier.ko
KCONFIG:=CONFIG_NF_CONNTRACK_CHAIN_EVENTS=y CONFIG_NF_CONNTRACK_MARK=y
AUTOLOAD:=$(call AutoLoad,z,fast-classifier)
PROVIDES:=$(PKG_NAME)
endef
define KernelPackage/fast-classifier/description
FAST Classifier connection manager for Shortcut forwarding engine.
It talks to SFE to make decisions about offloading connections.
endef
define Package/fast-classifier-example
TITLE:=Example user space program for fast-classifier
DEPENDS:=+libnl +kmod-fast-classifier
endef
define Package/fast-classifier-example/description
Example user space program that communicates with fast
classifier kernel module
endef
MAKE_OPTS:= \
ARCH="$(LINUX_KARCH)" \
CROSS_COMPILE="$(TARGET_CROSS)" \
SUBDIRS="$(PKG_BUILD_DIR)" \
EXTRA_CFLAGS="$(EXTRA_CFLAGS)"
define Build/Compile
$(MAKE) -C "$(LINUX_DIR)" \
$(MAKE_OPTS) \
modules
$(if $(CONFIG_PACKAGE_fast-classifier-example),$(Build/Compile/fast-classifier-example))
endef
define Build/Compile/fast-classifier-example
$(TARGET_CC) -o $(PKG_BUILD_DIR)/userspace_fast_classifier \
-I $(PKG_BUILD_DIR) \
-I$(STAGING_DIR)/usr/include/libnl \
-I$(STAGING_DIR)/usr/include/libnl3 \
-lnl-genl-3 -lnl-3 \
$(PKG_BUILD_DIR)/nl_classifier_test.c
endef
ifneq ($(CONFIG_PACKAGE_kmod-shortcut-fe)$(CONFIG_PACKAGE_kmod-shortcut-fe-cm)$(CONFIG_PACKAGE_kmod-fast-classifier),)
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/shortcut-fe
$(CP) -rf $(PKG_BUILD_DIR)/sfe.h $(1)/usr/include/shortcut-fe
ifneq ($(CONFIG_PACKAGE_kmod-fast-classifier),)
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_BUILD_DIR)/fast-classifier.h $(1)/usr/include/
endif
endef
endif
define Package/fast-classifier-example/install
$(INSTALL_DIR) $(1)/sbin
$(CP) $(PKG_BUILD_DIR)/userspace_fast_classifier $(1)/sbin/
endef
$(eval $(call KernelPackage,shortcut-fe))
$(eval $(call KernelPackage,shortcut-fe-cm))
$(eval $(call KernelPackage,fast-classifier))
$(eval $(call BuildPackage,fast-classifier-example))

View File

@ -0,0 +1,14 @@
#
# Shortcut forwarding engine
#
config SHORTCUT_FE
tristate "Shortcut Forwarding Engine"
depends on NF_CONNTRACK
---help---
Shortcut is a fast in-kernel packet forwarding engine.
To compile this code as a module, choose M here: the module will be
called shortcut-fe.
If unsure, say N.

View File

@ -0,0 +1,14 @@
#
# Makefile for Shortcut FE.
#
obj-m += shortcut-fe.o shortcut-fe-ipv6.o shortcut-fe-cm.o fast-classifier.o
shortcut-fe-objs := \
sfe_ipv4.o
shortcut-fe-ipv6-objs := \
sfe_ipv6.o
shortcut-fe-cm-objs := \
sfe_cm.o

View File

@ -0,0 +1,122 @@
Shortcut Forwarding Engine
--------------------------
Welcome to "Shortcut" :-)
Here's a quick FAQ:
Q) What is Shortcut?
A) Shortcut is an in-Linux-kernel IP packet forwarding engine. It's designed
to offer very high speed IP packet forwarding based on IP connection tracking.
It's dramatically faster than the standard netfilter-based NAT forwarding path
but is designed to synchronise state back to netfilter/conntrack so that it
doesn't need to deal with all of the complexities of special cases.
Q) What versions of IP does it support?
A) The current version only supports IPv4 but will be extended to support IPv6 in
the future.
Q) What transport protocols does it support?
A) TCP and UDP. It also knows enough about ICMP to spot ICMP error messages
related to TCP and UDP and handle things accordingly.
Q) Is there a design spec for this software?
A) Not at the moment. I'll write one when I get more time. The code is
intended to be a good tutorial though - it's very heavily commented. If you
find yourself reading something and not understanding it then I take that to
mean I've probably not done a sufficently good job of explaining what it's
doing in the comments. Let me know - I will try to fix it :-)
Q) Why was it written?
A) It was written as a demonstration of what can be done to provide high
performance forwarding inside the kernel. There were two initial motivations:
1) To provide a platform to enable research into how QoS analysis systems can
offload work and avoid huge Linux overheads.
2) To provide a tool to investigate the behaviour of various processors, SoCs
and software sets so that we can characterize and design new network processor
SoCs.
Q) How much faster is it than the Linux kernel forwarding path?
A) At the time of pushing this to github it's been tested on a QCA AP135.
This has a Scorpion (QCA Scopion, not the QMC one :-)) SoC, QCA9550. The
SoC's processor is a MIPS74K running at 720 MHz and with a DDR2 memory
subsystem that offers a peak of 600 MT/s (16-bit transfers).
Running IPv4 NAT forwarding of UDP between the board's 2 GMAC ports and
using a SmartBits 200 as a traffic generator Linux is able to forward 70k PPS.
Once the SFE code is invoked this will increase to 350k PPS!
There's also a slightly hacky mode which causes SFE to bypass the Linux
bridge layer, but this isn't really ready for use because it doesn't have
sufficient MAC address checks or integration of statistics back to the
Ethernet bridge, but that runs at 436k PPS.
Q) Are there any diagnostics?
A) Yes, this is a research tool after all! There's a complex way to do this
that's more general purpose and a simple one - here's the simple one:
mknod /dev/sfe c 253 0
The file /dev/sfe is an XML-ish output and provides details of all the
network connections currently being offloaded. It also reports the numbers
of packets that took various "exception" paths within the code. In addition
it provides a summary of the number of connections, attempts to accelerate
connections, cancel accelerations, etc. It also reports the numbers of
packets that were forwarded and not forwarded by the engine and has some
stats on the effectiveness of the hashing algorithm it uses.
Q) How does the code interact with Linux?
A) There are four minor patches required to make this software run with
Linux. These are currently against a 3.3.8 or 3.4.0 kernel:
* (net/core/dev.c) adds a hook to allow packets to be extracted out.
* (net/netfilter/nf_conntrack_proto_tcp.c) exposes a state variable inside
netfilter that's necessary to enable TCP sequence and ACK checking within
the offload path. Note that this specific patch is against the QCA QSDK
patched version of 3.3.8 - there's a slightly braindead "performance"
patch in that kernel, courtesy of the OpenWrt community that makes the
Linux forwarding path slightly faster at the expense of losing
functionality :-(
* (net/Kconfig) adds the shortcut-fe option.
* (net/Makefile) adds the shortcut-fe build support.
Once these are applied and the module is loaded then everything else
is automatic :-) The patches are in this git repo.
Q) Are any of the pieces reused from other projects?
A) Yes! Some of the forwarding concepts are reused from the Ubicom Network
Accelerator that morphed into part of the Akronite NSS. This code has all
been substantially changed though to accomodate Linux's needs.
There are also some pieces that I borrowed from the QCA "FastNAT" software
written by Xiaoping Fan <xfan@qca.qualcomm.com>. Xiaoping's code was the
first actual demonstration within QCA that this in-kernel concept could yield
signficant performance gains.
Enjoy!
Dave Hudson <dhudson@qti.qualcomm.com>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,57 @@
/*
* User space header to send message to the fast classifier
*
* Copyright (c) 2013,2016 The Linux Foundation. All rights reserved.
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all copies.
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <linux/if_ether.h>
#define FAST_CLASSIFIER_GENL_VERSION (1)
#define FAST_CLASSIFIER_GENL_NAME "FC"
#define FAST_CLASSIFIER_GENL_MCGRP "FC_MCGRP"
#define FAST_CLASSIFIER_GENL_HDRSIZE (0)
enum {
FAST_CLASSIFIER_A_UNSPEC,
FAST_CLASSIFIER_A_TUPLE,
__FAST_CLASSIFIER_A_MAX,
};
#define FAST_CLASSIFIER_A_MAX (__FAST_CLASSIFIER_A_MAX - 1)
enum {
FAST_CLASSIFIER_C_UNSPEC,
FAST_CLASSIFIER_C_OFFLOAD,
FAST_CLASSIFIER_C_OFFLOADED,
FAST_CLASSIFIER_C_DONE,
__FAST_CLASSIFIER_C_MAX,
};
#define FAST_CLASSIFIER_C_MAX (__FAST_CLASSIFIER_C_MAX - 1)
struct fast_classifier_tuple {
unsigned short ethertype;
unsigned char proto;
union {
struct in_addr in;
struct in6_addr in6;
} src_saddr;
union {
struct in_addr in;
struct in6_addr in6;
} dst_saddr;
unsigned short sport;
unsigned short dport;
unsigned char smac[ETH_ALEN];
unsigned char dmac[ETH_ALEN];
};

View File

@ -0,0 +1,281 @@
/*
* Copyright (c) 2016 The Linux Foundation. All rights reserved.
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all copies.
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <netlink/genl/genl.h>
#include <netlink/genl/ctrl.h>
#include <errno.h>
#include <stdio.h>
#include <signal.h>
#include <arpa/inet.h>
#define NL_CLASSIFIER_GENL_VERSION 1
#define NL_CLASSIFIER_GENL_FAMILY "FC"
#define NL_CLASSIFIER_GENL_GROUP "FC_MCGRP"
#define NL_CLASSIFIER_GENL_HDRSIZE 0
enum NL_CLASSIFIER_CMD {
NL_CLASSIFIER_CMD_UNSPEC,
NL_CLASSIFIER_CMD_ACCEL,
NL_CLASSIFIER_CMD_ACCEL_OK,
NL_CLASSIFIER_CMD_CONNECTION_CLOSED,
NL_CLASSIFIER_CMD_MAX,
};
enum NL_CLASSIFIER_ATTR {
NL_CLASSIFIER_ATTR_UNSPEC,
NL_CLASSIFIER_ATTR_TUPLE,
NL_CLASSIFIER_ATTR_MAX,
};
union nl_classifier_tuple_ip {
struct in_addr in;
struct in6_addr in6;
};
struct nl_classifier_tuple {
unsigned short af;
unsigned char proto;
union nl_classifier_tuple_ip src_ip;
union nl_classifier_tuple_ip dst_ip;
unsigned short sport;
unsigned short dport;
unsigned char smac[6];
unsigned char dmac[6];
};
struct nl_classifier_instance {
struct nl_sock *sock;
int family_id;
int group_id;
int stop;
};
struct nl_classifier_instance nl_cls_inst;
static struct nla_policy nl_classifier_genl_policy[(NL_CLASSIFIER_ATTR_MAX+1)] = {
[NL_CLASSIFIER_ATTR_TUPLE] = { .type = NLA_UNSPEC },
};
void nl_classifier_dump_nl_tuple(struct nl_classifier_tuple *tuple)
{
char ip_str[64];
printf("protocol = %s\n", (tuple->proto == IPPROTO_UDP) ? "udp" : ((tuple->proto == IPPROTO_TCP) ? "tcp" : "unknown"));
printf("source ip = %s\n", inet_ntop(tuple->af, &tuple->src_ip, ip_str, sizeof(ip_str)));
printf("destination ip = %s\n", inet_ntop(tuple->af, &tuple->dst_ip, ip_str, sizeof(ip_str)));
printf("source port = %d\n", ntohs(tuple->sport));
printf("destination port = %d\n", ntohs(tuple->dport));
}
int nl_classifier_msg_recv(struct nl_msg *msg, void *arg)
{
struct nlmsghdr *nlh = nlmsg_hdr(msg);
struct genlmsghdr *gnlh = nlmsg_data(nlh);
struct nlattr *attrs[(NL_CLASSIFIER_ATTR_MAX+1)];
genlmsg_parse(nlh, NL_CLASSIFIER_GENL_HDRSIZE, attrs, NL_CLASSIFIER_ATTR_MAX, nl_classifier_genl_policy);
switch (gnlh->cmd) {
case NL_CLASSIFIER_CMD_ACCEL_OK:
printf("Acceleration successful:\n");
nl_classifier_dump_nl_tuple(nla_data(attrs[NL_CLASSIFIER_ATTR_TUPLE]));
return NL_OK;
case NL_CLASSIFIER_CMD_CONNECTION_CLOSED:
printf("Connection is closed:\n");
nl_classifier_dump_nl_tuple(nla_data(attrs[NL_CLASSIFIER_ATTR_TUPLE]));
return NL_OK;
default:
printf("nl classifier received unknow message %d\n", gnlh->cmd);
}
return NL_SKIP;
}
void nl_classifier_offload(struct nl_classifier_instance *inst,
unsigned char proto, unsigned long *src_saddr,
unsigned long *dst_saddr, unsigned short sport,
unsigned short dport, int af)
{
struct nl_msg *msg;
int ret;
struct nl_classifier_tuple classifier_msg;
memset(&classifier_msg, 0, sizeof(classifier_msg));
classifier_msg.af = af;
classifier_msg.proto = proto;
memcpy(&classifier_msg.src_ip, src_saddr, (af == AF_INET ? 4 : 16));
memcpy(&classifier_msg.dst_ip, dst_saddr, (af == AF_INET ? 4 : 16));
classifier_msg.sport = sport;
classifier_msg.dport = dport;
msg = nlmsg_alloc();
if (!msg) {
printf("Unable to allocate message\n");
return;
}
genlmsg_put(msg, NL_AUTO_PID, NL_AUTO_SEQ, inst->family_id,
NL_CLASSIFIER_GENL_HDRSIZE, NLM_F_REQUEST,
NL_CLASSIFIER_CMD_ACCEL, NL_CLASSIFIER_GENL_VERSION);
nla_put(msg, NL_CLASSIFIER_ATTR_TUPLE, sizeof(classifier_msg), &classifier_msg);
ret = nl_send_auto(inst->sock, msg);
if (ret < 0) {
printf("send netlink message failed.\n");
nlmsg_free(msg);
return;
}
nlmsg_free(msg);
printf("nl classifier offload connection successful\n");
}
int nl_classifier_init(struct nl_classifier_instance *inst)
{
int ret;
inst->sock = nl_socket_alloc();
if (!inst->sock) {
printf("Unable to allocation socket.\n");
return -1;
}
genl_connect(inst->sock);
inst->family_id = genl_ctrl_resolve(inst->sock, NL_CLASSIFIER_GENL_FAMILY);
if (inst->family_id < 0) {
printf("Unable to resolve family %s\n", NL_CLASSIFIER_GENL_FAMILY);
goto init_failed;
}
inst->group_id = genl_ctrl_resolve_grp(inst->sock, NL_CLASSIFIER_GENL_FAMILY, NL_CLASSIFIER_GENL_GROUP);
if (inst->group_id < 0) {
printf("Unable to resolve mcast group %s\n", NL_CLASSIFIER_GENL_GROUP);
goto init_failed;
}
ret = nl_socket_add_membership(inst->sock, inst->group_id);
if (ret < 0) {
printf("Unable to add membership\n");
goto init_failed;
}
nl_socket_disable_seq_check(inst->sock);
nl_socket_modify_cb(inst->sock, NL_CB_VALID, NL_CB_CUSTOM, nl_classifier_msg_recv, NULL);
printf("nl classifier init successful\n");
return 0;
init_failed:
if (inst->sock) {
nl_close(inst->sock);
nl_socket_free(inst->sock);
inst->sock = NULL;
}
return -1;
}
void nl_classifier_exit(struct nl_classifier_instance *inst)
{
if (inst->sock) {
nl_close(inst->sock);
nl_socket_free(inst->sock);
inst->sock = NULL;
}
printf("nl classifier exit successful\n");
}
int nl_classifier_parse_arg(int argc, char *argv[], unsigned char *proto, unsigned long *src_saddr,
unsigned long *dst_saddr, unsigned short *sport, unsigned short *dport, int *af)
{
int ret;
unsigned short port;
if (argc < 7) {
printf("help: nl_classifier <v4|v6> <udp|tcp> <source ip> <destination ip> <source port> <destination port>\n");
return -1;
}
if (0 == strncmp(argv[1], "v4", 2)) {
*af = AF_INET;
} else if (0 == strncmp(argv[1], "v6", 2)) {
*af = AF_INET6;
} else {
printf("Address family is not supported");
return -1;
}
if (0 == strncmp(argv[2], "udp", 3)) {
*proto = IPPROTO_UDP;
} else if (0 == strncmp(argv[2], "tcp", 3)) {
*proto = IPPROTO_TCP;
} else {
printf("Protocol is not supported");
return -1;
}
ret = inet_pton(*af, argv[3], src_saddr);
if (ret <= 0) {
printf("source ip has wrong format\n");
return -1;
}
ret = inet_pton(*af, argv[4], dst_saddr);
if (ret <= 0) {
printf("destination ip has wrong format\n");
return -1;
}
port = strtol(argv[5], NULL, 0);
*sport = htons(port);
port = strtol(argv[6], NULL, 0);
*dport = htons(port);
printf("nl classifier parse arguments successful\n");
return 0;
}
int main(int argc, char *argv[])
{
struct nl_classifier_instance *inst = &nl_cls_inst;
unsigned char proto;
unsigned long src_addr[4];
unsigned long dst_addr[4];
unsigned short sport;
unsigned short dport;
int af;
int ret;
ret = nl_classifier_parse_arg(argc, argv, &proto, src_addr, dst_addr, &sport, &dport, &af);
if (ret < 0) {
printf("Failed to parse arguments\n");
return ret;
}
ret = nl_classifier_init(inst);
if (ret < 0) {
printf("Unable to init generic netlink\n");
return ret;
}
nl_classifier_offload(inst, proto, src_addr, dst_addr, sport, dport, af);
/* main loop to listen on message */
while (!inst->stop) {
nl_recvmsgs_default(inst->sock);
}
nl_classifier_exit(inst);
return 0;
}

View File

@ -0,0 +1,61 @@
/*
* sfe.h
* Shortcut forwarding engine.
*
* Copyright (c) 2013-2016 The Linux Foundation. All rights reserved.
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all copies.
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/*
* Debug output verbosity level.
*/
#define DEBUG_LEVEL 0
#if (DEBUG_LEVEL < 1)
#define DEBUG_ERROR(s, ...)
#else
#define DEBUG_ERROR(s, ...) \
do { \
printk("%s[%u]: ERROR:", __FILE__, __LINE__); \
printk(s, ##__VA_ARGS__); \
} while (0)
#endif
#if (DEBUG_LEVEL < 2)
#define DEBUG_WARN(s, ...)
#else
#define DEBUG_WARN(s, ...) \
do { \
printk("%s[%u]: WARN:", __FILE__, __LINE__); \
printk(s, ##__VA_ARGS__); \
} while (0)
#endif
#if (DEBUG_LEVEL < 3)
#define DEBUG_INFO(s, ...)
#else
#define DEBUG_INFO(s, ...) \
do { \
printk("%s[%u]: INFO:", __FILE__, __LINE__); \
printk(s, ##__VA_ARGS__); \
} while (0)
#endif
#if (DEBUG_LEVEL < 4)
#define DEBUG_TRACE(s, ...)
#else
#define DEBUG_TRACE(s, ...) \
do { \
printk("%s[%u]: TRACE:", __FILE__, __LINE__); \
printk(s, ##__VA_ARGS__); \
} while (0)
#endif

View File

@ -0,0 +1,138 @@
/*
* sfe_backport.h
* Shortcut forwarding engine compatible header file.
*
* Copyright (c) 2014-2016 The Linux Foundation. All rights reserved.
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all copies.
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <linux/version.h>
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0))
#define sfe_define_post_routing_hook(FN_NAME, HOOKNUM, OPS, SKB, UNUSED, OUT, OKFN) \
static unsigned int FN_NAME(void *priv, \
struct sk_buff *SKB, \
const struct nf_hook_state *state)
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0))
#define sfe_define_post_routing_hook(FN_NAME, HOOKNUM, OPS, SKB, UNUSED, OUT, OKFN) \
static unsigned int FN_NAME(const struct nf_hook_ops *OPS, \
struct sk_buff *SKB, \
const struct net_device *UNUSED, \
const struct net_device *OUT, \
int (*OKFN)(struct sk_buff *))
#else
#define sfe_define_post_routing_hook(FN_NAME, HOOKNUM, OPS, SKB, UNUSED, OUT, OKFN) \
static unsigned int FN_NAME(unsigned int HOOKNUM, \
struct sk_buff *SKB, \
const struct net_device *UNUSED, \
const struct net_device *OUT, \
int (*OKFN)(struct sk_buff *))
#endif
#define sfe_cm_ipv4_post_routing_hook(HOOKNUM, OPS, SKB, UNUSED, OUT, OKFN) \
sfe_define_post_routing_hook(__sfe_cm_ipv4_post_routing_hook, HOOKNUM, OPS, SKB, UNUSED, OUT, OKFN)
#define sfe_cm_ipv6_post_routing_hook(HOOKNUM, OPS, SKB, UNUSED, OUT, OKFN) \
sfe_define_post_routing_hook(__sfe_cm_ipv6_post_routing_hook, HOOKNUM, OPS, SKB, UNUSED, OUT, OKFN)
#define fast_classifier_ipv4_post_routing_hook(HOOKNUM, OPS, SKB, UNUSED, OUT, OKFN) \
sfe_define_post_routing_hook(__fast_classifier_ipv4_post_routing_hook, HOOKNUM, OPS, SKB, UNUSED, OUT, OKFN)
#define fast_classifier_ipv6_post_routing_hook(HOOKNUM, OPS, SKB, UNUSED, OUT, OKFN) \
sfe_define_post_routing_hook(__fast_classifier_ipv6_post_routing_hook, HOOKNUM, OPS, SKB, UNUSED, OUT, OKFN)
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0))
#define SFE_IPV4_NF_POST_ROUTING_HOOK(fn) \
{ \
.hook = fn, \
.pf = NFPROTO_IPV4, \
.hooknum = NF_INET_POST_ROUTING, \
.priority = NF_IP_PRI_NAT_SRC + 1, \
}
#else
#define SFE_IPV4_NF_POST_ROUTING_HOOK(fn) \
{ \
.hook = fn, \
.owner = THIS_MODULE, \
.pf = NFPROTO_IPV4, \
.hooknum = NF_INET_POST_ROUTING, \
.priority = NF_IP_PRI_NAT_SRC + 1, \
}
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0))
#define SFE_IPV6_NF_POST_ROUTING_HOOK(fn) \
{ \
.hook = fn, \
.pf = NFPROTO_IPV6, \
.hooknum = NF_INET_POST_ROUTING, \
.priority = NF_IP_PRI_NAT_SRC + 1, \
}
#else
#define SFE_IPV6_NF_POST_ROUTING_HOOK(fn) \
{ \
.hook = fn, \
.owner = THIS_MODULE, \
.pf = NFPROTO_IPV6, \
.hooknum = NF_INET_POST_ROUTING, \
.priority = NF_IP6_PRI_NAT_SRC + 1, \
}
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0))
#define SFE_NF_CT_DEFAULT_ZONE (&nf_ct_zone_dflt)
#else
#define SFE_NF_CT_DEFAULT_ZONE NF_CT_DEFAULT_ZONE
#endif
/*
* sfe_dev_get_master
* get master of bridge port, and hold it
*/
static inline struct net_device *sfe_dev_get_master(struct net_device *dev)
{
struct net_device *master;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0))
rcu_read_lock();
master = netdev_master_upper_dev_get_rcu(dev);
if (master)
dev_hold(master);
rcu_read_unlock();
#else
master = dev->master;
if (master)
dev_hold(master);
#endif
return master;
}
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0))
#define SFE_DEV_EVENT_PTR(PTR) netdev_notifier_info_to_dev(PTR)
#else
#define SFE_DEV_EVENT_PTR(PTR) (struct net_device *)(PTR)
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0))
#define SFE_NF_CONN_ACCT(NM) struct nf_conn_acct *NM
#else
#define SFE_NF_CONN_ACCT(NM) struct nf_conn_counter *NM
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0))
#define SFE_ACCT_COUNTER(NM) ((NM)->counter)
#else
#define SFE_ACCT_COUNTER(NM) (NM)
#endif
#define sfe_hash_for_each_possible(name, obj, member, key) \
hash_for_each_possible(name, obj, member, key)
#define sfe_hash_for_each(name, bkt, obj, member) \
hash_for_each(name, bkt, obj, member)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,222 @@
/*
* sfe_cm.h
* Shortcut forwarding engine.
*
* Copyright (c) 2013-2016 The Linux Foundation. All rights reserved.
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all copies.
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/*
* connection flags.
*/
#define SFE_CREATE_FLAG_NO_SEQ_CHECK BIT(0)
/* Indicates that we should not check sequence numbers */
#define SFE_CREATE_FLAG_REMARK_PRIORITY BIT(1)
/* Indicates that we should remark priority of skb */
#define SFE_CREATE_FLAG_REMARK_DSCP BIT(2)
/* Indicates that we should remark DSCP of packet */
/*
* IPv6 address structure
*/
struct sfe_ipv6_addr {
__be32 addr[4];
};
typedef union {
__be32 ip;
struct sfe_ipv6_addr ip6[1];
} sfe_ip_addr_t;
/*
* connection creation structure.
*/
struct sfe_connection_create {
int protocol;
struct net_device *src_dev;
struct net_device *dest_dev;
u32 flags;
u32 src_mtu;
u32 dest_mtu;
sfe_ip_addr_t src_ip;
sfe_ip_addr_t src_ip_xlate;
sfe_ip_addr_t dest_ip;
sfe_ip_addr_t dest_ip_xlate;
__be16 src_port;
__be16 src_port_xlate;
__be16 dest_port;
__be16 dest_port_xlate;
u8 src_mac[ETH_ALEN];
u8 src_mac_xlate[ETH_ALEN];
u8 dest_mac[ETH_ALEN];
u8 dest_mac_xlate[ETH_ALEN];
u8 src_td_window_scale;
u32 src_td_max_window;
u32 src_td_end;
u32 src_td_max_end;
u8 dest_td_window_scale;
u32 dest_td_max_window;
u32 dest_td_end;
u32 dest_td_max_end;
u32 mark;
#ifdef CONFIG_XFRM
u32 original_accel;
u32 reply_accel;
#endif
u32 src_priority;
u32 dest_priority;
u32 src_dscp;
u32 dest_dscp;
};
/*
* connection destruction structure.
*/
struct sfe_connection_destroy {
int protocol;
sfe_ip_addr_t src_ip;
sfe_ip_addr_t dest_ip;
__be16 src_port;
__be16 dest_port;
};
typedef enum sfe_sync_reason {
SFE_SYNC_REASON_STATS, /* Sync is to synchronize stats */
SFE_SYNC_REASON_FLUSH, /* Sync is to flush a entry */
SFE_SYNC_REASON_DESTROY /* Sync is to destroy a entry(requested by connection manager) */
} sfe_sync_reason_t;
/*
* Structure used to sync connection stats/state back within the system.
*
* NOTE: The addresses here are NON-NAT addresses, i.e. the true endpoint addressing.
* 'src' is the creator of the connection.
*/
struct sfe_connection_sync {
struct net_device *src_dev;
struct net_device *dest_dev;
int is_v6; /* Is it for ipv6? */
int protocol; /* IP protocol number (IPPROTO_...) */
sfe_ip_addr_t src_ip; /* Non-NAT source address, i.e. the creator of the connection */
sfe_ip_addr_t src_ip_xlate; /* NATed source address */
__be16 src_port; /* Non-NAT source port */
__be16 src_port_xlate; /* NATed source port */
sfe_ip_addr_t dest_ip; /* Non-NAT destination address, i.e. to whom the connection was created */
sfe_ip_addr_t dest_ip_xlate; /* NATed destination address */
__be16 dest_port; /* Non-NAT destination port */
__be16 dest_port_xlate; /* NATed destination port */
u32 src_td_max_window;
u32 src_td_end;
u32 src_td_max_end;
u64 src_packet_count;
u64 src_byte_count;
u32 src_new_packet_count;
u32 src_new_byte_count;
u32 dest_td_max_window;
u32 dest_td_end;
u32 dest_td_max_end;
u64 dest_packet_count;
u64 dest_byte_count;
u32 dest_new_packet_count;
u32 dest_new_byte_count;
u32 reason; /* reason for stats sync message, i.e. destroy, flush, period sync */
u64 delta_jiffies; /* Time to be added to the current timeout to keep the connection alive */
};
/*
* connection mark structure
*/
struct sfe_connection_mark {
int protocol;
sfe_ip_addr_t src_ip;
sfe_ip_addr_t dest_ip;
__be16 src_port;
__be16 dest_port;
u32 mark;
};
/*
* Expose the hook for the receive processing.
*/
extern int (*fast_nat_recv)(struct sk_buff *skb);
/*
* Expose what should be a static flag in the TCP connection tracker.
*/
extern int nf_ct_tcp_no_window_check;
/*
* This callback will be called in a timer
* at 100 times per second to sync stats back to
* Linux connection track.
*
* A RCU lock is taken to prevent this callback
* from unregistering.
*/
typedef void (*sfe_sync_rule_callback_t)(struct sfe_connection_sync *);
/*
* IPv4 APIs used by connection manager
*/
int sfe_ipv4_recv(struct net_device *dev, struct sk_buff *skb);
int sfe_ipv4_create_rule(struct sfe_connection_create *sic);
void sfe_ipv4_destroy_rule(struct sfe_connection_destroy *sid);
void sfe_ipv4_destroy_all_rules_for_dev(struct net_device *dev);
void sfe_ipv4_register_sync_rule_callback(sfe_sync_rule_callback_t callback);
void sfe_ipv4_update_rule(struct sfe_connection_create *sic);
void sfe_ipv4_mark_rule(struct sfe_connection_mark *mark);
/*
* IPv6 APIs used by connection manager
*/
int sfe_ipv6_recv(struct net_device *dev, struct sk_buff *skb);
int sfe_ipv6_create_rule(struct sfe_connection_create *sic);
void sfe_ipv6_destroy_rule(struct sfe_connection_destroy *sid);
void sfe_ipv6_destroy_all_rules_for_dev(struct net_device *dev);
void sfe_ipv6_register_sync_rule_callback(sfe_sync_rule_callback_t callback);
void sfe_ipv6_update_rule(struct sfe_connection_create *sic);
void sfe_ipv6_mark_rule(struct sfe_connection_mark *mark);
/*
* sfe_ipv6_addr_equal()
* compare ipv6 address
*
* return: 1, equal; 0, no equal
*/
static inline int sfe_ipv6_addr_equal(struct sfe_ipv6_addr *a,
struct sfe_ipv6_addr *b)
{
return a->addr[0] == b->addr[0] &&
a->addr[1] == b->addr[1] &&
a->addr[2] == b->addr[2] &&
a->addr[3] == b->addr[3];
}
/*
* sfe_ipv4_addr_equal()
* compare ipv4 address
*
* return: 1, equal; 0, no equal
*/
#define sfe_ipv4_addr_equal(a, b) ((u32)(a) == (u32)(b))
/*
* sfe_addr_equal()
* compare ipv4 or ipv6 address
*
* return: 1, equal; 0, no equal
*/
static inline int sfe_addr_equal(sfe_ip_addr_t *a,
sfe_ip_addr_t *b, int is_v4)
{
return is_v4 ? sfe_ipv4_addr_equal(a->ip, b->ip) : sfe_ipv6_addr_equal(a->ip6, b->ip6);
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,232 @@
/*
* Copyright (c) 2013,2016 The Linux Foundation. All rights reserved.
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all copies.
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <netlink/genl/genl.h>
#include <netlink/genl/ctrl.h>
#include <errno.h>
#include <stdio.h>
#include <arpa/inet.h>
#include "fast-classifier.h"
static struct nl_sock *sock;
static struct nl_sock *sock_event;
static int family;
static int grp_id;
static struct nla_policy fast_classifier_genl_policy[FAST_CLASSIFIER_A_MAX + 1] = {
[FAST_CLASSIFIER_A_TUPLE] = { .type = NLA_UNSPEC },
};
void dump_fc_tuple(struct fast_classifier_tuple *fc_msg)
{
char src_str[INET_ADDRSTRLEN];
char dst_str[INET_ADDRSTRLEN];
printf("TUPLE: %d, %s, %s, %d, %d"
" SMAC=%02x:%02x:%02x:%02x:%02x:%02x",
" DMAC=%02x:%02x:%02x:%02x:%02x:%02x\n",
fc_msg->proto,
inet_ntop(AF_INET,
&fc_msg->src_saddr.in.s_addr,
src_str,
INET_ADDRSTRLEN),
inet_ntop(AF_INET,
&fc_msg->dst_saddr.in.s_addr,
dst_str,
INET_ADDRSTRLEN),
fc_msg->sport, fc_msg->dport,
fc_msg->smac[0], fc_msg->smac[1], fc_msg->smac[2],
fc_msg->smac[3], fc_msg->smac[4], fc_msg->smac[5],
fc_msg->dmac[0], fc_msg->dmac[1], fc_msg->dmac[2],
fc_msg->dmac[3], fc_msg->dmac[4], fc_msg->dmac[5]);
}
static int parse_cb(struct nl_msg *msg, void *arg)
{
struct nlmsghdr *nlh = nlmsg_hdr(msg);
struct genlmsghdr *gnlh = nlmsg_data(nlh);
struct nlattr *attrs[FAST_CLASSIFIER_A_MAX];
genlmsg_parse(nlh, 0, attrs, FAST_CLASSIFIER_A_MAX, fast_classifier_genl_policy);
switch (gnlh->cmd) {
case FAST_CLASSIFIER_C_OFFLOADED:
printf("Got a offloaded message\n");
dump_fc_tuple(nla_data(attrs[FAST_CLASSIFIER_A_TUPLE]));
return NL_OK;
case FAST_CLASSIFIER_C_DONE:
printf("Got a done message\n");
dump_fc_tuple(nla_data(attrs[FAST_CLASSIFIER_A_TUPLE]));
return NL_OK;
}
return NL_SKIP;
}
int fast_classifier_init(void)
{
int err;
sock = nl_socket_alloc();
if (!sock) {
printf("Unable to allocation socket.\n");
return -1;
}
genl_connect(sock);
sock_event = nl_socket_alloc();
if (!sock_event) {
nl_close(sock);
nl_socket_free(sock);
printf("Unable to allocation socket.\n");
return -1;
}
genl_connect(sock_event);
family = genl_ctrl_resolve(sock, FAST_CLASSIFIER_GENL_NAME);
if (family < 0) {
nl_close(sock_event);
nl_close(sock);
nl_socket_free(sock);
nl_socket_free(sock_event);
printf("Unable to resolve family\n");
return -1;
}
grp_id = genl_ctrl_resolve_grp(sock, FAST_CLASSIFIER_GENL_NAME,
FAST_CLASSIFIER_GENL_MCGRP);
if (grp_id < 0) {
printf("Unable to resolve mcast group\n");
return -1;
}
err = nl_socket_add_membership(sock_event, grp_id);
if (err < 0) {
printf("Unable to add membership\n");
return -1;
}
nl_socket_disable_seq_check(sock_event);
nl_socket_modify_cb(sock_event, NL_CB_VALID, NL_CB_CUSTOM, parse_cb, NULL);
return 0;
}
void fast_classifier_close(void)
{
nl_close(sock_event);
nl_close(sock);
nl_socket_free(sock_event);
nl_socket_free(sock);
}
void fast_classifier_ipv4_offload(unsigned char proto, unsigned long src_saddr,
unsigned long dst_saddr, unsigned short sport,
unsigned short dport)
{
struct nl_msg *msg;
int ret;
#ifdef DEBUG
char src_str[INET_ADDRSTRLEN];
char dst_str[INET_ADDRSTRLEN];
#endif
struct fast_classifier_tuple fc_msg;
#ifdef DEBUG
printf("DEBUG: would offload: %d, %s, %s, %d, %d\n", proto,
inet_ntop(AF_INET, &src_saddr, src_str, INET_ADDRSTRLEN),
inet_ntop(AF_INET, &dst_saddr, dst_str, INET_ADDRSTRLEN),
sport, dport);
#endif
fc_msg.proto = proto;
fc_msg.src_saddr.in.s_addr = src_saddr;
fc_msg.dst_saddr.in.s_addr = dst_saddr;
fc_msg.sport = sport;
fc_msg.dport = dport;
fc_msg.smac[0] = 'a';
fc_msg.smac[1] = 'b';
fc_msg.smac[2] = 'c';
fc_msg.smac[3] = 'd';
fc_msg.smac[4] = 'e';
fc_msg.smac[5] = 'f';
fc_msg.dmac[0] = 'f';
fc_msg.dmac[1] = 'e';
fc_msg.dmac[2] = 'd';
fc_msg.dmac[3] = 'c';
fc_msg.dmac[4] = 'b';
fc_msg.dmac[5] = 'a';
if (fast_classifier_init() < 0) {
printf("Unable to init generic netlink\n");
exit(1);
}
msg = nlmsg_alloc();
if (!msg) {
nl_socket_free(sock);
printf("Unable to allocate message\n");
return;
}
genlmsg_put(msg, NL_AUTO_PID, NL_AUTO_SEQ, family,
FAST_CLASSIFIER_GENL_HDRSIZE, NLM_F_REQUEST,
FAST_CLASSIFIER_C_OFFLOAD, FAST_CLASSIFIER_GENL_VERSION);
nla_put(msg, 1, sizeof(fc_msg), &fc_msg);
ret = nl_send_auto_complete(sock, msg);
nlmsg_free(msg);
if (ret < 0) {
printf("nlmsg_free failed");
nl_close(sock);
nl_socket_free(sock);
return;
}
ret = nl_wait_for_ack(sock);
if (ret < 0) {
printf("wait for ack failed");
nl_close(sock);
nl_socket_free(sock);
return;
}
}
void fast_classifier_listen_for_messages(void)
{
printf("waiting for netlink events\n");
while (1) {
nl_recvmsgs_default(sock_event);
}
}
int main(int argc, char *argv[])
{
if (fast_classifier_init() < 0) {
printf("Unable to init generic netlink\n");
exit(1);
}
fast_classifier_ipv4_offload('a', 0, 0, 0, 0);
/* this never returns */
fast_classifier_listen_for_messages();
fast_classifier_close();
return 0;
}

View File

@ -0,0 +1,70 @@
#
# 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:=20170823
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=net
CATEGORY:=Network
TITLE:=Powerful adblock module to block ad.
DEPENDS:=
URL:=http://www.adbyby.com/
endef
define Package/$(PKG_NAME)/description
Adbyby is a powerful adblock module to block ad,just like adblock.
endef
define Build/Prepare
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/share/adbyby
$(INSTALL_BIN) ./files/adbyby.sh $(1)/usr/share/adbyby/
$(INSTALL_BIN) ./files/adbybyfirst.sh $(1)/usr/share/adbyby/
$(INSTALL_BIN) ./files/adbybyupdate.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/
ifeq ($(ARCH),mipsel)
$(INSTALL_BIN) ./files/7620n/adbyby $(1)/usr/share/adbyby/
endif
ifeq ($(ARCH),mips)
$(INSTALL_BIN) ./files/ar71xx/adbyby $(1)/usr/share/adbyby/
endif
ifeq ($(ARCH),i386)
$(INSTALL_BIN) ./files/x86/adbyby $(1)/usr/share/adbyby/
endif
ifeq ($(ARCH),x86_64)
$(INSTALL_BIN) ./files/x86_64/adbyby $(1)/usr/share/adbyby/
endif
ifeq ($(ARCH),arm)
$(INSTALL_BIN) ./files/arm/adbyby $(1)/usr/share/adbyby/
endif
ifeq ($(ARCH),aarch64)
$(INSTALL_BIN) ./files/armv7/adbyby $(1)/usr/share/adbyby/
endif
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

Binary file not shown.

View File

@ -0,0 +1,16 @@
#!/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

View File

@ -0,0 +1,11 @@
#!/bin/sh
PROG_PATH=/usr/share/adbyby
if [ -z "$(dnsmasq --version | grep no-ipset)" ]; then
[ $(uci get adbyby.@adbyby[-1].wan_mode) -ne 2 ] && \
[ $(awk -F= '/^ipset/{print $2}' $PROG_PATH/adhook.ini) -eq 1 ] && \
{
sed -i 's/adbyby_list/adbyby_wan/' /tmp/adbyby_host.conf
echo conf-file=/tmp/adbyby_host.conf >> /etc/dnsmasq.conf
/etc/init.d/dnsmasq restart
}
fi

View File

@ -0,0 +1,11 @@
#!/bin/sh
PROG_PATH=/usr/share/adbyby
if [ -z "$(dnsmasq --version | grep no-ipset)" ]; then
[ $(uci get adbyby.@adbyby[-1].wan_mode) -ne 2 ] && \
[ $(awk -F= '/^ipset/{print $2}' $PROG_PATH/adhook.ini) -eq 1 ] && \
{
sed -i 's/adbyby_list/adbyby_wan/' /tmp/adbyby_host.conf
ipset -F adbyby_wan 2>/dev/null
/etc/init.d/dnsmasq restart
}
fi

View File

@ -0,0 +1,14 @@
[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.

View File

@ -0,0 +1,121 @@
//IE6、7、8、9, from adsafe
%USERPROFILE%\Local Settings\Temporary Internet Files\*.html
%USERPROFILE%\Local Settings\Temporary Internet Files\*.js
%USERPROFILE%\Local Settings\Temporary Internet Files\*.htm
%USERPROFILE%\Local Settings\Temporary Internet Files\*.xml
%USERPROFILE%\Local Settings\Temporary Internet Files\*.css
%USERPROFILE%\Local Settings\Temporary Internet Files\*.swf
%USERPROFILE%\Local Settings\Temporary Internet Files\*.flv
%USERPROFILE%\Local Settings\Temporary Internet Files\*.mp4
%USERPROFILE%\Local Settings\Temporary Internet Files\Content.IE5\*.*
%USERPROFILE%\AppData\Local\Microsoft\Windows\Temporary Internet Files\*.*
%USERPROFILE%\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5\*.*
//360安全浏览器
%USERPROFILE%\Application Data\360se\ie8data\Temporary Internet Files\*.*
//chrome
%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Cache\*.*
//360极速浏览器
%USERPROFILE%\Local Settings\Application Data\360Chrome\Chrome\User Data\Default\CacheIE\*.*
%USERPROFILE%\Local Settings\Application Data\360Chrome\Chrome\User Data\Default\Cache\*.*
%USERPROFILE%\AppData\Local\360Chrome\Chrome\User Data\Default\Cache\*.*
%USERPROFILE%\Local Settings\Application Data\360Chrome\Chrome\User Data\Default\CacheIE\Content.IE5\*.*
//搜狗浏览器
%USERPROFILE%\Application Data\SogouExplorer\Webkit\Default\Cache\*.*
%USERPROFILE%\AppData\Roaming\SogouExplorer\Webkit\Default\Cache\*.*
//opera浏览器
%USERPROFILE%\AppData\Local\Opera\Opera\cache\*.*
%USERPROFILE%\Local Settings\Application Data\Opera\Opera\cache\*.*
%USERPROFILE%\Local Settings\Application Data\Opera\Opera\application_cache\mcache\*.*
%USERPROFILE%\Local Settings\Application Data\Opera\Opera\application_cache\cache_groups.xml
%USERPROFILE%\Local Settings\Application Data\Opera\Opera\opcache\*.*
//淘宝浏览器
%USERPROFILE%\AppData\Local\TaoBrowser\User Data\Default\Cache\*.*
%USERPROFILE%\AppData\Local\TaoBrowser\User Data\Default\JumpListIcons\*.*
%USERPROFILE%\Local Settings\Application Data\TaoBrowser\User Data\Default\Cache\*.*
//百度浏览器
%USERPROFILE%\Application Data\Baidu\browser\DiskCache\*.*
%USERPROFILE%\AppData\Roaming\Baidu\browser\DiskCache\*.*
//猎豹浏览器
%USERPROFILE%\Local Settings\Application Data\liebao\User Data\Default\Cache\*.*
%USERPROFILE%\Local Settings\Application Data\liebao\User Data\iecache\Content.IE5\*.*
%USERPROFILE%\AppData\Local\liebao\User Data\Default\Cache\*.*
%USERPROFILE%\AppData\Local\liebao\User Data\Default\JumpListIcons\*.*
//Letv
%USERPROFILE%\Application Data\Letv\Logg\*.log
//PPSStream
%APPDATA%\PPStream\adsys\*.*
%APPDATA%\PPStream\banner\*.*
%APPDATA%\PPStream\notice\*.*
%APPDATA%\PPStream\CLCache\*.pld
%APPDATA%\PPStream\FDSCache\*.blf
//PPTV
%APPDATA%\PPLive\PPTV\cache\*.*
//风行
%USERPROFILE%\funshion\cache\*.*
//youku
-s%appdata%\Macromedia\Flash Player\#SharedObjects\YOUKU_FSO_PROXY.sol
-s%APPDATA%\Roaming\Macromedia\Flash Player\#SharedObjects\YOUKU_FSO_PROXY.sol
//letv
-s%appdata%\Macromedia\Flash Player\#SharedObjects\com.letv.sol
//iqiyi
-s%appdata%\Macromedia\Flash Player\#SharedObjects\qiyi_statistics.sol
//chrome YOUKU
-s%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\YOUKU_FSO_PROXY.sol
//chrome LeTv
-s%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\com.letv.sol
//chrome iqiyi
-s%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\qiyi_statistics.sol
//360 youku
-s%USERPROFILE%\AppData\Local\360Chrome\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\YOUKU_FSO_PROXY.sol
//360 letv
-s%USERPROFILE%\AppData\Local\360Chrome\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\com.letv.sol
//360 iqiyi
-s%USERPROFILE%\AppData\Local\360Chrome\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\qiyi_statistics.sol
//暴风影音5
%ALLUSERSPROFILE%\Baofeng\StormPlayer\Profiles\md\*.*
%ALLUSERSPROFILE%\Baofeng\StormPlayer\Profiles\vod\*.*
%ALLUSERSPROFILE%\Application Data\Baofeng\StormPlayer\Profiles\md\*.*
%ALLUSERSPROFILE%\Application Data\Baofeng\StormPlayer\Profiles\vod\*.*
%ALLUSERSPROFILE%\Baofeng\Application Data\StormPlayer\Profiles\md\*.*
%ALLUSERSPROFILE%\Baofeng\Application Data\StormPlayer\Profiles\vod\*.*
//pptv
%ALLUSERSPROFILE%\PPLive\PPTV\Cache\pluginad\*.*
%ALLUSERSPROFILE%\Application Data\PPLive\PPTV\Cache\pluginad\*.*
%ALLUSERSPROFILE%\Application Data\PPLive\PPTV\screensaver\*.*
//多米
C:\Program Files\DuoMi\dmdeskinfo.exe
//UUSEE
%TEMP%\UUFile\*.*
//iqiyi
%ALLUSERSPROFILE%\Application Data\Qiyi\qiyiclient\cache\*.*

View File

@ -0,0 +1,43 @@
//youku
-y%appdata%\Macromedia\Flash Player\#SharedObjects\YOUKU_FSO_PROXY.sol
//youku win7
-y%APPDATA%\Roaming\Macromedia\Flash Player\#SharedObjects\YOUKU_FSO_PROXY.sol
//chrome YOUKU
-y%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\YOUKU_FSO_PROXY.sol
//360 youku
-y%USERPROFILE%\AppData\Local\360Chrome\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\YOUKU_FSO_PROXY.sol
//sougou youku
-y%appdata%\SogouExplorer\Webkit\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\YOUKU_FSO_PROXY.sol
-y%userprofile%\Local Settings\Application Data\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\YOUKU_FSO_PROXY.sol
-y%userprofile%\Local Settings\Application Data\UCBrowser\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\YOUKU_FSO_PROXY.sol
-y%userprofile%\Local Settings\Application Data\360Chrome\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\YOUKU_FSO_PROXY.sol
//qq
%appdata%\Tencent\QQ\Misc\com.tencent.advertisement\*.*
%appdata%\Tencent\QQ\Misc\com.tencent.advertisement\GDT_0\*.*
//letv
-s%appdata%\Macromedia\Flash Player\#SharedObjects\com.letv.sol
//letv1
-s%APPDATA%\Roaming\Macromedia\Flash Player\#SharedObjects\com.letv.sol
//iqiyi
-s%appdata%\Macromedia\Flash Player\#SharedObjects\qiyi_statistics.sol
//iqiyi1
-s%APPDATA%\Roaming\Macromedia\Flash Player\#SharedObjects\qiyi_statistics.sol
//chrome LeTv
-s%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\com.letv.sol
//chrome iqiyi
-s%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\qiyi_statistics.sol
//360 letv
-s%USERPROFILE%\AppData\Local\360Chrome\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\com.letv.sol
//360 iqiyi
-s%USERPROFILE%\AppData\Local\360Chrome\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\qiyi_statistics.sol

Binary file not shown.

View File

@ -0,0 +1 @@
! -----更新时间: 2017-1-2 00:12:25 by:xwhyc-----

View File

@ -0,0 +1,15 @@
! ------------------------------ ADByby 自定义过滤语法简表---------------------------------
! -------------- 规则基于abp规则并进行了字符替换部分的扩展-----------------------------
! ABP规则请参考https://adblockplus.org/zh_CN/filters下面为大致摘要
! "!" 为行注释符,注释行以该符号起始作为一行注释语义,用于规则描述
! "*" 为字符通配符能够匹配0长度或任意长度的字符串该通配符不能与正则语法混用。
! "^" 为分隔符,可以是除了字母、数字或者 _ - . % 之外的任何字符。
! "|" 为管线符号,来表示地址的最前端或最末端
! "||" 为子域通配符,方便匹配主域名下的所有子域。
! "~" 为排除标识符,通配符能过滤大多数广告,但同时存在误杀, 可以通过排除标识符修正误杀链接。
! "##" 为元素选择器标识符后面跟需要隐藏元素的CSS样式例如 #ad_id .ad_class
!! 元素隐藏暂不支持全局规则和排除规则
!! 字符替换扩展
! 文本替换选择器标识符,后面跟需要替换的文本数据,格式:$s@模式字符串@替换后的文本@
! 支持通配符*和?
! -------------------------------------------------------------------------------------------

View File

View File

@ -0,0 +1,17 @@
! -----更新时间: 2016-12-31 23:40:12 by:xwhyc-----------------------------------------------
! -----广告反馈:http://www.adbyby.com/help.htm QQ群: 79547134(满), 364066294(满)470705224534897434,438394572--------------
!-------------------------------------------
!-----------------------
!---------adbyby---------
!|http://bbs.kafan.cn/$s@</head>@</head><script>document.cookie="r6pb_69df_widthauto=1;domain=kafan.cn";</script>@
thegreatdaily.com/cat##.col-lg-8.col-md-8{width:1190px;}
!www.baidu.com,news.baidu.com###content_right,[srcid="6835"],[class="result-op xpath-log"]
!www.baidu.com,news.baidu.com###content_left,.c-container,.result{width:860px}.c-span-last{width:720px}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,10 @@
;¸üйæÔò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

View File

@ -0,0 +1,9 @@
{+fast-redirects{s@&plid=\d+&uid=@&plid=7038006&uid=@} }
hot.vrs.sohu.com/vrs_flash.action\?vid=
{+fast-redirects{s@/Main.swf\?(?!plid)@/Main.swf?plid=7038006&@} }
tv.sohu.com/upload/swf/201.*?/Main.swf\?
{+fast-redirects{s@http://tv.sohu.com/upload/swf/.*?/PlayerShell.swf@http://update.adbyby.com/swf/sohu_livezb.swf@} }
tv.sohu.com/upload/swf/.*?/PlayerShell.swf\?
{+fast-redirects{s@pl.youku.com/playlist/m3u8\?keyframe=0&.*@update.adbyby.com/youku.m3u8@} }
pl.youku.com/playlist/m3u8\?keyframe=0&

Binary file not shown.

Binary file not shown.

108
package/lean/amule/Makefile Normal file
View File

@ -0,0 +1,108 @@
#
# Copyright (C) 2007-2009 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:=aMule
PKG_VERSION:=2.3.2
PKG_RELEASE:=2
PKG_REV=4b87b20
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-r$(PKG_REV).tar.bz2
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_SOURCE_URL:=https://github.com/amule-project/amule.git
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_DEPENDS:=libgd libcryptopp
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
define Package/amule/config
config AMULE_CRYPTOPP_STATIC_LINKING
bool "Link libcryptopp statically"
default y
endef
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 \
$(ICONV_DEPENDS) $(INTL_DEPENDS) +!AMULE_CRYPTOPP_STATIC_LINKING:libcryptopp
endef
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
TARGET_LDFLAGS += -liconv
define Build/Configure
cd $(PKG_BUILD_DIR) && sh ./autogen.sh
$(call Build/Configure/Default)
endef
ifeq ($(CONFIG_AMULE_CRYPTOPP_STATIC_LINKING),y)
SED_CMD:=sed
else
SED_CMD:=true
endif
define Build/Compile
$(SED_CMD) -i 's;^CRYPTOPP_LIBS.*;CRYPTOPP_LIBS \= "$(STAGING_DIR)/usr/lib/libcryptopp.a";g' \
$(PKG_BUILD_DIR)/src/Makefile
$(MAKE) -C $(PKG_BUILD_DIR) \
HOSTCC="$(HOSTCC)" \
DESTDIR="$(PKG_INSTALL_DIR)" \
all
endef
define Package/amule/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_DIR) $(1)/usr/share/amule/webserver
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/amule{cmd,d} $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/webserver/src/amuleweb $(1)/usr/bin/
$(CP) $(PKG_BUILD_DIR)/src/webserver/default $(1)/usr/share/amule/webserver
endef
$(eval $(call BuildPackage,amule))

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,23 @@
diff -Naur a/m4/libupnp.m4 b/m4/libupnp.m4
--- a/m4/libupnp.m4 2016-10-06 19:01:54.000000000 +0800
+++ b/m4/libupnp.m4 2016-10-11 07:36:39.198318574 +0800
@@ -52,7 +52,6 @@
[export PKG_CONFIG_PATH=$withval/lib/pkgconfig])
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], [
@@ -79,11 +78,6 @@
])
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])

View File

@ -0,0 +1,78 @@
diff --git a/src/amule.h b/src/amule.h
index f25702f..240c02d 100644
--- a/src/amule.h
+++ b/src/amule.h
@@ -553,6 +553,13 @@ class CamuleDaemonApp : public CamuleApp
int OnExit();
virtual int InitGui(bool geometry_enable, wxString &geometry_string);
+ // The GTK wxApps sets its file name conversion properly
+ // in wxApp::Initialize(), while wxAppConsole::Initialize()
+ // does not, leaving wxConvFile being set to wxConvLibc. File
+ // name conversion should be set otherwise amuled will abort to
+ // handle non-ASCII file names which monolithic amule can handle.
+ // This function are overrided to perform this.
+ virtual bool Initialize(int& argc_, wxChar **argv_);
#ifdef AMULED_APPTRAITS
struct sigaction m_oldSignalChildAction;
diff --git a/src/amuled.cpp b/src/amuled.cpp
index 486da59..86e1ff8 100644
--- a/src/amuled.cpp
+++ b/src/amuled.cpp
@@ -704,6 +704,41 @@ int CamuleDaemonApp::InitGui(bool ,wxString &)
return 0;
}
+bool CamuleDaemonApp::Initialize(int& argc_, wxChar **argv_)
+{
+ if ( !wxAppConsole::Initialize(argc_, argv_) ) {
+ return false;
+ }
+
+#ifdef __UNIX__
+ wxString encName;
+#if wxUSE_INTL
+ // if a non default locale is set,
+ // assume that the user wants his
+ // filenames in this locale too
+ encName = wxLocale::GetSystemEncodingName().Upper();
+
+ // But don't consider ASCII in this case.
+ if ( !encName.empty() ) {
+ if ( encName == wxT("US-ASCII") ) {
+ // This means US-ASCII when returned
+ // from GetEncodingFromName().
+ encName.clear();
+ }
+ }
+#endif // wxUSE_INTL
+
+ // in this case, UTF-8 is used by default.
+ if ( encName.empty() ) {
+ encName = wxT("UTF-8");
+ }
+
+ static wxConvBrokenFileNames fileconv(encName);
+ wxConvFileName = &fileconv;
+#endif // __UNIX__
+
+ return true;
+}
int CamuleDaemonApp::OnExit()
{
diff --git a/src/libs/common/Path.cpp b/src/libs/common/Path.cpp
index 28152a2..5efefd0 100644
--- a/src/libs/common/Path.cpp
+++ b/src/libs/common/Path.cpp
@@ -229,7 +229,8 @@ CPath::CPath(const wxString& filename)
}
wxCharBuffer fn = filename2char(filename);
- if (fn.data()) {
+ // add fn.length() for wx 3.x
+ if (fn.data()) {
// Filename is valid in the current locale. This means that
// it either originated from a (wx)system-call, or from a
// user with a properly setup system.

View File

@ -0,0 +1,174 @@
diff --git a/src/SearchList.cpp b/src/SearchList.cpp
index 32b28e9..342a18f 100644
--- a/src/SearchList.cpp
+++ b/src/SearchList.cpp
@@ -75,7 +75,7 @@ void ParsedSearchExpression(const CSearchExpr* pexpr)
int iOpNot = 0;
for (unsigned int i = 0; i < pexpr->m_aExpr.GetCount(); i++) {
- wxString str(pexpr->m_aExpr[i]);
+ const wxString& str = pexpr->m_aExpr[i];
if (str == SEARCHOPTOK_AND) {
iOpAnd++;
} else if (str == SEARCHOPTOK_OR) {
@@ -108,6 +108,25 @@ void ParsedSearchExpression(const CSearchExpr* pexpr)
// optimize search expression, if no OR nor NOT specified
if (iOpAnd > 0 && iOpOr == 0 && iOpNot == 0) {
+ // figure out if we can use a better keyword than the one the user selected
+ // for example most user will search like this "The oxymoronaccelerator 2", which would ask the node which indexes "the"
+ // This causes higher traffic for such nodes and makes them a viable target to attackers, while the kad result should be
+ // the same or even better if we ask the node which indexes the rare keyword "oxymoronaccelerator", so we try to rearrange
+ // keywords and generally assume that the longer keywords are rarer
+ if (/*thePrefs::GetRearrangeKadSearchKeywords() &&*/ !s_strCurKadKeyword.IsEmpty()) {
+ for (unsigned int i = 0; i < pexpr->m_aExpr.GetCount(); i++) {
+ if (pexpr->m_aExpr[i] != SEARCHOPTOK_AND) {
+ if (pexpr->m_aExpr[i] != s_strCurKadKeyword
+ && pexpr->m_aExpr[i].find_first_of(Kademlia::CSearchManager::GetInvalidKeywordChars()) == wxString::npos
+ && pexpr->m_aExpr[i].Find('"') != 0 // no quoted expressions as keyword
+ && pexpr->m_aExpr[i].length() >= 3
+ && s_strCurKadKeyword.length() < pexpr->m_aExpr[i].length())
+ {
+ s_strCurKadKeyword = pexpr->m_aExpr[i];
+ }
+ }
+ }
+ }
wxString strAndTerms;
for (unsigned int i = 0; i < pexpr->m_aExpr.GetCount(); i++) {
if (pexpr->m_aExpr[i] != SEARCHOPTOK_AND) {
@@ -285,7 +304,7 @@ void CSearchList::RemoveResults(long searchID)
}
-wxString CSearchList::StartNewSearch(uint32* searchID, SearchType type, const CSearchParams& params)
+wxString CSearchList::StartNewSearch(uint32* searchID, SearchType type, CSearchParams& params)
{
// Check that we can actually perform the specified desired search.
if ((type == KadSearch) && !Kademlia::CKademlia::IsRunning()) {
@@ -306,6 +325,16 @@ wxString CSearchList::StartNewSearch(uint32* searchID, SearchType type, const CS
m_resultType.Clear();
}
+ if (type == KadSearch) {
+ Kademlia::WordList words;
+ Kademlia::CSearchManager::GetWords(params.searchString, &words);
+ if (!words.empty()) {
+ params.strKeyword = words.front();
+ } else {
+ return _("No keyword for Kad search - aborting");
+ }
+ }
+
bool supports64bit = type == KadSearch ? true : theApp->serverconnect->GetCurrentServer() != NULL && (theApp->serverconnect->GetCurrentServer()->GetTCPFlags() & SRV_TCPFLG_LARGEFILES);
bool packetUsing64bit;
@@ -332,8 +361,7 @@ wxString CSearchList::StartNewSearch(uint32* searchID, SearchType type, const CS
// searchstring will get tokenized there
// The tab must be created with the Kad search ID, so searchID is updated.
- Kademlia::CSearch* search = Kademlia::CSearchManager::PrepareFindKeywords(
- params.searchString, data->GetLength(), data->GetRawBuffer(), *searchID);
+ Kademlia::CSearch* search = Kademlia::CSearchManager::PrepareFindKeywords(params.strKeyword, data->GetLength(), data->GetRawBuffer(), *searchID);
*searchID = search->GetSearchID();
m_currentSearch = *searchID;
@@ -632,7 +660,7 @@ void CSearchList::StopSearch(bool globalOnly)
}
-CSearchList::CMemFilePtr CSearchList::CreateSearchData(const CSearchParams& params, SearchType WXUNUSED(type), bool supports64bit, bool& packetUsing64bit)
+CSearchList::CMemFilePtr CSearchList::CreateSearchData(CSearchParams& params, SearchType type, bool supports64bit, bool& packetUsing64bit)
{
// Count the number of used parameters
unsigned int parametercount = 0;
@@ -659,14 +687,16 @@ CSearchList::CMemFilePtr CSearchList::CreateSearchData(const CSearchParams& para
_astrParserErrors.Empty();
_SearchExpr.m_aExpr.Empty();
+ s_strCurKadKeyword.Clear();
+ if (type == KadSearch) {
+ wxASSERT( !params.strKeyword.IsEmpty() );
+ s_strCurKadKeyword = params.strKeyword;
+ }
+
LexInit(params.searchString);
int iParseResult = yyparse();
LexFree();
-#ifdef __DEBUG__
- AddLogLineNS(CFormat(wxT("Search parsing result for \"%s\": %i"))
- % params.searchString % iParseResult);
-#endif
if (_astrParserErrors.GetCount() > 0) {
for (unsigned int i=0; i < _astrParserErrors.GetCount(); ++i) {
AddLogLineNS(CFormat(wxT("Error %u: %s\n")) % i % _astrParserErrors[i]);
@@ -681,21 +711,13 @@ CSearchList::CMemFilePtr CSearchList::CreateSearchData(const CSearchParams& para
return CMemFilePtr(NULL);
}
- #ifdef __DEBUG__
- wxString mes(wxT("Search expression:"));
- for (unsigned int i = 0; i < _SearchExpr.m_aExpr.GetCount(); i++) {
- mes << wxT(" ") << _SearchExpr.m_aExpr[i];
+ if (type == KadSearch && s_strCurKadKeyword != params.strKeyword) {
+ AddDebugLogLineN(logSearch, CFormat(wxT("Keyword was rearranged, using '%s' instead of '%s'")) % s_strCurKadKeyword % params.strKeyword);
+ params.strKeyword = s_strCurKadKeyword;
}
- AddLogLineNS(mes);
- AddLogLineNS(CFormat(wxT("Expression count: %i")) % _SearchExpr.m_aExpr.GetCount());
- #endif
parametercount += _SearchExpr.m_aExpr.GetCount();
- #ifdef __DEBUG__
- AddLogLineNS(CFormat(wxT("Parameters: %i")) % parametercount);
- #endif
-
/* Leave the unicode comment there, please... */
CSearchExprTarget target(data.get(), true /*I assume everyone is unicoded */ ? utf8strRaw : utf8strNone, supports64bit, packetUsing64bit);
diff --git a/src/SearchList.h b/src/SearchList.h
index 35b0fc6..6db7508 100644
--- a/src/SearchList.h
+++ b/src/SearchList.h
@@ -64,6 +64,8 @@ class CSearchList : public wxEvtHandler
//! The actual string to search for.
wxString searchString;
+ //! The keyword selected for Kad search
+ wxString strKeyword;
//! The type of files to search for (may be empty), one of ED2KFTSTR_*
wxString typeText;
//! The filename extension. May be empty.
@@ -90,7 +92,7 @@ class CSearchList : public wxEvtHandler
* @param params The search parameters, see CSearchParams.
* @return An empty string on success, otherwise an error-message.
*/
- wxString StartNewSearch(uint32* searchID, SearchType type, const CSearchParams& params);
+ wxString StartNewSearch(uint32* searchID, SearchType type, CSearchParams& params);
/** Stops the current search (global or Kad), if any is in progress. */
void StopSearch(bool globalOnly = false);
@@ -189,7 +191,7 @@ class CSearchList : public wxEvtHandler
typedef std::auto_ptr<CMemFile> CMemFilePtr;
/** Create a basic search-packet for the given search-type. */
- CMemFilePtr CreateSearchData(const CSearchParams& params, SearchType type, bool supports64bit, bool& packetUsing64bit);
+ CMemFilePtr CreateSearchData(CSearchParams& params, SearchType type, bool supports64bit, bool& packetUsing64bit);
//! Timer used for global search intervals.
diff --git a/src/kademlia/kademlia/SearchManager.cpp b/src/kademlia/kademlia/SearchManager.cpp
index e7f25d4..f9ee924 100644
--- a/src/kademlia/kademlia/SearchManager.cpp
+++ b/src/kademlia/kademlia/SearchManager.cpp
@@ -127,7 +127,7 @@ CSearch* CSearchManager::PrepareFindKeywords(const wxString& keyword, uint32_t s
wxString wstrKeyword = s->m_words.front();
- AddLogLineNS(CFormat(_("Keyword for search: %s")) % wstrKeyword);
+ AddDebugLogLineN(logSearch, CFormat(wxT("Keyword for search: %s")) % wstrKeyword);
// Kry - I just decided to assume everyone is unicoded
// GonoszTopi - seconded

View File

@ -0,0 +1,37 @@
#
# Copyright (C) 2010-2011 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:=automount
PKG_VERSION:=1
PKG_RELEASE:=14
PKG_ARCH:=all
include $(INCLUDE_DIR)/package.mk
define Package/automount
SECTION:=net
CATEGORY:=Network
TITLE:=Mount autoconfig hotplug script.
MAINTAINER:=Lean
DEPENDS:=block-mount +kmod-usb-storage +kmod-usb-storage-extras +kmod-fs-ext4 +kmod-fs-vfat +kmod-fs-exfat +ntfs-3g
endef
define Package/automount/description
A usb autoconfig hotplug script.
endef
define Build/Compile
endef
define Package/automount/install
$(INSTALL_DIR) $(1)/etc/hotplug.d/block
$(INSTALL_BIN) ./files/15-automount $(1)/etc/hotplug.d/block/15-automount
endef
$(eval $(call BuildPackage,automount))

View File

@ -0,0 +1,29 @@
#!/bin/sh
# Copyright (C) 2015 OpenWrt.org
# 0 yes blockdevice handles this - 1 no it is not there
(ls /etc/uci-defaults £ü grep fstab > /dev/null 2>&1) && sleep 10
blkdev=`dirname $DEVPATH`
basename=`basename $blkdev`
device=`basename $DEVPATH`
skip=`block info | sed 's/\(.*\): .*/\1/' | grep -q $device ; echo $?`
path=$DEVPATH
if [ $basename != "block" ] && [ -z "${device##sd*}" ] && [ $skip -eq 1 ]; then
mntpnt=$device
case "$ACTION" in
add)
mkdir -p /mnt/$mntpnt
# Try to be gentle on solid state devices
mount -o rw,noatime,discard /dev/$device /mnt/$mntpnt
;;
remove)
# Once the device is removed, the /dev entry disappear. We need mountpoint
mountpoint=`mount |grep /dev/$device | sed 's/.* on \(.*\) type.*/\1/'`
umount -l $mountpoint
;;
esac
fi

View File

@ -0,0 +1,37 @@
#
# Copyright (C) 2010-2011 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:=autosamba
PKG_VERSION:=1
PKG_RELEASE:=8
PKG_ARCH:=all
include $(INCLUDE_DIR)/package.mk
define Package/autosamba
SECTION:=net
CATEGORY:=Network
TITLE:=Samba autoconfig hotplug script.
MAINTAINER:=Lean
DEPENDS:=+luci-app-samba
endef
define Package/autosamba/description
A hotplug script to config Samba share automatically.
endef
define Build/Compile
endef
define Package/autosamba/install
$(INSTALL_DIR) $(1)/etc/hotplug.d/block
$(INSTALL_BIN) ./files/20-smb $(1)/etc/hotplug.d/block/20-smb
endef
$(eval $(call BuildPackage,autosamba))

View File

@ -0,0 +1,105 @@
#!/bin/sh
#
# D-Team Technology Co.,Ltd. ShenZhen
# 作者:Vic
#
#
# 警告:对着屏幕的哥们,我们允许你使用此脚本,但不允许你抹去作者的信息,请保留这段话。
#
. /lib/functions.sh
. /lib/functions/service.sh
global=0
config_file="/etc/config/samba"
wait_for_init() {
for i in `seq 30`
do
[ -e /tmp/procd.done ] || {
sleep 1; continue;
}
return
done
}
smb_handle() {
config_get path $1 path
if [ "$path" = "$2" ] ;then
global=1
fi
}
chk_en() {
config_get_bool autoshare $1 autoshare 1
[ $autoshare -eq 0 ] && exit
}
config_load samba
config_foreach chk_en samba
device=`basename $DEVPATH`
case "$ACTION" in
add)
case "$device" in
sd*) ;;
md*) ;;
hd*);;
mmcblk*);;
*) return;;
esac
path="/dev/$device"
wait_for_init
cat /proc/mounts | while read j
do
str=${j%% *}
if [ "$str" == $path ];then
strr=${j#* }
target=${strr%% *}
global=0
config_foreach smb_handle sambashare $target
name=${target#*/mnt/}
if [ $global -eq 0 ] ;then
echo -e "\n\nconfig sambashare" >> $config_file
echo -e "\toption auto '1'" >> $config_file
echo -e "\toption name '$name'" >> $config_file
echo -e "\toption path '$target'" >> $config_file
echo -e "\toption read_only 'no'" >> $config_file
echo -e "\toption guest_ok 'yes'" >> $config_file
echo -e "\toption create_mask '0666'" >> $config_file
echo -e "\toption dir_mask '0777'" >> $config_file
echo -e "\toption device '$device'" >> $config_file
/etc/init.d/samba reload
return
fi
fi
done
;;
remove)
i=0
while true
do
dev=`uci get samba.@sambashare[$i].device`
[ $? -ne 0 ] && break
[ "$dev" = "$device" ] && {
auto=`uci get samba.@sambashare[$i].auto`
[ $auto = "1" ] && {
mount_dir=`uci get samba.@sambashare[$i].name`
rm -rf /mnt/$device /mnt/$mount_dir
uci delete samba.@sambashare[$i]
uci commit
/etc/init.d/samba reload
return
}
}
let i+=1
done
;;
esac

View File

@ -0,0 +1,48 @@
#
# Copyright (C) 2016-2017 GitHub
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=default-settings
PKG_VERSION:=1.0
PKG_RELEASE:=21
PKG_LICENSE:=GPLv3
PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/default-settings
SECTION:=luci
CATEGORY:=LuCI
TITLE:=LuCI support for Default Settings
PKGARCH:=all
endef
define Package/default-settings/description
Language Support Packages.
endef
define Build/Prepare
$(foreach po,$(wildcard ${CURDIR}/i18n/*.po), \
po2lmo $(po) $(PKG_BUILD_DIR)/$(patsubst %.po,%.lmo,$(notdir $(po)));)
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/default-settings/install
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DATA) $(PKG_BUILD_DIR)/*.lmo $(1)/usr/lib/lua/luci/i18n/
$(INSTALL_BIN) ./files/zzz-default-settings $(1)/etc/uci-defaults/99-default-settings
endef
$(eval $(call BuildPackage,default-settings))

View File

@ -0,0 +1,57 @@
#!/bin/sh
uci set luci.main.lang=zh_cn
uci commit luci
uci set system.@system[0].hostname=LEDE
uci set system.@system[0].timezone=CST-8
uci set system.@system[0].zonename=Asia/Shanghai
uci commit system
uci set fstab.@global[0].anon_mount=1
uci commit fstab
rm -f /usr/lib/lua/luci/view/admin_status/index/mwan.htm
rm -f /usr/lib/lua/luci/view/admin_status/index/upnp.htm
rm -f /usr/lib/lua/luci/view/admin_status/index/ddns.htm
rm -f /usr/lib/lua/luci/view/admin_status/index/minidlna.htm
sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/aria2.lua
sed -i 's/services/nas/g' /usr/lib/lua/luci/view/aria2/overview_status.htm
sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/hd_idle.lua
sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/samba.lua
sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/minidlna.lua
sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/transmission.lua
sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/mjpg-streamer.lua
sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/p910nd.lua
sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/usb_printer.lua
sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/xunlei.lua
[ ! -f /usr/bin/ip ] && ln -sf /sbin/ip /usr/bin/ip
(opkg list-installed | grep ip-full >/dev/null 2>&1) && ln -sf /usr/sbin/ip /usr/bin/ip
rm -rf /tmp/luci-modulecache/
rm -f /tmp/luci-indexcache
sed -i 's/downloads.openwrt.org/openwrt.proxy.ustclug.org/g' /etc/opkg/distfeeds.conf
sed -i 's/root::0:0:99999:7:::/root:$1$V4UetPzk$CYXluq4wUazHjmCDBCqXF.:0:0:99999:7:::/g' /etc/shadow
sed -i "s/# //g" /etc/opkg/distfeeds.conf
sed -i '/REDIRECT --to-ports 53/d' /etc/firewall.user
echo "iptables -t nat -A PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 53" >> /etc/firewall.user
echo "iptables -t nat -A PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports 53" >> /etc/firewall.user
sed -i '/option disabled/d' /etc/config/wireless
sed -i '/set wireless.radio${devidx}.disabled/d' /lib/wifi/mac80211.sh
wifi up
sed -i '/DISTRIB_REVISION/d' /etc/openwrt_release
echo "DISTRIB_REVISION='R7.4 By Lean'" >> /etc/openwrt_release
sed -i '/DISTRIB_DESCRIPTION/d' /etc/openwrt_release
echo "DISTRIB_DESCRIPTION='LEDE 17.01.2'" >> /etc/openwrt_release
exit 0

View File

@ -0,0 +1,102 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "Action"
msgstr "动作"
msgid "Advanced Reboot"
msgstr "双分区启动切换"
msgid "Alternative"
msgstr "备选"
msgid "Cancel"
msgstr "取消"
msgid "Confirm"
msgstr "确定"
msgid "Current"
msgstr "当前"
msgid "Firmware/OS (Kernel)"
msgstr "固件/系统 (内核)"
msgid "Partition"
msgstr "分区"
msgid "Partitions"
msgstr "分区"
msgid "Perform power off..."
msgstr "点击关机..."
msgid "Power Off Device"
msgstr "关闭设备"
msgid "Proceed"
msgstr "处理"
msgid "Reboot Device to an Alternative Partition"
msgstr "重启设备到备选分区"
msgid "Reboot to alternative partition..."
msgstr "重启到备选分区"
msgid "Reboot to current partition"
msgstr "重启到当前分区"
msgid "Rebooting..."
msgstr "正在重启..."
msgid "Shutting down..."
msgstr "正在关闭..."
msgid "Status"
msgstr "状态"
msgid ""
"The system is rebooting now.<br /> DO NOT POWER OFF THE DEVICE!<br /> Wait a "
"few minutes before you try to reconnect. It might be necessary to renew the "
"address of your computer to reach the device again, depending on your "
"settings."
msgstr ""
msgid ""
"The system is rebooting to an alternative partition now.<br /> DO NOT POWER "
"OFF THE DEVICE!<br /> Wait a few minutes before you try to reconnect. It "
"might be necessary to renew the address of your computer to reach the device "
"again, depending on your settings."
msgstr ""
msgid ""
"The system is shutting down now.<br /> DO NOT POWER OFF THE DEVICE!<br /> It "
"might be necessary to renew the address of your computer to reach the device "
"again, depending on your settings."
msgstr ""
msgid ""
"WARNING: An alternative partition might have its own settings and completely "
"different firmware.<br /><br /> As your network configuration and WiFi SSID/"
"password on alternative partition might be different, you might have to "
"adjust your computer settings to be able to access your device once it "
"reboots.<br /><br /> Please also be aware that alternative partition "
"firmware might not provide an easy way to switch active partition and boot "
"back to the currently active partition.<br /><br /> Click \"Proceed\" below "
"to reboot device to an alternative partition."
msgstr ""
msgid ""
"WARNING: Power off might result in a reboot on a device which doesn't "
"support power off.<br /><br /> Click \"Proceed\" below to power off your "
"device."
msgstr ""
msgid "Warning: There are unsaved changes that will get lost on reboot!"
msgstr "警告:某些设置没有保存,重启将导致丢失这些配置!"
msgid "Warning: This system does not have two partitions!"
msgstr "警告:当前系统没有包括两个分区!"
msgid "Warning: This system does not support powering off!"
msgstr "警告:本系统不支持软关机!"

View File

@ -0,0 +1,10 @@
msgid "Processor"
msgstr "处理器"
msgid "Architecture"
msgstr "架构"
msgid "CPU Temperature"
msgstr "CPU温度"

View File

@ -0,0 +1,563 @@
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Last-Translator: Hsing-Wang Liao <kuoruan@gmail.com>\n"
msgid "%d hour"
msgstr "%d 小时"
msgid "%d minute"
msgstr "%d 分钟"
msgid "%d minutes"
msgstr "%d 分钟"
msgid "%d second"
msgstr "%d 秒"
msgid "%d seconds"
msgstr "%d 秒"
msgid ""
"Acceptable values: 1-100. This many Tracking IP addresses must respond for "
"the link to be deemed up"
msgstr ""
"取值范围: 1-100。这个设置项指定了当多少个 IP 地址能够连通时接口会被认为在线"
msgid "Acceptable values: 1-1000. Defaults to 1 if not set"
msgstr "取值范围: 1-100。如果不填写默认值为 1"
msgid "Advanced"
msgstr "高级"
msgid "Check IP rules"
msgstr "检查 IP 规则"
msgid "Check routing table"
msgstr "检查路由表"
msgid "Collecting data..."
msgstr "正在收集数据..."
msgid "Configuration"
msgstr "配置"
msgid "Currently Configured Interfaces"
msgstr "当前配置的接口"
msgid "Currently Configured Members"
msgstr "当前配置的成员"
msgid "Currently Configured Policies"
msgstr "当前配置的策略"
msgid "Destination address"
msgstr "目标地址"
msgid "Destination port"
msgstr "目标端口"
msgid "Detailed Status"
msgstr "详细状态"
msgid "Diagnostic Results"
msgstr "诊断结果"
msgid "Diagnostics"
msgstr "诊断"
msgid "Disabled"
msgstr "禁用"
msgid ""
"Downed interface will be deemed up after this many successful ping tests"
msgstr "当 Ping 成功次数达到这个数值后,已经被认为离线的接口将会重新上线"
msgid "Enabled"
msgstr "启用"
msgid "Error collecting troubleshooting information"
msgstr "收集故障排除信息时出错"
msgid "Errors"
msgstr "错误"
msgid "Failure interval"
msgstr "故障检测间隔"
msgid "Flush conntrack table"
msgstr "刷新连接跟踪表"
msgid "Flush global firewall conntrack table on interface events"
msgstr "在接口事件触发时刷新全局防火墙连接跟踪表"
msgid "Hotplug Script"
msgstr "Hotplug 脚本"
msgid "Hotplug ifdown"
msgstr "Hotplug ifdown"
msgid "Hotplug ifup"
msgstr "Hotplug ifup"
msgid "IPset"
msgstr "IPset"
msgid "IPv4"
msgstr "IPv4"
msgid "IPv6"
msgstr "IPv6"
msgid "Interface"
msgstr "接口"
msgid "Interface Status"
msgstr "接口状态"
msgid "Interface down"
msgstr "接口离线"
msgid "Interface up"
msgstr "接口上线"
msgid "Interface will be deemed down after this many failed ping tests"
msgstr "当 Ping 失败次数达到这个数值后接口会被认为离线"
msgid "Interfaces"
msgstr "接口"
msgid "Internet Protocol"
msgstr "互联网协议"
msgid "Last 50 MWAN systemlog entries. Newest entries sorted at the top :"
msgstr "最近 50 条 MWAN 系统日志,最新条目排在顶部:"
msgid "Last resort"
msgstr "备用成员"
msgid "Load Balancing"
msgstr "负载均衡"
msgid "Loading"
msgstr "载入中"
msgid "MWAN Config"
msgstr "MWAN 配置文件"
msgid "MWAN Detailed Status"
msgstr "MWAN 详细状态"
msgid "MWAN Interface Configuration"
msgstr "MWAN 接口配置"
msgid "MWAN Interface Configuration - %s"
msgstr "MWAN 接口配置 - %s"
msgid "MWAN Interface Diagnostics"
msgstr "MWAN 接口诊断"
msgid "MWAN Interface Live Status"
msgstr "MWAN 接口实时状态"
msgid "MWAN Interface Systemlog"
msgstr "MWAN 接口系统日志"
msgid "MWAN Member Configuration"
msgstr "MWAN 成员配置"
msgid "MWAN Member Configuration - %s"
msgstr "MWAN 成员配置 - %s"
msgid "MWAN Policy Configuration"
msgstr "MWAN 策略配置"
msgid "MWAN Policy Configuration - %s"
msgstr "MWAN 策略配置 - %s"
msgid "MWAN Rule Configuration"
msgstr "MWAN 规则配置"
msgid "MWAN Rule Configuration - %s"
msgstr "MWAN 规则配置 - %s"
msgid "MWAN Service Control"
msgstr "MWAN 服务控制"
msgid ""
"MWAN supports up to 250 physical and/or logical interfaces<br />MWAN "
"requires that all interfaces have a unique metric configured in /etc/config/"
"network<br />Names must match the interface name found in /etc/config/"
"network (see advanced tab)<br />Names may contain characters A-Z, a-z, 0-9, "
"_ and no spaces<br />Interfaces may not share the same name as configured "
"members, policies or rules"
msgstr ""
"MWAN 支持最多 250 个物理或逻辑接口。<br />MWAN 要求所有接口必须在 /etc/"
"config/network 中设定唯一的网关跃点。<br />名称必须与 /etc/config/network 中"
"的接口名称匹配。(可查看“高级”选项卡)<br />名称允许包括A-Z、a-z、0-9、_ 但是"
"不能有空格。<br />接口不应该与成员、策略、规则中的任意一个设置项使用相同的名"
"称"
msgid ""
"May be entered as a single or multiple port(s) (eg \"22\" or \"80,443\") or "
"as a portrange (eg \"1024:2048\") without quotes"
msgstr ""
"可以输入一个或多个端口(例如 \"22\" 或者 \"80,443\")或者是一个端口范围(例"
"如 \"1024:2048\")不含引号"
msgid "Member"
msgstr "成员"
msgid "Member used"
msgstr "使用的成员"
msgid "Members"
msgstr "成员"
msgid ""
"Members are profiles attaching a metric and weight to an MWAN interface<br /"
">Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />Members "
"may not share the same name as configured interfaces, policies or rules"
msgstr ""
"“成员”用来设置每一个 MWAN 接口的跃点数(即接口优先级)和所占比重。<br />名称"
"允许包括 A-Z、 a-、0-9、_ 但是不能有空格。<br />成员不应该与接口、策略、规则"
"中的任意一个设置项使用相同的名称"
msgid "Members assigned"
msgstr "分配的成员"
msgid "Metric"
msgstr "跃点数"
msgid ""
"Name of IPset rule. Requires IPset rule in /etc/dnsmasq.conf (eg \"ipset=/"
"youtube.com/youtube\")"
msgstr ""
"匹配 IPset 规则列表名称。需要先配置 /etc/dnsmasq.conf 中的 IPset 规则 (例如: "
"\"ipset=/youtube.com/youtube\")"
msgid "Network Config"
msgstr "网络配置文件"
msgid "No"
msgstr "否"
msgid "No MWAN interfaces found"
msgstr "没有找到 MWAN 接口"
msgid "No MWAN systemlog history found"
msgstr "没有在系统日志中找到 MWAN 历史信息"
msgid "No detailed status information available"
msgstr "没有状态详细信息可用"
msgid "No diagnostic results returned"
msgstr "没有返回诊断结果"
msgid "No protocol specified"
msgstr "未指定协议"
msgid "Offline"
msgstr "离线"
msgid "Online (tracking active)"
msgstr "在线(追踪启用中)"
msgid "Online (tracking off)"
msgstr "在线(追踪已关闭)"
msgid "Overview"
msgstr "概况"
msgid "Ping count"
msgstr "Ping 计数"
msgid "Ping default gateway"
msgstr "Ping 默认网关"
msgid "Ping interval"
msgstr "Ping 间隔"
msgid "Ping interval during failure detection"
msgstr "故障检测期间的 Ping 间隔"
msgid "Ping interval during failure recovering"
msgstr "故障恢复期间的 Ping 间隔"
msgid "Ping size"
msgstr "Ping 大小"
msgid "Ping timeout"
msgstr "Ping 超时"
msgid "Ping tracking IP"
msgstr "Ping 跟踪 IP"
msgid "Policies"
msgstr "策略"
msgid ""
"Policies are profiles grouping one or more members controlling how MWAN "
"distributes traffic<br />Member interfaces with lower metrics are used "
"first. Interfaces with the same metric load-balance<br />Load-balanced "
"member interfaces distribute more traffic out those with higher weights<br /"
">Names may contain characters A-Z, a-z, 0-9, _ and no spaces. Names must be "
"15 characters or less<br />Policies may not share the same name as "
"configured interfaces, members or rules"
msgstr ""
"“策略”把成员进行分组,告诉 MWAN 如何分配“规则”中使用这一策略的流量<br />拥有"
"较低跃点数的成员将会被优先使用。拥有相同跃点数的成员把流量进行负载均衡。<br /"
">进行负载均衡的成员之间拥有较高比重的成员将会被分配到更多流量。<br />名称允许"
"包括A-Z、a-z、0-9、_ 但是不能有空格。名称应该在 15 个字符以内<br />策略不应该"
"与接口、成员、规则中的任意一个设置项使用相同的名称"
msgid "Policy"
msgstr "策略"
msgid "Policy assigned"
msgstr "分配的策略"
msgid "Protocol"
msgstr "通信协议"
msgid "Recovery interval"
msgstr "故障恢复间隔"
msgid "Restart MWAN"
msgstr "重启 MWAN"
msgid "Restore default hotplug script"
msgstr "恢复默认的 hotplug 脚本"
msgid "Restore..."
msgstr "恢复..."
msgid "Rule"
msgstr "规则"
msgid "Rules"
msgstr "规则"
msgid ""
"Rules specify which traffic will use a particular MWAN policy based on IP "
"address, port or protocol<br />Rules are matched from top to bottom. Rules "
"below a matching rule are ignored. Traffic not matching any rule is routed "
"using the main routing table<br />Traffic destined for known (other than "
"default) networks is handled by the main routing table. Traffic matching a "
"rule, but all WAN interfaces for that policy are down will be blackholed<br /"
">Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />Rules may "
"not share the same name as configured interfaces, members or policies"
msgstr ""
"“规则”基于 IP 地址、协议、端口把流量划分到指定的“策略”中。<br />规则按照从上"
"到下的顺序进行匹配。除了第一条能够匹配一次通信的规则以外,其它规则将被忽略。"
"不匹配任何规则的通信将会由系统默认路由表进行。<br />来自已知的网络的转发流量"
"由系统默认路由表接手,然后 MWAN 从中匹配出相应的流量并转移到 MWAN 自己的路由"
"表。但是所有被划分到一个无法使用的策略的流量将会无法正常进行路由。<br />名称"
"允许包括A-Z、a-z、0-9、_ 但是不能有空格。<br />规则不应该与接口、成员、策略中"
"的任意一个设置项使用相同的名称"
msgid "Seconds. Acceptable values: 1-1000000. Defaults to 600 if not set"
msgstr "单位为秒。接受的值: 1-1000000。留空则使用默认值 600 秒"
msgid "Source address"
msgstr "源地址"
msgid "Source port"
msgstr "源端口"
msgid "Start MWAN"
msgstr "启动 MWAN"
msgid "Sticky"
msgstr "粘滞模式"
msgid "Sticky timeout"
msgstr "粘滞超时"
msgid "Stop MWAN"
msgstr "停止 MWAN"
msgid "Supports CIDR notation (eg \"192.168.100.0/24\") without quotes"
msgstr "支持 CIDR 记法(例如: \"192.168.100.0/24\")不含引号"
msgid "There are currently %d of 250 supported interfaces configured"
msgstr "当前已配置 %d 个接口,最大支持 250 个"
msgid ""
"This displays the metric assigned to this interface in /etc/config/network"
msgstr "这里显示了这个接口在 /etc/config/network 中配置的跃点数"
msgid ""
"This hostname or IP address will be pinged to determine if the link is up or "
"down. Leave blank to assume interface is always online"
msgstr "通过 ping 此主机或 IP 地址来确定链路是否在线。留空则认为接口始终在线"
msgid "This section allows you to modify the contents of /etc/config/mwan3"
msgstr "这里允许你修改 /etc/config/mwan3 的内容"
msgid "This section allows you to modify the contents of /etc/config/network"
msgstr "这里允许你修改 /etc/config/network 的内容"
msgid "This section allows you to modify the contents of /etc/config/wireless"
msgstr "这里允许你修改 /etc/config/wireless 的内容"
msgid ""
"This section allows you to modify the contents of /etc/hotplug.d/iface/16-"
"mwancustom<br />This is useful for running system commands and/or scripts "
"based on interface ifup or ifdown hotplug events<br /><br />Notes:<br />The "
"first line of the script must be &#34;#!/bin/sh&#34; without quotes<br /"
">Lines beginning with # are comments and are not executed<br /><br /"
">Available variables:<br />$ACTION is the hotplug event (ifup, ifdown)<br />"
"$INTERFACE is the interface name (wan1, wan2, etc.)<br />$DEVICE is the "
"device name attached to the interface (eth0.1, eth1, etc.)"
msgstr ""
"这里允许你修改 /etc/hotplug.d/iface/16-mwancustom 的内容<br />这可以在接口 "
"ifup 或 ifdown Hotplug 事件时运行系统命令或脚本<br /><br />注意:<br />脚本的"
"第一行必须是 &#34;#!/bin/sh&#34; 不含引号<br />以#开头的行是注释,不会执行"
"<br /><br />可用变量:<br />$ACTION 是 Hotplug 事件ifup, ifdown<br />"
"$INTERFACE 是接口名称wan1、wan2 等)<br />$DEVICE 是连接到接口的设备名称 "
"eth0.1、eth1 等)"
msgid "Tracking IP"
msgstr "追踪的 IP"
msgid "Tracking hostname or IP address"
msgstr "追踪的主机或 IP 地址"
msgid "Tracking reliability"
msgstr "追踪可靠性"
msgid "Traffic Rules"
msgstr "流量规则"
msgid ""
"Traffic from the same source IP address that previously matched this rule "
"within the sticky timeout period will use the same WAN interface"
msgstr ""
"来自相同源 IP 的流量,如果已经匹配过此规则并且在粘滞超时时间内,将会使用相同"
"的 WAN 接口"
msgid "Troubleshooting"
msgstr "故障排除"
msgid "Troubleshooting Data"
msgstr "故障排除数据"
msgid "View the contents of /etc/protocols for protocol descriptions"
msgstr "请查看 /etc/protocols 获取可选协议详情"
msgid "WARNING: %d interfaces are configured exceeding the maximum of 250!"
msgstr "警告: 已配置 %d 个接口,超过最大值 250"
msgid ""
"WARNING: Some policies have names exceeding the maximum of 15 characters!"
msgstr "警告: 某些策略的名称超过了 15 个字符!"
msgid ""
"WARNING: some interfaces are configured incorrectly or not at all in /etc/"
"config/network!"
msgstr "警告: 某些接口配置不正确或未配置到 /etc/config/network"
msgid ""
"WARNING: some interfaces have a higher reliability requirement than there "
"are tracking IP addresses!"
msgstr "警告: 某些接口的追踪可靠性要求大于了追踪 IP 地址总数!"
msgid ""
"WARNING: some interfaces have duplicate metrics configured in /etc/config/"
"network!"
msgstr "警告: 某些接口在 /etc/config/network 中配置了相同的跃点数!"
msgid ""
"WARNING: some interfaces have no default route in the main routing table!"
msgstr "警告: 某些接口在主路由表中没有默认路由!"
msgid ""
"WARNING: some interfaces have no metric configured in /etc/config/network!"
msgstr "警告: 某些接口没有在 /etc/config/network 中配置跃点数!"
msgid ""
"WARNING: some rules have a port configured with no or improper protocol "
"specified! Please configure a specific protocol!"
msgstr ""
"警告: 某些规则指定了端口却没有配置或配置了不正确的协议,请重新指定协议!"
msgid ""
"WARNING: this and other interfaces have duplicate metrics configured in /etc/"
"config/network!"
msgstr "警告: 此接口和其他接口在 /etc/config/network 中配置了相同的跃点数!"
msgid ""
"WARNING: this interface has a higher reliability requirement than there are "
"tracking IP addresses!"
msgstr "警告: 此接口的追踪可靠性要求大于了追踪 IP 地址总数!"
msgid "WARNING: this interface has no default route in the main routing table!"
msgstr "警告: 此接口在主路由表中没有默认路由!"
msgid ""
"WARNING: this interface has no metric configured in /etc/config/network!"
msgstr "警告: 此接口没有在 /etc/config/network 中配置跃点数!"
msgid ""
"WARNING: this interface is configured incorrectly or not at all in /etc/"
"config/network!"
msgstr "警告: 此接口配置不正确或未配置到 /etc/config/network"
msgid ""
"WARNING: this policy's name is %d characters exceeding the maximum of 15!"
msgstr "警告: 此策略的名称具有 %d 个字符,超过了 15 个字符!"
msgid ""
"WARNING: this rule is incorrectly configured with no or improper protocol "
"specified! Please configure a specific protocol!"
msgstr "警告: 此规则没有配置或配置了不正确的协议,请重新指定协议!"
msgid "Waiting for MWAN to %s..."
msgstr "等待 MWAN %s..."
msgid "Waiting for diagnostic results..."
msgstr "等待诊断结果..."
msgid "Weight"
msgstr "比重"
msgid ""
"When all policy members are offline use this behavior for matched traffic"
msgstr "当所有策略成员都无法使用的时候,对使用该策略的流量使用这个操作"
msgid "Wireless Config"
msgstr "无线配置"
msgid "Yes"
msgstr "是"
msgid "always"
msgstr "总是"
msgid "blackhole (drop)"
msgstr "黑洞(丢弃)"
msgid "default (use main routing table)"
msgstr "默认(使用主路由表)"
msgid "ifdown"
msgstr "ifdown"
msgid "ifup"
msgstr "ifup"
msgid "never"
msgstr "从不"
msgid "restart"
msgstr ""
msgid "start"
msgstr ""
msgid "stop"
msgstr ""
msgid "unreachable (reject)"
msgstr "不可达(拒绝)"

View File

@ -0,0 +1,203 @@
msgid ""
msgstr ""
"Project-Id-Version: luci-i18n-sqm\n"
"POT-Creation-Date: 2017-03-28 04:14+0800\n"
"PO-Revision-Date: 2017-03-28 04:15+0800\n"
"Last-Translator: \n"
"Language-Team: player131 <player1311@gmail.com>\n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.10\n"
"X-Poedit-Basepath: .\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Poedit-KeywordsList: translate\n"
"X-Poedit-SearchPath-0: .\n"
#: usr/lib/lua/luci/controller/sqm.lua:24
msgid "SQM QoS"
msgstr "SQM QoS"
#: usr/lib/lua/luci/model/cbi/sqm.lua:25
msgid "Smart Queue Management"
msgstr "智能队列管理"
#: usr/lib/lua/luci/model/cbi/sqm.lua:26
msgid ""
"With <abbr title=\"Smart Queue Management\">SQM</abbr> you can enable "
"traffic shaping, better mixing (Fair Queueing), active queue length "
"management (AQM) and prioritisation on one network interface."
msgstr ""
"使用 <abbr title=\"智能列队管理\">SQM</abbr> 你可以启用流量整形,更好的混合"
"(公平列队)主动列队管理(AQM) 并设置网络接口优先级。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:32
msgid "Queues"
msgstr "队列"
#: usr/lib/lua/luci/model/cbi/sqm.lua:33
msgid "Basic Settings"
msgstr "基本设置"
#: usr/lib/lua/luci/model/cbi/sqm.lua:34
msgid "Queue Discipline"
msgstr "列队规则"
#: usr/lib/lua/luci/model/cbi/sqm.lua:35
msgid "Link Layer Adaptation"
msgstr "链路层适配"
#: usr/lib/lua/luci/model/cbi/sqm.lua:40
msgid "Enable this SQM instance."
msgstr "启用此SQM实例"
#: usr/lib/lua/luci/model/cbi/sqm.lua:54
msgid ""
"The SQM GUI has just enabled the sqm initscript on your behalf. Remember to "
"disable the sqm initscript manually under System Startup menu in case this "
"change was not wished for."
msgstr ""
"你刚刚开启了SQM随机启动功能如果你不希望SQM随机启动可以在系统启动菜单下手"
"动禁用。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:60
msgid "Interface name"
msgstr "接口名称"
#: usr/lib/lua/luci/model/cbi/sqm.lua:70
msgid ""
"Download speed (kbit/s) (ingress) set to 0 to selectively disable ingress "
"shaping:"
msgstr "下载速度(kbit/s)(入口)<br />设置为0关闭入口控制"
#: usr/lib/lua/luci/model/cbi/sqm.lua:74
msgid ""
"Upload speed (kbit/s) (egress) set to 0 to selectively disable egress "
"shaping:"
msgstr "上传速度(kbit/s)(出口)<br />设置为0关闭出口控制"
#: usr/lib/lua/luci/model/cbi/sqm.lua:78
msgid ""
"Create log file for this SQM instance under /var/run/sqm/${Inerface_name}."
"debug.log. Make sure to delete log files manually."
msgstr ""
"创建日志文件到/var/run/sqm/<br />${Inerface_name}.debug.log。<br />请务必手动"
"删除日志文件。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:82
msgid "Verbosity of SQM's output into the system log."
msgstr "SQM输出到系统日志的详细程度。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:86 usr/lib/lua/luci/model/cbi/sqm.lua:99
#: usr/lib/lua/luci/model/cbi/sqm.lua:148
#: usr/lib/lua/luci/model/cbi/sqm.lua:155
#: usr/lib/lua/luci/model/cbi/sqm.lua:202
#: usr/lib/lua/luci/model/cbi/sqm.lua:243
msgid "default"
msgstr "默认"
#: usr/lib/lua/luci/model/cbi/sqm.lua:98
msgid ""
"Queuing disciplines useable on this system. After installing a new qdisc, "
"you need to restart the router to see updates!"
msgstr "系统上可用的列队规则。安装新的队列规则后,重新启动路由器才会看到更新!"
#: usr/lib/lua/luci/model/cbi/sqm.lua:112
msgid "Queue setup script"
msgstr "队列脚本设置"
#: usr/lib/lua/luci/model/cbi/sqm.lua:129
msgid ""
"Show and Use Advanced Configuration. Advanced options will only be used as "
"long as this box is checked."
msgstr "选中该复选框显示高级配置。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:133
msgid "Squash DSCP on inbound packets (ingress):"
msgstr "入站数据包压缩DSCP:"
#: usr/lib/lua/luci/model/cbi/sqm.lua:140
msgid "Ignore DSCP on ingress:"
msgstr "忽略入站DSCP"
#: usr/lib/lua/luci/model/cbi/sqm.lua:147
msgid ""
"Explicit congestion notification (ECN) status on inbound packets (ingress):"
msgstr "入站数据包的显式拥塞通知ECN状态"
#: usr/lib/lua/luci/model/cbi/sqm.lua:154
msgid ""
"Explicit congestion notification (ECN) status on outbound packets (egress)."
msgstr "出站数据包的显式拥塞通知ECN状态"
#: usr/lib/lua/luci/model/cbi/sqm.lua:161
msgid ""
"Show and Use Dangerous Configuration. Dangerous options will only be used as "
"long as this box is checked."
msgstr "选中该复选框显示危险配置。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:166
msgid "Hard limit on ingress queues; leave empty for default."
msgstr "入站队列严格限制;留空为默认。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:173
msgid "Hard limit on egress queues; leave empty for default."
msgstr "出站队列严格限制;留空为默认。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:180
msgid "Latency target for ingress, e.g 5ms [units: s, ms, or us]; leave empty for automatic selection, put in the word default for the qdisc's default."
msgstr "入站延迟目标,例如 5ms [单位: s, ms, 或 us]留空为自动选择default为列队规则默认值。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:185
msgid "Latency target for egress, e.g. 5ms [units: s, ms, or us]; leave empty for automatic selection, put in the word default for the qdisc's default."
msgstr "出站延迟目标,例如 5ms [单位: s, ms, 或 us]留空为自动选择default为列队规则默认值。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:192
msgid ""
"Advanced option string to pass to the ingress queueing disciplines; no error "
"checking, use very carefully."
msgstr "传递到入站队列规则的高级选项字符串;没有错误检查。请谨慎使用!"
#: usr/lib/lua/luci/model/cbi/sqm.lua:196
msgid ""
"Advanced option string to pass to the egress queueing disciplines; no error "
"checking, use very carefully."
msgstr "传递到出站队列规则的高级选项字符串;没有错误检查。请谨慎使用!"
#: usr/lib/lua/luci/model/cbi/sqm.lua:201
msgid "Which link layer to account for:"
msgstr "对哪个链路层生效:"
#: usr/lib/lua/luci/model/cbi/sqm.lua:207
msgid "Per Packet Overhead (byte):"
msgstr "每个数据包开销"
#: usr/lib/lua/luci/model/cbi/sqm.lua:216
msgid ""
"Show Advanced Linklayer Options, (only needed if MTU > 1500). Advanced "
"options will only be used as long as this box is checked."
msgstr ""
"显示高级链路选项仅在MTU> 1500时才需要。 只有选中此框时,才会使用高级选"
"项。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:221
msgid ""
"Maximal Size for size and rate calculations, tcMTU (byte); needs to be >= "
"interface MTU + overhead:"
msgstr "大小和速率计算的最大尺寸tcMTUbyte; 需要> =接口MTU +开销:"
#: usr/lib/lua/luci/model/cbi/sqm.lua:228
msgid ""
"Number of entries in size/rate tables, TSIZE; for ATM choose TSIZE = (tcMTU "
"+ 1) / 16:"
msgstr "大小/速率表中的条目数TSIZE; 对于ATM选择TSIZE =tcMTU + 1/ 16"
#: usr/lib/lua/luci/model/cbi/sqm.lua:235
msgid ""
"Minimal packet size, MPU (byte); needs to be > 0 for ethernet size tables:"
msgstr "最小数据包大小MPUbyte; 在以太网中需要>0"
#: usr/lib/lua/luci/model/cbi/sqm.lua:242
msgid "Which linklayer adaptation mechanism to use; for testing only"
msgstr "使用哪个链路适应机制; 仅用于测试"

View File

@ -0,0 +1,12 @@
INSTALL = install
PREFIX = /usr/bin
po2lmo: src/po2lmo.o src/template_lmo.o
$(CC) $(LDFLAGS) -o src/po2lmo src/po2lmo.o src/template_lmo.o
install:
$(INSTALL) -m 755 src/po2lmo $(PREFIX)
clean:
$(RM) src/po2lmo src/*.o

Binary file not shown.

View File

@ -0,0 +1,247 @@
/*
* lmo - Lua Machine Objects - PO to LMO conversion tool
*
* Copyright (C) 2009-2012 Jo-Philipp Wich <xm@subsignal.org>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "template_lmo.h"
static void die(const char *msg)
{
fprintf(stderr, "Error: %s\n", msg);
exit(1);
}
static void usage(const char *name)
{
fprintf(stderr, "Usage: %s input.po output.lmo\n", name);
exit(1);
}
static void print(const void *ptr, size_t size, size_t nmemb, FILE *stream)
{
if( fwrite(ptr, size, nmemb, stream) == 0 )
die("Failed to write stdout");
}
static int extract_string(const char *src, char *dest, int len)
{
int pos = 0;
int esc = 0;
int off = -1;
for( pos = 0; (pos < strlen(src)) && (pos < len); pos++ )
{
if( (off == -1) && (src[pos] == '"') )
{
off = pos + 1;
}
else if( off >= 0 )
{
if( esc == 1 )
{
switch (src[pos])
{
case '"':
case '\\':
off++;
break;
}
dest[pos-off] = src[pos];
esc = 0;
}
else if( src[pos] == '\\' )
{
dest[pos-off] = src[pos];
esc = 1;
}
else if( src[pos] != '"' )
{
dest[pos-off] = src[pos];
}
else
{
dest[pos-off] = '\0';
break;
}
}
}
return (off > -1) ? strlen(dest) : -1;
}
static int cmp_index(const void *a, const void *b)
{
uint32_t x = ((const lmo_entry_t *)a)->key_id;
uint32_t y = ((const lmo_entry_t *)b)->key_id;
if (x < y)
return -1;
else if (x > y)
return 1;
return 0;
}
static void print_uint32(uint32_t x, FILE *out)
{
uint32_t y = htonl(x);
print(&y, sizeof(uint32_t), 1, out);
}
static void print_index(void *array, int n, FILE *out)
{
lmo_entry_t *e;
qsort(array, n, sizeof(*e), cmp_index);
for (e = array; n > 0; n--, e++)
{
print_uint32(e->key_id, out);
print_uint32(e->val_id, out);
print_uint32(e->offset, out);
print_uint32(e->length, out);
}
}
int main(int argc, char *argv[])
{
char line[4096];
char key[4096];
char val[4096];
char tmp[4096];
int state = 0;
int offset = 0;
int length = 0;
int n_entries = 0;
void *array = NULL;
lmo_entry_t *entry = NULL;
uint32_t key_id, val_id;
FILE *in;
FILE *out;
if( (argc != 3) || ((in = fopen(argv[1], "r")) == NULL) || ((out = fopen(argv[2], "w")) == NULL) )
usage(argv[0]);
memset(line, 0, sizeof(key));
memset(key, 0, sizeof(val));
memset(val, 0, sizeof(val));
while( (NULL != fgets(line, sizeof(line), in)) || (state >= 2 && feof(in)) )
{
if( state == 0 && strstr(line, "msgid \"") == line )
{
switch(extract_string(line, key, sizeof(key)))
{
case -1:
die("Syntax error in msgid");
case 0:
state = 1;
break;
default:
state = 2;
}
}
else if( state == 1 || state == 2 )
{
if( strstr(line, "msgstr \"") == line || state == 2 )
{
switch(extract_string(line, val, sizeof(val)))
{
case -1:
state = 4;
break;
default:
state = 3;
}
}
else
{
switch(extract_string(line, tmp, sizeof(tmp)))
{
case -1:
state = 2;
break;
default:
strcat(key, tmp);
}
}
}
else if( state == 3 )
{
switch(extract_string(line, tmp, sizeof(tmp)))
{
case -1:
state = 4;
break;
default:
strcat(val, tmp);
}
}
if( state == 4 )
{
if( strlen(key) > 0 && strlen(val) > 0 )
{
key_id = sfh_hash(key, strlen(key));
val_id = sfh_hash(val, strlen(val));
if( key_id != val_id )
{
n_entries++;
array = realloc(array, n_entries * sizeof(lmo_entry_t));
entry = (lmo_entry_t *)array + n_entries - 1;
if (!array)
die("Out of memory");
entry->key_id = key_id;
entry->val_id = val_id;
entry->offset = offset;
entry->length = strlen(val);
length = strlen(val) + ((4 - (strlen(val) % 4)) % 4);
print(val, length, 1, out);
offset += length;
}
}
state = 0;
memset(key, 0, sizeof(key));
memset(val, 0, sizeof(val));
}
memset(line, 0, sizeof(line));
}
print_index(array, n_entries, out);
if( offset > 0 )
{
print_uint32(offset, out);
fsync(fileno(out));
fclose(out);
}
else
{
fclose(out);
unlink(argv[2]);
}
fclose(in);
return(0);
}

View File

@ -0,0 +1,328 @@
/*
* lmo - Lua Machine Objects - Base functions
*
* Copyright (C) 2009-2010 Jo-Philipp Wich <xm@subsignal.org>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "template_lmo.h"
/*
* Hash function from http://www.azillionmonkeys.com/qed/hash.html
* Copyright (C) 2004-2008 by Paul Hsieh
*/
uint32_t sfh_hash(const char *data, int len)
{
uint32_t hash = len, tmp;
int rem;
if (len <= 0 || data == NULL) return 0;
rem = len & 3;
len >>= 2;
/* Main loop */
for (;len > 0; len--) {
hash += sfh_get16(data);
tmp = (sfh_get16(data+2) << 11) ^ hash;
hash = (hash << 16) ^ tmp;
data += 2*sizeof(uint16_t);
hash += hash >> 11;
}
/* Handle end cases */
switch (rem) {
case 3: hash += sfh_get16(data);
hash ^= hash << 16;
hash ^= data[sizeof(uint16_t)] << 18;
hash += hash >> 11;
break;
case 2: hash += sfh_get16(data);
hash ^= hash << 11;
hash += hash >> 17;
break;
case 1: hash += *data;
hash ^= hash << 10;
hash += hash >> 1;
}
/* Force "avalanching" of final 127 bits */
hash ^= hash << 3;
hash += hash >> 5;
hash ^= hash << 4;
hash += hash >> 17;
hash ^= hash << 25;
hash += hash >> 6;
return hash;
}
uint32_t lmo_canon_hash(const char *str, int len)
{
char res[4096];
char *ptr, prev;
int off;
if (!str || len >= sizeof(res))
return 0;
for (prev = ' ', ptr = res, off = 0; off < len; prev = *str, off++, str++)
{
if (isspace(*str))
{
if (!isspace(prev))
*ptr++ = ' ';
}
else
{
*ptr++ = *str;
}
}
if ((ptr > res) && isspace(*(ptr-1)))
ptr--;
return sfh_hash(res, ptr - res);
}
lmo_archive_t * lmo_open(const char *file)
{
int in = -1;
uint32_t idx_offset = 0;
struct stat s;
lmo_archive_t *ar = NULL;
if (stat(file, &s) == -1)
goto err;
if ((in = open(file, O_RDONLY)) == -1)
goto err;
if ((ar = (lmo_archive_t *)malloc(sizeof(*ar))) != NULL)
{
memset(ar, 0, sizeof(*ar));
ar->fd = in;
ar->size = s.st_size;
fcntl(ar->fd, F_SETFD, fcntl(ar->fd, F_GETFD) | FD_CLOEXEC);
if ((ar->mmap = mmap(NULL, ar->size, PROT_READ, MAP_SHARED, ar->fd, 0)) == MAP_FAILED)
goto err;
idx_offset = ntohl(*((const uint32_t *)
(ar->mmap + ar->size - sizeof(uint32_t))));
if (idx_offset >= ar->size)
goto err;
ar->index = (lmo_entry_t *)(ar->mmap + idx_offset);
ar->length = (ar->size - idx_offset - sizeof(uint32_t)) / sizeof(lmo_entry_t);
ar->end = ar->mmap + ar->size;
return ar;
}
err:
if (in > -1)
close(in);
if (ar != NULL)
{
if ((ar->mmap != NULL) && (ar->mmap != MAP_FAILED))
munmap(ar->mmap, ar->size);
free(ar);
}
return NULL;
}
void lmo_close(lmo_archive_t *ar)
{
if (ar != NULL)
{
if ((ar->mmap != NULL) && (ar->mmap != MAP_FAILED))
munmap(ar->mmap, ar->size);
close(ar->fd);
free(ar);
ar = NULL;
}
}
lmo_catalog_t *_lmo_catalogs = NULL;
lmo_catalog_t *_lmo_active_catalog = NULL;
int lmo_load_catalog(const char *lang, const char *dir)
{
DIR *dh = NULL;
char pattern[16];
char path[PATH_MAX];
struct dirent *de = NULL;
lmo_archive_t *ar = NULL;
lmo_catalog_t *cat = NULL;
if (!lmo_change_catalog(lang))
return 0;
if (!dir || !(dh = opendir(dir)))
goto err;
if (!(cat = malloc(sizeof(*cat))))
goto err;
memset(cat, 0, sizeof(*cat));
snprintf(cat->lang, sizeof(cat->lang), "%s", lang);
snprintf(pattern, sizeof(pattern), "*.%s.lmo", lang);
while ((de = readdir(dh)) != NULL)
{
if (!fnmatch(pattern, de->d_name, 0))
{
snprintf(path, sizeof(path), "%s/%s", dir, de->d_name);
ar = lmo_open(path);
if (ar)
{
ar->next = cat->archives;
cat->archives = ar;
}
}
}
closedir(dh);
cat->next = _lmo_catalogs;
_lmo_catalogs = cat;
if (!_lmo_active_catalog)
_lmo_active_catalog = cat;
return 0;
err:
if (dh) closedir(dh);
if (cat) free(cat);
return -1;
}
int lmo_change_catalog(const char *lang)
{
lmo_catalog_t *cat;
for (cat = _lmo_catalogs; cat; cat = cat->next)
{
if (!strncmp(cat->lang, lang, sizeof(cat->lang)))
{
_lmo_active_catalog = cat;
return 0;
}
}
return -1;
}
static lmo_entry_t * lmo_find_entry(lmo_archive_t *ar, uint32_t hash)
{
unsigned int m, l, r;
uint32_t k;
l = 0;
r = ar->length - 1;
while (1)
{
m = l + ((r - l) / 2);
if (r < l)
break;
k = ntohl(ar->index[m].key_id);
if (k == hash)
return &ar->index[m];
if (k > hash)
{
if (!m)
break;
r = m - 1;
}
else
{
l = m + 1;
}
}
return NULL;
}
int lmo_translate(const char *key, int keylen, char **out, int *outlen)
{
uint32_t hash;
lmo_entry_t *e;
lmo_archive_t *ar;
if (!key || !_lmo_active_catalog)
return -2;
hash = lmo_canon_hash(key, keylen);
for (ar = _lmo_active_catalog->archives; ar; ar = ar->next)
{
if ((e = lmo_find_entry(ar, hash)) != NULL)
{
*out = ar->mmap + ntohl(e->offset);
*outlen = ntohl(e->length);
return 0;
}
}
return -1;
}
void lmo_close_catalog(const char *lang)
{
lmo_archive_t *ar, *next;
lmo_catalog_t *cat, *prev;
for (prev = NULL, cat = _lmo_catalogs; cat; prev = cat, cat = cat->next)
{
if (!strncmp(cat->lang, lang, sizeof(cat->lang)))
{
if (prev)
prev->next = cat->next;
else
_lmo_catalogs = cat->next;
for (ar = cat->archives; ar; ar = next)
{
next = ar->next;
lmo_close(ar);
}
free(cat);
break;
}
}
}

View File

@ -0,0 +1,92 @@
/*
* lmo - Lua Machine Objects - General header
*
* Copyright (C) 2009-2012 Jo-Philipp Wich <xm@subsignal.org>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _TEMPLATE_LMO_H_
#define _TEMPLATE_LMO_H_
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <errno.h>
#include <fnmatch.h>
#include <dirent.h>
#include <ctype.h>
#include <limits.h>
#if (defined(__GNUC__) && defined(__i386__))
#define sfh_get16(d) (*((const uint16_t *) (d)))
#else
#define sfh_get16(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8)\
+(uint32_t)(((const uint8_t *)(d))[0]) )
#endif
struct lmo_entry {
uint32_t key_id;
uint32_t val_id;
uint32_t offset;
uint32_t length;
} __attribute__((packed));
typedef struct lmo_entry lmo_entry_t;
struct lmo_archive {
int fd;
int length;
uint32_t size;
lmo_entry_t *index;
char *mmap;
char *end;
struct lmo_archive *next;
};
typedef struct lmo_archive lmo_archive_t;
struct lmo_catalog {
char lang[6];
struct lmo_archive *archives;
struct lmo_catalog *next;
};
typedef struct lmo_catalog lmo_catalog_t;
uint32_t sfh_hash(const char *data, int len);
uint32_t lmo_canon_hash(const char *data, int len);
lmo_archive_t * lmo_open(const char *file);
void lmo_close(lmo_archive_t *ar);
extern lmo_catalog_t *_lmo_catalogs;
extern lmo_catalog_t *_lmo_active_catalog;
int lmo_load_catalog(const char *lang, const char *dir);
int lmo_change_catalog(const char *lang);
int lmo_translate(const char *key, int keylen, char **out, int *outlen);
void lmo_close_catalog(const char *lang);
#endif

View File

@ -0,0 +1,48 @@
#
# Copyright (c) 2015 Justin Liu
# Author: Justin Liu <rssnsj@gmail.com>
#
include $(TOPDIR)/rules.mk
PKG_NAME:=ipset-lists
PKG_VERSION:=20161112
PKG_RELEASE:=
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
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 +luci
endef
define Package/ipset-lists/conffiles
/etc/gfwlist/china-banned
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
define Build/Compile/Default
endef
Build/Compile = $(Build/Compile/Default)
define Package/ipset-lists/install
$(CP) -a 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

View File

@ -0,0 +1,95 @@
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

View File

@ -0,0 +1,29 @@
#!/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

View File

@ -0,0 +1,6 @@
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

View File

@ -0,0 +1,14 @@
--[[
Customize /etc/gfwlist.list content
Copyright (c) 2015 Justin Liu
Author: Justin Liu <rssnsj@gmail.com>
https://github.com/rssnsj/network-feeds
]]--
module("luci.controller.gfwlist", package.seeall)
function index()
local page
page = entry({"admin", "services", "gfwlist"}, cbi("gfwlist"), _("Domain Lists"))
page.dependent = true
end

View File

@ -0,0 +1,33 @@
--[[
Customize firewall-banned domain lists - /etc/gfwlist/
Copyright (c) 2015 Justin Liu
Author: Justin Liu <rssnsj@gmail.com>
https://github.com/rssnsj/network-feeds
]]--
local fs = require "nixio.fs"
function sync_value_to_file(value, file)
value = value:gsub("\r\n?", "\n")
local old_value = nixio.fs.readfile(file)
if value ~= old_value then
nixio.fs.writefile(file, value)
end
end
m = SimpleForm("gfwlist", translate("Domain Lists Settings"))
for e in fs.dir("/etc/gfwlist") do
glist = m:field(TextValue, e, e, nil)
glist.rmempty = false
glist.rows = 12
function glist.cfgvalue()
return nixio.fs.readfile("/etc/gfwlist/" .. e) or ""
end
function glist.write(self, section, value)
sync_value_to_file(value, "/etc/gfwlist/" .. e)
end
end
return m

View File

@ -0,0 +1,9 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "Domain Lists Settings"
msgstr "域名列表设置"
msgid "Domain Lists"
msgstr "域名列表"

View File

@ -0,0 +1,3 @@
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

View File

@ -0,0 +1,85 @@
#!/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://raw.githubusercontent.com/17mon/china_ip_list/master/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

View File

@ -0,0 +1,29 @@
#!/bin/sh -e
generate_china_banned()
{
if [ ! -f gfwlist.txt ]; then
wget https://raw.githubusercontent.com/gfwlist/gfwlist/master/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

View File

@ -0,0 +1,339 @@
#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;
}

View File

@ -0,0 +1,42 @@
#
# Copyright (C) 2015-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v3.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=k3wifi
PKG_VERSION:=1
PKG_RELEASE:=1
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
TITLE:=k3wifi
DEPENDS:=
URL:=http://www.k3wifi.com/
endef
define Package/$(PKG_NAME)/description
k3wifi fw
endef
define Build/Prepare
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/lib
$(INSTALL_DIR) $(1)/lib/firmware
$(INSTALL_DIR) $(1)/lib/firmware/brcm
$(INSTALL_DATA) ./files/lib/firmware/brcm/brcmfmac4366c-pcie.bin $(1)/lib/firmware/brcm/brcmfmac4366c-pcie.bin
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@ -0,0 +1,18 @@
# Copyright (C) 2016 Openwrt.org
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI support for Adbyby
LUCI_DEPENDS:=+adbyby +wget +ipset +coreutils +coreutils-nohup +dnsmasq-full
LUCI_PKGARCH:=all
PKG_NAME:=luci-app-adbyby-plus
PKG_VERSION:=2.0
PKG_RELEASE:=19
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -0,0 +1,10 @@
module("luci.controller.adbyby", package.seeall)
function index()
if not nixio.fs.access("/etc/config/adbyby") then
return
end
entry({"admin", "services", "adbyby"}, cbi("adbyby"), _("ADBYBY Plus +"), 10).dependent = true
end

View File

@ -0,0 +1,203 @@
local NXFS = require "nixio.fs"
local SYS = require "luci.sys"
local HTTP = require "luci.http"
local DISP = require "luci.dispatcher"
local m,s,o
local Status
if SYS.call("pidof adbyby >/dev/null") == 0 then
Status = translate("<strong><font color=\"green\">Adbyby Plus + is Running</font></strong>")
else
Status = translate("<strong><font color=\"red\">Adbyby Plus + is Not Running</font></strong>")
end
m = Map("adbyby")
m.title = translate("Adbyby Plus +")
m.description = translate("Adbyby Plus + can filter all kinds of banners, popups, video ads, and prevent tracking, privacy theft and a variety of malicious websites<br /><font color=\"red\">Plus + version combination mode can operation with Adblock Plus Hostfiltering ads without losing bandwidth</font>")
s = m:section(TypedSection, "adbyby")
s.anonymous = true
s.description = translate(string.format("%s<br /><br />", Status))
s:tab("basic", translate("Base Setting"))
o = s:taboption("basic", Flag, "enable")
o.title = translate("Enable")
o.default = 0
o.rmempty = false
o = s:taboption("basic", ListValue, "wan_mode")
o.title = translate("Running Mode")
o:value("0", translate("Global ModeThe slowest, the best effects"))
o:value("1", translate("Plus + ModeFilter domain name list and blacklist website.Recommended"))
o:value("2", translate("No filter Mode (Must set in Client Filter Mode Settings manually)"))
o.default = 1
o.rmempty = false
o = s:taboption("basic", Button, "proxy")
o.title = translate("Transparent proxy")
if SYS.call("iptables-save | grep ADBYBY >/dev/null") == 0 then
o.inputtitle = translate("Click to disable")
o.inputstyle = "reset"
o.write = function()
SYS.call("/etc/init.d/adbyby del_rule")
HTTP.redirect(DISP.build_url("admin", "services", "adbyby"))
end
else
o.inputtitle = translate("Click to enable")
o.inputstyle = "apply"
o.write = function()
SYS.call('[ -n "$(pgrep adbyby)" ] && /etc/init.d/adbyby add_rule')
HTTP.redirect(DISP.build_url("admin", "services", "adbyby"))
end
end
local DL = SYS.exec("head -1 /usr/share/adbyby/data/lazy.txt | awk -F' ' '{print $3,$4}'")
local DV = SYS.exec("head -1 /usr/share/adbyby/data/video.txt | awk -F' ' '{print $3,$4}'")
local NR = SYS.exec("grep -v '^!' /usr/share/adbyby/data/rules.txt | wc -l")
local NU = SYS.exec("cat /usr/share/adbyby/data/user.txt | wc -l")
--local NW = SYS.exec("uci get adbyby.@adbyby[-1].domain 2>/dev/null | wc -l")
local ND = SYS.exec("cat /usr/share/adbyby/dnsmasq.adblock | wc -l")
o = s:taboption("basic", Button, "restart")
o.title = translate("Adbyby and Rule state")
o.inputtitle = translate("Restart Adbyby")
o.description = translate(string.format("%s<br /><br />", Status))
o.description = translate(string.format("<strong>Lazy Rule</strong>%s <strong>&nbsp;&nbsp;Video Rule</strong>%s<br /><strong>Third Party Subscription Rule</strong>%d lines&nbsp;&nbsp;<strong>User-defined Rule</strong>%d lines", DL, DV, math.abs(NR-NU), NR))
o.inputstyle = "reload"
o.write = function()
SYS.call("/etc/init.d/adbyby restart")
HTTP.redirect(DISP.build_url("admin", "services", "adbyby"))
end
s:tab("advanced", translate("Advance Setting"))
o = s:taboption("advanced", Flag, "cron_mode")
o.title = translate("Update the rule at 6 a.m. every morning and restart adbyby")
o.default = 0
o.rmempty = false
o.description = translate(string.format("<strong><font color=blue>Adblock Plus Host List</font></strong> %s Lines<br /><br />", ND))
updatead = s:taboption("advanced", Button, "updatead", translate("Manually force update<br />Adblock Plus Host List"), translate("Note: It needs to download and convert the rules. The background process may takes 60-120 seconds to run. <br / > After completed it would automatically refresh, please do not duplicate click!"))
updatead.inputtitle = translate("Manually force update")
updatead.inputstyle = "apply"
updatead.write = function()
SYS.call("nohup sh /usr/share/adbyby/adblock.sh > /tmp/adupdate.log 2>&1 &")
end
o = s:taboption("advanced", Flag, "block_ios")
o.title = translate("Block Apple iOS OTA update")
o.default = 0
o.rmempty = false
mem = s:taboption("advanced", Flag, "mem_mode")
mem.title = translate("RAM Running Mode")
mem.default = 1
mem.rmempty = false
mem.description = translate("Running Adbyby in RAM.More speed,less disk consumption")
s:tab("help", translate("Plus+ Domain List"))
local conf = "/usr/share/adbyby/adhost.conf"
o = s:taboption("help", TextValue, "conf")
o.description = translate("!Note that you should fill to the domain name ONLY. For example, http://www.baidu.com only needs to write to baidu.com. One line for each")
o.rows = 13
o.wrap = "off"
o.cfgvalue = function(self, section)
return NXFS.readfile(conf) or ""
end
o.write = function(self, section, value)
NXFS.writefile(conf, value:gsub("\r\n", "\n"))
--SYS.call("/etc/init.d/adbyby restart")
end
s:tab("esc", translate("Bypass Domain List"))
local escconf = "/usr/share/adbyby/adesc.conf"
o = s:taboption("esc", TextValue, "escconf")
o.description = translate("!Will Never filter these Domain")
o.rows = 13
o.wrap = "off"
o.cfgvalue = function(self, section)
return NXFS.readfile(escconf) or ""
end
o.write = function(self, section, value)
NXFS.writefile(escconf, value:gsub("\r\n", "\n"))
--SYS.call("/etc/init.d/adbyby restart")
end
s:tab("black", translate("Black Domain List"))
local blackconf = "/usr/share/adbyby/adblack.conf"
o = s:taboption("black", TextValue, "blackconf")
o.description = translate("!Will Always block these Domain")
o.rows = 13
o.wrap = "off"
o.cfgvalue = function(self, section)
return NXFS.readfile(blackconf) or ""
end
o.write = function(self, section, value)
NXFS.writefile(blackconf, value:gsub("\r\n", "\n"))
--SYS.call("/etc/init.d/adbyby restart")
end
s:tab("block", translate("Black IP List"))
local blockconf = "/usr/share/adbyby/blockip.conf"
o = s:taboption("block", TextValue, "blockconf")
o.description = translate("!Will Always block these IP")
o.rows = 13
o.wrap = "off"
o.cfgvalue = function(self, section)
return NXFS.readfile(blockconf) or " "
end
o.write = function(self, section, value)
NXFS.writefile(blockconf, value:gsub("\r\n", "\n"))
--SYS.call("/etc/init.d/adbyby restart")
end
s:tab("user", translate("User-defined Rule"))
local file = "/usr/share/adbyby/rules.txt"
o = s:taboption("user", TextValue, "rules")
o.description = translate("Each line of the beginning exclamation mark is considered an annotation.")
o.rows = 13
o.wrap = "off"
o.cfgvalue = function(self, section)
return NXFS.readfile(file) or ""
end
o.write = function(self, section, value)
NXFS.writefile(file, value:gsub("\r\n", "\n"))
end
t=m:section(TypedSection,"acl_rule",translate("<strong>Client Filter Mode Settings</strong>"),
translate("Filter mode settings can be set to specific LAN clients ( <font color=blue> No filter , Global filter </font> ) . Does not need to be set by default."))
t.template="cbi/tblsection"
t.sortable=true
t.anonymous=true
t.addremove=true
e=t:option(Value,"ipaddr",translate("IP Address"))
e.width="40%"
e.datatype="ip4addr"
e.placeholder="0.0.0.0/0"
luci.ip.neighbors({ family = 4 }, function(entry)
if entry.reachable then
e:value(entry.dest:string())
end
end)
e=t:option(ListValue,"filter_mode",translate("Filter Mode"))
e.width="40%"
e.default="disable"
e.rmempty=false
e:value("disable",translate("No filter"))
e:value("global",translate("Global filter"))
return m

View File

@ -0,0 +1,118 @@
msgid "ADBYBY Plus +"
msgstr "广告屏蔽大师 Plus+"
msgid "<strong><font color=\"green\">Adbyby Plus + is Running</font></strong>"
msgstr "<strong><font color=\"green\">广告屏蔽大师 Plus + 正在运行</font></strong>"
msgid "<strong><font color=\"red\">Adbyby Plus + is Not Running</font></strong>"
msgstr "<strong><font color=\"red\">广告屏蔽大师 Plus + 没有运行</font></strong>"
msgid "Adbyby Plus + can filter all kinds of banners, popups, video ads, and prevent tracking, privacy theft and a variety of malicious websites<br /><font color=\"red\">Plus + version combination mode can operation with Adblock Plus Hostfiltering ads without losing bandwidth</font>"
msgstr "广告屏蔽大师 Plus + 可以全面过滤各种横幅、弹窗、视频广告,同时阻止跟踪、隐私窃取及各种恶意网站<br /><font color=\"red\">Plus + 版本可以和 Adblock Plus Host 结合方式运行,过滤广告不损失带宽</font>"
msgid "Adbyby Plus +"
msgstr "广告屏蔽大师 Plus+"
msgid "Base Setting"
msgstr "基本设置"
msgid "Running Mode"
msgstr "运行模式"
msgid "Global ModeThe slowest, the best effects"
msgstr "全局模式(最慢, 效果最好)"
msgid "Plus + ModeFilter domain name list and blacklist website.Recommended"
msgstr "Plus + 模式只过滤列表内域名结合ABP名单。推荐"
msgid "No filter Mode (Must set in Client Filter Mode Settings manually)"
msgstr "手动代理模式(必须手动设置浏览器代理,或者客户端过滤模式设置)"
msgid "Transparent proxy"
msgstr "透明代理"
msgid "Click to disable"
msgstr "点击关闭"
msgid "Click to enable"
msgstr "点击开启"
msgid "Adbyby and Rule state"
msgstr "规则状态"
msgid "Restart Adbyby"
msgstr "重启Adbyby"
msgid "Plus+ Domain List"
msgstr "Plus+ 模式过滤的域名"
msgid "Bypass Domain List"
msgstr "域名白名单"
msgid "Black Domain List"
msgstr "域名黑名单"
msgid "Black IP List"
msgstr "IP黑名单"
msgid "Advance Setting"
msgstr "高级设置"
msgid "Update the rule at 6 a.m. every morning and restart adbyby"
msgstr "每天凌晨6点更新规则并重启"
msgid "Manually force update<br />Adblock Plus Host List"
msgstr "手动强制更新<br />Adblock Plus Host List"
msgid "Manually force update"
msgstr "手动强制更新"
msgid "Block Apple iOS OTA update"
msgstr "拦截 Apple iOS 的OTA更新"
msgid "RAM Running Mode"
msgstr "内存运行模式"
msgid "Running Adbyby in RAM.More speed,less disk consumption"
msgstr "在内存中运行Adbyby。更快的速度更少的存储空间损耗"
msgid "User-defined Rule"
msgstr "用户自定义规则"
msgid "<strong>Client Filter Mode Settings</strong>"
msgstr "<strong>客户端过滤模式设置</strong>"
msgid "Filter mode settings can be set to specific LAN clients ( <font color=blue> No filter , Global filter </font> ) . Does not need to be set by default."
msgstr "可以为局域网客户端分别设置不同的过滤模式 ( <font color=blue> 不过滤 , 全局过滤 </font> ) 。默认无需设置"
msgid "IP Address"
msgstr "IP地址"
msgid "Filter Mode"
msgstr "过滤模式"
msgid "!Note that you should fill to the domain name ONLY. For example, http://www.baidu.com only needs to write to baidu.com. One line for each"
msgstr "这些域名在 Plus 模式中会被过滤。你需要要填写域名即可,例如 http://www.baidu.com你写 baidu.com 即可。每行一个域名"
msgid "!Will Never filter these Domain"
msgstr "永不过滤白名单内的域名(所有模式中生效)"
msgid "!Will Always block these Domain"
msgstr "拦截黑名单内的域名(所有模式中生效)"
msgid "!Will Always block these IP"
msgstr "拦截黑名单内的IP地址所有模式中生效"
msgid "Each line of the beginning exclamation mark is considered an annotation."
msgstr "每行一条规则,感叹号开头的被认为是注释"
msgid "<strong><font color=blue>Adblock Plus Host List</font></strong>"
msgstr "<strong><font color=blue>Adblock Plus Host 列表:</font></strong>"
msgid "Note: It needs to download and convert the rules. The background process may takes 60-120 seconds to run. <br / > After completed it would automatically refresh, please do not duplicate click!"
msgstr "注意需要下载并转换规则。后台进程可能需要60-120秒运行。完成后会自动刷新请不要重复点击"

View File

@ -0,0 +1,10 @@
config adbyby
option daemon '2'
option lan_mode '0'
option cron_mode '1'
option block_ios '1'
option enable '1'
option wan_mode '1'
option mem_mode '1'

View File

@ -0,0 +1,218 @@
#!/bin/sh /etc/rc.common
START=99
STOP=10
EXTRA_COMMANDS="add_rule del_rule reload_rule"
PROG_PATH=/usr/share/adbyby
DATA_PATH=$PROG_PATH/data
WAN_FILE=/var/etc/dnsmasq-adbyby.d/03-adbyby-ipset.conf
CRON_FILE=/etc/crontabs/root
CONFIG=adbyby
ipt_n="iptables -t nat"
get_config()
{
config_get_bool enable $1 enable
config_get_bool cron_mode $1 cron_mode
config_get wan_mode $1 wan_mode
config_get_bool block_ios $1 block_ios 0
config_get_bool mem_mode $1 mem_mode 1
}
add_rules()
{
rm -f $DATA_PATH/user.bin
grep -v ^! $PROG_PATH/rules.txt > $DATA_PATH/user.txt
cp $PROG_PATH/rules.txt $DATA_PATH/rules.txt
}
add_cron()
{
if [ $cron_mode -eq 1 ]; then
sed -i '/adblock.sh/d' $CRON_FILE
echo '0 6 * * * /usr/share/adbyby/adblock.sh > /tmp/adupdate.log 2>&1' >> $CRON_FILE
crontab $CRON_FILE
fi
}
del_cron()
{
sed -i '/adblock.sh/d' $CRON_FILE
/etc/init.d/cron restart
}
ip_rule()
{
ipset -N adbyby_esc hash:ip
$ipt_n -A ADBYBY -m set --match-set adbyby_esc dst -j RETURN
for i in $(seq 0 100)
do
local ip=$(uci_get_by_type acl_rule ipaddr '' $i)
local mode=$(uci_get_by_type acl_rule filter_mode '' $i)
case "$mode" in
disable)
$ipt_n -A ADBYBY -s $ip -j RETURN
;;
global)
$ipt_n -A ADBYBY -s $ip -p tcp -j REDIRECT --to-ports 8118
$ipt_n -A ADBYBY -s $ip -j RETURN
;;
esac
done
case $wan_mode in
0)
;;
1)
ipset -N adbyby_wan hash:ip
$ipt_n -A ADBYBY -m set ! --match-set adbyby_wan dst -j RETURN
;;
2)
$ipt_n -I ADBYBY -j RETURN
;;
esac
echo "create blockip hash:net family inet hashsize 1024 maxelem 65536" > /tmp/blockip.ipset
awk '!/^$/&&!/^#/{printf("add blockip %s'" "'\n",$0)}' /usr/share/adbyby/blockip.conf >> /tmp/blockip.ipset
ipset -! restore < /tmp/blockip.ipset 2>/dev/null
iptables -I FORWARD -m set --match-set blockip dst -j DROP
iptables -I OUTPUT -m set --match-set blockip dst -j DROP
}
add_dns()
{
mkdir -p /var/etc/dnsmasq-adbyby.d
mkdir -p /tmp/dnsmasq.d
awk '!/^$/&&!/^#/{printf("ipset=/%s/'"adbyby_esc"'\n",$0)}' $PROG_PATH/adesc.conf > /var/etc/dnsmasq-adbyby.d/06-dnsmasq.esc
awk '!/^$/&&!/^#/{printf("address=/%s/'"0.0.0.0"'\n",$0)}' $PROG_PATH/adblack.conf > /var/etc/dnsmasq-adbyby.d/07-dnsmasq.black
cat > /tmp/dnsmasq.d/dnsmasq-adbyby.conf <<EOF
conf-dir=/var/etc/dnsmasq-adbyby.d
EOF
local var=1
if [ $wan_mode -eq 1 ]; then
awk '!/^$/&&!/^#/{printf("ipset=/%s/'"adbyby_wan"'\n",$0)}' $PROG_PATH/adhost.conf > $WAN_FILE
if ls /var/etc/dnsmasq-adbyby.d/* >/dev/null 2>&1; then
mkdir -p /tmp/dnsmasq.d
cp /usr/share/adbyby/dnsmasq.adblock /var/etc/dnsmasq-adbyby.d/04-dnsmasq.adblock
cp /usr/share/adbyby/dnsmasq.ads /var/etc/dnsmasq-adbyby.d/05-dnsmasq.ads
fi
fi
sed -i '/mesu.apple.com/d' /etc/dnsmasq.conf && [ $block_ios -eq 1 ] && echo 'address=/mesu.apple.com/0.0.0.0' >> /etc/dnsmasq.conf
}
del_dns()
{
rm -f /tmp/dnsmasq.d/dnsmasq-adbyby.conf
rm -f /var/etc/dnsmasq-adbyby.d/*
rm -f /tmp/adbyby_host.conf
}
add_rule()
{
$ipt_n -N ADBYBY
$ipt_n -A ADBYBY -d 0.0.0.0/8 -j RETURN
$ipt_n -A ADBYBY -d 10.0.0.0/8 -j RETURN
$ipt_n -A ADBYBY -d 127.0.0.0/8 -j RETURN
$ipt_n -A ADBYBY -d 169.254.0.0/16 -j RETURN
$ipt_n -A ADBYBY -d 172.16.0.0/12 -j RETURN
$ipt_n -A ADBYBY -d 192.168.0.0/16 -j RETURN
$ipt_n -A ADBYBY -d 224.0.0.0/4 -j RETURN
$ipt_n -A ADBYBY -d 240.0.0.0/4 -j RETURN
ip_rule
$ipt_n -A ADBYBY -p tcp -j REDIRECT --to-ports 8118
$ipt_n -I PREROUTING -p tcp --dport 80 -j ADBYBY
}
del_rule()
{
$ipt_n -D PREROUTING -p tcp --dport 80 -j ADBYBY 2>/dev/null
$ipt_n -F ADBYBY 2>/dev/null
$ipt_n -X ADBYBY 2>/dev/null
iptables -D FORWARD -m set --match-set blockip dst -j DROP 2>/dev/null
iptables -D OUTPUT -m set --match-set blockip dst -j DROP 2>/dev/null
ipset -F adbyby_esc 2>/dev/null
ipset -X adbyby_esc 2>/dev/null
ipset -F adbyby_wan 2>/dev/null
ipset -X adbyby_wan 2>/dev/null
ipset -F blockip 2>/dev/null
ipset -X blockip 2>/dev/null
}
reload_rule()
{
config_load adbyby
config_foreach get_config adbyby
del_rule
iptables-save | grep ADBYBY >/dev/null || \
add_rule
}
start()
{
config_load adbyby
config_foreach get_config adbyby
[ $enable -eq 0 ] && exit 0
add_cron
if [ $mem_mode -eq 1 ]; then
echo "start mem mode"
if mount | grep adbyby >/dev/null 2>&1; then
echo "has mount"
else
echo "mount adbyby"
[ ! -d "/tmp/adbyby" ] && mkdir -p /tmp/adbyby && cp -a $PROG_PATH/data /tmp/adbyby/
mount --bind /tmp/adbyby/data $PROG_PATH/data
fi
fi
echo "add adbyby rules"
add_rules
$PROG_PATH/adbyby &>/dev/null &
add_dns
iptables-save | grep ADBYBY >/dev/null || \
add_rule
/etc/init.d/dnsmasq restart
}
stop()
{
config_load adbyby
config_foreach get_config adbyby
del_rule
del_cron
del_dns
killall -q adbyby
if [ $mem_mode -eq 1 ]; then
echo "stop mem mode"
if mount | grep adbyby >/dev/null 2>&1; then
echo "umount adbyby"
umount /usr/share/adbyby/data
fi
fi
/etc/init.d/dnsmasq restart
}
uci_get_by_name() {
local ret=$(uci get $CONFIG.$1.$2 2>/dev/null)
echo ${ret:=$3}
}
uci_get_by_type() {
local index=0
if [ -n $4 ]; then
index=$4
fi
local ret=$(uci get $CONFIG.@$1[$index].$2 2>/dev/null)
echo ${ret:=$3}
}

View File

@ -0,0 +1,21 @@
#!/bin/sh
uci -q batch <<-EOF >/dev/null
delete ucitrack.@adbyby[-1]
add ucitrack adbyby
set ucitrack.@adbyby[-1].init=adbyby
commit ucitrack
delete firewall.adbyby
set firewall.adbyby=include
set firewall.adbyby.type=script
set firewall.adbyby.path=/usr/share/adbyby/firewall.include
set firewall.adbyby.reload=1
commit firewall
EOF
mkdir -p /etc/dnsmasq.d
/etc/init.d/adbyby enable
rm -f /tmp/luci-indexcache
exit 0

View File

@ -0,0 +1 @@
gvod.aiseejapp.atianqi.com

View File

@ -0,0 +1,17 @@
#!/bin/sh
rm -f /tmp/dnsmasq.adblock
wget-ssl --no-check-certificate -O- https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt | grep ^\|\|[^\*]*\^$ | sed -e 's:||:address\=\/:' -e 's:\^:/0\.0\.0\.0:' > /tmp/dnsmasq.adblock
if [ -s "/tmp/dnsmasq.adblock" ];then
sed -i '/youku.com/d' /tmp/dnsmasq.adblock
if ( ! cmp -s /tmp/dnsmasq.adblock /usr/share/adbyby/dnsmasq.adblock );then
mv /tmp/dnsmasq.adblock /usr/share/adbyby/dnsmasq.adblock
fi
fi
sh /usr/share/adbyby/adupdate.sh

View File

@ -0,0 +1,3 @@
weixin.qq.com
qpic.cn
imtt.qq.com

View File

@ -0,0 +1,69 @@
cbjs.baidu.com
list.video.baidu.com
nsclick.baidu.com
play.baidu.com
sclick.baidu.com
tieba.baidu.com
baidustatic.com
bdimg.com
bdstatic.com
share.baidu.com
hm.baidu.com
v.baidu.com
cpro.baidu.com
1000fr.net
atianqi.com
56.com
v-56.com
acfun.com
acfun.tv
baofeng.com
baofeng.net
cntv.cn
hoopchina.com.cn
funshion.com
fun.tv
hitvs.cn
hljtv.com
iqiyi.com
qiyi.com
agn.aty.sohu.com
itc.cn
kankan.com
ku6.com
letv.com
letvcloud.com
letvimg.com
pplive.cn
pps.tv
ppsimg.com
pptv.com
www.qq.com
l.qq.com
v.qq.com
video.sina.com.cn
tudou.com
wasu.cn
analytics-union.xunlei.com
kankan.xunlei.com
youku.com
hunantv.com
ifeng.com
renren.com
mediav.com
cnbeta.com
mydrivers.com
168f.info
doubleclick.net
126.net
sohu.com
163.com
right.com.cn
50bang.org
you85.cn
jiuzhilan.com
googles.com
cnbetacdn.com
ptqy.gitv.tv
admaster.com.cn
serving-sys.com

View File

@ -0,0 +1,16 @@
#!/bin/sh
wget -t 1 -T 10 -O /tmp/lazy.txt http://update.adbyby.com/rule3/lazy.jpg
wget -t 1 -T 10 -O /tmp/video.txt http://update.adbyby.com/rule3/video.jpg
wget -t 1 -T 10 -O /tmp/user.action http://update.adbyby.com/rule3/user.action
[ ! -s "/tmp/lazy.txt" ] && wget --no-check-certificate -O /tmp/lazy.txt https://raw.githubusercontent.com/adbyby/xwhyc-rules/master/lazy.txt
[ ! -s "/tmp/video.txt" ] && wget --no-check-certificate -O /tmp/video.txt https://raw.githubusercontent.com/adbyby/xwhyc-rules/master/video.txt
[ -s "/tmp/lazy.txt" ] && ( ! cmp -s /tmp/lazy.txt /usr/share/adbyby/data/lazy.txt ) && mv /tmp/lazy.txt /usr/share/adbyby/data/lazy.txt
[ -s "/tmp/video.txt" ] && ( ! cmp -s /tmp/video.txt /usr/share/adbyby/data/video.txt ) && mv /tmp/video.txt /usr/share/adbyby/data/video.txt
[ -s "/tmp/user.action" ] && ( ! cmp -s /tmp/user.action /usr/share/adbyby/user.action ) && mv /tmp/user.action /usr/share/adbyby/user.action
rm -f /tmp/lazy.txt /tmp/video.txt /tmp/user.action
/etc/init.d/adbyby restart

View File

@ -0,0 +1 @@
1.1.1.1

View File

@ -0,0 +1,940 @@
address=/a.youdao.com/0.0.0.0
address=/adrs.sdo.com/0.0.0.0
address=/hiad.myweb.hinet.net/0.0.0.0
address=/log.interest.mix.sina.com.cn/0.0.0.0
address=/tuiguang.178.com/0.0.0.0
address=/0xxd.com/0.0.0.0
address=/104.195.62.12/0.0.0.0
address=/111.175.219.7/0.0.0.0
address=/111111qb.com/0.0.0.0
address=/112.124.98.75/0.0.0.0
address=/116.55.227.242/0.0.0.0
address=/122.227.254.195/0.0.0.0
address=/123hala.com/0.0.0.0
address=/139.159.32.82/0.0.0.0
address=/182.92.81.104/0.0.0.0
address=/1l1.cc/0.0.0.0
address=/201071.com/0.0.0.0
address=/2012ui.com/0.0.0.0
address=/211.167.105.131/0.0.0.0
address=/220.115.251.25/0.0.0.0
address=/221.204.213.222/0.0.0.0
address=/2m2n.com/0.0.0.0
address=/360baidus.com/0.0.0.0
address=/365bibi.com/0.0.0.0
address=/365safego.com/0.0.0.0
address=/366safego.com/0.0.0.0
address=/36pn.com/0.0.0.0
address=/3g.990.net/0.0.0.0
address=/52kmk.com/0.0.0.0
address=/58.215.179.159/0.0.0.0
address=/61.152.223.15/0.0.0.0
address=/68665565.com/0.0.0.0
address=/6dvip.com/0.0.0.0
address=/71sem.com/0.0.0.0
address=/77power.com/0.0.0.0
address=/7wen.cn/0.0.0.0
address=/7xz3.com/0.0.0.0
address=/81c.cn/0.0.0.0
address=/85tgw.com/0.0.0.0
address=/88rpg.net/0.0.0.0
address=/892155.com/0.0.0.0
address=/91ysa.com/0.0.0.0
address=/91zgm.com/0.0.0.0
address=/9377co.com/0.0.0.0
address=/9377os.com/0.0.0.0
address=/a907907.com/0.0.0.0
address=/ad000000.com/0.0.0.0
address=/adm-cnzz.net/0.0.0.0
address=/ads.uc.cn/0.0.0.0
address=/ajaxcdn.org/0.0.0.0
address=/aliyuncss.com/0.0.0.0
address=/aliyunxin.com/0.0.0.0
address=/amazingmagics.com/0.0.0.0
address=/aralego.com/0.0.0.0
address=/at98.com/0.0.0.0
address=/cangnews.com/0.0.0.0
address=/caob5.info/0.0.0.0
address=/cb.baidu.com/0.0.0.0
address=/cbjs.baidu.com/0.0.0.0
address=/cnxad.net/0.0.0.0
address=/cnzz.com.so/0.0.0.0
address=/code668.com/0.0.0.0
address=/cpcv.cc/0.0.0.0
address=/cpms.cc/0.0.0.0
address=/cpro.baidu.com/0.0.0.0
address=/cpro.baidustatic.com/0.0.0.0
address=/cpv6.com/0.0.0.0
address=/cpva.cc/0.0.0.0
address=/crdrjs.info/0.0.0.0
address=/csqiulong.com/0.0.0.0
address=/ctsywy.com/0.0.0.0
address=/cyacc.com/0.0.0.0
address=/czpush.com/0.0.0.0
address=/dashet.com/0.0.0.0
address=/datafastguru.info/0.0.0.0
address=/dou777.com/0.0.0.0
address=/drmcmm.baidu.com/0.0.0.0
address=/duiwai.baidu.com/0.0.0.0
address=/dvr8.com/0.0.0.0
address=/dw998.com/0.0.0.0
address=/dxssiyi.com/0.0.0.0
address=/e701.net/0.0.0.0
address=/e70123.com/0.0.0.0
address=/e708.net/0.0.0.0
address=/e719.net/0.0.0.0
address=/ecuc123.net/0.0.0.0
address=/eiv.baidu.com/0.0.0.0
address=/f1190.com/0.0.0.0
address=/f6ce.com/0.0.0.0
address=/f70123.com/0.0.0.0
address=/fd7c.com/0.0.0.0
address=/fjmeyer.com/0.0.0.0
address=/fu68.com/0.0.0.0
address=/fv99.com/0.0.0.0
address=/gf108.com/0.0.0.0
address=/gf1352.com/0.0.0.0
address=/gm682.com/0.0.0.0
address=/guduopu.com/0.0.0.0
address=/gzmjnx.cn/0.0.0.0
address=/gzqudou.com/0.0.0.0
address=/hao123rt.com/0.0.0.0
address=/haohaowan8.com/0.0.0.0
address=/haolew.com/0.0.0.0
address=/hfjuki.com/0.0.0.0
address=/hmp33.com/0.0.0.0
address=/hr44.com/0.0.0.0
address=/humanding.com/0.0.0.0
address=/i3818.com/0.0.0.0
address=/ihualun.com/0.0.0.0
address=/img80.net/0.0.0.0
address=/jczzjx.com/0.0.0.0
address=/jdlhg.com/0.0.0.0
address=/jhzl001.com/0.0.0.0
address=/jiyou2014.com/0.0.0.0
address=/jk939.com/0.0.0.0
address=/jlssbz.com/0.0.0.0
address=/jnrsjm.com/0.0.0.0
address=/johtzj.com/0.0.0.0
address=/jwqj.net/0.0.0.0
address=/jxjzny.com/0.0.0.0
address=/keyyou.net/0.0.0.0
address=/kingwam.com/0.0.0.0
address=/kmadou.com/0.0.0.0
address=/ku9377.com/0.0.0.0
address=/lajizhan.org/0.0.0.0
address=/le4le.com/0.0.0.0
address=/lishuanghao.com/0.0.0.0
address=/lzmm8.com/0.0.0.0
address=/mainbx.com/0.0.0.0
address=/mathads.com/0.0.0.0
address=/mlt01.com/0.0.0.0
address=/moodoocrv.com.cn/0.0.0.0
address=/mscimg.com/0.0.0.0
address=/nextcps.com/0.0.0.0
address=/niuxgame77.com/0.0.0.0
address=/notice.uchome.manyou.com/0.0.0.0
address=/oikxlcv.wang/0.0.0.0
address=/okm918.com/0.0.0.0
address=/p3tt.com/0.0.0.0
address=/pdsjycm.com/0.0.0.0
address=/pos.baidu.com/0.0.0.0
address=/qiqiww.com/0.0.0.0
address=/qucaigg.com/0.0.0.0
address=/re.taotaosou.com/0.0.0.0
address=/ruxianke.com/0.0.0.0
address=/rwjfs.com/0.0.0.0
address=/sgbfjs.info/0.0.0.0
address=/sharedaddomain.com/0.0.0.0
address=/show.kc.taotaosou.com/0.0.0.0
address=/si9377.com/0.0.0.0
address=/socdm.com/0.0.0.0
address=/spcode.baidu.com/0.0.0.0
address=/sstc360.com/0.0.0.0
address=/t70123.com/0.0.0.0
address=/taat00889.com/0.0.0.0
address=/tad.suning.com/0.0.0.0
address=/tc600.com/0.0.0.0
address=/tdayi.com/0.0.0.0
address=/tg.1155t.cn/0.0.0.0
address=/toourbb.com/0.0.0.0
address=/ubmcmm.baidustatic.com/0.0.0.0
address=/uoyrsd.com/0.0.0.0
address=/v707070.com/0.0.0.0
address=/victorjx.com/0.0.0.0
address=/w65p.com/0.0.0.0
address=/wdzsb.com.cn/0.0.0.0
address=/winvestern.com.cn/0.0.0.0
address=/wqsph.net/0.0.0.0
address=/ws341.com/0.0.0.0
address=/xa9t.com/0.0.0.0
address=/xabaitai.com/0.0.0.0
address=/xchgx.com/0.0.0.0
address=/xcy8.com/0.0.0.0
address=/xtxa.net/0.0.0.0
address=/xxad.cc/0.0.0.0
address=/xzyituo.com/0.0.0.0
address=/yk0712.com/0.0.0.0
address=/ymcqb.com/0.0.0.0
address=/yqw88.com/0.0.0.0
address=/yule8.net/0.0.0.0
address=/yyp17.com/0.0.0.0
address=/zgksb.com/0.0.0.0
address=/zgunion.cn/0.0.0.0
address=/zp22938576.com/0.0.0.0
address=/120.27.34.156/0.0.0.0
address=/122.228.236.165/0.0.0.0
address=/125.46.61.28/0.0.0.0
address=/192.184.10.171/0.0.0.0
address=/218.65.30.232/0.0.0.0
address=/27.255.67.120/0.0.0.0
address=/32345sf.com/0.0.0.0
address=/360safego.com/0.0.0.0
address=/3dm.huya.com/0.0.0.0
address=/5y9nfpes.52pk.com/0.0.0.0
address=/654mmm.com/0.0.0.0
address=/6d245gxt.52pk.com/0.0.0.0
address=/7mad.7m.cn/0.0.0.0
address=/801.tianyaui.com/0.0.0.0
address=/86file.megajoy.com/0.0.0.0
address=/8jkx.com/0.0.0.0
address=/96.43.97.243/0.0.0.0
address=/a-m-s.poco.cn/0.0.0.0
address=/a.baomihua.com/0.0.0.0
address=/a.xizi.com/0.0.0.0
address=/a2.b310.com/0.0.0.0
address=/a4.yeshj.com/0.0.0.0
address=/a5.yeshj.com/0.0.0.0
address=/a6.hujiang.com/0.0.0.0
address=/abc.hkepc.com/0.0.0.0
address=/acsystem.wasu.cn/0.0.0.0
address=/ad.17173.com/0.0.0.0
address=/ad.bjmama.net/0.0.0.0
address=/adadmin.house365.com/0.0.0.0
address=/add.dz19.net/0.0.0.0
address=/adf.dahe.cn/0.0.0.0
address=/adhome.1fangchan.com/0.0.0.0
address=/adk.funshion.com/0.0.0.0
address=/adm.265g.com/0.0.0.0
address=/adm.72zx.com/0.0.0.0
address=/adm.86wan.com/0.0.0.0
address=/adm.bbcss.com/0.0.0.0
address=/adm.funshion.com/0.0.0.0
address=/adm.jjj8.cn/0.0.0.0
address=/adm.qzbbs.com/0.0.0.0
address=/adm.xmfish.com/0.0.0.0
address=/adm.zbinfo.net/0.0.0.0
address=/adm.zzfish.cn/0.0.0.0
address=/admd.yam.com/0.0.0.0
address=/adnetpub.yaolan.com/0.0.0.0
address=/adp.cnool.net/0.0.0.0
address=/adpub.yaolan.com/0.0.0.0
address=/adpubs.yaolan.com/0.0.0.0
address=/adsclick.yx.js.cn/0.0.0.0
address=/adspending01.bwnet.com.tw/0.0.0.0
address=/afp.chinanews.com/0.0.0.0
address=/afp.wasu.cn/0.0.0.0
address=/afpcreative.wasu.cn/0.0.0.0
address=/ai.bioon.com/0.0.0.0
address=/aid.chinayk.com/0.0.0.0
address=/am.6park.com/0.0.0.0
address=/am.szhome.com/0.0.0.0
address=/app.acm.dzwww.com/0.0.0.0
address=/as.sinahk.net/0.0.0.0
address=/ashow.pcpop.com/0.0.0.0
address=/bb345.com/0.0.0.0
address=/besc.baidustatic.com/0.0.0.0
address=/biz.gexing.com/0.0.0.0
address=/biz.weibo.com/0.0.0.0
address=/btn.onlylady.com/0.0.0.0
address=/btn.pchome.net/0.0.0.0
address=/business.92wy.com/0.0.0.0
address=/by.7avz.com/0.0.0.0
address=/cacafly.net/0.0.0.0
address=/cachead.com/0.0.0.0
address=/cdn.wdlm.cn/0.0.0.0
address=/chidir.com/0.0.0.0
address=/cps.okbuy.com/0.0.0.0
address=/d.107788.com/0.0.0.0
address=/d.taomato.com/0.0.0.0
address=/d0.xcar.com.cn/0.0.0.0
address=/dd.xdnice.com/0.0.0.0
address=/de.as.pptv.com/0.0.0.0
address=/dfad.dfdaily.com/0.0.0.0
address=/dg.073img.com/0.0.0.0
address=/doubleclick.tv002.com/0.0.0.0
address=/dvs.china.com/0.0.0.0
address=/dvser.china.com/0.0.0.0
address=/e.yycqc.com/0.0.0.0
address=/eap.big5.enorth.com.cn/0.0.0.0
address=/eap.enorth.com.cn/0.0.0.0
address=/ebp.renren.com/0.0.0.0
address=/ecma.bdimg.com/0.0.0.0
address=/ecmb.bdimg.com/0.0.0.0
address=/fun.ynet.com/0.0.0.0
address=/g.gxorg.com/0.0.0.0
address=/g.hsw.cn/0.0.0.0
address=/g.ousns.net/0.0.0.0
address=/g1.0573ren.com/0.0.0.0
address=/g2.ousns.net/0.0.0.0
address=/ganjituiguang.ganji.com/0.0.0.0
address=/gdt.qq.com/0.0.0.0
address=/get.766.com/0.0.0.0
address=/gg.0598yu.com/0.0.0.0
address=/gg.18183.com/0.0.0.0
address=/gg.cs090.com/0.0.0.0
address=/gg.gao7.com/0.0.0.0
address=/gg.kugou.com/0.0.0.0
address=/gg.sonhoo.com/0.0.0.0
address=/gg.yxdown.com/0.0.0.0
address=/ggg.zj.com/0.0.0.0
address=/ggw.gusuwang.com/0.0.0.0
address=/ggw.watertu.com/0.0.0.0
address=/ggyq.xdkb.net/0.0.0.0
address=/go.hangzhou.com.cn/0.0.0.0
address=/goto.www.iciba.com/0.0.0.0
address=/gqgc.sz.zj.cn/0.0.0.0
address=/groupa.onlylady.com/0.0.0.0
address=/gsspcln.jp/0.0.0.0
address=/gt.yy.com/0.0.0.0
address=/guess.h.qhimg.com/0.0.0.0
address=/haxiu.miaotiao.com/0.0.0.0
address=/hdad.baike.com/0.0.0.0
address=/hiad.vmall.com/0.0.0.0
address=/hz.shouyoutv.com/0.0.0.0
address=/hzhyhm.com/0.0.0.0
address=/i.syasn.com/0.0.0.0
address=/iads.xinmin.cn/0.0.0.0
address=/idcot.com/0.0.0.0
address=/ifx.aifang.com/0.0.0.0
address=/image.6park.com/0.0.0.0
address=/image.9duw.com/0.0.0.0
address=/image.hh010.com/0.0.0.0
address=/image.lepan.cc/0.0.0.0
address=/images.chinaz.com/0.0.0.0
address=/images.gxsky.com/0.0.0.0
address=/img.3sjt.com/0.0.0.0
address=/img.9duw.com/0.0.0.0
address=/img1.126.net/0.0.0.0
address=/img2.126.net/0.0.0.0
address=/img2.www.fmdisk.com/0.0.0.0
address=/inte.sogou.com/0.0.0.0
address=/iwanad.baidu.com/0.0.0.0
address=/j.6avz.com/0.0.0.0
address=/j.7avz.com/0.0.0.0
address=/ja.gamersky.com/0.0.0.0
address=/jmsyzj.com/0.0.0.0
address=/js-1.pchome.net/0.0.0.0
address=/js.duotegame.com/0.0.0.0
address=/js.leshen.com/0.0.0.0
address=/js.pub.tom.com/0.0.0.0
address=/js.youxi369.com/0.0.0.0
address=/jxad.jx163.com/0.0.0.0
address=/knnwdyou.com/0.0.0.0
address=/leiqun.snxyf.com/0.0.0.0
address=/life.e0575.com/0.0.0.0
address=/lingdian98.com/0.0.0.0
address=/link.fobshanghai.com/0.0.0.0
address=/lxting.com/0.0.0.0
address=/m.aty.sohu.com/0.0.0.0
address=/manads.static.olcdn.com/0.0.0.0
address=/manage.wdfans.cn/0.0.0.0
address=/market.178.com/0.0.0.0
address=/market.21cn.com/0.0.0.0
address=/market.duowan.com/0.0.0.0
address=/media.cheshi-img.com/0.0.0.0
address=/money.qz828.com/0.0.0.0
address=/myad.toocle.com/0.0.0.0
address=/ok.432kkk.com/0.0.0.0
address=/p.szonline.net/0.0.0.0
address=/p.zol-img.com.cn/0.0.0.0
address=/p4p.sina.com.cn/0.0.0.0
address=/p8u.hinet.net/0.0.0.0
address=/panda.kdnet.net/0.0.0.0
address=/pcs1.app.joy.cn/0.0.0.0
address=/phpad.cqnews.net/0.0.0.0
address=/pic.0597kk.com/0.0.0.0
address=/pic.111cn.net/0.0.0.0
address=/pic.2u.com.cn/0.0.0.0
address=/pic.ea3w.com/0.0.0.0
address=/pic.fengniao.com/0.0.0.0
address=/pic.taian.com/0.0.0.0
address=/pic.xgo-img.com.cn/0.0.0.0
address=/playad.xjmg.com/0.0.0.0
address=/poster.weather.com.cn/0.0.0.0
address=/pp.7060.la/0.0.0.0
address=/pro.iweihai.cn/0.0.0.0
address=/pub.funshion.com/0.0.0.0
address=/pub.mop.com/0.0.0.0
address=/publicize.liao1.com/0.0.0.0
address=/publish.ad.youth.cn/0.0.0.0
address=/res.hunantv.com/0.0.0.0
address=/rh.qq.com/0.0.0.0
address=/same.chinadaily.com.cn/0.0.0.0
address=/same.eastmoney.com/0.0.0.0
address=/same.stockstar.com/0.0.0.0
address=/sc.tom.com/0.0.0.0
address=/sgg.southcn.com/0.0.0.0
address=/share.gzdsw.com/0.0.0.0
address=/shenleyuni.com/0.0.0.0
address=/shows.21cn.com/0.0.0.0
address=/so.6949.com/0.0.0.0
address=/sss.sege.xxx/0.0.0.0
address=/static.yujiehenaishang.com/0.0.0.0
address=/sub.powerapple.com/0.0.0.0
address=/super.cat898.com/0.0.0.0
address=/super.kdnet.net/0.0.0.0
address=/synacast.com/0.0.0.0
address=/tf.360.cn/0.0.0.0
address=/tg.delnapb.com/0.0.0.0
address=/tk.504pk.com/0.0.0.0
address=/tp.sgcn.com/0.0.0.0
address=/u.63kc.com/0.0.0.0
address=/u.cnzol.com/0.0.0.0
address=/union.china.com.cn/0.0.0.0
address=/untitled.dwstatic.com/0.0.0.0
address=/up.hiao.com/0.0.0.0
address=/v-56.com/0.0.0.0
address=/vas.funshion.com/0.0.0.0
address=/vupload.duowan.com/0.0.0.0
address=/web.900.la/0.0.0.0
address=/xc.macd.cn/0.0.0.0
address=/xs.houyi.baofeng.net/0.0.0.0
address=/yktj.yzz.cn/0.0.0.0
address=/zo66.com/0.0.0.0
address=/zt2088.com/0.0.0.0
address=/146.148.85.61/0.0.0.0
address=/hdapp1003-a.akamaihd.net/0.0.0.0
address=/hdapp1008-a.akamaihd.net/0.0.0.0
address=/hdsrc-a.akamaihd.net/0.0.0.0
address=/46.165.197.153/0.0.0.0
address=/46.165.197.231/0.0.0.0
address=/74.117.182.77/0.0.0.0
address=/78.140.131.214/0.0.0.0
address=/clkrev.com/0.0.0.0
address=/a.livesportmedia.eu/0.0.0.0
address=/a.ucoz.net/0.0.0.0
address=/a.watershed-publishing.com/0.0.0.0
address=/a04296f070c0146f314d-0dcad72565cb350972beb3666a86f246.r50.cf5.rackcdn.com/0.0.0.0
address=/ad.about.co.kr/0.0.0.0
address=/ad.accessmediaproductions.com/0.0.0.0
address=/ad.bitmedia.io/0.0.0.0
address=/ad.flux.com/0.0.0.0
address=/ad.foxnetworks.com/0.0.0.0
address=/ad.icasthq.com/0.0.0.0
address=/ad.idgtn.net/0.0.0.0
address=/ad.jamba.net/0.0.0.0
address=/ad.livere.co.kr/0.0.0.0
address=/ad.mail.ru/0.0.0.0
address=/ad.mesomorphosis.com/0.0.0.0
address=/ad.openmultimedia.biz/0.0.0.0
address=/ad.outsidehub.com/0.0.0.0
address=/ad.pickple.net/0.0.0.0
address=/ad.proxy.sh/0.0.0.0
address=/ad.r.worldssl.net/0.0.0.0
address=/ad.rambler.ru/0.0.0.0
address=/ad.reklamport.com/0.0.0.0
address=/ad.sensismediasmart.com.au/0.0.0.0
address=/ad.smartclip.net/0.0.0.0
address=/ad.spielothek.so/0.0.0.0
address=/ad.vidaroo.com/0.0.0.0
address=/ad.winningpartner.com/0.0.0.0
address=/add.bugun.com.tr/0.0.0.0
address=/adingo.jp.eimg.jp/0.0.0.0
address=/adn.ebay.com/0.0.0.0
address=/adplus.goo.mx/0.0.0.0
address=/ads.mp.mydas.mobi/0.0.0.0
address=/adscaspion.appspot.com/0.0.0.0
address=/adss.dotdo.net/0.0.0.0
address=/adz.zwee.ly/0.0.0.0
address=/aff.eteachergroup.com/0.0.0.0
address=/aff.marathonbet.com/0.0.0.0
address=/aff.svjump.com/0.0.0.0
address=/affil.mupromo.com/0.0.0.0
address=/affiliateprogram.keywordspy.com/0.0.0.0
address=/affiliates.allposters.com/0.0.0.0
address=/affiliatesmedia.sbobet.com/0.0.0.0
address=/affiliation.fotovista.com/0.0.0.0
address=/agenda.complex.com/0.0.0.0
address=/airpushmarketing.s3.amazonaws.com/0.0.0.0
address=/ais.abacast.com/0.0.0.0
address=/analytics.disneyinternational.com/0.0.0.0
address=/ard.ihookup.com/0.0.0.0
address=/award.sitekeuring.net/0.0.0.0
address=/b.babylon.com/0.0.0.0
address=/b.livesport.eu/0.0.0.0
address=/b92.putniktravel.com/0.0.0.0
address=/banner.101xp.com/0.0.0.0
address=/banner.3ddownloads.com/0.0.0.0
address=/banner.europacasino.com/0.0.0.0
address=/banner.telefragged.com/0.0.0.0
address=/banner.titancasino.com/0.0.0.0
address=/bl.wavecdn.de/0.0.0.0
address=/blamads-assets.s3.amazonaws.com/0.0.0.0
address=/bluhostedbanners.blucigs.com/0.0.0.0
address=/box.anchorfree.net/0.0.0.0
address=/btr.domywife.com/0.0.0.0
address=/c.netu.tv/0.0.0.0
address=/cas.clickability.com/0.0.0.0
address=/cash.neweramediaworks.com/0.0.0.0
address=/cerebral.typn.com/0.0.0.0
address=/cjmooter.xcache.kinxcdn.com/0.0.0.0
address=/clarity.abacast.com/0.0.0.0
address=/click.eyk.net/0.0.0.0
address=/clickstrip.6wav.es/0.0.0.0
address=/connect.summit.co.uk/0.0.0.0
address=/content.livesportmedia.eu/0.0.0.0
address=/cpm.amateurcommunity.de/0.0.0.0
address=/creatives.inmotionhosting.com/0.0.0.0
address=/creatives.summitconnect.co.uk/0.0.0.0
address=/d13czkep7ax7nj.cloudfront.net/0.0.0.0
address=/d140sbu1b1m3h0.cloudfront.net/0.0.0.0
address=/d15565yqt7pv7r.cloudfront.net/0.0.0.0
address=/d15gt9gwxw5wu0.cloudfront.net/0.0.0.0
address=/d17f2fxw547952.cloudfront.net/0.0.0.0
address=/d19972r8wdpby8.cloudfront.net/0.0.0.0
address=/d1ade4ciw4bqyc.cloudfront.net/0.0.0.0
address=/d1cl1sqtf3o420.cloudfront.net/0.0.0.0
address=/d1d95giojjkirt.cloudfront.net/0.0.0.0
address=/d1ep3cn6qx0l3z.cloudfront.net/0.0.0.0
address=/d1ey3fksimezm4.cloudfront.net/0.0.0.0
address=/d1fo96xm8fci0r.cloudfront.net/0.0.0.0
address=/d1gojtoka5qi10.cloudfront.net/0.0.0.0
address=/d1k74lgicilrr3.cloudfront.net/0.0.0.0
address=/d1noellhv8fksc.cloudfront.net/0.0.0.0
address=/d1pcttwib15k25.cloudfront.net/0.0.0.0
address=/d1pdpbxj733bb1.cloudfront.net/0.0.0.0
address=/d1spb7fplenrp4.cloudfront.net/0.0.0.0
address=/d1vbm0eveofcle.cloudfront.net/0.0.0.0
address=/d1zgderxoe1a.cloudfront.net/0.0.0.0
address=/d23guct4biwna6.cloudfront.net/0.0.0.0
address=/d23nyyb6dc29z6.cloudfront.net/0.0.0.0
address=/d25ruj6ht8bs1.cloudfront.net/0.0.0.0
address=/d25xkbr68qqtcn.cloudfront.net/0.0.0.0
address=/d26dzd2k67we08.cloudfront.net/0.0.0.0
address=/d26j9bp9bq4uhd.cloudfront.net/0.0.0.0
address=/d26wy0pxd3qqpv.cloudfront.net/0.0.0.0
address=/d27jt7xr4fq3e8.cloudfront.net/0.0.0.0
address=/d287x05ve9a63s.cloudfront.net/0.0.0.0
address=/d29r6igjpnoykg.cloudfront.net/0.0.0.0
address=/d2anfhdgjxf8s1.cloudfront.net/0.0.0.0
address=/d2b2x1ywompm1b.cloudfront.net/0.0.0.0
address=/d2b65ihpmocv7w.cloudfront.net/0.0.0.0
address=/d2bgg7rjywcwsy.cloudfront.net/0.0.0.0
address=/d2cxkkxhecdzsq.cloudfront.net/0.0.0.0
address=/d2d2lbvq8xirbs.cloudfront.net/0.0.0.0
address=/d2dxgm96wvaa5j.cloudfront.net/0.0.0.0
address=/d2gpgaupalra1d.cloudfront.net/0.0.0.0
address=/d2gtlljtkeiyzd.cloudfront.net/0.0.0.0
address=/d2gz6iop9uxobu.cloudfront.net/0.0.0.0
address=/d2hap2bsh1k9lw.cloudfront.net/0.0.0.0
address=/d2ipklohrie3lo.cloudfront.net/0.0.0.0
address=/d2mic0r0bo3i6z.cloudfront.net/0.0.0.0
address=/d2mq0uzafv8ytp.cloudfront.net/0.0.0.0
address=/d2nlytvx51ywh9.cloudfront.net/0.0.0.0
address=/d2o307dm5mqftz.cloudfront.net/0.0.0.0
address=/d2oallm7wrqvmi.cloudfront.net/0.0.0.0
address=/d2omcicc3a4zlg.cloudfront.net/0.0.0.0
address=/d2pgy8h4i30on1.cloudfront.net/0.0.0.0
address=/d2plxos94peuwp.cloudfront.net/0.0.0.0
address=/d2r359adnh3sfn.cloudfront.net/0.0.0.0
address=/d2s64zaa9ua7uv.cloudfront.net/0.0.0.0
address=/d2tgev5wuprbqq.cloudfront.net/0.0.0.0
address=/d2tnimpzlb191i.cloudfront.net/0.0.0.0
address=/d2ubicnllnnszy.cloudfront.net/0.0.0.0
address=/d2ue9k1rhsumed.cloudfront.net/0.0.0.0
address=/d2v4glj2m8yzg5.cloudfront.net/0.0.0.0
address=/d2v9ajh2eysdau.cloudfront.net/0.0.0.0
address=/d2vt6q0n0iy66w.cloudfront.net/0.0.0.0
address=/d2yhukq7vldf1u.cloudfront.net/0.0.0.0
address=/d2z1smm3i01tnr.cloudfront.net/0.0.0.0
address=/d31807xkria1x4.cloudfront.net/0.0.0.0
address=/d32pxqbknuxsuy.cloudfront.net/0.0.0.0
address=/d33f10u0pfpplc.cloudfront.net/0.0.0.0
address=/d33otidwg56k90.cloudfront.net/0.0.0.0
address=/d34obr29voew8l.cloudfront.net/0.0.0.0
address=/d34rdvn2ky3gnm.cloudfront.net/0.0.0.0
address=/d37kzqe5knnh6t.cloudfront.net/0.0.0.0
address=/d38pxm3dmrdu6d.cloudfront.net/0.0.0.0
address=/d38r21vtgndgb1.cloudfront.net/0.0.0.0
address=/d39xqloz8t5a6x.cloudfront.net/0.0.0.0
address=/d3bvcf24wln03d.cloudfront.net/0.0.0.0
address=/d3dphmosjk9rot.cloudfront.net/0.0.0.0
address=/d3f9mcik999dte.cloudfront.net/0.0.0.0
address=/d3fzrm6pcer44x.cloudfront.net/0.0.0.0
address=/d3irruagotonpp.cloudfront.net/0.0.0.0
address=/d3iwjrnl4m67rd.cloudfront.net/0.0.0.0
address=/d3lvr7yuk4uaui.cloudfront.net/0.0.0.0
address=/d3lzezfa753mqu.cloudfront.net/0.0.0.0
address=/d3m41swuqq4sv5.cloudfront.net/0.0.0.0
address=/d3nvrqlo8rj1kw.cloudfront.net/0.0.0.0
address=/d3p9ql8flgemg7.cloudfront.net/0.0.0.0
address=/d3pkae9owd2lcf.cloudfront.net/0.0.0.0
address=/d3q2dpprdsteo.cloudfront.net/0.0.0.0
address=/d3qszud4qdthr8.cloudfront.net/0.0.0.0
address=/d3t2wca0ou3lqz.cloudfront.net/0.0.0.0
address=/d3t9ip55bsuxrf.cloudfront.net/0.0.0.0
address=/d3tdefw8pwfkbk.cloudfront.net/0.0.0.0
address=/d3vc1nm9xbncz5.cloudfront.net/0.0.0.0
address=/d5pvnbpawsaav.cloudfront.net/0.0.0.0
address=/d6bdy3eto8fyu.cloudfront.net/0.0.0.0
address=/d8qy7md4cj3gz.cloudfront.net/0.0.0.0
address=/dal9hkyfi0m0n.cloudfront.net/0.0.0.0
address=/dart.clearchannel.com/0.0.0.0
address=/dasfdasfasdf.no-ip.info/0.0.0.0
address=/data.neuroxmedia.com/0.0.0.0
address=/dbam.dashbida.com/0.0.0.0
address=/ddwht76d9jvfl.cloudfront.net/0.0.0.0
address=/dew9ckzjyt2gn.cloudfront.net/0.0.0.0
address=/dff7tx5c2qbxc.cloudfront.net/0.0.0.0
address=/display.digitalriver.com/0.0.0.0
address=/disy2s34euyqm.cloudfront.net/0.0.0.0
address=/dizixdllzznrf.cloudfront.net/0.0.0.0
address=/djlf5xdlz7m8m.cloudfront.net/0.0.0.0
address=/dkd69bwkvrht1.cloudfront.net/0.0.0.0
address=/dkdwv3lcby5zi.cloudfront.net/0.0.0.0
address=/dl392qndlveq0.cloudfront.net/0.0.0.0
address=/dl5v5atodo7gn.cloudfront.net/0.0.0.0
address=/dlupv9uqtjlie.cloudfront.net/0.0.0.0
address=/dm0acvguygm9h.cloudfront.net/0.0.0.0
address=/dm8srf206hien.cloudfront.net/0.0.0.0
address=/dp51h10v6ggpa.cloudfront.net/0.0.0.0
address=/dpsq2uzakdgqz.cloudfront.net/0.0.0.0
address=/dq2tgxnc2knif.cloudfront.net/0.0.0.0
address=/dqhi3ea93ztgv.cloudfront.net/0.0.0.0
address=/dr8pk6ovub897.cloudfront.net/0.0.0.0
address=/duct5ntjian71.cloudfront.net/0.0.0.0
address=/dvf2u7vwmkr5w.cloudfront.net/0.0.0.0
address=/dvt4pepo9om3r.cloudfront.net/0.0.0.0
address=/dx5qvhwg92mjd.cloudfront.net/0.0.0.0
address=/dxq6c0tx3v6mm.cloudfront.net/0.0.0.0
address=/dxqd86uz345mg.cloudfront.net/0.0.0.0
address=/dy48bnzanqw0v.cloudfront.net/0.0.0.0
address=/dycpc40hvg4ki.cloudfront.net/0.0.0.0
address=/dyl3p6so5yozo.cloudfront.net/0.0.0.0
address=/epowernetworktrackerimages.s3.amazonaws.com/0.0.0.0
address=/euwidget.imshopping.com/0.0.0.0
address=/events.kalooga.com/0.0.0.0
address=/ext.theglobalweb.com/0.0.0.0
address=/feeds.logicbuy.com/0.0.0.0
address=/ft.pnop.com/0.0.0.0
address=/gateway.fortunelounge.com/0.0.0.0
address=/gateways.s3.amazonaws.com/0.0.0.0
address=/geo.connexionsecure.com/0.0.0.0
address=/geobanner.friendfinder.com/0.0.0.0
address=/geobanner.passion.com/0.0.0.0
address=/gfaf-banners.s3.amazonaws.com/0.0.0.0
address=/homad-global-configs.schneevonmorgen.com/0.0.0.0
address=/im.ov.yahoo.co.jp/0.0.0.0
address=/ima3vpaid.appspot.com/0.0.0.0
address=/indieclick.3janecdn.com/0.0.0.0
address=/inskin.vo.llnwd.net/0.0.0.0
address=/k2team.kyiv.ua/0.0.0.0
address=/mads.aol.com/0.0.0.0
address=/marketing.888.com/0.0.0.0
address=/mb.zam.com/0.0.0.0
address=/mozo-widgets.f2.com.au/0.0.0.0
address=/network.aufeminin.com/0.0.0.0
address=/network.business.com/0.0.0.0
address=/oclasrv.comindex-2.htmlapu.php/0.0.0.0
address=/odin.goo.mx/0.0.0.0
address=/on.maxspeedcdn.com/0.0.0.0
address=/ox-i.cordillera.tv/0.0.0.0
address=/partner.bargaindomains.com/0.0.0.0
address=/partner.catchy.com/0.0.0.0
address=/partner.premiumdomains.com/0.0.0.0
address=/partnerads.ysm.yahoo.com/0.0.0.0
address=/partnerads1.ysm.yahoo.com/0.0.0.0
address=/partners.fshealth.com/0.0.0.0
address=/partners.optiontide.com/0.0.0.0
address=/partners.rochen.com/0.0.0.0
address=/partners.sportingbet.com.au/0.0.0.0
address=/partners.vouchedfor.co.uk/0.0.0.0
address=/partners.xpertmarket.com/0.0.0.0
address=/priceinfo.comuv.com/0.0.0.0
address=/promos.fling.com/0.0.0.0
address=/promote.pair.com/0.0.0.0
address=/promotions.iasbet.com/0.0.0.0
address=/pub.betclick.com/0.0.0.0
address=/pubs.hiddennetwork.com/0.0.0.0
address=/rack.bauermedia.co.uk/0.0.0.0
address=/res3.feedsportal.com/0.0.0.0
address=/revealads.appspot.com/0.0.0.0
address=/rotabanner.kulichki.net/0.0.0.0
address=/rotator.tradetracker.net/0.0.0.0
address=/s-yoolk-banner-assets.yoolk.com/0.0.0.0
address=/s-yoolk-billboard-assets.yoolk.com/0.0.0.0
address=/secretmedia.s3.amazonaws.com/0.0.0.0
address=/servedby.keygamesnetwork.com/0.0.0.0
address=/sitescout-video-cdn.edgesuite.net/0.0.0.0
address=/slot.union.ucweb.com/0.0.0.0
address=/smart.styria-digital.com/0.0.0.0
address=/squarespace.evyy.net/0.0.0.0
address=/stats.hosting24.com/0.0.0.0
address=/stats.sitesuite.org/0.0.0.0
address=/stuff-nzwhistleout.s3.amazonaws.com/0.0.0.0
address=/survey.g.doubleclick.net/0.0.0.0
address=/syndication.jsadapi.com/0.0.0.0
address=/syndication1.viraladnetwork.net/0.0.0.0
address=/tap.more-results.net/0.0.0.0
address=/ti.tradetracker.net/0.0.0.0
address=/track.bcvcmedia.com/0.0.0.0
address=/twinplan.com/0.0.0.0
address=/vendor1.fitschigogerl.com/0.0.0.0
address=/web-jp.ad-v.jp/0.0.0.0
address=/whistleout.s3.amazonaws.com/0.0.0.0
address=/widget.crowdignite.com/0.0.0.0
address=/widget.kelkoo.com/0.0.0.0
address=/widget.raaze.com/0.0.0.0
address=/widget.searchschoolsnetwork.com/0.0.0.0
address=/widget.shopstyle.com.au/0.0.0.0
address=/widget.solarquotes.com.au/0.0.0.0
address=/widgets.realestate.com.au/0.0.0.0
address=/wtpn.twenga.co.uk/0.0.0.0
address=/wtpn.twenga.de/0.0.0.0
address=/yb.torchbrowser.com/0.0.0.0
address=/yeas.yahoo.co.jp/0.0.0.0
address=/zapads.zapak.com/0.0.0.0
address=/zeus.qj.net/0.0.0.0
address=/iadc.qwapi.com/0.0.0.0
address=/d1nmk7iw7hajjn.cloudfront.net/0.0.0.0
address=/ad.duga.jp/0.0.0.0
address=/ad.iloveinterracial.com/0.0.0.0
address=/ads.videosz.com/0.0.0.0
address=/affiliates.thrixxx.com/0.0.0.0
address=/ard.sweetdiscreet.com/0.0.0.0
address=/bannershotlink.perfectgonzo.com/0.0.0.0
address=/blaaaa12.googlecode.com/0.0.0.0
address=/br.blackfling.com/0.0.0.0
address=/br.fling.com/0.0.0.0
address=/br.realitykings.com/0.0.0.0
address=/cpm.amateurcommunity.com/0.0.0.0
address=/dailyvideo.securejoin.com/0.0.0.0
address=/desk.cmix.org/0.0.0.0
address=/feeds.videosz.com/0.0.0.0
address=/ff.nsg.org.ua/0.0.0.0
address=/freexxxvideoclip.aebn.net/0.0.0.0
address=/geo.cliphunter.com/0.0.0.0
address=/geo.frtya.com/0.0.0.0
address=/geobanner.adultfriendfinder.com/0.0.0.0
address=/geobanner.alt.com/0.0.0.0
address=/geobanner.socialflirt.com/0.0.0.0
address=/partners.pornerbros.com/0.0.0.0
address=/s1magnettvcom.maynemyltf.netdna-cdn.com/0.0.0.0
address=/surv.xbizmedia.com/0.0.0.0
address=/sweet.game-rust.ru/0.0.0.0
address=/widgets.comcontent.net/0.0.0.0
address=/widgetssec.cam-content.com/0.0.0.0
address=/a.cdngeek.net/0.0.0.0
address=/a.clipconverter.cc/0.0.0.0
address=/a.giantrealm.com/0.0.0.0
address=/a.i-sgcm.com/0.0.0.0
address=/a.kat.cr/0.0.0.0
address=/a.kickass.to/0.0.0.0
address=/a.lolwot.com/0.0.0.0
address=/ac2.msn.com/0.0.0.0
address=/access.njherald.com/0.0.0.0
address=/ad.cooks.com/0.0.0.0
address=/ad.digitimes.com.tw/0.0.0.0
address=/ad.directmirror.com/0.0.0.0
address=/ad.download.cnet.com/0.0.0.0
address=/ad.evozi.com/0.0.0.0
address=/ad.fnnews.com/0.0.0.0
address=/ad.jamster.com/0.0.0.0
address=/ad.lyricswire.com/0.0.0.0
address=/ad.mangareader.net/0.0.0.0
address=/ad.newegg.com/0.0.0.0
address=/ad.pandora.tv/0.0.0.0
address=/ad.reachlocal.com/0.0.0.0
address=/ad.search.ch/0.0.0.0
address=/ad.services.distractify.com/0.0.0.0
address=/adcitrus.com/0.0.0.0
address=/addirector.vindicosuite.com/0.0.0.0
address=/adds.weatherology.com/0.0.0.0
address=/adlink.shopsafe.co.nz/0.0.0.0
address=/admeta.vo.llnwd.net/0.0.0.0
address=/ads-rolandgarros.com/0.0.0.0
address=/ads.pof.com/0.0.0.0
address=/ads.yahoo.com/0.0.0.0
address=/ads.zynga.com/0.0.0.0
address=/adsatt.abcnews.starwave.com/0.0.0.0
address=/adsatt.espn.starwave.com/0.0.0.0
address=/adshare.freedocast.com/0.0.0.0
address=/adsor.openrunner.com/0.0.0.0
address=/adss.yahoo.com/0.0.0.0
address=/adstil.indiatimes.com/0.0.0.0
address=/adtest.theonion.com/0.0.0.0
address=/advertise.twitpic.com/0.0.0.0
address=/advice-ads-cdn.vice.com/0.0.0.0
address=/adx.kat.ph/0.0.0.0
address=/aff.lmgtfy.com/0.0.0.0
address=/ajnad.aljazeera.net/0.0.0.0
address=/amz.steamprices.com/0.0.0.0
address=/analytics.mmosite.com/0.0.0.0
address=/as.inbox.com/0.0.0.0
address=/asd.projectfreetv.so/0.0.0.0
address=/avpa.dzone.com/0.0.0.0
address=/b.localpages.com/0.0.0.0
address=/b.thefile.me/0.0.0.0
address=/ba.ccm2.net/0.0.0.0
address=/ba.kioskea.net/0.0.0.0
address=/banner.automotiveworld.com/0.0.0.0
address=/banner.itweb.co.za/0.0.0.0
address=/banners.beevpn.com/0.0.0.0
address=/banners.beted.com/0.0.0.0
address=/banners.clubworldgroup.com/0.0.0.0
address=/banners.expressindia.com/0.0.0.0
address=/banners.i-comers.com/0.0.0.0
address=/banners.itweb.co.za/0.0.0.0
address=/banners.playocio.com/0.0.0.0
address=/beap.gemini.yahoo.com/0.0.0.0
address=/bizanti.youwatch.org/0.0.0.0
address=/bnrs.ilm.ee/0.0.0.0
address=/bwp.theinsider.com.com/0.0.0.0
address=/cadvv.heraldm.com/0.0.0.0
address=/cadvv.koreaherald.com/0.0.0.0
address=/canvas.thenextweb.com/0.0.0.0
address=/click.livedoor.com/0.0.0.0
address=/clicks.superpages.com/0.0.0.0
address=/cnetwidget.creativemark.co.uk/0.0.0.0
address=/collector.viki.io/0.0.0.0
address=/creatives.livejasmin.com/0.0.0.0
address=/d.annarbor.com/0.0.0.0
address=/d.businessinsider.com/0.0.0.0
address=/d.gossipcenter.com/0.0.0.0
address=/d.thelocal.com/0.0.0.0
address=/dads.new.digg.com/0.0.0.0
address=/dailydeals.amarillo.com/0.0.0.0
address=/dailydeals.augustachronicle.com/0.0.0.0
address=/dailydeals.brainerddispatch.com/0.0.0.0
address=/dailydeals.lubbockonline.com/0.0.0.0
address=/dailydeals.onlineathens.com/0.0.0.0
address=/dailydeals.savannahnow.com/0.0.0.0
address=/dcad.watersoul.com/0.0.0.0
address=/deals.ledgertranscript.com/0.0.0.0
address=/digdug.divxnetworks.com/0.0.0.0
address=/display.superbay.net/0.0.0.0
address=/dontblockme.modaco.com/0.0.0.0
address=/ehow.com/media/ad.html/0.0.0.0
address=/eva.ucas.com/0.0.0.0
address=/fan.twitch.tv/0.0.0.0
address=/fimserve.ign.com/0.0.0.0
address=/findnsave.idahostatesman.com/0.0.0.0
address=/g.brothersoft.com/0.0.0.0
address=/gameads.digyourowngrave.com/0.0.0.0
address=/geoshopping.nzherald.co.nz/0.0.0.0
address=/get.thefile.me/0.0.0.0
address=/gfx.infomine.com/0.0.0.0
address=/green.virtual-nights.com/0.0.0.0
address=/hejban.youwatch.org/0.0.0.0
address=/ibanners.empoweredcomms.com.au/0.0.0.0
address=/iframe.travel.yahoo.com/0.0.0.0
address=/imads.rediff.com/0.0.0.0
address=/kat-ads.torrenticity.com/0.0.0.0
address=/keepthelighton.vpsboard.com/0.0.0.0
address=/kermit.macnn.com/0.0.0.0
address=/life.imagepix.org/0.0.0.0
address=/ll.a.hulu.com/0.0.0.0
address=/londonprivaterentals.standard.co.uk/0.0.0.0
address=/looky.hyves.org/0.0.0.0
address=/lw2.gamecopyworld.com/0.0.0.0
address=/mads.dailymail.co.uk/0.0.0.0
address=/marketingsolutions.yahoo.com/0.0.0.0
address=/mb.hockeybuzz.com/0.0.0.0
address=/mealsandsteals.sandiego6.com/0.0.0.0
address=/media-delivery.armorgames.com/0.0.0.0
address=/media-mgmt.armorgames.com/0.0.0.0
address=/mediamgr.ugo.com/0.0.0.0
address=/nest.youwatch.org/0.0.0.0
address=/netspidermm.indiatimes.com/0.0.0.0
address=/network.sofeminine.co.uk/0.0.0.0
address=/noram.srv.ysm.yahoo.com/0.0.0.0
address=/oas.autotrader.co.uk/0.0.0.0
address=/oas.skyscanner.net/0.0.0.0
address=/oasc07.citywire.co.uk/0.0.0.0
address=/oascentral.chron.com/0.0.0.0
address=/oascentral.hosted.ap.org/0.0.0.0
address=/oascentral.newsmax.com/0.0.0.0
address=/ox-d.rantsports.com/0.0.0.0
address=/ox-d.sbnation.com/0.0.0.0
address=/ox-d.wetransfer.com/0.0.0.0
address=/ox.furaffinity.net/0.0.0.0
address=/partners-z.com/0.0.0.0
address=/photo.net/equipment/pg-160/0.0.0.0
address=/player.1800coupon.com/0.0.0.0
address=/player.1stcreditrepairs.com/0.0.0.0
address=/player.800directories.com/0.0.0.0
address=/player.accoona.com/0.0.0.0
address=/player.alloutwedding.com/0.0.0.0
address=/player.insuranceandhealth.com/0.0.0.0
address=/pmm.people.com.cn/0.0.0.0
address=/pop-over.powered-by.justplayzone.com/0.0.0.0
address=/prerollads.ign.com/0.0.0.0
address=/promo.fileforum.com/0.0.0.0
address=/rad.microsoft.com/0.0.0.0
address=/rad.msn.com/0.0.0.0
address=/red.bayimg.net/0.0.0.0
address=/redvase.bravenet.com/0.0.0.0
address=/richmedia.yimg.com/0.0.0.0
address=/roia.com/0.0.0.0
address=/rpt.anchorfree.net/0.0.0.0
address=/searchignited.com/0.0.0.0
address=/sebar.thand.info/0.0.0.0
address=/shoppingpartners2.futurenet.com/0.0.0.0
address=/sponsors.s2ki.com/0.0.0.0
address=/sponsors.webosroundup.com/0.0.0.0
address=/srv.thespacereporter.com/0.0.0.0
address=/storewidget.pcauthority.com.au/0.0.0.0
address=/stream.heavenmedia.net/0.0.0.0
address=/tanzanite.infomine.com/0.0.0.0
address=/targetedinfo.com/0.0.0.0
address=/targetedtopic.com/0.0.0.0
address=/thejesperbay.com/0.0.0.0
address=/themis.yahoo.com/0.0.0.0
address=/tmcs.net/0.0.0.0
address=/tom.itv.com/0.0.0.0
address=/tracking.hostgator.com/0.0.0.0
address=/ua.badongo.com/0.0.0.0
address=/uimserv.net/0.0.0.0
address=/unicast.ign.com/0.0.0.0
address=/unicast.msn.com/0.0.0.0
address=/verdict.abc.go.com/0.0.0.0
address=/vice-ads-cdn.vice.com/0.0.0.0
address=/w.homes.yahoo.net/0.0.0.0
address=/webmaster.extabit.com/0.0.0.0
address=/widget.directory.dailycommercial.com/0.0.0.0
address=/x.castanet.net/0.0.0.0
address=/yea.uploadimagex.com/0.0.0.0
address=/yesbeby.whies.info/0.0.0.0
address=/yrt7dgkf.exashare.com/0.0.0.0
address=/ysm.yahoo.com/0.0.0.0
address=/zads.care2.com/0.0.0.0
address=/a.eporner.com/0.0.0.0
address=/a.heavy-r.com/0.0.0.0
address=/a.killergram-girls.com/0.0.0.0
address=/ad.eporner.com/0.0.0.0
address=/ad.slutload.com/0.0.0.0
address=/ad.thisav.com/0.0.0.0
address=/ad.userporn.com/0.0.0.0
address=/ads.xxxbunker.com/0.0.0.0
address=/affiliates.goodvibes.com/0.0.0.0
address=/banner1.pornhost.com/0.0.0.0
address=/banners.cams.com/0.0.0.0
address=/bob.crazyshit.com/0.0.0.0
address=/brcache.madthumbs.com/0.0.0.0
address=/creatives.cliphunter.com/0.0.0.0
address=/creatives.pichunter.com/0.0.0.0
address=/dot.eporner.com/0.0.0.0
address=/dot2.eporner.com/0.0.0.0
address=/exit.macandbumble.com/0.0.0.0
address=/lw1.cdmediaworld.com/0.0.0.0
address=/m2.xhamster.com/0.0.0.0
address=/partners.xhamster.com/0.0.0.0
address=/pr-static.empflix.com/0.0.0.0
address=/pr-static.tnaflix.com/0.0.0.0
address=/r.radikal.ru/0.0.0.0
address=/rev.fapdu.com/0.0.0.0
address=/site.img.4tube.com/0.0.0.0
address=/static.kinghost.com/0.0.0.0
address=/x.eroticity.net/0.0.0.0
address=/x.vipergirls.to/0.0.0.0

View File

@ -0,0 +1,4 @@
address=/p.tanx.com/0.0.0.0
address=/googlesyndication.com/0.0.0.0
address=/linkvans.com/0.0.0.0
server=/valf.atm.youku.com/114.114.114.114

View File

@ -0,0 +1,3 @@
ipset=/weixin.qq.com/adbyby_wan
ipset=/qpic.cn/adbyby_wan
ipset=/imtt.qq.com/adbyby_wan

View File

@ -0,0 +1,13 @@
#!/bin/sh
adbyby_enable=$(uci get adbyby.@adbyby[0].enable)
if [ $adbyby_enable -eq 1 ]; then
if pidof adbyby>/dev/null; then
/etc/init.d/adbyby reload_rule
else
/etc/init.d/adbyby restart
fi
fi

View File

@ -0,0 +1,15 @@
! ------------------------------ ADByby 自定义过滤语法简表---------------------------------
! -------------- 规则基于abp规则并进行了字符替换部分的扩展-----------------------------
! ABP规则请参考https://adblockplus.org/zh_CN/filters下面为大致摘要
! "!" 为行注释符,注释行以该符号起始作为一行注释语义,用于规则描述
! "*" 为字符通配符能够匹配0长度或任意长度的字符串该通配符不能与正则语法混用。
! "^" 为分隔符,可以是除了字母、数字或者 _ - . % 之外的任何字符。
! "|" 为管线符号,来表示地址的最前端或最末端
! "||" 为子域通配符,方便匹配主域名下的所有子域。
! "~" 为排除标识符,通配符能过滤大多数广告,但同时存在误杀, 可以通过排除标识符修正误杀链接。
! "##" 为元素选择器标识符后面跟需要隐藏元素的CSS样式例如 #ad_id .ad_class
!! 元素隐藏暂不支持全局规则和排除规则
!! 字符替换扩展
! 文本替换选择器标识符,后面跟需要替换的文本数据,格式:$s@模式字符串@替换后的文本@
! 支持通配符*和?
! -------------------------------------------------------------------------------------------

View File

@ -0,0 +1,19 @@
#
# Copyright (C) 2008-2014 The LuCI Team <luci@lists.subsignal.org>
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI for Aliddns
LUCI_DEPENDS:=+wget +openssl-util
LUCI_PKGARCH:=all
PKG_VERSION:=1.0
PKG_RELEASE:=1
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -0,0 +1,4 @@
module("luci.controller.aliddns",package.seeall)
function index()
entry({"admin","services","aliddns"},cbi("aliddns"),_("Aliddns Client"),101)
end

View File

@ -0,0 +1,52 @@
local a=require"luci.sys"
local e=luci.model.uci.cursor()
local e=require"nixio.fs"
require("luci.sys")
local t,e,o
local m,s
t=Map("aliddns",translate("阿里DDNS客户端"),translate("基于阿里云解析的私人DDNS解决方案"))
e=t:section(TypedSection,"base")
e.anonymous=true
e:tab("basic", translate("设置"))
enable=e:taboption("basic",Flag,"enable",translate("开启"),translate("开启或关闭aliddns动态域名"))
enable.rmempty=false
token=e:taboption("basic",Value,"app_key",translate("APP KEY"))
email=e:taboption("basic",Value,"app_secret",translate("APP SECRET"))
iface=e:taboption("basic",ListValue,"interface",translate("选择外网接口"),translate("限定要动态aliddns的外网接口如pppoe-wan"))
iface:value("",translate("选择要动态更新的外网接口"))
for t,e in ipairs(a.net.devices())do
if e~="lo"then iface:value(e)end
end
iface.rmempty=false
main=e:taboption("basic",Value,"main_domain",translate("主域名"),"想要解析的主域名,例如:baidu.com")
main.rmempty=false
sub=e:taboption("basic",Value,"sub_domain",translate("子域名"),"想要解析的子域名,例如:test hehe")
sub.rmempty=false
time=e:taboption("basic",Value,"time",translate("检查时间"),"域名检查时间单位分钟范围1-59")
time.rmempty=false
e:tab("log", translate("更新记录"))
--e=t:section(TypedSection,"base",translate("更新记录"))
e.anonymous=true
local a="/var/log/aliddns.log"
tvlog=e:taboption("log",TextValue,"sylogtext")
tvlog.rows=14
tvlog.readonly="readonly"
tvlog.wrap="off"
function tvlog.cfgvalue(e,e)
sylogtext=""
if a and nixio.fs.access(a)then
sylogtext=luci.sys.exec("tail -n 100 %s"%a)
end
return sylogtext
end
tvlog.write=function(e,e,e)
end
local e=luci.http.formvalue("cbi.apply")
if e then
io.popen("/etc/init.d/aliddns restart")
end
return t

View File

@ -0,0 +1,4 @@
msgid "Aliddns Client"
msgstr "阿里DDNS客户端"

View File

@ -0,0 +1,10 @@
config base 'base'
option time '30'
option enable '0'
option app_key '1'
option app_secret '1'
option interface 'br-lan'
option main_domain '1.com'
option sub_domain '2'

View File

@ -0,0 +1,18 @@
#!/bin/sh /etc/rc.common
START=80
restart()
{
/usr/sbin/aliddns
}
start()
{
/usr/sbin/aliddns
}
stop()
{
/usr/sbin/aliddns
}

View File

@ -0,0 +1,5 @@
#!/bin/sh
rm -f /tmp/luci-indexcache
exit 0

View File

@ -0,0 +1,126 @@
#!/bin/sh
aliddns_ak=`uci get aliddns.base.app_key 2>/dev/null`
aliddns_sk=`uci get aliddns.base.app_secret 2>/dev/null`
aliddns_record_id=`uci get aliddns.base.record_id 2>/dev/null`
time=`uci get aliddns.base.time 2>/dev/null`
aliddns_enable=`uci get aliddns.base.enable`
aliddns_domain=`uci get aliddns.base.main_domain 2>/dev/null`
aliddns_name=`uci get aliddns.base.sub_domain 2>/dev/null`
interface=`uci get aliddns.base.interface 2>/dev/null`
DATE=$(date +'%Y-%m-%d %H:%M:%S')
timestamp=`date -u "+%Y-%m-%dT%H%%3A%M%%3A%SZ"`
ip=$(ifconfig $interface 2> /dev/null | grep 'inet addr' | awk '{print $2}' | cut -d: -f2 2>/dev/null)
check_aliddns() {
#ip=`wget -qO- http://whatismyip.akamai.com/ 2>/dev/null`
current_ip=`nslookup $aliddns_name.$aliddns_domain | grep "Address 1"|tail -n1|cut -d' ' -f3 2>/dev/null`
echo "$DATE 当前路由IP: ${ip}" >> /var/log/aliddns.log
echo "$DATE 远程解析IP: ${current_ip}" >> /var/log/aliddns.log
if [ "$ip" = "$current_ip" ]
then
echo "$DATE IP未改变无需更新" >> /var/log/aliddns.log
exit 0
else
echo "$DATE 更新中..." >> /var/log/aliddns.log
fi
}
urlencode() {
# urlencode <string>
local length="${#1}"
i=0
out=""
for i in $(awk "BEGIN { for ( i=0; i<$length; i++ ) { print i; } }")
do
local c="${1:$i:1}"
case $c in
[a-zA-Z0-9._-]) out="$out$c" ;;
*) out="$out`printf '%%%02X' "'$c"`" ;;
esac
i=$(($i + 1))
done
echo -n $out
}
send_request() {
local args="AccessKeyId=$aliddns_ak&Action=$1&Format=json&$2&Version=2015-01-09"
local hash=$(urlencode $(echo -n "GET&%2F&$(urlencode $args)" | openssl dgst -sha1 -hmac "$aliddns_sk&" -binary | openssl base64))
wget -qO- "http://alidns.aliyuncs.com/?$args&Signature=$hash" 2> /dev/null
}
get_recordid() {
grep -Eo '"RecordId":"[0-9]+"' | cut -d':' -f2 | tr -d '"'
}
query_recordid() {
send_request "DescribeSubDomainRecords" "SignatureMethod=HMAC-SHA1&SignatureNonce=$timestamp&SignatureVersion=1.0&SubDomain=$aliddns_name.$aliddns_domain&Timestamp=$timestamp"
}
update_record() {
send_request "UpdateDomainRecord" "RR=$aliddns_name&RecordId=$1&SignatureMethod=HMAC-SHA1&SignatureNonce=$timestamp&SignatureVersion=1.0&Timestamp=$timestamp&Type=A&Value=$ip"
}
add_record() {
send_request "AddDomainRecord&DomainName=$aliddns_domain" "RR=$aliddns_name&SignatureMethod=HMAC-SHA1&SignatureNonce=$timestamp&SignatureVersion=1.0&Timestamp=$timestamp&Type=A&Value=$ip"
}
go_record() {
if [ "$aliddns_record_id" = "" ]
then
aliddns_record_id=`query_recordid | get_recordid`
fi
if [ "$aliddns_record_id" = "" ]
then
aliddns_record_id=`add_record | get_recordid`
echo "$DATE 添加 record $aliddns_record_id" >> /var/log/aliddns.log
else
update_record $aliddns_record_id
echo "$DATE 更新 record $aliddns_record_id" >> /var/log/aliddns.log
fi
# save to file
if [ "$aliddns_record_id" = "" ]; then
# failed
echo "$DATE : 更新出错,请检查设置!" >> /var/log/aliddns.log
exit 0
else
uci set aliddns.base.record_id=$aliddns_record_id
uci commit
echo "$DATE : 更新成功!($ip)" >> /var/log/aliddns.log
fi
}
#将执行脚本写入crontab定时运行
add_aliddns_cru(){
wirtecron=$(cat /etc/crontabs/root | grep "$time * * * *" | grep aliddns)
if [ -z "$wirtecron" ];then
sed -i '/aliddns/d' /etc/crontabs/root >/dev/null 2>&1
echo "*/$time * * * * /usr/sbin/aliddns" >> /etc/crontabs/root
fi
}
#清除过多记录
clean_log(){
logrow=$(grep -c "" /var/log/aliddns.log)
if [ $logrow -ge 15 ];then
cat /dev/null > /var/log/aliddns.log
echo "$DATE Log条数超限清空处理" >> /var/log/aliddns.log
fi
}
#停止服务
stop_aliddns(){
#停掉cru里的任务
sed -i '/aliddns/d' /etc/crontabs/root >/dev/null 2>&1
}
if [ "$aliddns_enable" != "1" ]; then
stop_aliddns
echo "$DATE : aliddns没有开启" >> /var/log/aliddns.log
else
clean_log
check_aliddns
go_record
add_aliddns_cru
fi

View File

@ -0,0 +1,15 @@
# Copyright (C) 2016 Openwrt.org
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI support for Amule
LUCI_DEPENDS:=+amule
LUCI_PKGARCH:=all
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -0,0 +1,160 @@
--[[
LuCI - Lua Configuration Interface - amule support
Copyright 2016 maz-1 <ohmygod19993@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
]]--
module("luci.controller.amule", package.seeall)
local uci = luci.model.uci.cursor()
local configdir = uci:get("amule", "main", "config_dir")
function index()
if not nixio.fs.access("/etc/config/amule") then
return
end
entry({"admin", "nas"}, firstchild(), "NAS", 45).dependent = false
local page = entry({"admin", "nas", "amule"}, cbi("amule"), _("aMule Settings"))
page.dependent = true
entry( {"admin", "nas", "amule", "logview"}, call("logread") ).leaf = true
entry( {"admin", "nas", "amule", "status"}, call("get_pid") ).leaf = true
entry( {"admin", "nas", "amule", "amulecmd"}, call("amulecmd") ).leaf = true
entry( {"admin", "nas", "amule", "startstop"}, post("startstop") ).leaf = true
entry( {"admin", "nas", "amule", "down_kad"}, post("down_kad") ).leaf = true
entry( {"admin", "nas", "amule", "down_ed2k"}, post("down_ed2k") ).leaf = true
end
-- called by XHR.get from detail_logview.htm
function logread()
-- read application settings
local uci = luci.model.uci.cursor()
local logdir = uci:get("amule", "main", "config_dir") or "/var/run/amule"
uci:unload("amule")
local ldata=nixio.fs.readfile(logdir .. "/logfile")
if not ldata or #ldata == 0 then
ldata="_nodata_"
end
luci.http.write(ldata)
end
-- called by XHR.get from detail_startstop.htm
function startstop()
local pid = get_pid(true)
if pid > 0 then
luci.sys.call("/etc/init.d/amule stop")
nixio.nanosleep(1) -- sleep a second
if nixio.kill(pid, 0) then -- still running
nixio.kill(pid, 9) -- send SIGKILL
end
pid = 0
else
luci.sys.call("/etc/init.d/amule start")
nixio.nanosleep(1) -- sleep a second
pid = tonumber(luci.sys.exec("pidof amuled")) or 0
if pid > 0 and not nixio.kill(pid, 0) then
pid = 0 -- process did not start
end
end
luci.http.write(tostring(pid)) -- HTTP needs string not number
end
function down_kad()
url = uci:get("amule", "main", "kad_nodes_url")
data_path = configdir .. "/nodes.dat"
proto = string.gsub(url, "://%S*", "")
proto_opt = ( proto == "https" ) and " --no-check-certificate" or ""
cmd = "wget -O /tmp/down_nodes.dat \"" .. url .. "\"" .. proto_opt ..
" && cat /tmp/down_nodes.dat > " .. "\"" .. data_path .. "\""
luci.sys.call(cmd)
end
function down_ed2k()
url = uci:get("amule", "main", "ed2k_servers_url")
data_path = configdir .. "/server.met"
proto = string.gsub(url, "://%S*", "")
proto_opt = ( proto == "https" ) and " --no-check-certificate" or ""
cmd = "wget -O /tmp/down_server.met \"" .. url .. "\"" .. proto_opt ..
" && cat /tmp/down_server.met > " .. "\"" .. data_path .. "\""
luci.sys.call(cmd)
end
-- called by XHR.poll from detail_startstop.htm
-- and from lua (with parameter "true")
function get_pid(from_lua)
local pid_amuled = tonumber(luci.sys.exec("pidof amuled")) or 0
local amuled_stat =false
if pid_amuled > 0 and not nixio.kill(pid_amuled, 0) then
pid_amuled = 0
end
if pid_amuled > 0 then
amuled_stat =true
else
amuled_stat =false
end
local pid_amuleweb = tonumber(luci.sys.exec("pidof amuleweb")) or 0
local amuleweb_stat = false
if pid_amuleweb > 0 and not nixio.kill(pid_amuleweb, 0) then
pid_amuleweb = 0
end
if pid_amuleweb > 0 then
amuleweb_stat =true
else
amuleweb_stat =false
end
local status = {
amuled = amuled_stat,
amuled_pid = pid_amuled,
amuleweb = amuleweb_stat
}
if from_lua then
return pid_amuled
else
luci.http.prepare_content("application/json")
luci.http.write_json(status)
end
end
function amulecmd()
local re =""
local rv = { }
local cmd = luci.http.formvalue("cmd")
local full_cmd = "HOME=\""..configdir.. "\" /usr/bin/amulecmd".." -c \""..cmd.."\" 2>&1"
local shellpipe = io.popen(full_cmd,"rw")
re = shellpipe:read("*a")
shellpipe:close()
if not re then
re=""
end
re = string.gsub(re, "This is amulecmd %S*\n", "")
re = string.gsub(re, "Creating client%S*\n", "")
re = string.gsub(re, "Succeeded! Connection established to aMule %S*\n", "")
re = string.gsub(re, "\n", "\r\n")
rv[#rv+1]=re
if #rv > 0 then
luci.http.prepare_content("application/json")
luci.http.write_json(rv)
return
end
luci.http.status(404, "No such device")
end

Some files were not shown because too many files have changed in this diff Show More