Skip to content

Commit cab087d

Browse files
O-O111caleb2h
authored andcommitted
gnb node id changed from 32bit to 64bit. Incompatible with previous versions
1 parent 2878d48 commit cab087d

37 files changed

+466
-304
lines changed

src/cli/gnb.c

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,26 @@ extern gnb_arg_list_t *gnb_es_arg_list;
5656

5757
extern int is_self_test;
5858

59+
void signal_alrm_handler(int signum){
60+
return;
61+
}
62+
5963
void signal_handler(int signum){
6064

65+
6166
if ( SIGTERM == signum ) {
62-
unlink(gnb_core->conf->pid_file);
63-
exit(0);
67+
goto finish;
6468
}
6569

70+
if ( SIGINT == signum ) {
71+
goto finish;
72+
}
73+
74+
finish:
75+
gnb_core_stop(gnb_core);
76+
unlink(gnb_core->conf->pid_file);
77+
exit(0);
78+
6679
}
6780

6881
static void self_test(){
@@ -84,7 +97,7 @@ static void self_test(){
8497
GNB_LOG1(gnb_core->log, GNB_LOG_ID_CORE, "SELF-TEST systemd_daemon='%d'\n", gnb_core->conf->systemd_daemon );
8598

8699
if ( 1 == gnb_core->conf->activate_tun && 0 == gnb_core->conf->public_index_service ) {
87-
GNB_LOG1(gnb_core->log, GNB_LOG_ID_CORE, "SELF-TEST local node=%"PRIu64"\n", gnb_core->local_node->uuid64);
100+
GNB_LOG1(gnb_core->log, GNB_LOG_ID_CORE, "SELF-TEST local node=%lu\n", gnb_core->local_node->uuid64);
88101
GNB_LOG1(gnb_core->log, GNB_LOG_ID_CORE, "SELF-TEST tun ipv4[%s]\n", GNB_ADDR4STR_PLAINTEXT1(&gnb_core->local_node->tun_addr4));
89102
}
90103

@@ -229,9 +242,9 @@ static void self_test(){
229242
node = &ctl_block->node_zone->node[i];
230243

231244
if ( node->uuid64 != ctl_block->core_zone->local_uuid ) {
232-
GNB_LOG1(gnb_core->log, GNB_LOG_ID_CORE, "SELF-TEST ----- remote node %"PRIu64" -----\n", node->uuid64);
245+
GNB_LOG1(gnb_core->log, GNB_LOG_ID_CORE, "SELF-TEST ----- remote node %u -----\n", node->uuid64);
233246
} else {
234-
GNB_LOG1(gnb_core->log, GNB_LOG_ID_CORE, "SELF-TEST local node %"PRIu64"\n", node->uuid64);
247+
GNB_LOG1(gnb_core->log, GNB_LOG_ID_CORE, "SELF-TEST local node %u\n", node->uuid64);
235248
}
236249

237250
GNB_LOG1(gnb_core->log, GNB_LOG_ID_CORE, "SELF-TEST tun_ipv6 %s\n", GNB_ADDR6STR_PLAINTEXT1(&node->tun_ipv6_addr));
@@ -262,7 +275,7 @@ static void self_test(){
262275
GNB_LOG1(gnb_core->log, GNB_LOG_ID_CORE,"SELF-TEST num of fwd node=%d\n", gnb_core->fwd_node_ring.num);
263276

264277
for ( i=0; i<gnb_core->fwd_node_ring.num; i++ ) {
265-
GNB_LOG1(gnb_core->log, GNB_LOG_ID_CORE, "SELF-TEST fwd node=%"PRIu64"\n", gnb_core->fwd_node_ring.nodes[i]->uuid64);
278+
GNB_LOG1(gnb_core->log, GNB_LOG_ID_CORE, "SELF-TEST fwd node=%llu\n", gnb_core->fwd_node_ring.nodes[i]->uuid64);
266279
}
267280

268281
for ( i=0; i<gnb_es_arg_list->argc; i++ ) {
@@ -381,8 +394,10 @@ int main (int argc,char *argv[]){
381394

382395
#ifdef __UNIX_LIKE_OS__
383396
signal(SIGPIPE, SIG_IGN);
384-
signal(SIGALRM, signal_handler);
397+
signal(SIGALRM, signal_alrm_handler);
398+
385399
signal(SIGTERM, signal_handler);
400+
signal(SIGINT, signal_handler);
386401

387402
if ( gnb_core->conf->daemon ) {
388403
gnb_daemon();

src/cli/gnb_crypto.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static void show_useage(int argc,char *argv[]){
5151

5252
}
5353

54-
static void create_keypair(uint64_t uuid64, const char *private_key_file, const char *public_key_file){
54+
static void create_keypair(gnb_uuid_t uuid64, const char *private_key_file, const char *public_key_file){
5555

5656
int private_file_fd;
5757
int public_file_fd;
@@ -119,7 +119,7 @@ int main (int argc,char *argv[]){
119119

120120
int opt;
121121

122-
uint64_t uuid64 = 0;
122+
gnb_uuid_t uuid64 = 0;
123123

124124
char *public_key_file = NULL;
125125
char *private_key_file = NULL;

src/cli/gnb_ctl.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@
3939
#endif
4040

4141

42-
void gnb_ctl_dump_status(gnb_ctl_block_t *ctl_block, uint64_t in_nodeid, uint8_t online_opt);
43-
void gnb_ctl_dump_address_list(gnb_ctl_block_t *ctl_block, uint64_t in_nodeid);
42+
void gnb_ctl_dump_status(gnb_ctl_block_t *ctl_block, gnb_uuid_t in_nodeid, uint8_t online_opt);
43+
void gnb_ctl_dump_address_list(gnb_ctl_block_t *ctl_block, gnb_uuid_t in_nodeid, uint8_t online_opt);
4444

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

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

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

@@ -76,7 +76,7 @@ int main (int argc,char *argv[]){
7676
uint8_t core_opt = 0;
7777
uint8_t node_status_opt = 0;
7878
uint8_t online_opt = 0;
79-
uint64_t nodeid = 0;
79+
gnb_uuid_t nodeid = 0;
8080

8181
static struct option long_options[] = {
8282

@@ -112,7 +112,7 @@ int main (int argc,char *argv[]){
112112
break;
113113

114114
case 'n':
115-
nodeid = (uint64_t)strtoull(optarg, NULL, 10);
115+
nodeid = (gnb_uuid_t)strtoull(optarg, NULL, 10);
116116
break;
117117

118118
case 'c':
@@ -167,7 +167,7 @@ int main (int argc,char *argv[]){
167167
}
168168

169169
if ( address_opt ) {
170-
gnb_ctl_dump_address_list(ctl_block, nodeid);
170+
gnb_ctl_dump_address_list(ctl_block, nodeid, online_opt);
171171
}
172172

173173

src/cli/gnb_es.c

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.4.5.c protocol version 1.4.5\n");
78+
printf("GNB Environment Service version 1.5.0.a protocol version 1.5.0\n");
7979

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

src/ctl/gnb_ctl_dump.c

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#endif
3838

3939

40-
void gnb_ctl_dump_status(gnb_ctl_block_t *ctl_block, uint64_t in_nodeid, uint8_t online_opt){
40+
void gnb_ctl_dump_status(gnb_ctl_block_t *ctl_block, gnb_uuid_t in_nodeid, uint8_t online_opt){
4141

4242
#define LINE_SIZE 1024
4343
char line_string[LINE_SIZE];
@@ -110,7 +110,7 @@ void gnb_ctl_dump_status(gnb_ctl_block_t *ctl_block, uint64_t in_nodeid, uint8_t
110110

111111
printf("\n====================\n");
112112

113-
printf("node %"PRIu64"\n",node->uuid64);
113+
printf("node %llu\n",node->uuid64);
114114
printf("addr4_ping_latency_usec %"PRIu64"\n",node->addr4_ping_latency_usec);
115115
printf("tun_ipv4 %s\n",GNB_ADDR4STR1(&node->tun_addr4));
116116
printf("tun_ipv6 %s\n",GNB_ADDR6STR1(&node->tun_ipv6_addr));
@@ -171,7 +171,7 @@ void gnb_ctl_dump_status(gnb_ctl_block_t *ctl_block, uint64_t in_nodeid, uint8_t
171171
printf("addr6_ping_latency_usec:%"PRIu64"\n", node->addr6_ping_latency_usec);
172172
printf("addr4_ping_latency_usec:%"PRIu64"\n", node->addr4_ping_latency_usec);
173173

174-
printf("detect_count %d\n", node->detect_count);
174+
printf("detect_count %u\n", node->detect_count);
175175

176176
printf("wan_ipv4 %s\n", GNB_SOCKADDR4STR1(&node->udp_sockaddr4));
177177
printf("wan_ipv6 %s\n", GNB_SOCKADDR6STR1(&node->udp_sockaddr6));
@@ -243,7 +243,7 @@ void gnb_ctl_dump_status(gnb_ctl_block_t *ctl_block, uint64_t in_nodeid, uint8_t
243243

244244
for ( j=0; j<GNB_UNIFIED_FORWARDING_NODE_ARRAY_SIZE; j++ ) {
245245

246-
wlen = snprintf(p, line_string_len-wlen, "%"PRIu64",", node->unified_forwarding_node_array[j].uuid64);
246+
wlen = snprintf(p, line_string_len-wlen, "%llu,", node->unified_forwarding_node_array[j].uuid64);
247247

248248
line_string_len -= wlen;
249249

@@ -280,7 +280,7 @@ void gnb_ctl_dump_status(gnb_ctl_block_t *ctl_block, uint64_t in_nodeid, uint8_t
280280
}
281281

282282

283-
void gnb_ctl_dump_address_list(gnb_ctl_block_t *ctl_block, uint64_t in_nodeid, uint8_t online_opt) {
283+
void gnb_ctl_dump_address_list(gnb_ctl_block_t *ctl_block, gnb_uuid_t in_nodeid, uint8_t online_opt) {
284284

285285
gnb_address_t *gnb_address;
286286

@@ -307,34 +307,32 @@ void gnb_ctl_dump_address_list(gnb_ctl_block_t *ctl_block, uint64_t in_nodeid, u
307307
goto dump_all_node_address;
308308
}
309309

310-
if ( 0 != in_nodeid && in_nodeid != node->uuid64 ) {
310+
if ( 0 != in_nodeid && in_nodeid != node->uuid64 ) {
311311
continue;
312312
}
313313

314314
dump_all_node_address:
315315

316316
if ( node->uuid64 == ctl_block->core_zone->local_uuid ) {
317-
printf( "l|%"PRIu64"|%s\n", node->uuid64, GNB_SOCKADDR6STR1(&node->udp_sockaddr6) );
318-
printf( "l|%"PRIu64"|%s\n", node->uuid64, GNB_SOCKADDR4STR1(&node->udp_sockaddr4) );
317+
printf( "l|%llu|%s\n", node->uuid64, GNB_SOCKADDR6STR1(&node->udp_sockaddr6) );
318+
printf( "l|%llu|%s\n", node->uuid64, GNB_SOCKADDR4STR1(&node->udp_sockaddr4) );
319319
continue;
320320
}
321321

322322
if ( 0 != online_opt && !((GNB_NODE_STATUS_IPV6_PONG | GNB_NODE_STATUS_IPV4_PONG) & node->udp_addr_status) ) {
323323
continue;
324324
}
325325

326-
if ( 0 != online_opt ) {
327-
328-
if ( GNB_NODE_STATUS_IPV6_PONG & node->udp_addr_status ) {
329-
printf( "w|%"PRIu64"|%s\n", node->uuid64, GNB_SOCKADDR6STR1(&node->udp_sockaddr6) );
330-
}
326+
if ( GNB_NODE_STATUS_IPV6_PONG & node->udp_addr_status ) {
327+
printf( "w|%llu|%s\n", node->uuid64, GNB_SOCKADDR6STR1(&node->udp_sockaddr6) );
328+
}
331329

332-
if ( GNB_NODE_STATUS_IPV4_PONG & node->udp_addr_status ) {
333-
printf( "w|%"PRIu64"|%s\n", node->uuid64, GNB_SOCKADDR4STR1(&node->udp_sockaddr4) );
334-
}
330+
if ( GNB_NODE_STATUS_IPV4_PONG & node->udp_addr_status ) {
331+
printf( "w|%llu|%s\n", node->uuid64, GNB_SOCKADDR4STR1(&node->udp_sockaddr4) );
332+
}
335333

334+
if ( 0 != online_opt ) {
336335
continue;
337-
338336
}
339337

340338
available_address6_list = (gnb_address_list_t *)&node->available_address6_list3_block;
@@ -353,9 +351,9 @@ void gnb_ctl_dump_address_list(gnb_ctl_block_t *ctl_block, uint64_t in_nodeid, u
353351
}
354352

355353
if ( AF_INET6 == gnb_address->type ) {
356-
printf( "a|%"PRIu64"|%s|%d\n", node->uuid64, GNB_ADDR6STR1(&gnb_address->address.addr6), ntohs(gnb_address->port) );
354+
printf( "a|%llu|%s|%d\n", node->uuid64, GNB_ADDR6STR1(&gnb_address->address.addr6), ntohs(gnb_address->port) );
357355
} else if ( AF_INET == gnb_address->type ) {
358-
printf( "p|%"PRIu64"|%s|%d\n", node->uuid64, GNB_ADDR4STR1(&gnb_address->address.addr4), ntohs(gnb_address->port) );
356+
printf( "p|%llu|%s|%d\n", node->uuid64, GNB_ADDR4STR1(&gnb_address->address.addr4), ntohs(gnb_address->port) );
359357
} else {
360358
continue;
361359
}
@@ -371,9 +369,9 @@ void gnb_ctl_dump_address_list(gnb_ctl_block_t *ctl_block, uint64_t in_nodeid, u
371369
}
372370

373371
if ( AF_INET6 == gnb_address->type ) {
374-
printf( "a|%"PRIu64"|%s|%d\n", node->uuid64, GNB_ADDR6STR1(&gnb_address->address.addr6), ntohs(gnb_address->port) );
372+
printf( "a|%llu|%s|%d\n", node->uuid64, GNB_ADDR6STR1(&gnb_address->address.addr6), ntohs(gnb_address->port) );
375373
} else if ( AF_INET == gnb_address->type ) {
376-
printf( "p|%"PRIu64"|%s|%d\n", node->uuid64, GNB_ADDR4STR1(&gnb_address->address.addr4), ntohs(gnb_address->port) );
374+
printf( "p|%llu|%s|%d\n", node->uuid64, GNB_ADDR4STR1(&gnb_address->address.addr4), ntohs(gnb_address->port) );
377375
} else {
378376
continue;
379377
}
@@ -389,9 +387,9 @@ void gnb_ctl_dump_address_list(gnb_ctl_block_t *ctl_block, uint64_t in_nodeid, u
389387
}
390388

391389
if ( AF_INET6 == gnb_address->type ) {
392-
printf( "s|%"PRIu64"|%s|%d\n", node->uuid64, GNB_ADDR6STR1(&gnb_address->address.addr6), ntohs(gnb_address->port) );
390+
printf( "s|%llu|%s|%d\n", node->uuid64, GNB_ADDR6STR1(&gnb_address->address.addr6), ntohs(gnb_address->port) );
393391
} else if ( AF_INET == gnb_address->type ) {
394-
printf( "s|%"PRIu64"|%s|%d\n", node->uuid64, GNB_ADDR4STR1(&gnb_address->address.addr4), ntohs(gnb_address->port) );
392+
printf( "s|%llu|%s|%d\n", node->uuid64, GNB_ADDR4STR1(&gnb_address->address.addr4), ntohs(gnb_address->port) );
395393
} else {
396394
continue;
397395
}
@@ -407,9 +405,9 @@ void gnb_ctl_dump_address_list(gnb_ctl_block_t *ctl_block, uint64_t in_nodeid, u
407405
}
408406

409407
if ( AF_INET6 == gnb_address->type ) {
410-
printf( "d|%"PRIu64"|%s|%d\n", node->uuid64, GNB_ADDR6STR1(&gnb_address->address.addr6), ntohs(gnb_address->port) );
408+
printf( "d|%llu|%s|%d\n", node->uuid64, GNB_ADDR6STR1(&gnb_address->address.addr6), ntohs(gnb_address->port) );
411409
} else if ( AF_INET == gnb_address->type ) {
412-
printf( "d|%"PRIu64"|%s|%d\n", node->uuid64, GNB_ADDR4STR1(&gnb_address->address.addr4), ntohs(gnb_address->port) );
410+
printf( "d|%llu|%s|%d\n", node->uuid64, GNB_ADDR4STR1(&gnb_address->address.addr4), ntohs(gnb_address->port) );
413411
} else {
414412
continue;
415413
}
@@ -425,9 +423,9 @@ void gnb_ctl_dump_address_list(gnb_ctl_block_t *ctl_block, uint64_t in_nodeid, u
425423
}
426424

427425
if ( AF_INET6 == gnb_address->type ) {
428-
printf( "r|%"PRIu64"|%s|%d\n", node->uuid64, GNB_ADDR6STR1(&gnb_address->address.addr6), ntohs(gnb_address->port) );
426+
printf( "r|%llu|%s|%d\n", node->uuid64, GNB_ADDR6STR1(&gnb_address->address.addr6), ntohs(gnb_address->port) );
429427
} else if ( AF_INET == gnb_address->type ) {
430-
printf( "r|%"PRIu64"|%s|%d\n", node->uuid64, GNB_ADDR4STR1(&gnb_address->address.addr4), ntohs(gnb_address->port) );
428+
printf( "r|%llu|%s|%d\n", node->uuid64, GNB_ADDR4STR1(&gnb_address->address.addr4), ntohs(gnb_address->port) );
431429
} else {
432430
continue;
433431
}
@@ -443,9 +441,9 @@ void gnb_ctl_dump_address_list(gnb_ctl_block_t *ctl_block, uint64_t in_nodeid, u
443441
}
444442

445443
if ( AF_INET6 == gnb_address->type ) {
446-
printf( "p|%"PRIu64"|%s|%d\n", node->uuid64, GNB_ADDR6STR1(&gnb_address->address.addr6), ntohs(gnb_address->port) );
444+
printf( "p|%llu|%s|%d\n", node->uuid64, GNB_ADDR6STR1(&gnb_address->address.addr6), ntohs(gnb_address->port) );
447445
} else if ( AF_INET == gnb_address->type ) {
448-
printf( "p|%"PRIu64"|%s|%d\n", node->uuid64, GNB_ADDR4STR1(&gnb_address->address.addr4), ntohs(gnb_address->port) );
446+
printf( "p|%llu|%s|%d\n", node->uuid64, GNB_ADDR4STR1(&gnb_address->address.addr4), ntohs(gnb_address->port) );
449447
} else {
450448
continue;
451449
}

src/es/gnb_discover_in_lan.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ static void send_broadcast4(gnb_es_ctx *es_ctx, struct sockaddr_in *src_address_
7474
local_node = (gnb_node_t *)GNB_HASH32_UINT64_GET_PTR(es_ctx->uuid_node_map, es_ctx->ctl_block->core_zone->local_uuid);
7575

7676
if ( NULL == local_node ) {
77-
GNB_LOG1(es_ctx->log, GNB_LOG_ID_ES_DISCOVER_IN_LAN, "send broadcast4 error local node=%"PRIu64"\n", es_ctx->ctl_block->core_zone->local_uuid);
77+
GNB_LOG1(es_ctx->log, GNB_LOG_ID_ES_DISCOVER_IN_LAN, "send broadcast4 error local node=%llu\n", es_ctx->ctl_block->core_zone->local_uuid);
7878
return;
7979
}
8080
#endif
@@ -107,7 +107,7 @@ static void send_broadcast4(gnb_es_ctx *es_ctx, struct sockaddr_in *src_address_
107107
broadcast_address_st.sin_addr.s_addr = INADDR_BROADCAST;
108108
}
109109

110-
snprintf(discover_lan_in_frame->data.text, 256, "GNB LAN DISCOVER node=%"PRIu64" address=%s,port=%d,broadcast_address=%s",
110+
snprintf(discover_lan_in_frame->data.text, 256, "GNB LAN DISCOVER node=%llu address=%s,port=%d,broadcast_address=%s",
111111
local_node->uuid64,
112112
gnb_get_address4string(&src_address_in->sin_addr.s_addr, gnb_static_ip_port_string_buffer1, 0),
113113
es_ctx->ctl_block->conf_zone->conf_st.udp4_ports[0],
@@ -138,7 +138,7 @@ static void send_broadcast4(gnb_es_ctx *es_ctx, struct sockaddr_in *src_address_
138138

139139
static void handle_discover_lan_in_frame(gnb_es_ctx *es_ctx, gnb_payload16_t *in_payload, gnb_sockaddress_t *node_addr){
140140

141-
uint64_t in_src_uuid64;
141+
gnb_uuid_t in_src_uuid64;
142142
gnb_node_t *local_node;
143143
gnb_node_t *dst_node;
144144

@@ -160,25 +160,25 @@ static void handle_discover_lan_in_frame(gnb_es_ctx *es_ctx, gnb_payload16_t *in
160160
local_node = (gnb_node_t *)GNB_HASH32_UINT64_GET_PTR(es_ctx->uuid_node_map, es_ctx->ctl_block->core_zone->local_uuid);
161161

162162
if ( NULL == local_node ) {
163-
GNB_LOG1(es_ctx->log, GNB_LOG_ID_ES_DISCOVER_IN_LAN, "handle_discover_lan_in_frame error local_uuid=%"PRIu64"\n", es_ctx->ctl_block->core_zone->local_uuid);
163+
GNB_LOG1(es_ctx->log, GNB_LOG_ID_ES_DISCOVER_IN_LAN, "handle_discover_lan_in_frame error local_uuid=%llu\n", es_ctx->ctl_block->core_zone->local_uuid);
164164
return;
165165
}
166166

167167
discover_lan_in_frame = (discover_lan_in_frame_t *)in_payload->data;
168168

169169
in_src_uuid64 = gnb_ntohll(discover_lan_in_frame->data.src_uuid64);
170170

171-
GNB_LOG1(es_ctx->log, GNB_LOG_ID_ES_DISCOVER_IN_LAN, "handle_discover_lan_in_frame src_node[%"PRIu64"]\n", in_src_uuid64);
171+
GNB_LOG1(es_ctx->log, GNB_LOG_ID_ES_DISCOVER_IN_LAN, "handle_discover_lan_in_frame src_node[%llu]\n", in_src_uuid64);
172172

173173
if ( in_src_uuid64 == local_node->uuid64 ) {
174-
GNB_LOG1(es_ctx->log, GNB_LOG_ID_ES_DISCOVER_IN_LAN, "handle_discover_lan_in_frame error in_src_uuid64=%"PRIu64" local_node->uuid64=%"PRIu64"\n", in_src_uuid64, local_node->uuid64);
174+
GNB_LOG1(es_ctx->log, GNB_LOG_ID_ES_DISCOVER_IN_LAN, "handle_discover_lan_in_frame error in_src_uuid64=%llu local_node->uuid64=%llu\n", in_src_uuid64, local_node->uuid64);
175175
return;
176176
}
177177

178178
dst_node = (gnb_node_t *)GNB_HASH32_UINT64_GET_PTR(es_ctx->uuid_node_map, in_src_uuid64);
179179

180180
if ( NULL == dst_node ) {
181-
GNB_LOG1(es_ctx->log, GNB_LOG_ID_ES_DISCOVER_IN_LAN, "handle_discover_lan_in_frame error dst node[%"PRIu64"] not found!\n", in_src_uuid64);
181+
GNB_LOG1(es_ctx->log, GNB_LOG_ID_ES_DISCOVER_IN_LAN, "handle_discover_lan_in_frame error dst node[%llu] not found!\n", in_src_uuid64);
182182
return;
183183
}
184184

@@ -198,7 +198,7 @@ static void handle_discover_lan_in_frame(gnb_es_ctx *es_ctx, gnb_payload16_t *in
198198
src_port4 = htons(es_ctx->ctl_block->conf_zone->conf_st.udp4_ports[0]);
199199
memcpy(node_ping_frame->data.attachment, &src_port4, sizeof(uint16_t));
200200

201-
snprintf((char *)node_ping_frame->data.text, 32, "(LAN)%"PRIu64" --PING-> %"PRIu64"", local_node->uuid64, dst_node->uuid64);
201+
snprintf((char *)node_ping_frame->data.text, 32, "(LAN)%llu --PING-> %llu", local_node->uuid64, dst_node->uuid64);
202202

203203
if ( 0 == es_ctx->ctl_block->conf_zone->conf_st.lite_mode ) {
204204
ed25519_sign(node_ping_frame->src_sign, (const unsigned char *)&node_ping_frame->data, sizeof(struct ping_frame_data), es_ctx->ctl_block->core_zone->ed25519_public_key, es_ctx->ctl_block->core_zone->ed25519_private_key);

src/es/gnb_environment_service.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ gnb_es_ctx* gnb_es_ctx_create(int is_service, char *ctl_block_file, gnb_log_ctx_
151151
es_ctx->local_node = (gnb_node_t *)GNB_HASH32_UINT64_GET_PTR(es_ctx->uuid_node_map, es_ctx->ctl_block->core_zone->local_uuid);
152152

153153
if ( NULL == es_ctx->local_node ) {
154-
GNB_LOG1(log, GNB_LOG_ID_ES_CORE, "gnb_es_ctx_create local node=%"PRIu64"\n", es_ctx->ctl_block->core_zone->local_uuid);
154+
GNB_LOG1(log, GNB_LOG_ID_ES_CORE, "gnb_es_ctx_create local node=%llu\n", es_ctx->ctl_block->core_zone->local_uuid);
155155
return NULL;
156156
}
157157

src/es/gnb_es_broadcast_address.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static void send_address_to_node(gnb_es_ctx *es_ctx, gnb_node_t *src_node, gnb_n
7676
memcpy(&push_addr_frame->data.addr4_a, &src_node->udp_sockaddr4.sin_addr.s_addr, 4);
7777
push_addr_frame->data.port4_a = src_node->udp_sockaddr4.sin_port;
7878

79-
snprintf(push_addr_frame->data.text,32,"%"PRIu64">%"PRIu64">%"PRIu64"", ctl_block->core_zone->local_uuid, src_node->uuid64, dst_node->uuid64);
79+
snprintf(push_addr_frame->data.text,32,"%llu>%llu>%llu", ctl_block->core_zone->local_uuid, src_node->uuid64, dst_node->uuid64);
8080

8181
struct sockaddr_in udp_sockaddr4;
8282
memset(&udp_sockaddr4, 0, sizeof(struct sockaddr_in));
@@ -132,7 +132,7 @@ static void broadcast_address_to_node(gnb_es_ctx *es_ctx, gnb_node_t *src_node){
132132
continue;
133133
}
134134

135-
GNB_LOG1(log, GNB_LOG_ID_ES_BROADCAST, "broadcast_address_to_node [%"PRIu64"] ==> [%"PRIu64"]\n", src_node->uuid64, dst_node->uuid64);
135+
GNB_LOG1(log, GNB_LOG_ID_ES_BROADCAST, "broadcast_address_to_node [%llu] ==> [%llu]\n", src_node->uuid64, dst_node->uuid64);
136136

137137
send_address_to_node(es_ctx, src_node, dst_node);
138138

0 commit comments

Comments
 (0)