Skip to content

Commit 4240921

Browse files
committed
1.6.0.a更新说明:
1、全新 packet filter 流水线,提升IP分组处理效率,修复加密模块和流量压缩模块冲突的问题. 2、新增与 index 节点通讯支持加密. 3、减少内存使用,可以在内存紧张的 OpenWRT 路上运行. 4、适配在macOS Sequoia 15.4 上编译,为此更新libs中的第三方代码zlib. 5、调整节点探测的频率,减少对网络带宽的占用. 6、修复在一些要求整型字节地址对齐CPU在下崩溃的问题. 7、支持全新 ur1 转发,默认启动是禁用
1 parent 06acbaa commit 4240921

File tree

116 files changed

+2124
-1366
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+2124
-1366
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,4 +320,8 @@ For details, please visit [https://aur.archlinux.org/packages/opengnb/](https://
320320
[gnb_udp_over_tcp](https://github.com/gnbdev/gnb_udp_over_tcp "gnb_udp_over_tcp") is a service developed for GNB that forwards UDP packets through tcp link, and can also forward data for other services based on UDP protocol.
321321

322322
---
323-
[Disclaimer](docs/disclaimer_cn.md)
323+
[Disclaimer](docs/disclaimer_cn.md)
324+
325+
Any organization or individual is free to use GNB's source code under the GPL V3 license, this also include any commercial projects. Commercial projects that utilize GNB's source code under closed-source conditions must obtain authorization from us.
326+
327+

README_CN.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,4 +320,6 @@ apt install opengnb
320320
[gnb_udp_over_tcp](https://github.com/gnbdev/gnb_udp_over_tcp "gnb_udp_over_tcp") 是一个为 GNB 开发的通过 tcp 链路中转 UDP 分组转发的服务,也可以为其他基于 UDP 协议的服务中转数据。
321321

322322
---
323-
[免责声明](docs/disclaimer_cn.md)
323+
[免责声明](docs/disclaimer_cn.md)
324+
325+
个人和商业可以免费自由使用gnb的源码,但是必须遵循gplv3许可,把使用的gnb源码的项目开源,如果想闭源,需要取得我们的商业授权

src/Darwin/gnb_drv_darwin.c

100644100755
File mode changed.

src/cli/gnb.c

100644100755
Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -156,24 +156,16 @@ static void self_test(){
156156

157157
GNB_LOG1(gnb_core->log, GNB_LOG_ID_CORE, "SELF-TEST zip_level=%d\n", gnb_core->conf->zip_level);
158158

159-
160-
switch (gnb_core->conf->pf_bits) {
161-
162-
case GNB_PF_BITS_CRYPTO_XOR:
163-
GNB_LOG1(gnb_core->log, GNB_LOG_ID_CORE, "SELF-TEST crypto xor\n");
164-
break;
165-
case GNB_PF_BITS_CRYPTO_ARC4:
166-
GNB_LOG1(gnb_core->log, GNB_LOG_ID_CORE, "SELF-TEST crypto arc4\n");
167-
break;
168-
169-
case GNB_PF_BITS_NONE:
159+
if ( GNB_PF_BITS_NONE == gnb_core->conf->pf_bits ) {
170160
GNB_LOG1(gnb_core->log, GNB_LOG_ID_CORE, "SELF-TEST crypto none\n");
171-
break;
161+
}
172162

173-
default:
174-
GNB_LOG1(gnb_core->log, GNB_LOG_ID_CORE, "SELF-TEST crypto config error\n");
175-
break;
163+
if ( gnb_core->conf->pf_bits & GNB_PF_BITS_CRYPTO_XOR ) {
164+
GNB_LOG1(gnb_core->log, GNB_LOG_ID_CORE, "SELF-TEST crypto xor\n");
165+
}
176166

167+
if ( gnb_core->conf->pf_bits & GNB_PF_BITS_CRYPTO_ARC4 ) {
168+
GNB_LOG1(gnb_core->log, GNB_LOG_ID_CORE, "SELF-TEST crypto arc4\n");
177169
}
178170

179171
switch (gnb_core->conf->unified_forwarding) {
@@ -201,9 +193,11 @@ static void self_test(){
201193

202194
}
203195

204-
205196
GNB_LOG1(gnb_core->log, GNB_LOG_ID_CORE, "SELF-TEST activate tun=%d\n", gnb_core->conf->activate_tun);
206197

198+
GNB_LOG1(gnb_core->log, GNB_LOG_ID_CORE, "SELF-TEST universal relay0 ur0=%d\n", gnb_core->conf->universal_relay0);
199+
GNB_LOG1(gnb_core->log, GNB_LOG_ID_CORE, "SELF-TEST universal relay1 ur1=%d\n", gnb_core->conf->universal_relay1);
200+
207201
GNB_LOG1(gnb_core->log, GNB_LOG_ID_CORE, "SELF-TEST console_log_level=%d\n", gnb_core->conf->console_log_level);
208202
GNB_LOG1(gnb_core->log, GNB_LOG_ID_CORE, "SELF-TEST file_log_level=%d\n", gnb_core->conf->file_log_level);
209203
GNB_LOG1(gnb_core->log, GNB_LOG_ID_CORE, "SELF-TEST udp_log_level=%d\n", gnb_core->conf->udp_log_level);

src/cli/gnb_crypto.c

100644100755
File mode changed.

src/cli/gnb_ctl.c

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void gnb_ctl_dump_address_list(gnb_ctl_block_t *ctl_block, gnb_uuid_t in_nodeid,
4444

4545
static void show_useage(int argc,char *argv[]){
4646

47-
printf("GNB Ctl version 1.5.0.a protocol version 1.5.0\n");
47+
printf("GNB Ctl version 1.6.0.a protocol version 1.6.0\n");
4848

4949
printf("%s\n", GNB_BUILD_STRING);
5050

src/cli/gnb_es.c

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void gnb_start_environment_service(gnb_es_ctx *es_ctx);
7575

7676
static void show_useage(int argc,char *argv[]){
7777

78-
printf("GNB Environment Service version 1.5.0.a protocol version 1.5.0\n");
78+
printf("GNB Environment Service version 1.6.0.a protocol version 1.6.0\n");
7979

8080
printf("%s\n", GNB_BUILD_STRING);
8181

src/crypto/random/gnb_random.c

100644100755
File mode changed.

src/crypto/random/gnb_random.h

100644100755
File mode changed.

src/crypto/xor/xor.c

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
Copyright (C) gnbdev
3+
4+
This program is free software; you can redistribute it and/or modify
5+
it under the terms of the GNU General Public License as published by
6+
the Free Software Foundation; either version 3 of the License, or
7+
(at your option) any later version.
8+
9+
This program is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
GNU General Public License for more details.
13+
14+
You should have received a copy of the GNU General Public License
15+
along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
void xor_crypto(unsigned char *crypto_key, unsigned char *data, unsigned int len) {
19+
20+
int i;
21+
int j = 0;
22+
23+
for ( i=0; i<len; i++ ) {
24+
25+
*data = *data ^ crypto_key[j];
26+
27+
data++;
28+
29+
j++;
30+
31+
if ( j >= 64 ) {
32+
j = 0;
33+
}
34+
35+
}
36+
37+
}
38+
39+
40+
void xor_crypto_copy(unsigned char *crypto_key, unsigned char *dest, unsigned char *src, unsigned int len) {
41+
42+
int i;
43+
int j = 0;
44+
45+
for ( i=0; i<len; i++ ) {
46+
47+
*dest = *src ^ crypto_key[j];
48+
49+
src++;
50+
dest++;
51+
52+
j++;
53+
54+
if ( j >= 64 ) {
55+
j = 0;
56+
}
57+
58+
}
59+
60+
}

src/crypto/xor/xor.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
Copyright (C) gnbdev
3+
4+
This program is free software; you can redistribute it and/or modify
5+
it under the terms of the GNU General Public License as published by
6+
the Free Software Foundation; either version 3 of the License, or
7+
(at your option) any later version.
8+
9+
This program is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
GNU General Public License for more details.
13+
14+
You should have received a copy of the GNU General Public License
15+
along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
#ifndef XOR_H
19+
#define XOR_H
20+
21+
void xor_crypto(unsigned char *crypto_key, unsigned char *data, unsigned int len);
22+
void xor_crypto_copy(unsigned char *crypto_key, unsigned char *dest, unsigned char *src, unsigned int len);
23+
24+
#endif

src/ctl/gnb_ctl_dump.c

100644100755
File mode changed.

src/es/gnb_discover_in_lan.c

100644100755
File mode changed.

src/es/gnb_environment_service.c

100644100755
File mode changed.

src/es/gnb_es_broadcast_address.c

100644100755
File mode changed.

src/es/gnb_es_dump.c

100644100755
File mode changed.

src/es/gnb_es_platform.c

100644100755
File mode changed.

src/es/gnb_es_resolv.c

100644100755
File mode changed.

src/es/gnb_es_type.h

100644100755
File mode changed.

src/es/gnb_es_upnp.c

100644100755
File mode changed.

src/freebsd/gnb_drv_freebsd.c

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ static int open_tun_freebsd(gnb_core_t *gnb_core){
361361
static int read_tun_freebsd(gnb_core_t *gnb_core, void *buf, size_t buf_size){
362362

363363
ssize_t rlen;
364-
rlen = read(gnb_core->tun_fd, buf, GNB_MAX_PAYLOAD_SIZE);
364+
rlen = read(gnb_core->tun_fd, buf, buf_size);
365365
return rlen;
366366

367367
}

src/gnb.h

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ typedef struct _gnb_core_t{
171171
#define GNB_LOG_ID_INDEX_SERVICE_WORKER 5
172172
#define GNB_LOG_ID_DETECT_WORKER 6
173173

174-
#define GNB_VERSION_STRING "GNB version Dev 1.5.0.c protocol version 1.5.0"
174+
#define GNB_VERSION_STRING "GNB version Dev 1.6.0.a protocol version 1.6.0"
175175
#define GNB_COPYRIGHT_STRING "Copyright (C) 2019 gnbdev<gnbdev@qq.com>"
176176
#define GNB_URL_STRING "https://github.com/gnbdev/opengnb"
177177

src/gnb_address.c

100644100755
File mode changed.

src/gnb_address.h

100644100755
File mode changed.

src/gnb_address_type.h

100644100755
File mode changed.

src/gnb_alloc.c

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
*/
1717

18-
#include "stdlib.h"
19-
#include "string.h"
18+
#include <stdlib.h>
19+
#include <string.h>
2020

2121
#include "gnb_alloc.h"
2222

src/gnb_alloc.h

100644100755
File mode changed.

src/gnb_arg_list.c

100644100755
File mode changed.

src/gnb_arg_list.h

100644100755
File mode changed.

0 commit comments

Comments
 (0)