Skip to content

Commit

Permalink
ver1.4.5.b
Browse files Browse the repository at this point in the history
  • Loading branch information
GNBDEV committed Dec 31, 2023
1 parent 25ff341 commit 0e81d29
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 26 deletions.
4 changes: 2 additions & 2 deletions Makefile.Darwin
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ ${GNB_ES}: ${GNB_ES_OBJS} ${CRYPTO_OBJS} ${MINIUPNP_OBJS} ${LIBNATPMP_OBJS}
strip ${GNB_ES}


${GNB_CRYPTO}: ${CRYPTO_OBJS} ./src/gnb_crypto.o
${CC} -o ${GNB_CRYPTO} ./src/gnb_crypto.o ${CRYPTO_OBJS} ${CLI_LDFLAGS}
${GNB_CRYPTO}: ${CRYPTO_OBJS} ./src/cli/gnb_crypto.o
${CC} -o ${GNB_CRYPTO} ./src/cli/gnb_crypto.o ${CRYPTO_OBJS} ${CLI_LDFLAGS}
strip ${GNB_CRYPTO}


Expand Down
4 changes: 2 additions & 2 deletions Makefile.freebsd
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ $(GNB_ES): $(GNB_ES_OBJS) ${CRYPTO_OBJS} ${MINIUPNP_OBJS} ${LIBNATPMP_OBJS}
${CC} -o ${GNB_ES} ${GNB_ES_OBJS} ${CRYPTO_OBJS} ${MINIUPNP_OBJS} ${LIBNATPMP_OBJS} ${GNB_ES_LDFLAGS}


$(GNB_CRYPTO): $(CRYPTO_OBJS) ./src/gnb_crypto.o
${CC} -o ${GNB_CRYPTO} ./src/gnb_crypto.o ${CRYPTO_OBJS} ${CLI_LDFLAGS}
$(GNB_CRYPTO): $(CRYPTO_OBJS) ./src/cli/gnb_crypto.o
${CC} -o ${GNB_CRYPTO} ./src/cli/gnb_crypto.o ${CRYPTO_OBJS} ${CLI_LDFLAGS}


$(GNB_CLI): $(GNB_OBJS) $(GNB_CLI_OBJS) $(GNB_PF_OBJS) ${CRYPTO_OBJS} ${ZLIB_OBJS}
Expand Down
4 changes: 2 additions & 2 deletions Makefile.linux
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ $(GNB_ES): $(GNB_ES_OBJS) ${CRYPTO_OBJS} ${MINIUPNP_OBJS} ${LIBNATPMP_OBJS}
${CC} -o ${GNB_ES} ${GNB_ES_OBJS} ${CRYPTO_OBJS} ${MINIUPNP_OBJS} ${LIBNATPMP_OBJS} ${GNB_ES_LDFLAGS}


$(GNB_CRYPTO): $(CRYPTO_OBJS) ./src/gnb_crypto.o
${CC} -o ${GNB_CRYPTO} ./src/gnb_crypto.o ${CRYPTO_OBJS} ${CLI_LDFLAGS}
$(GNB_CRYPTO): $(CRYPTO_OBJS) ./src/cli/gnb_crypto.o
${CC} -o ${GNB_CRYPTO} ./src/cli/gnb_crypto.o ${CRYPTO_OBJS} ${CLI_LDFLAGS}


$(GNB_CLI): $(GNB_OBJS) $(GNB_CLI_OBJS) $(GNB_PF_OBJS) ${CRYPTO_OBJS} ${ZLIB_OBJS}
Expand Down
4 changes: 2 additions & 2 deletions Makefile.mingw_x86_64
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ ${GNB_ES}: ${GNB_ES_OBJS} ${CRYPTO_OBJS} ${MINIUPNP_OBJS} ${LIBNATPMP_OBJS}
${CC} -o ${GNB_ES} ${GNB_ES_OBJS} ${CRYPTO_OBJS} ${MINIUPNP_OBJS} ${LIBNATPMP_OBJS} ./src/mingw/gnb_res.o ${GNB_ES_LDFLAGS}


