1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Add eBPF support to ShadowSocks

This commit is contained in:
Ycarus 2018-12-31 14:52:47 +01:00
parent bc15ea644e
commit d5e4f83c7c
4 changed files with 947 additions and 3 deletions

View file

@ -50,6 +50,10 @@ ss_mkjson_server_conf_() {
password="${password//\"/\\\"}"
key="$(echo $key | sed 's/+/-/g; s/\//_/g;')"
[ "$method" = "none" -a -z "$key" ] && key="none"
[ "$method" = "none-ebpf" -a -z "$key" ] && {
key="none"
method="none"
}
cat <<-EOF
${server:+${q}server${q}: ${q}$server${q},}
"server_port": $server_port,
@ -66,12 +70,14 @@ ss_mkjson_common_conf() {
[ "$reuse_port" = 0 ] && reuse_port=false || reuse_port=true
[ "$mptcp" = 0 ] && mptcp=false || mptcp=true
[ "$syslog" = 0 ] && syslog=false || syslog=true
[ "$method" = "none-ebpf" ] && ebpf=true || ebpf=false
cat <<-EOF
"use_syslog": $syslog,
"ipv6_first": $ipv6_first,
"fast_open": $fast_open,
"no_delay": $no_delay,
"mptcp": $mptcp,
"ebpf": $ebpf,
"reuse_port": $reuse_port,
${local_address:+${q}local_address${q}: ${q}$local_address${q},}
${local_port:+${q}local_port${q}: $local_port,}
@ -383,7 +389,7 @@ validate_common_server_options_() {
local cfgtype="$1"; shift
local cfg="$1"; shift
local func="$1"; shift
local stream_methods='"none", "table", "rc4", "rc4-md5", "aes-128-cfb", "aes-192-cfb", "aes-256-cfb", "aes-128-ctr", "aes-192-ctr", "aes-256-ctr", "bf-cfb", "camellia-128-cfb", "camellia-192-cfb", "camellia-256-cfb", "salsa20", "chacha20", "chacha20-ietf"'
local stream_methods='"none-ebpf", "none", "table", "rc4", "rc4-md5", "aes-128-cfb", "aes-192-cfb", "aes-256-cfb", "aes-128-ctr", "aes-192-ctr", "aes-256-ctr", "bf-cfb", "camellia-128-cfb", "camellia-192-cfb", "camellia-256-cfb", "salsa20", "chacha20", "chacha20-ietf"'
local aead_methods='"aes-128-gcm", "aes-192-gcm", "aes-256-gcm", "chacha20-ietf-poly1305", "xchacha20-ietf-poly1305"'
"${func:-ss_validate}" "$cfgtype" "$cfg" "$@" \