mirror of
https://github.com/bolucat/Archive.git
synced 2025-09-26 20:21:35 +08:00
Update On Sat Apr 26 20:33:20 CEST 2025
This commit is contained in:
1
.github/update.log
vendored
1
.github/update.log
vendored
@@ -980,3 +980,4 @@ Update On Fri Apr 18 20:35:44 CEST 2025
|
||||
Update On Sat Apr 19 20:35:13 CEST 2025
|
||||
Update On Fri Apr 25 14:32:58 CEST 2025
|
||||
Update On Fri Apr 25 20:35:32 CEST 2025
|
||||
Update On Sat Apr 26 20:33:12 CEST 2025
|
||||
|
@@ -2,7 +2,7 @@
|
||||
"manifest_version": 1,
|
||||
"latest": {
|
||||
"mihomo": "v1.19.5",
|
||||
"mihomo_alpha": "alpha-468cfc3",
|
||||
"mihomo_alpha": "alpha-a2f0ee7",
|
||||
"clash_rs": "v0.7.7",
|
||||
"clash_premium": "2023-09-05-gdcc8d87",
|
||||
"clash_rs_alpha": "0.7.7-alpha+sha.0abd79a"
|
||||
@@ -69,5 +69,5 @@
|
||||
"linux-armv7hf": "clash-armv7-unknown-linux-gnueabihf"
|
||||
}
|
||||
},
|
||||
"updated_at": "2025-04-24T22:21:16.043Z"
|
||||
"updated_at": "2025-04-25T22:21:31.448Z"
|
||||
}
|
||||
|
@@ -64,42 +64,7 @@ pub fn quit() {
|
||||
|
||||
// 在单独线程中处理资源清理,避免阻塞主线程
|
||||
std::thread::spawn(move || {
|
||||
use tokio::time::{timeout, Duration};
|
||||
let rt = tokio::runtime::Runtime::new().unwrap();
|
||||
let cleanup_result = rt.block_on(async {
|
||||
// 1. 处理TUN模式
|
||||
let tun_success = if Config::verge().data().enable_tun_mode.unwrap_or(false) {
|
||||
let disable_tun = serde_json::json!({
|
||||
"tun": {
|
||||
"enable": false
|
||||
}
|
||||
});
|
||||
timeout(
|
||||
Duration::from_secs(1),
|
||||
MihomoManager::global().patch_configs(disable_tun),
|
||||
)
|
||||
.await
|
||||
.is_ok()
|
||||
} else {
|
||||
true
|
||||
};
|
||||
|
||||
// 2. 顺序执行关键清理
|
||||
let proxy_res = timeout(
|
||||
Duration::from_secs(1),
|
||||
sysopt::Sysopt::global().reset_sysproxy(),
|
||||
)
|
||||
.await;
|
||||
|
||||
let core_res = timeout(Duration::from_secs(1), CoreManager::global().stop_core()).await;
|
||||
|
||||
// 3. 平台特定清理
|
||||
#[cfg(target_os = "macos")]
|
||||
let _dns_res = timeout(Duration::from_millis(500), resolve::restore_public_dns()).await;
|
||||
|
||||
tun_success && proxy_res.is_ok() && core_res.is_ok()
|
||||
});
|
||||
|
||||
let cleanup_result = clean();
|
||||
app_handle.exit(match cleanup_result {
|
||||
true => 0,
|
||||
false => 1,
|
||||
@@ -107,6 +72,45 @@ pub fn quit() {
|
||||
});
|
||||
}
|
||||
|
||||
pub fn clean() -> bool {
|
||||
use tokio::time::{timeout, Duration};
|
||||
let rt = tokio::runtime::Runtime::new().unwrap();
|
||||
let cleanup_result = rt.block_on(async {
|
||||
// 1. 处理TUN模式
|
||||
let tun_success = if Config::verge().data().enable_tun_mode.unwrap_or(false) {
|
||||
let disable_tun = serde_json::json!({
|
||||
"tun": {
|
||||
"enable": false
|
||||
}
|
||||
});
|
||||
timeout(
|
||||
Duration::from_secs(1),
|
||||
MihomoManager::global().patch_configs(disable_tun),
|
||||
)
|
||||
.await
|
||||
.is_ok()
|
||||
} else {
|
||||
true
|
||||
};
|
||||
|
||||
// 2. 顺序执行关键清理
|
||||
let proxy_res = timeout(
|
||||
Duration::from_secs(1),
|
||||
sysopt::Sysopt::global().reset_sysproxy(),
|
||||
)
|
||||
.await;
|
||||
|
||||
let core_res = timeout(Duration::from_secs(1), CoreManager::global().stop_core()).await;
|
||||
|
||||
// 3. 平台特定清理
|
||||
#[cfg(target_os = "macos")]
|
||||
let _dns_res = timeout(Duration::from_millis(500), resolve::restore_public_dns()).await;
|
||||
|
||||
tun_success && proxy_res.is_ok() && core_res.is_ok()
|
||||
});
|
||||
cleanup_result
|
||||
}
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
pub fn hide() {
|
||||
use crate::module::lightweight::add_light_weight_timer;
|
||||
|
@@ -302,6 +302,13 @@ pub fn run() {
|
||||
api.prevent_exit();
|
||||
}
|
||||
}
|
||||
tauri::RunEvent::Exit => {
|
||||
// avoid duplicate cleanup
|
||||
if core::handle::Handle::global().is_exiting() {
|
||||
return;
|
||||
}
|
||||
feat::clean();
|
||||
}
|
||||
tauri::RunEvent::WindowEvent { label, event, .. } => {
|
||||
if label == "main" {
|
||||
match event {
|
||||
|
@@ -1,18 +1,7 @@
|
||||
From 7304d1909080ef0c9da703500a97f46c98393fcd Mon Sep 17 00:00:00 2001
|
||||
From: Md Sadre Alam <quic_mdalam@quicinc.com>
|
||||
To: <broonie@kernel.org>, <robh@kernel.org>, <krzk+dt@kernel.org>,
|
||||
<conor+dt@kernel.org>, <andersson@kernel.org>,
|
||||
<konradybcio@kernel.org>, <miquel.raynal@bootlin.com>,
|
||||
<richard@nod.at>, <vigneshr@ti.com>,
|
||||
<manivannan.sadhasivam@linaro.org>,
|
||||
<linux-arm-msm@vger.kernel.org>, <linux-spi@vger.kernel.org>,
|
||||
<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
|
||||
<linux-mtd@lists.infradead.org>
|
||||
Cc: <quic_srichara@quicinc.com>, <quic_varada@quicinc.com>,
|
||||
<quic_mdalam@quicinc.com>
|
||||
Subject: [PATCH v14 6/8] spi: spi-qpic: add driver for QCOM SPI NAND flash Interface
|
||||
Date: Wed, 20 Nov 2024 14:45:04 +0530 [thread overview]
|
||||
Message-ID: <20241120091507.1404368-7-quic_mdalam@quicinc.com> (raw)
|
||||
In-Reply-To: <20241120091507.1404368-1-quic_mdalam@quicinc.com>
|
||||
Date: Mon, 24 Feb 2025 16:44:14 +0530
|
||||
Subject: [PATCH] spi: spi-qpic: add driver for QCOM SPI NAND flash Interface
|
||||
|
||||
This driver implements support for the SPI-NAND mode of QCOM NAND Flash
|
||||
Interface as a SPI-MEM controller with pipelined ECC capability.
|
||||
@@ -22,199 +11,23 @@ Signed-off-by: Sricharan Ramabadhran <quic_srichara@quicinc.com>
|
||||
Co-developed-by: Varadarajan Narayanan <quic_varada@quicinc.com>
|
||||
Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
|
||||
Signed-off-by: Md Sadre Alam <quic_mdalam@quicinc.com>
|
||||
Link: https://patch.msgid.link/20250224111414.2809669-3-quic_mdalam@quicinc.com
|
||||
Signed-off-by: Mark Brown <broonie@kernel.org>
|
||||
---
|
||||
|
||||
Change in [v14]
|
||||
|
||||
* No Change
|
||||
|
||||
Change in [v13]
|
||||
|
||||
* Changed return type of qcom_spi_cmd_mapping() from u32 to
|
||||
int to fix the kernel test bot warning
|
||||
* Changed type of variable cmd in qcom_spi_write_page() from u32
|
||||
to int
|
||||
* Removed unused variable s_op from qcom_spi_write_page()
|
||||
* Updated return value variable type from u32 to int in
|
||||
qcom_spi_send_cmdaddr()
|
||||
|
||||
Change in [v12]
|
||||
|
||||
* Added obj-$(CONFIG_SPI_QPIC_SNAND) += qpic_common.o in Makefile
|
||||
to build qpic_common.c based on CONFIG_SPI_QPIC_SNAND
|
||||
|
||||
Change in [v11]
|
||||
|
||||
* Fixed build error reported by kernel test bot
|
||||
* Changed "depends on MTD" to "select MTD" in
|
||||
drivers/spi/Kconfig file
|
||||
|
||||
Change in [v10]
|
||||
|
||||
* Fixed compilation warnings reported by kernel test robot.
|
||||
* Added depends on CONFIG_MTD
|
||||
* removed extra bracket from statement if (i == (num_cw - 1)) in
|
||||
qcom_spi_program_raw() api.
|
||||
|
||||
Change in [v9]
|
||||
|
||||
* Changed data type of addr1, addr2, cmd, to __le32 in qpic_spi_nand
|
||||
structure
|
||||
* In qcom_spi_set_read_loc_first() api added cpu_to_le32() macro to fix
|
||||
compilation warning
|
||||
* In qcom_spi_set_read_loc_last() api added cpu_to_le32() macro to fix
|
||||
compilation warning
|
||||
* In qcom_spi_init() api added cpu_to_le32() macro to fix compilation
|
||||
warning
|
||||
* In qcom_spi_ecc_init_ctx_pipelined() api removed unused variables
|
||||
reqs, user, step_size, strength and added cpu_to_le32() macro as well
|
||||
to fix compilation warning
|
||||
* In qcom_spi_read_last_cw() api added cpu_to_le32() macro to fix compilation
|
||||
warning
|
||||
* In qcom_spi_check_error() api added cpu_to_le32() macro to fix compilation
|
||||
warning
|
||||
* In qcom_spi_read_page_ecc() api added cpu_to_le32() macro to fix compilation
|
||||
warning
|
||||
* In qcom_spi_read_page_oob() api added cpu_to_le32() macro to fix compilation
|
||||
warning
|
||||
* In qcom_spi_program_raw() api added cpu_to_le32() macro to fix compilation
|
||||
warning
|
||||
* In qcom_spi_program_ecc() api added cpu_to_le32() macro to fix compilation
|
||||
warning
|
||||
* In qcom_spi_program_oob() api added cpu_to_le32() macro to fix compilation
|
||||
warning
|
||||
* In qcom_spi_send_cmdaddr() api added cpu_to_le32() macro to fix compilation
|
||||
warning
|
||||
* In qcom_spi_io_op() api added cpu_to_le32() macro to fix compilation
|
||||
warning
|
||||
|
||||
Change in [v8]
|
||||
|
||||
* Included "bitfield.h" file to /spi-qpic-snand.c
|
||||
to fix compilation warning reported by kernel test robot
|
||||
* Removed unused variable "steps" in
|
||||
qcom_spi_ecc_init_ctx_pipelined() to fix compilation warning
|
||||
|
||||
Change in [v7]
|
||||
|
||||
* Added read_oob() and write_oob() api
|
||||
|
||||
* Handled offset value for oob layout
|
||||
|
||||
* Made CONFIG_SPI_QPIC_SNAND as bool
|
||||
|
||||
* Added macro ecceng_to_qspi()
|
||||
|
||||
* Added FIELD_PREP() Macro in spi init
|
||||
|
||||
* Added else condition in
|
||||
qcom_spi_ecc_finish_io_req_pipelined()
|
||||
for corrected ecc
|
||||
|
||||
* Handled multiple error condition for api
|
||||
qcom_spi_cmd_mapping()
|
||||
|
||||
* Fix typo for printing debug message
|
||||
|
||||
Change in [v6]
|
||||
|
||||
* Added separate qpic_spi_nand{...} struct
|
||||
|
||||
* moved qpic_ecc and qcom_ecc_stats struct to
|
||||
spi-qpic-snand.c file, since its spi nand
|
||||
specific
|
||||
|
||||
* Added FIELD_PREP() and GENMASK() macro
|
||||
|
||||
* Removed rawnand.h and partition.h from
|
||||
spi-qpic-snand.c
|
||||
|
||||
* Removed oob_buff assignment form
|
||||
qcom_spi_write_page_cache
|
||||
|
||||
* Added qcom_nand_unalloc() in remove() path
|
||||
|
||||
* Fixes all all comments
|
||||
|
||||
Change in [v5]
|
||||
|
||||
* Added raw_read() and raw_write() api
|
||||
|
||||
* Updated commit message
|
||||
|
||||
* Removed register indirection
|
||||
|
||||
* Added qcom_spi_ prefix to all the api
|
||||
|
||||
* Removed snand_set_reg() api.
|
||||
|
||||
* Fixed nandbiterr issue
|
||||
|
||||
* Removed hardcoded num_cw and made it variable
|
||||
|
||||
* Removed hardcoded value for mtd pagesize
|
||||
|
||||
* Added -ENOSUPPORT in cmd mapping for unsupported
|
||||
commands
|
||||
|
||||
* Replace if..else with switch..case statement
|
||||
|
||||
Change in [v4]
|
||||
|
||||
* No change
|
||||
|
||||
Change in [v3]
|
||||
|
||||
* Set SPI_QPIC_SNAND to n and added COMPILE_TEST in Kconfig
|
||||
|
||||
* Made driver name sorted in Make file
|
||||
|
||||
* Made comment like c++
|
||||
|
||||
* Changed macro to functions, snandc_set_read_loc_last()
|
||||
and snandc_set_read_loc_first()
|
||||
|
||||
* Added error handling in snandc_set_reg()
|
||||
|
||||
* Changed into normal conditional statement for
|
||||
return snandc->ecc_stats.failed ? -EBADMSG :
|
||||
snandc->ecc_stats.bitflips;
|
||||
|
||||
* Remove cast of wbuf in qpic_snand_program_execute()
|
||||
function
|
||||
|
||||
* Made num_cw variable instead hardcoded value
|
||||
|
||||
* changed if..else condition of function qpic_snand_io_op()
|
||||
to switch..case statement
|
||||
|
||||
* Added __devm_spi_alloc_controller() api instead of
|
||||
devm_spi_alloc_master()
|
||||
|
||||
* Disabling clock in remove path
|
||||
|
||||
Change in [v2]
|
||||
|
||||
* Added initial support for SPI-NAND driver
|
||||
|
||||
Change in [v1]
|
||||
|
||||
* Added RFC patch for design review
|
||||
|
||||
drivers/mtd/nand/Makefile | 4 +
|
||||
drivers/spi/Kconfig | 9 +
|
||||
drivers/spi/Makefile | 1 +
|
||||
drivers/spi/spi-qpic-snand.c | 1633 ++++++++++++++++++++++++++
|
||||
drivers/spi/spi-qpic-snand.c | 1631 ++++++++++++++++++++++++++
|
||||
include/linux/mtd/nand-qpic-common.h | 7 +
|
||||
5 files changed, 1654 insertions(+)
|
||||
5 files changed, 1652 insertions(+)
|
||||
create mode 100644 drivers/spi/spi-qpic-snand.c
|
||||
|
||||
--- a/drivers/mtd/nand/Makefile
|
||||
+++ b/drivers/mtd/nand/Makefile
|
||||
@@ -4,7 +4,11 @@ nandcore-objs := core.o bbt.o
|
||||
@@ -3,7 +3,11 @@
|
||||
nandcore-objs := core.o bbt.o
|
||||
obj-$(CONFIG_MTD_NAND_CORE) += nandcore.o
|
||||
obj-$(CONFIG_MTD_NAND_ECC_MEDIATEK) += ecc-mtk.o
|
||||
obj-$(CONFIG_MTD_NAND_MTK_BMT) += mtk_bmt.o mtk_bmt_v2.o mtk_bmt_bbt.o mtk_bmt_nmbm.o
|
||||
+ifeq ($(CONFIG_SPI_QPIC_SNAND),y)
|
||||
+obj-$(CONFIG_SPI_QPIC_SNAND) += qpic_common.o
|
||||
+else
|
||||
@@ -253,7 +66,7 @@ Change in [v1]
|
||||
obj-$(CONFIG_SPI_ROCKCHIP_SFC) += spi-rockchip-sfc.o
|
||||
--- /dev/null
|
||||
+++ b/drivers/spi/spi-qpic-snand.c
|
||||
@@ -0,0 +1,1633 @@
|
||||
@@ -0,0 +1,1631 @@
|
||||
+/*
|
||||
+ * SPDX-License-Identifier: GPL-2.0
|
||||
+ *
|
||||
@@ -314,6 +127,7 @@ Change in [v1]
|
||||
+#define BAD_BLOCK_MARKER_SIZE 0x2
|
||||
+#define OOB_BUF_SIZE 128
|
||||
+#define ecceng_to_qspi(eng) container_of(eng, struct qpic_spi_nand, ecc_eng)
|
||||
+
|
||||
+struct qpic_snand_op {
|
||||
+ u32 cmd_reg;
|
||||
+ u32 addr1_reg;
|
||||
@@ -1456,64 +1270,63 @@ Change in [v1]
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int qcom_spi_cmd_mapping(struct qcom_nand_controller *snandc, u32 opcode)
|
||||
+static int qcom_spi_cmd_mapping(struct qcom_nand_controller *snandc, u32 opcode, u32 *cmd)
|
||||
+{
|
||||
+ int cmd = 0x0;
|
||||
+
|
||||
+ switch (opcode) {
|
||||
+ case SPINAND_RESET:
|
||||
+ cmd = (SPI_WP | SPI_HOLD | SPI_TRANSFER_MODE_x1 | OP_RESET_DEVICE);
|
||||
+ *cmd = (SPI_WP | SPI_HOLD | SPI_TRANSFER_MODE_x1 | OP_RESET_DEVICE);
|
||||
+ break;
|
||||
+ case SPINAND_READID:
|
||||
+ cmd = (SPI_WP | SPI_HOLD | SPI_TRANSFER_MODE_x1 | OP_FETCH_ID);
|
||||
+ *cmd = (SPI_WP | SPI_HOLD | SPI_TRANSFER_MODE_x1 | OP_FETCH_ID);
|
||||
+ break;
|
||||
+ case SPINAND_GET_FEATURE:
|
||||
+ cmd = (SPI_TRANSFER_MODE_x1 | SPI_WP | SPI_HOLD | ACC_FEATURE);
|
||||
+ *cmd = (SPI_TRANSFER_MODE_x1 | SPI_WP | SPI_HOLD | ACC_FEATURE);
|
||||
+ break;
|
||||
+ case SPINAND_SET_FEATURE:
|
||||
+ cmd = (SPI_TRANSFER_MODE_x1 | SPI_WP | SPI_HOLD | ACC_FEATURE |
|
||||
+ *cmd = (SPI_TRANSFER_MODE_x1 | SPI_WP | SPI_HOLD | ACC_FEATURE |
|
||||
+ QPIC_SET_FEATURE);
|
||||
+ break;
|
||||
+ case SPINAND_READ:
|
||||
+ if (snandc->qspi->raw_rw) {
|
||||
+ cmd = (PAGE_ACC | LAST_PAGE | SPI_TRANSFER_MODE_x1 |
|
||||
+ *cmd = (PAGE_ACC | LAST_PAGE | SPI_TRANSFER_MODE_x1 |
|
||||
+ SPI_WP | SPI_HOLD | OP_PAGE_READ);
|
||||
+ } else {
|
||||
+ cmd = (PAGE_ACC | LAST_PAGE | SPI_TRANSFER_MODE_x1 |
|
||||
+ *cmd = (PAGE_ACC | LAST_PAGE | SPI_TRANSFER_MODE_x1 |
|
||||
+ SPI_WP | SPI_HOLD | OP_PAGE_READ_WITH_ECC);
|
||||
+ }
|
||||
+
|
||||
+ break;
|
||||
+ case SPINAND_ERASE:
|
||||
+ cmd = OP_BLOCK_ERASE | PAGE_ACC | LAST_PAGE | SPI_WP |
|
||||
+ *cmd = OP_BLOCK_ERASE | PAGE_ACC | LAST_PAGE | SPI_WP |
|
||||
+ SPI_HOLD | SPI_TRANSFER_MODE_x1;
|
||||
+ break;
|
||||
+ case SPINAND_WRITE_EN:
|
||||
+ cmd = SPINAND_WRITE_EN;
|
||||
+ *cmd = SPINAND_WRITE_EN;
|
||||
+ break;
|
||||
+ case SPINAND_PROGRAM_EXECUTE:
|
||||
+ cmd = (PAGE_ACC | LAST_PAGE | SPI_TRANSFER_MODE_x1 |
|
||||
+ *cmd = (PAGE_ACC | LAST_PAGE | SPI_TRANSFER_MODE_x1 |
|
||||
+ SPI_WP | SPI_HOLD | OP_PROGRAM_PAGE);
|
||||
+ break;
|
||||
+ case SPINAND_PROGRAM_LOAD:
|
||||
+ cmd = SPINAND_PROGRAM_LOAD;
|
||||
+ *cmd = SPINAND_PROGRAM_LOAD;
|
||||
+ break;
|
||||
+ default:
|
||||
+ dev_err(snandc->dev, "Opcode not supported: %u\n", opcode);
|
||||
+ return -EOPNOTSUPP;
|
||||
+ }
|
||||
+
|
||||
+ return cmd;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int qcom_spi_write_page(struct qcom_nand_controller *snandc,
|
||||
+ const struct spi_mem_op *op)
|
||||
+{
|
||||
+ int cmd;
|
||||
+ int ret;
|
||||
+ u32 cmd;
|
||||
+
|
||||
+ cmd = qcom_spi_cmd_mapping(snandc, op->cmd.opcode);
|
||||
+ if (cmd < 0)
|
||||
+ return cmd;
|
||||
+ ret = qcom_spi_cmd_mapping(snandc, op->cmd.opcode, &cmd);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ if (op->cmd.opcode == SPINAND_PROGRAM_LOAD)
|
||||
+ snandc->qspi->data_buf = (u8 *)op->data.buf.out;
|
||||
@@ -1528,12 +1341,10 @@ Change in [v1]
|
||||
+ u32 cmd;
|
||||
+ int ret, opcode;
|
||||
+
|
||||
+ ret = qcom_spi_cmd_mapping(snandc, op->cmd.opcode);
|
||||
+ ret = qcom_spi_cmd_mapping(snandc, op->cmd.opcode, &cmd);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ cmd = ret;
|
||||
+
|
||||
+ s_op.cmd_reg = cmd;
|
||||
+ s_op.addr1_reg = op->addr.val;
|
||||
+ s_op.addr2_reg = 0;
|
@@ -0,0 +1,28 @@
|
||||
From cf1ba3cb245020459f2ca446b7a7b199839f5d83 Mon Sep 17 00:00:00 2001
|
||||
From: Dan Carpenter <dan.carpenter@linaro.org>
|
||||
Date: Thu, 6 Mar 2025 12:40:01 +0300
|
||||
Subject: [PATCH] spi: spi-qpic-snand: Fix ECC_CFG_ECC_DISABLE shift in
|
||||
qcom_spi_read_last_cw()
|
||||
|
||||
The ECC_CFG_ECC_DISABLE define is BIT(0). It's supposed to be used
|
||||
directly instead of used as a shifter.
|
||||
|
||||
Fixes: 7304d1909080 ("spi: spi-qpic: add driver for QCOM SPI NAND flash Interface")
|
||||
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
|
||||
Link: https://patch.msgid.link/2f4b0a0b-2c03-41c0-8a4a-3d789a83832d@stanley.mountain
|
||||
Signed-off-by: Mark Brown <broonie@kernel.org>
|
||||
---
|
||||
drivers/spi/spi-qpic-snand.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/spi/spi-qpic-snand.c
|
||||
+++ b/drivers/spi/spi-qpic-snand.c
|
||||
@@ -514,7 +514,7 @@ static int qcom_spi_read_last_cw(struct
|
||||
cfg0 = (ecc_cfg->cfg0_raw & ~(7U << CW_PER_PAGE)) |
|
||||
0 << CW_PER_PAGE;
|
||||
cfg1 = ecc_cfg->cfg1_raw;
|
||||
- ecc_bch_cfg = 1 << ECC_CFG_ECC_DISABLE;
|
||||
+ ecc_bch_cfg = ECC_CFG_ECC_DISABLE;
|
||||
|
||||
snandc->regs->cmd = snandc->qspi->cmd;
|
||||
snandc->regs->cfg0 = cpu_to_le32(cfg0);
|
@@ -0,0 +1,35 @@
|
||||
From d450cdd9c4398add1f2aa7200f2c95f1e3b9f9fa Mon Sep 17 00:00:00 2001
|
||||
From: Gabor Juhos <j4g8y7@gmail.com>
|
||||
Date: Thu, 13 Mar 2025 19:31:21 +0100
|
||||
Subject: [PATCH] spi: spi-qpic-snand: avoid memleak in
|
||||
qcom_spi_ecc_init_ctx_pipelined()
|
||||
|
||||
When the allocation of the OOB buffer fails, the
|
||||
qcom_spi_ecc_init_ctx_pipelined() function returns without freeing
|
||||
the memory allocated for 'ecc_cfg' thus it can cause a memory leak.
|
||||
|
||||
Call kfree() to free 'ecc_cfg' before returning from the function
|
||||
to avoid that.
|
||||
|
||||
Fixes: 7304d1909080 ("spi: spi-qpic: add driver for QCOM SPI NAND flash Interface")
|
||||
Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
|
||||
Link: https://patch.msgid.link/20250313-qpic-snand-memleak-fix-v1-1-e54e78d1da3a@gmail.com
|
||||
Signed-off-by: Mark Brown <broonie@kernel.org>
|
||||
---
|
||||
drivers/spi/spi-qpic-snand.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/spi/spi-qpic-snand.c
|
||||
+++ b/drivers/spi/spi-qpic-snand.c
|
||||
@@ -263,8 +263,10 @@ static int qcom_spi_ecc_init_ctx_pipelin
|
||||
return -ENOMEM;
|
||||
snandc->qspi->oob_buf = kzalloc(mtd->writesize + mtd->oobsize,
|
||||
GFP_KERNEL);
|
||||
- if (!snandc->qspi->oob_buf)
|
||||
+ if (!snandc->qspi->oob_buf) {
|
||||
+ kfree(ecc_cfg);
|
||||
return -ENOMEM;
|
||||
+ }
|
||||
|
||||
memset(snandc->qspi->oob_buf, 0xff, mtd->writesize + mtd->oobsize);
|
||||
|
@@ -0,0 +1,49 @@
|
||||
From d32c4e58545f17caaa854415f854691e32d42075 Mon Sep 17 00:00:00 2001
|
||||
From: Geert Uytterhoeven <geert+renesas@glider.be>
|
||||
Date: Wed, 26 Mar 2025 15:22:19 +0100
|
||||
Subject: [PATCH] spi: SPI_QPIC_SNAND should be tristate and depend on MTD
|
||||
|
||||
SPI_QPIC_SNAND is the only driver that selects MTD instead of depending
|
||||
on it, which could lead to circular dependencies. Moreover, as
|
||||
SPI_QPIC_SNAND is bool, this forces MTD (and various related symbols) to
|
||||
be built-in, as can be seen in an allmodconfig kernel.
|
||||
|
||||
Except for a missing semicolon, there is no reason why SPI_QPIC_SNAND
|
||||
cannot be tristate; all MODULE_*() boilerplate is already present.
|
||||
Hence make SPI_QPIC_SNAND tristate, let it depend on MTD, and add the
|
||||
missing semicolon.
|
||||
|
||||
Fixes: 7304d1909080ef0c ("spi: spi-qpic: add driver for QCOM SPI NAND flash Interface")
|
||||
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
|
||||
Link: https://patch.msgid.link/b63db431cbf35223a4400e44c296293d32c4543c.1742998909.git.geert+renesas@glider.be
|
||||
Signed-off-by: Mark Brown <broonie@kernel.org>
|
||||
---
|
||||
drivers/spi/Kconfig | 4 ++--
|
||||
drivers/spi/spi-qpic-snand.c | 2 +-
|
||||
2 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/drivers/spi/Kconfig
|
||||
+++ b/drivers/spi/Kconfig
|
||||
@@ -871,9 +871,9 @@ config SPI_QCOM_QSPI
|
||||
QSPI(Quad SPI) driver for Qualcomm QSPI controller.
|
||||
|
||||
config SPI_QPIC_SNAND
|
||||
- bool "QPIC SNAND controller"
|
||||
+ tristate "QPIC SNAND controller"
|
||||
depends on ARCH_QCOM || COMPILE_TEST
|
||||
- select MTD
|
||||
+ depends on MTD
|
||||
help
|
||||
QPIC_SNAND (QPIC SPI NAND) driver for Qualcomm QPIC controller.
|
||||
QPIC controller supports both parallel nand and serial nand.
|
||||
--- a/drivers/spi/spi-qpic-snand.c
|
||||
+++ b/drivers/spi/spi-qpic-snand.c
|
||||
@@ -1614,7 +1614,7 @@ static const struct of_device_id qcom_sn
|
||||
.data = &ipq9574_snandc_props,
|
||||
},
|
||||
{}
|
||||
-}
|
||||
+};
|
||||
MODULE_DEVICE_TABLE(of, qcom_snandc_of_match);
|
||||
|
||||
static struct platform_driver qcom_spi_driver = {
|
@@ -0,0 +1,29 @@
|
||||
From f48d80503504257682e493dc17408f2f0b47bcfa Mon Sep 17 00:00:00 2001
|
||||
From: Gabor Juhos <j4g8y7@gmail.com>
|
||||
Date: Thu, 20 Mar 2025 19:11:59 +0100
|
||||
Subject: [PATCH] spi: spi-qpic-snand: use kmalloc() for OOB buffer allocation
|
||||
|
||||
The qcom_spi_ecc_init_ctx_pipelined() function allocates zeroed
|
||||
memory for the OOB buffer, then it fills the buffer with '0xff'
|
||||
bytes right after the allocation. In this case zeroing the memory
|
||||
during allocation is superfluous, so use kmalloc() instead of
|
||||
kzalloc() to avoid that.
|
||||
|
||||
Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
|
||||
Link: https://patch.msgid.link/20250320-qpic-snand-kmalloc-v1-1-94e267550675@gmail.com
|
||||
Signed-off-by: Mark Brown <broonie@kernel.org>
|
||||
---
|
||||
drivers/spi/spi-qpic-snand.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/spi/spi-qpic-snand.c
|
||||
+++ b/drivers/spi/spi-qpic-snand.c
|
||||
@@ -261,7 +261,7 @@ static int qcom_spi_ecc_init_ctx_pipelin
|
||||
ecc_cfg = kzalloc(sizeof(*ecc_cfg), GFP_KERNEL);
|
||||
if (!ecc_cfg)
|
||||
return -ENOMEM;
|
||||
- snandc->qspi->oob_buf = kzalloc(mtd->writesize + mtd->oobsize,
|
||||
+ snandc->qspi->oob_buf = kmalloc(mtd->writesize + mtd->oobsize,
|
||||
GFP_KERNEL);
|
||||
if (!snandc->qspi->oob_buf) {
|
||||
kfree(ecc_cfg);
|
@@ -28,6 +28,6 @@ Subject: [PATCH] mtd/nand: add MediaTek NAND bad block managment table
|
||||
obj-$(CONFIG_MTD_NAND_CORE) += nandcore.o
|
||||
obj-$(CONFIG_MTD_NAND_ECC_MEDIATEK) += ecc-mtk.o
|
||||
+obj-$(CONFIG_MTD_NAND_MTK_BMT) += mtk_bmt.o mtk_bmt_v2.o mtk_bmt_bbt.o mtk_bmt_nmbm.o
|
||||
obj-$(CONFIG_MTD_NAND_QCOM) += qpic_common.o
|
||||
obj-y += onenand/
|
||||
obj-y += raw/
|
||||
ifeq ($(CONFIG_SPI_QPIC_SNAND),y)
|
||||
obj-$(CONFIG_SPI_QPIC_SNAND) += qpic_common.o
|
||||
else
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,125 +0,0 @@
|
||||
From 8716f3c03d9f71ed0bd12a26f6e9d1e85cff0d12 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Thu, 30 Jan 2025 00:27:22 +0100
|
||||
Subject: [PATCH 1/2] spi: spi-qpic: fix broken driver with SPINAND_SET_FEATURE
|
||||
command
|
||||
|
||||
The driver always return probe error with SPINAND_SET_FEATURE command:
|
||||
|
||||
spi-nand: probe of spi0.0 failed with error -1207959538
|
||||
|
||||
The error doesn't match any expected negative error but instead seems to
|
||||
be an u32 converted to an int. Investigating the entire codeflow I
|
||||
reached the culprit: qcom_spi_cmd_mapping.
|
||||
|
||||
Such function can return -EOPNOTSUPP or the cmd to run. Problem is that
|
||||
in the specific context of SPINAND_SET_FEATURE, BIT(31) is set that in
|
||||
the context of an integer, it gets treated as a negative value.
|
||||
|
||||
To correctly handle this, rework the function to return 0 or a "correct"
|
||||
negative error and pass a pointer to store the cmd.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
---
|
||||
drivers/spi/spi-qpic-snand.c | 40 +++++++++++++++++-------------------
|
||||
1 file changed, 19 insertions(+), 21 deletions(-)
|
||||
|
||||
--- a/drivers/spi/spi-qpic-snand.c
|
||||
+++ b/drivers/spi/spi-qpic-snand.c
|
||||
@@ -1200,64 +1200,64 @@ static int qcom_spi_program_execute(stru
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int qcom_spi_cmd_mapping(struct qcom_nand_controller *snandc, u32 opcode)
|
||||
+static int qcom_spi_cmd_mapping(struct qcom_nand_controller *snandc, u32 opcode,
|
||||
+ u32 *cmd)
|
||||
{
|
||||
- int cmd = 0x0;
|
||||
-
|
||||
switch (opcode) {
|
||||
case SPINAND_RESET:
|
||||
- cmd = (SPI_WP | SPI_HOLD | SPI_TRANSFER_MODE_x1 | OP_RESET_DEVICE);
|
||||
+ *cmd = (SPI_WP | SPI_HOLD | SPI_TRANSFER_MODE_x1 | OP_RESET_DEVICE);
|
||||
break;
|
||||
case SPINAND_READID:
|
||||
- cmd = (SPI_WP | SPI_HOLD | SPI_TRANSFER_MODE_x1 | OP_FETCH_ID);
|
||||
+ *cmd = (SPI_WP | SPI_HOLD | SPI_TRANSFER_MODE_x1 | OP_FETCH_ID);
|
||||
break;
|
||||
case SPINAND_GET_FEATURE:
|
||||
- cmd = (SPI_TRANSFER_MODE_x1 | SPI_WP | SPI_HOLD | ACC_FEATURE);
|
||||
+ *cmd = (SPI_TRANSFER_MODE_x1 | SPI_WP | SPI_HOLD | ACC_FEATURE);
|
||||
break;
|
||||
case SPINAND_SET_FEATURE:
|
||||
- cmd = (SPI_TRANSFER_MODE_x1 | SPI_WP | SPI_HOLD | ACC_FEATURE |
|
||||
+ *cmd = (SPI_TRANSFER_MODE_x1 | SPI_WP | SPI_HOLD | ACC_FEATURE |
|
||||
QPIC_SET_FEATURE);
|
||||
break;
|
||||
case SPINAND_READ:
|
||||
if (snandc->qspi->raw_rw) {
|
||||
- cmd = (PAGE_ACC | LAST_PAGE | SPI_TRANSFER_MODE_x1 |
|
||||
+ *cmd = (PAGE_ACC | LAST_PAGE | SPI_TRANSFER_MODE_x1 |
|
||||
SPI_WP | SPI_HOLD | OP_PAGE_READ);
|
||||
} else {
|
||||
- cmd = (PAGE_ACC | LAST_PAGE | SPI_TRANSFER_MODE_x1 |
|
||||
+ *cmd = (PAGE_ACC | LAST_PAGE | SPI_TRANSFER_MODE_x1 |
|
||||
SPI_WP | SPI_HOLD | OP_PAGE_READ_WITH_ECC);
|
||||
}
|
||||
|
||||
break;
|
||||
case SPINAND_ERASE:
|
||||
- cmd = OP_BLOCK_ERASE | PAGE_ACC | LAST_PAGE | SPI_WP |
|
||||
+ *cmd = OP_BLOCK_ERASE | PAGE_ACC | LAST_PAGE | SPI_WP |
|
||||
SPI_HOLD | SPI_TRANSFER_MODE_x1;
|
||||
break;
|
||||
case SPINAND_WRITE_EN:
|
||||
- cmd = SPINAND_WRITE_EN;
|
||||
+ *cmd = SPINAND_WRITE_EN;
|
||||
break;
|
||||
case SPINAND_PROGRAM_EXECUTE:
|
||||
- cmd = (PAGE_ACC | LAST_PAGE | SPI_TRANSFER_MODE_x1 |
|
||||
+ *cmd = (PAGE_ACC | LAST_PAGE | SPI_TRANSFER_MODE_x1 |
|
||||
SPI_WP | SPI_HOLD | OP_PROGRAM_PAGE);
|
||||
break;
|
||||
case SPINAND_PROGRAM_LOAD:
|
||||
- cmd = SPINAND_PROGRAM_LOAD;
|
||||
+ *cmd = SPINAND_PROGRAM_LOAD;
|
||||
break;
|
||||
default:
|
||||
dev_err(snandc->dev, "Opcode not supported: %u\n", opcode);
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
- return cmd;
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
static int qcom_spi_write_page(struct qcom_nand_controller *snandc,
|
||||
const struct spi_mem_op *op)
|
||||
{
|
||||
- int cmd;
|
||||
+ u32 cmd;
|
||||
+ int ret;
|
||||
|
||||
- cmd = qcom_spi_cmd_mapping(snandc, op->cmd.opcode);
|
||||
- if (cmd < 0)
|
||||
- return cmd;
|
||||
+ ret = qcom_spi_cmd_mapping(snandc, op->cmd.opcode, &cmd);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
|
||||
if (op->cmd.opcode == SPINAND_PROGRAM_LOAD)
|
||||
snandc->qspi->data_buf = (u8 *)op->data.buf.out;
|
||||
@@ -1272,12 +1272,10 @@ static int qcom_spi_send_cmdaddr(struct
|
||||
u32 cmd;
|
||||
int ret, opcode;
|
||||
|
||||
- ret = qcom_spi_cmd_mapping(snandc, op->cmd.opcode);
|
||||
+ ret = qcom_spi_cmd_mapping(snandc, op->cmd.opcode, &cmd);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
- cmd = ret;
|
||||
-
|
||||
s_op.cmd_reg = cmd;
|
||||
s_op.addr1_reg = op->addr.val;
|
||||
s_op.addr2_reg = 0;
|
@@ -13,7 +13,7 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
|
||||
|
||||
--- a/drivers/spi/spi-qpic-snand.c
|
||||
+++ b/drivers/spi/spi-qpic-snand.c
|
||||
@@ -252,6 +252,7 @@ static int qcom_spi_ecc_init_ctx_pipelin
|
||||
@@ -253,6 +253,7 @@ static int qcom_spi_ecc_init_ctx_pipelin
|
||||
struct nand_ecc_props *conf = &nand->ecc.ctx.conf;
|
||||
struct mtd_info *mtd = nanddev_to_mtd(nand);
|
||||
int cwperpage, bad_block_byte;
|
||||
@@ -21,7 +21,7 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
|
||||
struct qpic_ecc *ecc_cfg;
|
||||
|
||||
cwperpage = mtd->writesize / NANDC_STEP_SIZE;
|
||||
@@ -270,14 +271,17 @@ static int qcom_spi_ecc_init_ctx_pipelin
|
||||
@@ -273,14 +274,17 @@ static int qcom_spi_ecc_init_ctx_pipelin
|
||||
nand->ecc.ctx.priv = ecc_cfg;
|
||||
snandc->qspi->mtd = mtd;
|
||||
|
||||
@@ -42,7 +42,7 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
|
||||
ecc_cfg->step_size = 512;
|
||||
ecc_cfg->cw_data = 516;
|
||||
ecc_cfg->cw_size = ecc_cfg->cw_data + ecc_cfg->bytes;
|
||||
@@ -319,7 +323,7 @@ static int qcom_spi_ecc_init_ctx_pipelin
|
||||
@@ -322,7 +326,7 @@ static int qcom_spi_ecc_init_ctx_pipelin
|
||||
FIELD_PREP(ECC_SW_RESET, 0) |
|
||||
FIELD_PREP(ECC_NUM_DATA_BYTES_MASK, ecc_cfg->cw_data) |
|
||||
FIELD_PREP(ECC_FORCE_CLK_OPEN, 1) |
|
||||
|
@@ -2,7 +2,6 @@ package pingtunnel
|
||||
|
||||
import (
|
||||
"github.com/esrrhs/gohome/common"
|
||||
"github.com/esrrhs/gohome/frame"
|
||||
"github.com/esrrhs/gohome/loggo"
|
||||
"github.com/esrrhs/gohome/network"
|
||||
"github.com/golang/protobuf/proto"
|
||||
@@ -131,7 +130,7 @@ type ClientConn struct {
|
||||
activeSendTime time.Time
|
||||
close bool
|
||||
|
||||
fm *frame.FrameMgr
|
||||
fm *network.FrameMgr
|
||||
}
|
||||
|
||||
func (p *Client) Addr() string {
|
||||
@@ -323,7 +322,7 @@ func (p *Client) AcceptTcpConn(conn *net.TCPConn, targetAddr string) {
|
||||
|
||||
uuid := common.UniqueId()
|
||||
|
||||
fm := frame.NewFrameMgr(FRAME_MAX_SIZE, FRAME_MAX_ID, p.tcpmode_buffersize, p.tcpmode_maxwin, p.tcpmode_resend_timems, p.tcpmode_compress, p.tcpmode_stat)
|
||||
fm := network.NewFrameMgr(FRAME_MAX_SIZE, FRAME_MAX_ID, p.tcpmode_buffersize, p.tcpmode_maxwin, p.tcpmode_resend_timems, p.tcpmode_compress, p.tcpmode_stat)
|
||||
|
||||
now := time.Now()
|
||||
clientConn := &ClientConn{exit: false, tcpaddr: tcpsrcaddr, id: uuid, activeRecvTime: now, activeSendTime: now, close: false,
|
||||
@@ -341,7 +340,7 @@ func (p *Client) AcceptTcpConn(conn *net.TCPConn, targetAddr string) {
|
||||
clientConn.fm.Update()
|
||||
sendlist := clientConn.fm.GetSendList()
|
||||
for e := sendlist.Front(); e != nil; e = e.Next() {
|
||||
f := e.Value.(*frame.Frame)
|
||||
f := e.Value.(*network.Frame)
|
||||
mb, _ := clientConn.fm.MarshalFrame(f)
|
||||
p.sequence++
|
||||
sendICMP(p.id, p.sequence, *p.conn, p.ipaddrServer, targetAddr, clientConn.id, (uint32)(MyMsg_DATA), mb,
|
||||
@@ -400,7 +399,7 @@ func (p *Client) AcceptTcpConn(conn *net.TCPConn, targetAddr string) {
|
||||
sleep = false
|
||||
clientConn.activeSendTime = now
|
||||
for e := sendlist.Front(); e != nil; e = e.Next() {
|
||||
f := e.Value.(*frame.Frame)
|
||||
f := e.Value.(*network.Frame)
|
||||
mb, err := clientConn.fm.MarshalFrame(f)
|
||||
if err != nil {
|
||||
loggo.Error("Error tcp Marshal %s %s %s", uuid, tcpsrcaddr.String(), err)
|
||||
@@ -467,7 +466,7 @@ func (p *Client) AcceptTcpConn(conn *net.TCPConn, targetAddr string) {
|
||||
|
||||
sendlist := clientConn.fm.GetSendList()
|
||||
for e := sendlist.Front(); e != nil; e = e.Next() {
|
||||
f := e.Value.(*frame.Frame)
|
||||
f := e.Value.(*network.Frame)
|
||||
mb, _ := clientConn.fm.MarshalFrame(f)
|
||||
p.sequence++
|
||||
sendICMP(p.id, p.sequence, *p.conn, p.ipaddrServer, targetAddr, clientConn.id, (uint32)(MyMsg_DATA), mb,
|
||||
@@ -608,7 +607,7 @@ func (p *Client) processPacket(packet *Packet) {
|
||||
clientConn.activeRecvTime = now
|
||||
|
||||
if p.tcpmode > 0 {
|
||||
f := &frame.Frame{}
|
||||
f := &network.Frame{}
|
||||
err := proto.Unmarshal(packet.my.Data, f)
|
||||
if err != nil {
|
||||
loggo.Error("Unmarshal tcp Error %s", err)
|
||||
|
@@ -4,8 +4,8 @@ import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"github.com/esrrhs/gohome/common"
|
||||
"github.com/esrrhs/gohome/geoip"
|
||||
"github.com/esrrhs/gohome/loggo"
|
||||
"github.com/esrrhs/gohome/thirdparty"
|
||||
"github.com/esrrhs/pingtunnel"
|
||||
"net"
|
||||
"net/http"
|
||||
@@ -146,7 +146,7 @@ func main() {
|
||||
s5filter := flag.String("s5filter", "", "sock5 filter")
|
||||
s5ftfile := flag.String("s5ftfile", "GeoLite2-Country.mmdb", "sock5 filter file")
|
||||
flag.Usage = func() {
|
||||
fmt.Printf(usage)
|
||||
fmt.Print(usage)
|
||||
}
|
||||
|
||||
flag.Parse()
|
||||
@@ -215,7 +215,7 @@ func main() {
|
||||
}
|
||||
|
||||
if len(*s5filter) > 0 {
|
||||
err := geoip.Load(*s5ftfile)
|
||||
err := thirdparty.LoadGeoip2(*s5ftfile)
|
||||
if err != nil {
|
||||
loggo.Error("Load Sock5 ip file ERROR: %s", err.Error())
|
||||
return
|
||||
@@ -231,7 +231,7 @@ func main() {
|
||||
return false
|
||||
}
|
||||
|
||||
ret, err := geoip.GetCountryIsoCode(taddr.IP.String())
|
||||
ret, err := thirdparty.GetGeoipCountryIsoCode(taddr.IP.String())
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
@@ -1,19 +1,37 @@
|
||||
module github.com/esrrhs/pingtunnel
|
||||
|
||||
go 1.21
|
||||
toolchain go1.24.1
|
||||
go 1.24.1
|
||||
|
||||
require (
|
||||
github.com/esrrhs/gohome v0.0.0-20231129030235-4e6f13493d6c
|
||||
github.com/golang/protobuf v1.5.3
|
||||
golang.org/x/net v0.38.0
|
||||
github.com/esrrhs/gohome v0.0.0-20250426022937-504d912bccf7
|
||||
github.com/golang/protobuf v1.5.4
|
||||
golang.org/x/net v0.39.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/OneOfOne/xxhash v1.2.8 // indirect
|
||||
github.com/google/uuid v1.4.0 // indirect
|
||||
github.com/oschwald/geoip2-golang v1.9.0 // indirect
|
||||
github.com/oschwald/maxminddb-golang v1.12.0 // indirect
|
||||
golang.org/x/sys v0.31.0 // indirect
|
||||
google.golang.org/protobuf v1.33.0 // indirect
|
||||
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
|
||||
github.com/google/pprof v0.0.0-20250423184734-337e5dd93bb4 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.2.10 // indirect
|
||||
github.com/klauspost/reedsolomon v1.12.4 // indirect
|
||||
github.com/onsi/ginkgo/v2 v2.23.4 // indirect
|
||||
github.com/oschwald/geoip2-golang v1.11.0 // indirect
|
||||
github.com/oschwald/maxminddb-golang v1.13.1 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/quic-go/quic-go v0.51.0 // indirect
|
||||
github.com/templexxx/cpufeat v0.0.0-20180724012125-cef66df7f161 // indirect
|
||||
github.com/templexxx/xor v0.0.0-20191217153810-f85b25db303b // indirect
|
||||
github.com/tjfoc/gmsm v1.4.1 // indirect
|
||||
github.com/xtaci/kcp-go v5.4.20+incompatible // indirect
|
||||
github.com/xtaci/smux v1.5.34 // indirect
|
||||
go.uber.org/automaxprocs v1.6.0 // indirect
|
||||
go.uber.org/mock v0.5.1 // indirect
|
||||
golang.org/x/crypto v0.37.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 // indirect
|
||||
golang.org/x/mod v0.24.0 // indirect
|
||||
golang.org/x/sync v0.13.0 // indirect
|
||||
golang.org/x/sys v0.32.0 // indirect
|
||||
golang.org/x/tools v0.32.0 // indirect
|
||||
google.golang.org/protobuf v1.36.6 // indirect
|
||||
)
|
||||
|
@@ -1,33 +1,176 @@
|
||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/OneOfOne/xxhash v1.2.8 h1:31czK/TI9sNkxIKfaUfGlU47BAxQ0ztGgd9vPyqimf8=
|
||||
github.com/OneOfOne/xxhash v1.2.8/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/esrrhs/gohome v0.0.0-20231129030235-4e6f13493d6c h1:i5uscwGClUYsOier4aVbkD8Tna7aQgRZpbllMygKSMM=
|
||||
github.com/esrrhs/gohome v0.0.0-20231129030235-4e6f13493d6c/go.mod h1:gSrPvj3oNMs3rdHFQka+Di6hHlFnkZbSKCa2z80KisU=
|
||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
|
||||
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4=
|
||||
github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/oschwald/geoip2-golang v1.9.0 h1:uvD3O6fXAXs+usU+UGExshpdP13GAqp4GBrzN7IgKZc=
|
||||
github.com/oschwald/geoip2-golang v1.9.0/go.mod h1:BHK6TvDyATVQhKNbQBdrj9eAvuwOMi2zSFXizL3K81Y=
|
||||
github.com/oschwald/maxminddb-golang v1.12.0 h1:9FnTOD0YOhP7DGxGsq4glzpGy5+w7pq50AS6wALUMYs=
|
||||
github.com/oschwald/maxminddb-golang v1.12.0/go.mod h1:q0Nob5lTCqyQ8WT6FYgS1L7PXKVVbgiymefNwIjPzgY=
|
||||
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
|
||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/esrrhs/gohome v0.0.0-20250426022937-504d912bccf7 h1:EpgZzfBgtv89nRgnpziXylmWiatXGCijG41xK0XqZUM=
|
||||
github.com/esrrhs/gohome v0.0.0-20250426022937-504d912bccf7/go.mod h1:4kAeSdLmMeWMOpzi/Jx82YvDnrBHcbWcLT18FwTujFA=
|
||||
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
|
||||
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
|
||||
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
|
||||
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
|
||||
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
|
||||
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
|
||||
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
|
||||
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
|
||||
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
|
||||
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
|
||||
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
|
||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/pprof v0.0.0-20241101162523-b92577c0c142 h1:sAGdeJj0bnMgUNVeUpp6AYlVdCt3/GdI3pGRqsNSQLs=
|
||||
github.com/google/pprof v0.0.0-20241101162523-b92577c0c142/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
|
||||
github.com/google/pprof v0.0.0-20250423184734-337e5dd93bb4 h1:gD0vax+4I+mAj+jEChEf25Ia07Jq7kYOFO5PPhAxFl4=
|
||||
github.com/google/pprof v0.0.0-20250423184734-337e5dd93bb4/go.mod h1:5hDyRhoBCxViHszMt12TnOpEI4VVi+U8Gm9iphldiMA=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/klauspost/cpuid/v2 v2.2.9 h1:66ze0taIn2H33fBvCkXuv9BmCwDfafmiIVpKV9kKGuY=
|
||||
github.com/klauspost/cpuid/v2 v2.2.9/go.mod h1:rqkxqrZ1EhYM9G+hXH7YdowN5R5RGN6NK4QwQ3WMXF8=
|
||||
github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE=
|
||||
github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
|
||||
github.com/klauspost/reedsolomon v1.12.4 h1:5aDr3ZGoJbgu/8+j45KtUJxzYm8k08JGtB9Wx1VQ4OA=
|
||||
github.com/klauspost/reedsolomon v1.12.4/go.mod h1:d3CzOMOt0JXGIFZm1StgkyF14EYr3xneR2rNWo7NcMU=
|
||||
github.com/onsi/ginkgo/v2 v2.21.0 h1:7rg/4f3rB88pb5obDgNZrNHrQ4e6WpjonchcpuBRnZM=
|
||||
github.com/onsi/ginkgo/v2 v2.21.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo=
|
||||
github.com/onsi/ginkgo/v2 v2.23.4 h1:ktYTpKJAVZnDT4VjxSbiBenUjmlL/5QkBEocaWXiQus=
|
||||
github.com/onsi/ginkgo/v2 v2.23.4/go.mod h1:Bt66ApGPBFzHyR+JO10Zbt0Gsp4uWxu5mIOTusL46e8=
|
||||
github.com/onsi/gomega v1.34.2 h1:pNCwDkzrsv7MS9kpaQvVb1aVLahQXyJ/Tv5oAZMI3i8=
|
||||
github.com/onsi/gomega v1.34.2/go.mod h1:v1xfxRgk0KIsG+QOdm7p8UosrOzPYRo60fd3B/1Dukc=
|
||||
github.com/onsi/gomega v1.36.3 h1:hID7cr8t3Wp26+cYnfcjR6HpJ00fdogN6dqZ1t6IylU=
|
||||
github.com/oschwald/geoip2-golang v1.11.0 h1:hNENhCn1Uyzhf9PTmquXENiWS6AlxAEnBII6r8krA3w=
|
||||
github.com/oschwald/geoip2-golang v1.11.0/go.mod h1:P9zG+54KPEFOliZ29i7SeYZ/GM6tfEL+rgSn03hYuUo=
|
||||
github.com/oschwald/maxminddb-golang v1.13.1 h1:G3wwjdN9JmIK2o/ermkHM+98oX5fS+k5MbwsmL4MRQE=
|
||||
github.com/oschwald/maxminddb-golang v1.13.1/go.mod h1:K4pgV9N/GcK694KSTmVSDTODk4IsCNThNdTmnaBZ/F8=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/quic-go/quic-go v0.48.1 h1:y/8xmfWI9qmGTc+lBr4jKRUWLGSlSigv847ULJ4hYXA=
|
||||
github.com/quic-go/quic-go v0.48.1/go.mod h1:yBgs3rWBOADpga7F+jJsb6Ybg1LSYiQvwWlLX+/6HMs=
|
||||
github.com/quic-go/quic-go v0.51.0 h1:K8exxe9zXxeRKxaXxi/GpUqYiTrtdiWP8bo1KFya6Wc=
|
||||
github.com/quic-go/quic-go v0.51.0/go.mod h1:MFlGGpcpJqRAfmYi6NC2cptDPSxRWTOGNuP4wqrWmzQ=
|
||||
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/templexxx/cpufeat v0.0.0-20180724012125-cef66df7f161 h1:89CEmDvlq/F7SJEOqkIdNDGJXrQIhuIx9D2DBXjavSU=
|
||||
github.com/templexxx/cpufeat v0.0.0-20180724012125-cef66df7f161/go.mod h1:wM7WEvslTq+iOEAMDLSzhVuOt5BRZ05WirO+b09GHQU=
|
||||
github.com/templexxx/xor v0.0.0-20191217153810-f85b25db303b h1:fj5tQ8acgNUr6O8LEplsxDhUIe2573iLkJc+PqnzZTI=
|
||||
github.com/templexxx/xor v0.0.0-20191217153810-f85b25db303b/go.mod h1:5XA7W9S6mni3h5uvOC75dA3m9CCCaS83lltmc0ukdi4=
|
||||
github.com/tjfoc/gmsm v1.4.1 h1:aMe1GlZb+0bLjn+cKTPEvvn9oUEBlJitaZiiBwsbgho=
|
||||
github.com/tjfoc/gmsm v1.4.1/go.mod h1:j4INPkHWMrhJb38G+J6W4Tw0AbuN8Thu3PbdVYhVcTE=
|
||||
github.com/xtaci/kcp-go v5.4.20+incompatible h1:TN1uey3Raw0sTz0Fg8GkfM0uH3YwzhnZWQ1bABv5xAg=
|
||||
github.com/xtaci/kcp-go v5.4.20+incompatible/go.mod h1:bN6vIwHQbfHaHtFpEssmWsN45a+AZwO7eyRCmEIbtvE=
|
||||
github.com/xtaci/lossyconn v0.0.0-20200209145036-adba10fffc37 h1:EWU6Pktpas0n8lLQwDsRyZfmkPeRbdgPtW609es+/9E=
|
||||
github.com/xtaci/lossyconn v0.0.0-20200209145036-adba10fffc37/go.mod h1:HpMP7DB2CyokmAh4lp0EQnnWhmycP/TvwBGzvuie+H0=
|
||||
github.com/xtaci/smux v1.5.31 h1:3ha7sHtH46h85Iv7MfQogxasuRt1KPRhoFB3S4rmHgU=
|
||||
github.com/xtaci/smux v1.5.31/go.mod h1:OMlQbT5vcgl2gb49mFkYo6SMf+zP3rcjcwQz7ZU7IGY=
|
||||
github.com/xtaci/smux v1.5.34 h1:OUA9JaDFHJDT8ZT3ebwLWPAgEfE6sWo2LaTy3anXqwg=
|
||||
github.com/xtaci/smux v1.5.34/go.mod h1:OMlQbT5vcgl2gb49mFkYo6SMf+zP3rcjcwQz7ZU7IGY=
|
||||
go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs=
|
||||
go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8=
|
||||
go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU=
|
||||
go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM=
|
||||
go.uber.org/mock v0.5.1 h1:ASgazW/qBmR+A32MYFDB6E2POoTgOwT509VP0CT/fjs=
|
||||
go.uber.org/mock v0.5.1/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34=
|
||||
golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc=
|
||||
golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE=
|
||||
golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo=
|
||||
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak=
|
||||
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 h1:R84qjqJb5nVJMxqWYb3np9L5ZsaDtB+a39EqjV0JSUM=
|
||||
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0/go.mod h1:S9Xr4PYopiDyqSyp5NjCrhFrqg6A5zA2E/iPHPhqnS8=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=
|
||||
golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
|
||||
golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU=
|
||||
golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
|
||||
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
|
||||
golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY=
|
||||
golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=
|
||||
golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610=
|
||||
golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
|
||||
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
||||
golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20=
|
||||
golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
|
||||
golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
|
||||
golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0=
|
||||
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
|
||||
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o=
|
||||
golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q=
|
||||
golang.org/x/tools v0.32.0 h1:Q7N1vhpkQv7ybVzLFtTjvQya2ewbwNDZzUgfXGqtMWU=
|
||||
golang.org/x/tools v0.32.0/go.mod h1:ZxrU41P/wAbZD8EDa6dDCa6XfpkhJ7HFMjHJXfBDu8s=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
|
||||
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
|
||||
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
|
||||
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
|
||||
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA=
|
||||
google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
||||
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
|
||||
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
|
@@ -2,9 +2,9 @@ package pingtunnel
|
||||
|
||||
import (
|
||||
"github.com/esrrhs/gohome/common"
|
||||
"github.com/esrrhs/gohome/frame"
|
||||
"github.com/esrrhs/gohome/loggo"
|
||||
"github.com/esrrhs/gohome/threadpool"
|
||||
"github.com/esrrhs/gohome/network"
|
||||
"github.com/esrrhs/gohome/thread"
|
||||
"github.com/golang/protobuf/proto"
|
||||
"golang.org/x/net/icmp"
|
||||
"net"
|
||||
@@ -23,7 +23,7 @@ func NewServer(key int, maxconn int, maxprocessthread int, maxprocessbuffer int,
|
||||
}
|
||||
|
||||
if maxprocessthread > 0 {
|
||||
s.processtp = threadpool.NewThreadPool(maxprocessthread, maxprocessbuffer, func(v interface{}) {
|
||||
s.processtp = thread.NewThreadPool(maxprocessthread, maxprocessbuffer, func(v interface{}) {
|
||||
packet := v.(*Packet)
|
||||
s.processDataPacket(packet)
|
||||
})
|
||||
@@ -52,7 +52,7 @@ type Server struct {
|
||||
recvPacketSize uint64
|
||||
localConnMapSize int
|
||||
|
||||
processtp *threadpool.ThreadPool
|
||||
processtp *thread.ThreadPool
|
||||
recvcontrol chan int
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ type ServerConn struct {
|
||||
activeSendTime time.Time
|
||||
close bool
|
||||
rproto int
|
||||
fm *frame.FrameMgr
|
||||
fm *network.FrameMgr
|
||||
tcpmode int
|
||||
echoId int
|
||||
echoSeq int
|
||||
@@ -192,7 +192,7 @@ func (p *Server) processDataPacketNewConn(id string, packet *Packet) *ServerConn
|
||||
targetConn := c.(*net.TCPConn)
|
||||
ipaddrTarget := targetConn.RemoteAddr().(*net.TCPAddr)
|
||||
|
||||
fm := frame.NewFrameMgr(FRAME_MAX_SIZE, FRAME_MAX_ID, (int)(packet.my.TcpmodeBuffersize), (int)(packet.my.TcpmodeMaxwin), (int)(packet.my.TcpmodeResendTimems), (int)(packet.my.TcpmodeCompress),
|
||||
fm := network.NewFrameMgr(FRAME_MAX_SIZE, FRAME_MAX_ID, (int)(packet.my.TcpmodeBuffersize), (int)(packet.my.TcpmodeMaxwin), (int)(packet.my.TcpmodeResendTimems), (int)(packet.my.TcpmodeCompress),
|
||||
(int)(packet.my.TcpmodeStat))
|
||||
|
||||
localConn := &ServerConn{exit: false, timeout: (int)(packet.my.Timeout), tcpconn: targetConn, tcpaddrTarget: ipaddrTarget, id: id, activeRecvTime: now, activeSendTime: now, close: false,
|
||||
@@ -250,7 +250,7 @@ func (p *Server) processDataPacket(packet *Packet) {
|
||||
if packet.my.Type == (int32)(MyMsg_DATA) {
|
||||
|
||||
if packet.my.Tcpmode > 0 {
|
||||
f := &frame.Frame{}
|
||||
f := &network.Frame{}
|
||||
err := proto.Unmarshal(packet.my.Data, f)
|
||||
if err != nil {
|
||||
loggo.Error("Unmarshal tcp Error %s", err)
|
||||
@@ -294,7 +294,7 @@ func (p *Server) RecvTCP(conn *ServerConn, id string, src *net.IPAddr) {
|
||||
conn.fm.Update()
|
||||
sendlist := conn.fm.GetSendList()
|
||||
for e := sendlist.Front(); e != nil; e = e.Next() {
|
||||
f := e.Value.(*frame.Frame)
|
||||
f := e.Value.(*network.Frame)
|
||||
mb, _ := conn.fm.MarshalFrame(f)
|
||||
sendICMP(conn.echoId, conn.echoSeq, *p.conn, src, "", id, (uint32)(MyMsg_DATA), mb,
|
||||
conn.rproto, -1, p.key,
|
||||
@@ -353,7 +353,7 @@ func (p *Server) RecvTCP(conn *ServerConn, id string, src *net.IPAddr) {
|
||||
sleep = false
|
||||
conn.activeSendTime = now
|
||||
for e := sendlist.Front(); e != nil; e = e.Next() {
|
||||
f := e.Value.(*frame.Frame)
|
||||
f := e.Value.(*network.Frame)
|
||||
mb, err := conn.fm.MarshalFrame(f)
|
||||
if err != nil {
|
||||
loggo.Error("Error tcp Marshal %s %s %s", conn.id, conn.tcpaddrTarget.String(), err)
|
||||
@@ -419,7 +419,7 @@ func (p *Server) RecvTCP(conn *ServerConn, id string, src *net.IPAddr) {
|
||||
|
||||
sendlist := conn.fm.GetSendList()
|
||||
for e := sendlist.Front(); e != nil; e = e.Next() {
|
||||
f := e.Value.(*frame.Frame)
|
||||
f := e.Value.(*network.Frame)
|
||||
mb, _ := conn.fm.MarshalFrame(f)
|
||||
sendICMP(conn.echoId, conn.echoSeq, *p.conn, src, "", id, (uint32)(MyMsg_DATA), mb,
|
||||
conn.rproto, -1, p.key,
|
||||
|
@@ -341,6 +341,16 @@ func (d *DefaultDialer) ListenSerialInterfacePacket(ctx context.Context, destina
|
||||
}
|
||||
|
||||
func (d *DefaultDialer) ListenPacketCompat(network, address string) (net.PacketConn, error) {
|
||||
udpListener := d.udpListener
|
||||
udpListener.Control = control.Append(udpListener.Control, func(network, address string, conn syscall.RawConn) error {
|
||||
for _, wgControlFn := range WgControlFns {
|
||||
err := wgControlFn(network, address, conn)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
})
|
||||
return d.udpListener.ListenPacket(context.Background(), network, address)
|
||||
}
|
||||
|
||||
|
@@ -268,13 +268,10 @@ func (c *Client) Lookup(ctx context.Context, transport adapter.DNSTransport, dom
|
||||
return nil
|
||||
})
|
||||
err := group.Run(ctx)
|
||||
if len(response4) > 0 || len(response6) > 0 {
|
||||
return sortAddresses(response4, response6, options.Strategy), nil
|
||||
} else if err != nil {
|
||||
if len(response4) == 0 && len(response6) == 0 {
|
||||
return nil, err
|
||||
} else {
|
||||
return nil, RcodeError(dns.RcodeNameError)
|
||||
}
|
||||
return sortAddresses(response4, response6, options.Strategy), nil
|
||||
}
|
||||
|
||||
func (c *Client) ClearCache() {
|
||||
|
@@ -323,6 +323,9 @@ func (r *Router) Lookup(ctx context.Context, domain string, options adapter.DNSQ
|
||||
err error
|
||||
)
|
||||
printResult := func() {
|
||||
if err == nil && len(responseAddrs) == 0 {
|
||||
err = E.New("empty result")
|
||||
}
|
||||
if err != nil {
|
||||
if errors.Is(err, ErrResponseRejectedCached) {
|
||||
r.logger.DebugContext(ctx, "response rejected for ", domain, " (cached)")
|
||||
@@ -331,14 +334,15 @@ func (r *Router) Lookup(ctx context.Context, domain string, options adapter.DNSQ
|
||||
} else {
|
||||
r.logger.ErrorContext(ctx, E.Cause(err, "lookup failed for ", domain))
|
||||
}
|
||||
} else if len(responseAddrs) == 0 {
|
||||
panic("unexpected empty result")
|
||||
}
|
||||
if err != nil {
|
||||
err = E.Cause(err, "lookup ", domain)
|
||||
}
|
||||
}
|
||||
responseAddrs, cached = r.client.LookupCache(domain, options.Strategy)
|
||||
if cached {
|
||||
if len(responseAddrs) == 0 {
|
||||
return nil, RcodeNameError
|
||||
return nil, E.New("lookup ", domain, ": empty result (cached)")
|
||||
}
|
||||
return responseAddrs, nil
|
||||
}
|
||||
|
@@ -3,6 +3,7 @@ package local
|
||||
import (
|
||||
"context"
|
||||
"math/rand"
|
||||
"net/netip"
|
||||
"time"
|
||||
|
||||
"github.com/sagernet/sing-box/adapter"
|
||||
@@ -90,8 +91,9 @@ func (t *Transport) exchangeParallel(ctx context.Context, systemConfig *dnsConfi
|
||||
startRacer := func(ctx context.Context, fqdn string) {
|
||||
response, err := t.tryOneName(ctx, systemConfig, fqdn, message)
|
||||
if err == nil {
|
||||
addresses, _ := dns.MessageToAddresses(response)
|
||||
if len(addresses) == 0 {
|
||||
var addresses []netip.Addr
|
||||
addresses, err = dns.MessageToAddresses(response)
|
||||
if err == nil && len(addresses) == 0 {
|
||||
err = E.New(fqdn, ": empty result")
|
||||
}
|
||||
}
|
||||
|
@@ -9,7 +9,6 @@ import (
|
||||
"os"
|
||||
"runtime"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
@@ -50,7 +49,6 @@ type Server struct {
|
||||
httpServer *http.Server
|
||||
trafficManager *trafficontrol.Manager
|
||||
urlTestHistory adapter.URLTestHistoryStorage
|
||||
uiUpdateAccess sync.Mutex
|
||||
logDebug bool
|
||||
|
||||
mode string
|
||||
|
@@ -37,8 +37,6 @@ func (s *Server) checkAndDownloadExternalUI() {
|
||||
}
|
||||
|
||||
func (s *Server) downloadExternalUI() error {
|
||||
s.uiUpdateAccess.Lock()
|
||||
defer s.uiUpdateAccess.Unlock()
|
||||
var downloadURL string
|
||||
if s.externalUIDownloadURL != "" {
|
||||
downloadURL = s.externalUIDownloadURL
|
||||
|
@@ -83,7 +83,6 @@ type DialerOptions struct {
|
||||
NetworkType badoption.Listable[InterfaceType] `json:"network_type,omitempty"`
|
||||
FallbackNetworkType badoption.Listable[InterfaceType] `json:"fallback_network_type,omitempty"`
|
||||
FallbackDelay badoption.Duration `json:"fallback_delay,omitempty"`
|
||||
IsWireGuardListener bool `json:"-"`
|
||||
|
||||
// Deprecated: migrated to domain resolver
|
||||
DomainStrategy DomainStrategy `json:"domain_strategy,omitempty"`
|
||||
|
@@ -45,8 +45,8 @@ func NewEndpoint(ctx context.Context, router adapter.Router, logger log.ContextL
|
||||
logger: logger,
|
||||
localAddresses: options.Address,
|
||||
}
|
||||
if options.Detour == "" {
|
||||
options.IsWireGuardListener = true
|
||||
if options.Detour != "" && options.ListenPort != 0 {
|
||||
return nil, E.New("`listen_port` is conflict with `detour`")
|
||||
}
|
||||
outboundDialer, err := dialer.NewWithOptions(dialer.Options{
|
||||
Context: ctx,
|
||||
|
@@ -46,9 +46,7 @@ func NewOutbound(ctx context.Context, router adapter.Router, logger log.ContextL
|
||||
logger: logger,
|
||||
localAddresses: options.LocalAddress,
|
||||
}
|
||||
if options.Detour == "" {
|
||||
options.IsWireGuardListener = true
|
||||
} else if options.GSO {
|
||||
if options.Detour != "" && options.GSO {
|
||||
return nil, E.New("gso is conflict with detour")
|
||||
}
|
||||
outboundDialer, err := dialer.NewWithOptions(dialer.Options{
|
||||
|
@@ -7,6 +7,7 @@ import (
|
||||
"net"
|
||||
"net/netip"
|
||||
"os"
|
||||
"strings"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
@@ -66,7 +67,17 @@ func (m *ConnectionManager) NewConnection(ctx context.Context, this N.Dialer, co
|
||||
remoteConn, err = this.DialContext(ctx, N.NetworkTCP, metadata.Destination)
|
||||
}
|
||||
if err != nil {
|
||||
err = E.Cause(err, "open outbound connection")
|
||||
var remoteString string
|
||||
if len(metadata.DestinationAddresses) > 0 {
|
||||
remoteString = "[" + strings.Join(common.Map(metadata.DestinationAddresses, netip.Addr.String), ",") + "]"
|
||||
} else {
|
||||
remoteString = metadata.Destination.String()
|
||||
}
|
||||
var dialerString string
|
||||
if outbound, isOutbound := this.(adapter.Outbound); isOutbound {
|
||||
dialerString = " using outbound/" + outbound.Type() + "[" + outbound.Tag() + "]"
|
||||
}
|
||||
err = E.Cause(err, "open connection to ", remoteString, dialerString)
|
||||
N.CloseOnHandshakeFailure(conn, onClose, err)
|
||||
m.logger.ErrorContext(ctx, err)
|
||||
return
|
||||
@@ -133,8 +144,19 @@ func (m *ConnectionManager) NewPacketConnection(ctx context.Context, this N.Dial
|
||||
remoteConn, err = this.DialContext(ctx, N.NetworkUDP, metadata.Destination)
|
||||
}
|
||||
if err != nil {
|
||||
var remoteString string
|
||||
if len(metadata.DestinationAddresses) > 0 {
|
||||
remoteString = "[" + strings.Join(common.Map(metadata.DestinationAddresses, netip.Addr.String), ",") + "]"
|
||||
} else {
|
||||
remoteString = metadata.Destination.String()
|
||||
}
|
||||
var dialerString string
|
||||
if outbound, isOutbound := this.(adapter.Outbound); isOutbound {
|
||||
dialerString = " using outbound/" + outbound.Type() + "[" + outbound.Tag() + "]"
|
||||
}
|
||||
err = E.Cause(err, "open packet connection to ", remoteString, dialerString)
|
||||
N.CloseOnHandshakeFailure(conn, onClose, err)
|
||||
m.logger.ErrorContext(ctx, "open outbound packet connection: ", err)
|
||||
m.logger.ErrorContext(ctx, err)
|
||||
return
|
||||
}
|
||||
remotePacketConn = bufio.NewUnbindPacketConn(remoteConn)
|
||||
@@ -149,8 +171,13 @@ func (m *ConnectionManager) NewPacketConnection(ctx context.Context, this N.Dial
|
||||
remotePacketConn, err = this.ListenPacket(ctx, metadata.Destination)
|
||||
}
|
||||
if err != nil {
|
||||
var dialerString string
|
||||
if outbound, isOutbound := this.(adapter.Outbound); isOutbound {
|
||||
dialerString = " using outbound/" + outbound.Type() + "[" + outbound.Tag() + "]"
|
||||
}
|
||||
err = E.Cause(err, "listen packet connection using ", dialerString)
|
||||
N.CloseOnHandshakeFailure(conn, onClose, err)
|
||||
m.logger.ErrorContext(ctx, "listen outbound packet connection: ", err)
|
||||
m.logger.ErrorContext(ctx, err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
@@ -141,7 +141,7 @@ func (e *Endpoint) Start(resolve bool) error {
|
||||
return nil
|
||||
}
|
||||
var bind conn.Bind
|
||||
wgListener, isWgListener := e.options.Dialer.(conn.Listener)
|
||||
wgListener, isWgListener := common.Cast[conn.Listener](e.options.Dialer)
|
||||
if isWgListener {
|
||||
bind = conn.NewStdNetBind(wgListener)
|
||||
} else {
|
||||
|
@@ -1,12 +1,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=geoview
|
||||
PKG_VERSION:=0.1.6
|
||||
PKG_VERSION:=0.1.9
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/snowie2000/geoview/tar.gz/$(PKG_VERSION)?
|
||||
PKG_HASH:=f6ce6943fd09ec2ab2794a5da1078ca9cae3ed83de98d4e6650f2d8b81d051ea
|
||||
PKG_HASH:=c071983826e34b22b0d1383e4e778eb28a232dc5b3f9e5d5dd5247972be5ca95
|
||||
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
@@ -18,8 +18,8 @@
|
||||
<PackageVersion Include="ReactiveUI" Version="20.2.45" />
|
||||
<PackageVersion Include="ReactiveUI.Fody" Version="19.5.41" />
|
||||
<PackageVersion Include="ReactiveUI.WPF" Version="20.2.45" />
|
||||
<PackageVersion Include="Semi.Avalonia" Version="11.2.1.6" />
|
||||
<PackageVersion Include="Semi.Avalonia.DataGrid" Version="11.2.1.6" />
|
||||
<PackageVersion Include="Semi.Avalonia" Version="11.2.1.7" />
|
||||
<PackageVersion Include="Semi.Avalonia.DataGrid" Version="11.2.1.7" />
|
||||
<PackageVersion Include="Splat.NLog" Version="15.3.1" />
|
||||
<PackageVersion Include="sqlite-net-pcl" Version="1.9.172" />
|
||||
<PackageVersion Include="TaskScheduler" Version="2.12.1" />
|
||||
|
@@ -31,15 +31,6 @@ public sealed class AppHandler
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsAdministrator
|
||||
{
|
||||
get
|
||||
{
|
||||
_isAdministrator ??= Utils.IsAdministrator();
|
||||
return _isAdministrator.Value;
|
||||
}
|
||||
}
|
||||
|
||||
public string LinuxSudoPwd { get; set; }
|
||||
|
||||
#endregion Property
|
||||
|
144
v2rayn/v2rayN/ServiceLib/Handler/CoreAdminHandler.cs
Normal file
144
v2rayn/v2rayN/ServiceLib/Handler/CoreAdminHandler.cs
Normal file
@@ -0,0 +1,144 @@
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
using CliWrap;
|
||||
|
||||
namespace ServiceLib.Handler;
|
||||
|
||||
public class CoreAdminHandler
|
||||
{
|
||||
private static readonly Lazy<CoreAdminHandler> _instance = new(() => new());
|
||||
public static CoreAdminHandler Instance => _instance.Value;
|
||||
private Config _config;
|
||||
private Action<bool, string>? _updateFunc;
|
||||
private const string _tag = "CoreAdminHandler";
|
||||
private int _linuxSudoPid = -1;
|
||||
|
||||
public async Task Init(Config config, Action<bool, string> updateFunc)
|
||||
{
|
||||
if (_config != null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
_config = config;
|
||||
_updateFunc = updateFunc;
|
||||
}
|
||||
|
||||
private void UpdateFunc(bool notify, string msg)
|
||||
{
|
||||
_updateFunc?.Invoke(notify, msg);
|
||||
}
|
||||
|
||||
public async Task<Process?> RunProcessAsLinuxSudo(string fileName, CoreInfo coreInfo, string configPath)
|
||||
{
|
||||
try
|
||||
{
|
||||
var cmdLine = $"{fileName.AppendQuotes()} {string.Format(coreInfo.Arguments, Utils.GetBinConfigPath(configPath).AppendQuotes())}";
|
||||
var shFilePath = await CreateLinuxShellFile(cmdLine, "run_as_sudo.sh");
|
||||
|
||||
Process proc = new()
|
||||
{
|
||||
StartInfo = new()
|
||||
{
|
||||
FileName = shFilePath,
|
||||
Arguments = "",
|
||||
WorkingDirectory = Utils.GetBinConfigPath(),
|
||||
UseShellExecute = false,
|
||||
RedirectStandardInput = true,
|
||||
RedirectStandardOutput = true,
|
||||
RedirectStandardError = true,
|
||||
CreateNoWindow = true,
|
||||
StandardInputEncoding = Encoding.UTF8,
|
||||
StandardOutputEncoding = Encoding.UTF8,
|
||||
StandardErrorEncoding = Encoding.UTF8,
|
||||
}
|
||||
};
|
||||
|
||||
proc.OutputDataReceived += (sender, e) =>
|
||||
{
|
||||
if (e.Data.IsNotEmpty())
|
||||
{
|
||||
UpdateFunc(false, e.Data + Environment.NewLine);
|
||||
}
|
||||
};
|
||||
proc.ErrorDataReceived += (sender, e) =>
|
||||
{
|
||||
if (e.Data.IsNotEmpty())
|
||||
{
|
||||
UpdateFunc(false, e.Data + Environment.NewLine);
|
||||
}
|
||||
};
|
||||
|
||||
proc.Start();
|
||||
proc.BeginOutputReadLine();
|
||||
proc.BeginErrorReadLine();
|
||||
|
||||
await Task.Delay(10);
|
||||
await proc.StandardInput.WriteLineAsync();
|
||||
await Task.Delay(10);
|
||||
await proc.StandardInput.WriteLineAsync(AppHandler.Instance.LinuxSudoPwd);
|
||||
|
||||
await Task.Delay(100);
|
||||
if (proc is null or { HasExited: true })
|
||||
{
|
||||
throw new Exception(ResUI.FailedToRunCore);
|
||||
}
|
||||
|
||||
_linuxSudoPid = proc.Id;
|
||||
|
||||
return proc;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logging.SaveLog(_tag, ex);
|
||||
UpdateFunc(false, ex.Message);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task KillProcessAsLinuxSudo()
|
||||
{
|
||||
if (_linuxSudoPid < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var cmdLine = $"pkill -P {_linuxSudoPid} ; kill {_linuxSudoPid}";
|
||||
var shFilePath = await CreateLinuxShellFile(cmdLine, "kill_as_sudo.sh");
|
||||
|
||||
var result = await Cli.Wrap(shFilePath)
|
||||
.WithStandardInputPipe(PipeSource.FromString(AppHandler.Instance.LinuxSudoPwd))
|
||||
.ExecuteAsync();
|
||||
|
||||
_linuxSudoPid = -1;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logging.SaveLog(_tag, ex);
|
||||
UpdateFunc(false, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<string> CreateLinuxShellFile(string cmdLine, string fileName)
|
||||
{
|
||||
var shFilePath = Utils.GetBinConfigPath(fileName);
|
||||
File.Delete(shFilePath);
|
||||
|
||||
var sb = new StringBuilder();
|
||||
sb.AppendLine("#!/bin/sh");
|
||||
if (Utils.IsAdministrator())
|
||||
{
|
||||
sb.AppendLine($"{cmdLine}");
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.AppendLine($"sudo -S {cmdLine}");
|
||||
}
|
||||
|
||||
await File.WriteAllTextAsync(shFilePath, sb.ToString());
|
||||
await Utils.SetLinuxChmod(shFilePath);
|
||||
|
||||
return shFilePath;
|
||||
}
|
||||
}
|
@@ -13,7 +13,7 @@ public class CoreHandler
|
||||
private Config _config;
|
||||
private Process? _process;
|
||||
private Process? _processPre;
|
||||
private int _linuxSudoPid = -1;
|
||||
private bool _linuxSudo = false;
|
||||
private Action<bool, string>? _updateFunc;
|
||||
private const string _tag = "CoreHandler";
|
||||
|
||||
@@ -155,21 +155,21 @@ public class CoreHandler
|
||||
{
|
||||
try
|
||||
{
|
||||
if (_linuxSudoPid > 0)
|
||||
if (_linuxSudo)
|
||||
{
|
||||
await KillProcessAsLinuxSudo();
|
||||
_linuxSudoPid = -1;
|
||||
await CoreAdminHandler.Instance.KillProcessAsLinuxSudo();
|
||||
_linuxSudo = false;
|
||||
}
|
||||
|
||||
if (_process != null)
|
||||
{
|
||||
await ProcUtils.ProcessKill(_process, true);
|
||||
await ProcUtils.ProcessKill(_process, Utils.IsWindows());
|
||||
_process = null;
|
||||
}
|
||||
|
||||
if (_processPre != null)
|
||||
{
|
||||
await ProcUtils.ProcessKill(_processPre, true);
|
||||
await ProcUtils.ProcessKill(_processPre, Utils.IsWindows());
|
||||
_processPre = null;
|
||||
}
|
||||
}
|
||||
@@ -225,13 +225,6 @@ public class CoreHandler
|
||||
_updateFunc?.Invoke(notify, msg);
|
||||
}
|
||||
|
||||
private bool IsNeedSudo(ECoreType eCoreType)
|
||||
{
|
||||
return _config.TunModeItem.EnableTun
|
||||
&& eCoreType == ECoreType.sing_box
|
||||
&& Utils.IsNonWindows();
|
||||
}
|
||||
|
||||
#endregion Private
|
||||
|
||||
#region Process
|
||||
@@ -245,6 +238,16 @@ public class CoreHandler
|
||||
return null;
|
||||
}
|
||||
|
||||
if (mayNeedSudo
|
||||
&& _config.TunModeItem.EnableTun
|
||||
&& coreInfo.CoreType == ECoreType.sing_box
|
||||
&& Utils.IsNonWindows())
|
||||
{
|
||||
_linuxSudo = true;
|
||||
await CoreAdminHandler.Instance.Init(_config, _updateFunc);
|
||||
return await CoreAdminHandler.Instance.RunProcessAsLinuxSudo(fileName, coreInfo, configPath);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Process proc = new()
|
||||
@@ -263,38 +266,25 @@ public class CoreHandler
|
||||
}
|
||||
};
|
||||
|
||||
var isNeedSudo = mayNeedSudo && IsNeedSudo(coreInfo.CoreType);
|
||||
if (isNeedSudo)
|
||||
{
|
||||
await RunProcessAsLinuxSudo(proc, fileName, coreInfo, configPath);
|
||||
}
|
||||
|
||||
if (displayLog)
|
||||
{
|
||||
proc.OutputDataReceived += (sender, e) =>
|
||||
{
|
||||
if (e.Data.IsNullOrEmpty())
|
||||
return;
|
||||
UpdateFunc(false, e.Data + Environment.NewLine);
|
||||
if (e.Data.IsNotEmpty())
|
||||
{
|
||||
UpdateFunc(false, e.Data + Environment.NewLine);
|
||||
}
|
||||
};
|
||||
proc.ErrorDataReceived += (sender, e) =>
|
||||
{
|
||||
if (e.Data.IsNullOrEmpty())
|
||||
return;
|
||||
UpdateFunc(false, e.Data + Environment.NewLine);
|
||||
if (e.Data.IsNotEmpty())
|
||||
{
|
||||
UpdateFunc(false, e.Data + Environment.NewLine);
|
||||
}
|
||||
};
|
||||
}
|
||||
proc.Start();
|
||||
|
||||
if (isNeedSudo && AppHandler.Instance.LinuxSudoPwd.IsNotEmpty())
|
||||
{
|
||||
await proc.StandardInput.WriteLineAsync();
|
||||
await Task.Delay(10);
|
||||
await proc.StandardInput.WriteLineAsync(AppHandler.Instance.LinuxSudoPwd);
|
||||
}
|
||||
if (isNeedSudo)
|
||||
_linuxSudoPid = proc.Id;
|
||||
|
||||
if (displayLog)
|
||||
{
|
||||
proc.BeginOutputReadLine();
|
||||
@@ -318,82 +308,4 @@ public class CoreHandler
|
||||
}
|
||||
|
||||
#endregion Process
|
||||
|
||||
#region Linux
|
||||
|
||||
private async Task RunProcessAsLinuxSudo(Process proc, string fileName, CoreInfo coreInfo, string configPath)
|
||||
{
|
||||
var cmdLine = $"{fileName.AppendQuotes()} {string.Format(coreInfo.Arguments, Utils.GetBinConfigPath(configPath).AppendQuotes())}";
|
||||
|
||||
var shFilePath = await CreateLinuxShellFile(cmdLine, "run_as_sudo.sh");
|
||||
proc.StartInfo.FileName = shFilePath;
|
||||
proc.StartInfo.Arguments = "";
|
||||
proc.StartInfo.WorkingDirectory = "";
|
||||
if (AppHandler.Instance.LinuxSudoPwd.IsNotEmpty())
|
||||
{
|
||||
proc.StartInfo.StandardInputEncoding = Encoding.UTF8;
|
||||
proc.StartInfo.RedirectStandardInput = true;
|
||||
}
|
||||
}
|
||||
|
||||
private async Task KillProcessAsLinuxSudo()
|
||||
{
|
||||
var cmdLine = $"pkill -P {_linuxSudoPid} ; kill {_linuxSudoPid}";
|
||||
var shFilePath = await CreateLinuxShellFile(cmdLine, "kill_as_sudo.sh");
|
||||
Process proc = new()
|
||||
{
|
||||
StartInfo = new()
|
||||
{
|
||||
FileName = shFilePath,
|
||||
UseShellExecute = false,
|
||||
CreateNoWindow = true,
|
||||
StandardInputEncoding = Encoding.UTF8,
|
||||
RedirectStandardInput = true
|
||||
}
|
||||
};
|
||||
proc.Start();
|
||||
|
||||
if (AppHandler.Instance.LinuxSudoPwd.IsNotEmpty())
|
||||
{
|
||||
try
|
||||
{
|
||||
await proc.StandardInput.WriteLineAsync();
|
||||
await Task.Delay(10);
|
||||
await proc.StandardInput.WriteLineAsync(AppHandler.Instance.LinuxSudoPwd);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
|
||||
var timeout = new CancellationTokenSource(TimeSpan.FromSeconds(10));
|
||||
await proc.WaitForExitAsync(timeout.Token);
|
||||
await Task.Delay(1000);
|
||||
}
|
||||
|
||||
private async Task<string> CreateLinuxShellFile(string cmdLine, string fileName)
|
||||
{
|
||||
//Shell scripts
|
||||
var shFilePath = Utils.GetBinConfigPath(AppHandler.Instance.IsAdministrator ? "root_" + fileName : fileName);
|
||||
File.Delete(shFilePath);
|
||||
var sb = new StringBuilder();
|
||||
sb.AppendLine("#!/bin/sh");
|
||||
if (AppHandler.Instance.IsAdministrator)
|
||||
{
|
||||
sb.AppendLine($"{cmdLine}");
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.AppendLine($"sudo -S {cmdLine}");
|
||||
}
|
||||
|
||||
await File.WriteAllTextAsync(shFilePath, sb.ToString());
|
||||
await Utils.SetLinuxChmod(shFilePath);
|
||||
//Logging.SaveLog(shFilePath);
|
||||
|
||||
return shFilePath;
|
||||
}
|
||||
|
||||
#endregion Linux
|
||||
}
|
||||
|
@@ -1339,7 +1339,7 @@
|
||||
<value>رمز عبور sudo سیستم</value>
|
||||
</data>
|
||||
<data name="TbSettingsLinuxSudoPasswordTip" xml:space="preserve">
|
||||
<value>The password you entered cannot be verified, so make sure you enter it correctly. If the application does not work properly due to an incorrect input, please restart the application. The password will not be stored and you will need to enter it again after each restart.</value>
|
||||
<value>رمز عبوری که وارد کرده اید تایید نمی شود، بنابراین مطمئن شوید که آن را به درستی وارد کرده اید. اگر برنامه به دلیل ورودی نادرست به درستی کار نمی کند، لطفاً برنامه را مجدداً راه اندازی کنید. رمز عبور ذخیره نمی شود و پس از هر بار راه اندازی مجدد باید آن را دوباره وارد کنید.</value>
|
||||
</data>
|
||||
<data name="TbSettingsLinuxSudoPasswordIsEmpty" xml:space="preserve">
|
||||
<value>لطفاً ابتدا رمز عبور sudo را در تنظیمات حالت Tun تنظیم کنید</value>
|
||||
@@ -1416,4 +1416,4 @@
|
||||
<data name="menuExportConfig" xml:space="preserve">
|
||||
<value>صادر کردن سرور</value>
|
||||
</data>
|
||||
</root>
|
||||
</root>
|
||||
|
@@ -454,7 +454,7 @@ public class StatusBarViewModel : MyReactiveObject
|
||||
{
|
||||
if (Utils.IsWindows())
|
||||
{
|
||||
return AppHandler.Instance.IsAdministrator;
|
||||
return Utils.IsAdministrator();
|
||||
}
|
||||
else if (Utils.IsLinux())
|
||||
{
|
||||
|
@@ -143,7 +143,7 @@ public partial class MainWindow : ReactiveWindow<MainWindowViewModel>
|
||||
}
|
||||
else
|
||||
{
|
||||
if (AppHandler.Instance.IsAdministrator)
|
||||
if (Utils.IsAdministrator())
|
||||
{
|
||||
this.Title = $"{Utils.GetVersion()} - {ResUI.TbSettingsLinuxSudoPasswordNotSudoRunApp}";
|
||||
NoticeHandler.Instance.SendMessageAndEnqueue(ResUI.TbSettingsLinuxSudoPasswordNotSudoRunApp);
|
||||
|
@@ -8,7 +8,6 @@ using DialogHostAvalonia;
|
||||
using ReactiveUI;
|
||||
using Splat;
|
||||
using v2rayN.Desktop.Common;
|
||||
using static QRCoder.PayloadGenerator;
|
||||
|
||||
namespace v2rayN.Desktop.Views;
|
||||
|
||||
|
@@ -1,9 +1,9 @@
|
||||
<Application
|
||||
x:Class="v2rayN.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:conv="clr-namespace:v2rayN.Converters"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
ShutdownMode="OnExplicitShutdown"
|
||||
StartupUri="Views/MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
|
@@ -1,14 +1,14 @@
|
||||
<reactiveui:ReactiveWindow
|
||||
x:Class="v2rayN.Views.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:reactiveui="http://reactiveui.net"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:reactiveui="http://reactiveui.net"
|
||||
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
|
||||
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
|
||||
xmlns:view="clr-namespace:v2rayN.Views"
|
||||
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
|
||||
Title="v2rayN"
|
||||
Width="900"
|
||||
Height="700"
|
||||
@@ -40,10 +40,10 @@
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
ClipToBounds="True"
|
||||
Style="{StaticResource MaterialDesignToolBar}">
|
||||
Style="{StaticResource MaterialDesignToolBar}"
|
||||
KeyboardNavigation.TabNavigation="Continue">
|
||||
<Menu Margin="0,1" Style="{StaticResource ToolbarMenu}">
|
||||
<MenuItem Padding="8,0"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuServers}">
|
||||
<MenuItem Padding="8,0" AutomationProperties.Name="{x:Static resx:ResUI.menuServers}">
|
||||
<MenuItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon
|
||||
@@ -111,8 +111,7 @@
|
||||
</Menu>
|
||||
<Separator />
|
||||
<Menu Margin="0,1" Style="{StaticResource ToolbarMenu}">
|
||||
<MenuItem Padding="8,0"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuSubscription}">
|
||||
<MenuItem Padding="8,0" AutomationProperties.Name="{x:Static resx:ResUI.menuSubscription}">
|
||||
<MenuItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon
|
||||
@@ -147,8 +146,7 @@
|
||||
</Menu>
|
||||
<Separator />
|
||||
<Menu Margin="0,1" Style="{StaticResource ToolbarMenu}">
|
||||
<MenuItem Padding="8,0"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuSetting}">
|
||||
<MenuItem Padding="8,0" AutomationProperties.Name="{x:Static resx:ResUI.menuSetting}">
|
||||
<MenuItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon
|
||||
@@ -214,8 +212,10 @@
|
||||
</Menu>
|
||||
<Separator />
|
||||
<Menu Margin="0,1" Style="{StaticResource ToolbarMenu}">
|
||||
<MenuItem x:Name="menuReload" Padding="8,0"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuReload}">
|
||||
<MenuItem
|
||||
x:Name="menuReload"
|
||||
Padding="8,0"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuReload}">
|
||||
<MenuItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon
|
||||
@@ -229,8 +229,10 @@
|
||||
</Menu>
|
||||
<Separator />
|
||||
<Menu Margin="0,1" Style="{StaticResource ToolbarMenu}">
|
||||
<MenuItem Name="menuCheckUpdate" Padding="8,0"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuCheckUpdate}">
|
||||
<MenuItem
|
||||
Name="menuCheckUpdate"
|
||||
Padding="8,0"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuCheckUpdate}">
|
||||
<MenuItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon
|
||||
@@ -244,8 +246,10 @@
|
||||
</Menu>
|
||||
<Separator />
|
||||
<Menu Margin="0,1" Style="{StaticResource ToolbarMenu}">
|
||||
<MenuItem x:Name="menuHelp" Padding="8,0"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuHelp}">
|
||||
<MenuItem
|
||||
x:Name="menuHelp"
|
||||
Padding="8,0"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuHelp}">
|
||||
<MenuItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon
|
||||
@@ -259,8 +263,10 @@
|
||||
</Menu>
|
||||
<Separator />
|
||||
<Menu Margin="0,1" Style="{StaticResource ToolbarMenu}">
|
||||
<MenuItem x:Name="menuPromotion" Padding="8,0"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuPromotion}">
|
||||
<MenuItem
|
||||
x:Name="menuPromotion"
|
||||
Padding="8,0"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuPromotion}">
|
||||
<MenuItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon
|
||||
@@ -274,8 +280,10 @@
|
||||
</Menu>
|
||||
<Separator />
|
||||
<Menu Margin="0,1" Style="{StaticResource ToolbarMenu}">
|
||||
<MenuItem x:Name="menuClose" Padding="8,0"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuClose}">
|
||||
<MenuItem
|
||||
x:Name="menuClose"
|
||||
Padding="8,0"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuClose}">
|
||||
<MenuItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon
|
||||
|
@@ -132,7 +132,7 @@ public partial class MainWindow
|
||||
}
|
||||
});
|
||||
|
||||
this.Title = $"{Utils.GetVersion()} - {(AppHandler.Instance.IsAdministrator ? ResUI.RunAsAdmin : ResUI.NotRunAsAdmin)}";
|
||||
this.Title = $"{Utils.GetVersion()} - {(Utils.IsAdministrator() ? ResUI.RunAsAdmin : ResUI.NotRunAsAdmin)}";
|
||||
|
||||
if (!_config.GuiItem.EnableHWA)
|
||||
{
|
||||
|
@@ -40,9 +40,9 @@
|
||||
Width="30"
|
||||
Height="30"
|
||||
Margin="{StaticResource MarginLeftRight4}"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuSubEdit}"
|
||||
Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
|
||||
ToolTip="{x:Static resx:ResUI.menuSubEdit}"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuSubEdit}">
|
||||
ToolTip="{x:Static resx:ResUI.menuSubEdit}">
|
||||
<materialDesign:PackIcon VerticalAlignment="Center" Kind="Edit" />
|
||||
</Button>
|
||||
<Button
|
||||
@@ -50,9 +50,9 @@
|
||||
Width="30"
|
||||
Height="30"
|
||||
Margin="{StaticResource MarginLeftRight4}"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuSubAdd}"
|
||||
Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
|
||||
ToolTip="{x:Static resx:ResUI.menuSubAdd}"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuSubAdd}">
|
||||
ToolTip="{x:Static resx:ResUI.menuSubAdd}">
|
||||
<materialDesign:PackIcon VerticalAlignment="Center" Kind="Plus" />
|
||||
</Button>
|
||||
|
||||
@@ -61,9 +61,9 @@
|
||||
Width="30"
|
||||
Height="30"
|
||||
Margin="{StaticResource MarginLeftRight8}"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuProfileAutofitColumnWidth}"
|
||||
Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
|
||||
ToolTip="{x:Static resx:ResUI.menuProfileAutofitColumnWidth}"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuProfileAutofitColumnWidth}">
|
||||
ToolTip="{x:Static resx:ResUI.menuProfileAutofitColumnWidth}">
|
||||
<materialDesign:PackIcon VerticalAlignment="Center" Kind="ArrowSplitVertical" />
|
||||
</Button>
|
||||
<TextBox
|
||||
@@ -73,8 +73,8 @@
|
||||
VerticalContentAlignment="Center"
|
||||
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.MsgServerTitle}"
|
||||
materialDesign:TextFieldAssist.HasClearButton="True"
|
||||
Style="{StaticResource DefTextBox}"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.MsgServerTitle}" />
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.MsgServerTitle}"
|
||||
Style="{StaticResource DefTextBox}" />
|
||||
</WrapPanel>
|
||||
<DataGrid
|
||||
x:Name="lstProfiles"
|
||||
|
@@ -1,11 +1,11 @@
|
||||
<reactiveui:ReactiveWindow
|
||||
x:Class="v2rayN.Views.RoutingRuleDetailsWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:reactiveui="http://reactiveui.net"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:reactiveui="http://reactiveui.net"
|
||||
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
|
||||
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
|
||||
Title="{x:Static resx:ResUI.menuRoutingRuleDetailsSetting}"
|
||||
|
@@ -1,11 +1,11 @@
|
||||
<reactiveui:ReactiveWindow
|
||||
x:Class="v2rayN.Views.RoutingRuleSettingWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:reactiveui="http://reactiveui.net"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:reactiveui="http://reactiveui.net"
|
||||
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
|
||||
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
|
||||
Title="{x:Static resx:ResUI.menuRoutingRuleSetting}"
|
||||
|
@@ -61,7 +61,8 @@
|
||||
x:Name="togEnableTun"
|
||||
Margin="{StaticResource Margin4}"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center" AutomationProperties.Name="{x:Static resx:ResUI.TbEnableTunAs}" />
|
||||
VerticalAlignment="Center"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.TbEnableTunAs}" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel
|
||||
@@ -74,9 +75,9 @@
|
||||
Width="160"
|
||||
Margin="{StaticResource MarginLeftRight8}"
|
||||
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.menuSystemproxy}"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuSystemproxy}"
|
||||
FontSize="{DynamicResource StdFontSize}"
|
||||
Style="{StaticResource MaterialDesignFloatingHintComboBox}"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuSystemproxy}">
|
||||
Style="{StaticResource MaterialDesignFloatingHintComboBox}">
|
||||
<ComboBoxItem Content="{x:Static resx:ResUI.menuSystemProxyClear}" />
|
||||
<ComboBoxItem Content="{x:Static resx:ResUI.menuSystemProxySet}" />
|
||||
<ComboBoxItem Content="{x:Static resx:ResUI.menuSystemProxyNothing}" />
|
||||
@@ -88,10 +89,10 @@
|
||||
Width="160"
|
||||
Margin="{StaticResource MarginLeftRight8}"
|
||||
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.menuRouting}"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuRouting}"
|
||||
DisplayMemberPath="Remarks"
|
||||
FontSize="{DynamicResource StdFontSize}"
|
||||
Style="{StaticResource MaterialDesignFloatingHintComboBox}"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuRouting}"/>
|
||||
Style="{StaticResource MaterialDesignFloatingHintComboBox}" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Margin="{StaticResource MarginLeftRight8}" VerticalAlignment="Center">
|
||||
@@ -109,8 +110,10 @@
|
||||
ToolTipText="v2rayN">
|
||||
<tb:TaskbarIcon.ContextMenu>
|
||||
<ContextMenu Style="{StaticResource DefContextMenu}">
|
||||
<MenuItem x:Name="menuSystemProxyClear" Height="{StaticResource MenuItemHeight}"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuSystemProxyClear}">
|
||||
<MenuItem
|
||||
x:Name="menuSystemProxyClear"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuSystemProxyClear}">
|
||||
<MenuItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon
|
||||
@@ -122,8 +125,10 @@
|
||||
</StackPanel>
|
||||
</MenuItem.Header>
|
||||
</MenuItem>
|
||||
<MenuItem x:Name="menuSystemProxySet" Height="{StaticResource MenuItemHeight}"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuSystemProxySet}">
|
||||
<MenuItem
|
||||
x:Name="menuSystemProxySet"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuSystemProxySet}">
|
||||
<MenuItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon
|
||||
@@ -135,8 +140,10 @@
|
||||
</StackPanel>
|
||||
</MenuItem.Header>
|
||||
</MenuItem>
|
||||
<MenuItem x:Name="menuSystemProxyNothing" Height="{StaticResource MenuItemHeight}"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuSystemProxyNothing}">
|
||||
<MenuItem
|
||||
x:Name="menuSystemProxyNothing"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuSystemProxyNothing}">
|
||||
<MenuItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon
|
||||
@@ -148,8 +155,10 @@
|
||||
</StackPanel>
|
||||
</MenuItem.Header>
|
||||
</MenuItem>
|
||||
<MenuItem x:Name="menuSystemProxyPac" Height="{StaticResource MenuItemHeight}"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuSystemProxyPac}">
|
||||
<MenuItem
|
||||
x:Name="menuSystemProxyPac"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuSystemProxyPac}">
|
||||
<MenuItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon
|
||||
@@ -162,18 +171,20 @@
|
||||
</MenuItem.Header>
|
||||
</MenuItem>
|
||||
<Separator x:Name="sepRoutings" />
|
||||
<MenuItem x:Name="menuRoutings" Height="Auto"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuRouting}">
|
||||
<MenuItem
|
||||
x:Name="menuRoutings"
|
||||
Height="Auto"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuRouting}">
|
||||
<MenuItem.Header>
|
||||
<DockPanel>
|
||||
<ComboBox
|
||||
x:Name="cmbRoutings"
|
||||
MaxWidth="300"
|
||||
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.menuRouting}"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuRouting}"
|
||||
DisplayMemberPath="Remarks"
|
||||
FontSize="{DynamicResource StdFontSize}"
|
||||
Style="{StaticResource MaterialDesignFilledComboBox}"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuRouting}"/>
|
||||
Style="{StaticResource MaterialDesignFilledComboBox}" />
|
||||
</DockPanel>
|
||||
</MenuItem.Header>
|
||||
</MenuItem>
|
||||
@@ -184,10 +195,10 @@
|
||||
x:Name="cmbServers"
|
||||
MaxWidth="300"
|
||||
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.menuServers}"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuServers}"
|
||||
DisplayMemberPath="Text"
|
||||
FontSize="{DynamicResource StdFontSize}"
|
||||
Style="{StaticResource MaterialDesignFilledComboBox}"
|
||||
AutomationProperties.Name="{x:Static resx:ResUI.menuServers}"/>
|
||||
Style="{StaticResource MaterialDesignFilledComboBox}" />
|
||||
</DockPanel>
|
||||
</MenuItem.Header>
|
||||
</MenuItem>
|
||||
|
@@ -1,11 +1,11 @@
|
||||
<reactiveui:ReactiveWindow
|
||||
x:Class="v2rayN.Views.SubEditWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:reactiveui="http://reactiveui.net"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:reactiveui="http://reactiveui.net"
|
||||
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
|
||||
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
|
||||
Title="{x:Static resx:ResUI.menuSubSetting}"
|
||||
|
@@ -1,11 +1,11 @@
|
||||
<reactiveui:ReactiveWindow
|
||||
x:Class="v2rayN.Views.SubSettingWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:reactiveui="http://reactiveui.net"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:reactiveui="http://reactiveui.net"
|
||||
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
|
||||
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
|
||||
Title="{x:Static resx:ResUI.menuSubSetting}"
|
||||
|
@@ -1,10 +1,10 @@
|
||||
<reactiveui:ReactiveUserControl
|
||||
x:Class="v2rayN.Views.ThemeSettingView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:reactiveui="http://reactiveui.net"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:reactiveui="http://reactiveui.net"
|
||||
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
|
||||
xmlns:vms="clr-namespace:v2rayN.ViewModels"
|
||||
d:DesignHeight="450"
|
||||
|
@@ -13,7 +13,7 @@ require (
|
||||
github.com/pelletier/go-toml v1.9.5
|
||||
github.com/pires/go-proxyproto v0.8.0
|
||||
github.com/quic-go/quic-go v0.51.0
|
||||
github.com/refraction-networking/utls v1.6.7
|
||||
github.com/refraction-networking/utls v1.7.1
|
||||
github.com/sagernet/sing v0.5.1
|
||||
github.com/sagernet/sing-shadowsocks v0.2.7
|
||||
github.com/seiflotfy/cuckoofilter v0.0.0-20240715131351-a2f2c23f1771
|
||||
|
@@ -56,8 +56,8 @@ github.com/quic-go/qpack v0.5.1 h1:giqksBPnT/HDtZ6VhtFKgoLOWmlyo9Ei6u9PqzIMbhI=
|
||||
github.com/quic-go/qpack v0.5.1/go.mod h1:+PC4XFrEskIVkcLzpEkbLqq1uCoxPhQuvK5rH1ZgaEg=
|
||||
github.com/quic-go/quic-go v0.51.0 h1:K8exxe9zXxeRKxaXxi/GpUqYiTrtdiWP8bo1KFya6Wc=
|
||||
github.com/quic-go/quic-go v0.51.0/go.mod h1:MFlGGpcpJqRAfmYi6NC2cptDPSxRWTOGNuP4wqrWmzQ=
|
||||
github.com/refraction-networking/utls v1.6.7 h1:zVJ7sP1dJx/WtVuITug3qYUq034cDq9B2MR1K67ULZM=
|
||||
github.com/refraction-networking/utls v1.6.7/go.mod h1:BC3O4vQzye5hqpmDTWUqi4P5DDhzJfkV1tdqtawQIH0=
|
||||
github.com/refraction-networking/utls v1.7.1 h1:dxg+jla3uocgN8HtX+ccwDr68uCBBO3qLrkZUbqkcw0=
|
||||
github.com/refraction-networking/utls v1.7.1/go.mod h1:TUhh27RHMGtQvjQq+RyO11P6ZNQNBb3N0v7wsEjKAIQ=
|
||||
github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 h1:f/FNXud6gA3MNr8meMVVGxhp+QBTqY91tM8HjEuMjGg=
|
||||
github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3/go.mod h1:HgjTstvQsPGkxUsCd2KWxErBblirPizecHcpD3ffK+s=
|
||||
github.com/sagernet/sing v0.5.1 h1:mhL/MZVq0TjuvHcpYcFtmSD1BFOxZ/+8ofbNZcg1k1Y=
|
||||
|
@@ -137,10 +137,10 @@ func UClient(c net.Conn, config *Config, ctx context.Context, dest net.Destinati
|
||||
if err != nil {
|
||||
return nil, errors.New("REALITY: publicKey == nil")
|
||||
}
|
||||
if uConn.HandshakeState.State13.EcdheKey == nil {
|
||||
if uConn.HandshakeState.State13.KeyShareKeys.Ecdhe == nil {
|
||||
return nil, errors.New("Current fingerprint ", uConn.ClientHelloID.Client, uConn.ClientHelloID.Version, " does not support TLS 1.3, REALITY handshake cannot establish.")
|
||||
}
|
||||
uConn.AuthKey, _ = uConn.HandshakeState.State13.EcdheKey.ECDH(publicKey)
|
||||
uConn.AuthKey, _ = uConn.HandshakeState.State13.KeyShareKeys.Ecdhe.ECDH(publicKey)
|
||||
if uConn.AuthKey == nil {
|
||||
return nil, errors.New("REALITY: SharedKey == nil")
|
||||
}
|
||||
|
@@ -163,7 +163,7 @@ func init() {
|
||||
|
||||
func GetFingerprint(name string) (fingerprint *utls.ClientHelloID) {
|
||||
if name == "" {
|
||||
return &utls.HelloChrome_Auto
|
||||
return &utls.HelloChrome_120
|
||||
}
|
||||
if fingerprint = PresetFingerprints[name]; fingerprint != nil {
|
||||
return
|
||||
@@ -179,7 +179,7 @@ func GetFingerprint(name string) (fingerprint *utls.ClientHelloID) {
|
||||
|
||||
var PresetFingerprints = map[string]*utls.ClientHelloID{
|
||||
// Recommended preset options in GUI clients
|
||||
"chrome": &utls.HelloChrome_Auto,
|
||||
"chrome": &utls.HelloChrome_120,
|
||||
"firefox": &utls.HelloFirefox_Auto,
|
||||
"safari": &utls.HelloSafari_Auto,
|
||||
"ios": &utls.HelloIOS_Auto,
|
||||
@@ -240,4 +240,13 @@ var OtherFingerprints = map[string]*utls.ClientHelloID{
|
||||
"hello360_auto": &utls.Hello360_Auto,
|
||||
"hello360_7_5": &utls.Hello360_7_5,
|
||||
"helloqq_auto": &utls.HelloQQ_Auto,
|
||||
|
||||
// reality currently does not support these new fingerprints
|
||||
"hellochrome_100_psk": &utls.HelloChrome_100_PSK,
|
||||
"hellochrome_112_psk_shuf": &utls.HelloChrome_112_PSK_Shuf,
|
||||
"hellochrome_114_padding_psk_shuf": &utls.HelloChrome_114_Padding_PSK_Shuf,
|
||||
"hellochrome_115_pq": &utls.HelloChrome_115_PQ,
|
||||
"hellochrome_115_pq_psk": &utls.HelloChrome_115_PQ_PSK,
|
||||
"hellochrome_120_pq": &utls.HelloChrome_120_PQ,
|
||||
"hellochrome_131": &utls.HelloChrome_131,
|
||||
}
|
||||
|
Reference in New Issue
Block a user