$(GNB_CRYPTO): $(CRYPTO_OBJS) ./src/gnb_crypto.o
${CC} -o ${GNB_CRYPTO} ./src/gnb_crypto.o ${CRYPTO_OBJS} ${CLI_LDFLAGS}
$(GNB_CRYPTO): $(CRYPTO_OBJS) ./src/cli/gnb_crypto.o
${CC} -o ${GNB_CRYPTO} ./src/cli/gnb_crypto.o ${CRYPTO_OBJS} ${CLI_LDFLAGS}


${GNB_CLI}: ${GNB_OBJS} ${GNB_CLI_OBJS} ${GNB_PF_OBJS} ${CRYPTO_OBJS} ${ZLIB_OBJS}
Expand Down
4 changes: 2 additions & 2 deletions Makefile.openbsd
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ $(GNB_ES): $(GNB_ES_OBJS) ${CRYPTO_OBJS} ${MINIUPNP_OBJS} ${LIBNATPMP_OBJS}
${CC} -o ${GNB_ES} ${GNB_ES_OBJS} ${CRYPTO_OBJS} ${MINIUPNP_OBJS} ${LIBNATPMP_OBJS} ${GNB_ES_LDFLAGS}


$(GNB_CRYPTO): $(CRYPTO_OBJS) ./src/gnb_crypto.o
${CC} -o ${GNB_CRYPTO} ./src/gnb_crypto.o ${CRYPTO_OBJS} ${CLI_LDFLAGS}
$(GNB_CRYPTO): $(CRYPTO_OBJS) ./src/cli/gnb_crypto.o
${CC} -o ${GNB_CRYPTO} ./src/cli/gnb_crypto.o ${CRYPTO_OBJS} ${CLI_LDFLAGS}


$(GNB_CLI): $(GNB_OBJS) $(GNB_CLI_OBJS) $(GNB_PF_OBJS) ${CRYPTO_OBJS} ${ZLIB_OBJS}
Expand Down
4 changes: 2 additions & 2 deletions Makefile.openwrt
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ $(GNB_ES): $(GNB_ES_OBJS) ${CRYPTO_OBJS} ${MINIUPNP_OBJS} ${LIBNATPMP_OBJS}
${CC} -o ${GNB_ES} ${GNB_ES_OBJS} ${CRYPTO_OBJS} ${MINIUPNP_OBJS} ${LIBNATPMP_OBJS} ${GNB_ES_LDFLAGS}


$(GNB_CRYPTO): $(CRYPTO_OBJS) ./src/gnb_crypto.o
${CC} -o ${GNB_CRYPTO} ./src/gnb_crypto.o ${CRYPTO_OBJS} ${CLI_LDFLAGS}
$(GNB_CRYPTO): $(CRYPTO_OBJS) ./src/cli/gnb_crypto.o
${CC} -o ${GNB_CRYPTO} ./src/cli/gnb_crypto.o ${CRYPTO_OBJS} ${CLI_LDFLAGS}


$(GNB_CLI): $(GNB_OBJS) $(GNB_CLI_OBJS) $(GNB_PF_OBJS) ${CRYPTO_OBJS} ${ZLIB_OBJS}
Expand Down
1 change: 0 additions & 1 deletion src/cli/gnb.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#endif



#ifndef GNB_SKIP_BUILD_TIME
#define GNB_BUILD_STRING "Build Time ["__DATE__","__TIME__"]"
#else
Expand Down
20 changes: 13 additions & 7 deletions src/gnb_crypto.c → src/cli/gnb_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,17 @@
#include "crypto/random/gnb_random.h"
#include "ed25519/ed25519.h"


#ifndef GNB_SKIP_BUILD_TIME
#define GNB_BUILD_STRING "Build Time ["__DATE__","__TIME__"]"
#else
#define GNB_BUILD_STRING "Build Time [Hidden]"
#endif


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

printf("Build[%s %s]\n", __DATE__, __TIME__);
printf("%s\n", GNB_BUILD_STRING);

printf("usage: %s -c -p private_key_file -k public_key_file\n",argv[0]);
printf("example:\n");
Expand Down Expand Up @@ -68,13 +76,14 @@ static void create_keypair(uint32_t uuid32, const char *private_key_file, const
public_file_fd = open(public_key_file, O_WRONLY|O_CREAT,S_IRUSR|S_IWUSR);

if ( -1 == public_file_fd ) {
perror("create public key file");
exit(0);
}

wlen = write(public_file_fd,hex_string,64);

if ( -1 == wlen ) {
perror("write public_file");
perror("write public key file");
}

close(public_file_fd);
Expand All @@ -84,13 +93,14 @@ static void create_keypair(uint32_t uuid32, const char *private_key_file, const
private_file_fd = open(private_key_file, O_WRONLY|O_CREAT,S_IRUSR|S_IWUSR);

if ( -1 == private_file_fd ) {
perror("create private key file");
exit(0);
}

wlen = write(private_file_fd,hex_string,128);

if ( -1 == wlen ) {
perror("write private_file");
perror("write private key file");
}

close(private_file_fd);
Expand Down Expand Up @@ -159,7 +169,3 @@ int main (int argc,char *argv[]){
return 0;

}

/*
./gnb_crypto -c -p 1010.private -k 1010.public
*/
13 changes: 11 additions & 2 deletions src/cli/gnb_ctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,22 @@
#include "gnb_conf_type.h"
#include "gnb_ctl_block.h"


#ifndef GNB_SKIP_BUILD_TIME
#define GNB_BUILD_STRING "Build Time ["__DATE__","__TIME__"]"
#else
#define GNB_BUILD_STRING "Build Time [Hidden]"
#endif


void gnb_ctl_dump_status(gnb_ctl_block_t *ctl_block, uint32_t in_nodeid, uint8_t online_opt);
void gnb_ctl_dump_address_list(gnb_ctl_block_t *ctl_block, uint32_t in_nodeid);

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

printf("GNB Ctl version 1.4.5.a protocol version 1.2.6\n");
printf("Build[%s %s]\n", __DATE__, __TIME__);
printf("GNB Ctl version 1.4.5.b protocol version 1.4.5\n");

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

printf("Copyright (C) 2019 gnbdev\n");
printf("Usage: %s -b CTL_BLOCK [OPTION]\n", argv[0]);
Expand Down
12 changes: 10 additions & 2 deletions src/cli/gnb_es.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@
#include "gnb_core_frame_type_defs.h"
#include "es/gnb_es_type.h"


#ifndef GNB_SKIP_BUILD_TIME
#define GNB_BUILD_STRING "Build Time ["__DATE__","__TIME__"]"
#else
#define GNB_BUILD_STRING "Build Time [Hidden]"
#endif


gnb_es_ctx* gnb_es_ctx_create(int is_service, char *ctl_block_file,gnb_log_ctx_t *log);
void gnb_es_ctx_init(gnb_es_ctx *es_ctx);

Expand Down Expand Up @@ -67,9 +75,9 @@ void gnb_start_environment_service(gnb_es_ctx *es_ctx);

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

printf("GNB Environment Service version 1.3.0.b protocol version 1.1.3\n");
printf("GNB Environment Service version 1.4.5.b protocol version 1.4.5\n");

printf("Build[%s %s]\n", __DATE__, __TIME__);
printf("%s\n", GNB_BUILD_STRING);

printf("Copyright (C) 2019 gnbdev<[email protected]>\n");

Expand Down
2 changes: 1 addition & 1 deletion src/gnb.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ typedef struct _gnb_core_t{
#define GNB_LOG_ID_INDEX_SERVICE_WORKER 5
#define GNB_LOG_ID_DETECT_WORKER 6

#define GNB_VERSION_STRING "GNB version 1.4.5.a protocol version 1.4.5"
#define GNB_VERSION_STRING "GNB version 1.4.5.b protocol version 1.4.5"
#define GNB_COPYRIGHT_STRING "Copyright (C) 2019 gnbdev<[email protected]>"
#define GNB_URL_STRING "https://github.com/gnbdev/opengnb"

Expand Down
4 changes: 4 additions & 0 deletions src/gnb_node.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ gnb_node_t* gnb_select_forward_node(gnb_core_t *gnb_core){
return gnb_core->fwd_node_ring.nodes[0];
}

if ( gnb_core->conf->pf_worker_num > 0 ) {
return gnb_core->fwd_node_ring.nodes[0];
}

if ( GNB_MULTI_ADDRESS_TYPE_SIMPLE_FAULT_TOLERANT == gnb_core->conf->multi_forward_type ) {
goto SIMPLE_FAULT_TOLERANT;
}
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.5.a
1.4.5.b

0 comments on commit 0e81d29

Please sign in to comment.