Skip to content

Commit 2878d48

Browse files
author
caleb2h
committed
Implement 64-bit node uuid
1 parent 1612639 commit 2878d48

38 files changed

+475
-475
lines changed

src/cli/gnb.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static void self_test(){
8484
GNB_LOG1(gnb_core->log, GNB_LOG_ID_CORE, "SELF-TEST systemd_daemon='%d'\n", gnb_core->conf->systemd_daemon );
8585

8686
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=%lu\n", gnb_core->local_node->uuid32);
87+
GNB_LOG1(gnb_core->log, GNB_LOG_ID_CORE, "SELF-TEST local node=%"PRIu64"\n", gnb_core->local_node->uuid64);
8888
GNB_LOG1(gnb_core->log, GNB_LOG_ID_CORE, "SELF-TEST tun ipv4[%s]\n", GNB_ADDR4STR_PLAINTEXT1(&gnb_core->local_node->tun_addr4));
8989
}
9090

@@ -228,10 +228,10 @@ static void self_test(){
228228

229229
node = &ctl_block->node_zone->node[i];
230230

231-
if ( node->uuid32 != ctl_block->core_zone->local_uuid ) {
232-
GNB_LOG1(gnb_core->log, GNB_LOG_ID_CORE, "SELF-TEST ----- remote node %u -----\n", node->uuid32);
231+
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);
233233
} else {
234-
GNB_LOG1(gnb_core->log, GNB_LOG_ID_CORE, "SELF-TEST local node %u\n", node->uuid32);
234+
GNB_LOG1(gnb_core->log, GNB_LOG_ID_CORE, "SELF-TEST local node %"PRIu64"\n", node->uuid64);
235235
}
236236

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

264264
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=%d\n", gnb_core->fwd_node_ring.nodes[i]->uuid32);
265+
GNB_LOG1(gnb_core->log, GNB_LOG_ID_CORE, "SELF-TEST fwd node=%"PRIu64"\n", gnb_core->fwd_node_ring.nodes[i]->uuid64);
266266
}
267267

268268
for ( i=0; i<gnb_es_arg_list->argc; i++ ) {

src/cli/gnb_crypto.c

Lines changed: 3 additions & 3 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(uint32_t uuid32, const char *private_key_file, const char *public_key_file){
54+
static void create_keypair(uint64_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-
uint32_t uuid32 = 0;
122+
uint64_t uuid64 = 0;
123123

124124
char *public_key_file = NULL;
125125
char *private_key_file = NULL;
@@ -164,7 +164,7 @@ int main (int argc,char *argv[]){
164164
exit(0);
165165
}
166166

167-
create_keypair(uuid32, private_key_file, public_key_file);
167+
create_keypair(uuid64, private_key_file, public_key_file);
168168

169169
return 0;
170170

src/cli/gnb_ctl.c

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

4141

42-
void gnb_ctl_dump_status(gnb_ctl_block_t *ctl_block, uint32_t in_nodeid, uint8_t online_opt);
43-
void gnb_ctl_dump_address_list(gnb_ctl_block_t *ctl_block, uint32_t in_nodeid);
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);
4444

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

@@ -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-
uint32_t nodeid = 0;
79+
uint64_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 = (uint32_t)strtoul(optarg, NULL, 10);
115+
nodeid = (uint64_t)strtoull(optarg, NULL, 10);
116116
break;
117117

118118
case 'c':

src/ctl/gnb_ctl_dump.c

Lines changed: 24 additions & 24 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, uint32_t in_nodeid, uint8_t online_opt){
40+
void gnb_ctl_dump_status(gnb_ctl_block_t *ctl_block, uint64_t in_nodeid, uint8_t online_opt){
4141

4242
#define LINE_SIZE 1024
4343
char line_string[LINE_SIZE];
@@ -89,7 +89,7 @@ void gnb_ctl_dump_status(gnb_ctl_block_t *ctl_block, uint32_t in_nodeid, uint8_t
8989
goto dump_all_node;
9090
}
9191

92-
if ( 0 != in_nodeid && in_nodeid != node->uuid32 ) {
92+
if ( 0 != in_nodeid && in_nodeid != node->uuid64 ) {
9393
continue;
9494
}
9595

@@ -110,7 +110,7 @@ void gnb_ctl_dump_status(gnb_ctl_block_t *ctl_block, uint32_t in_nodeid, uint8_t
110110

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

113-
printf("node %u\n",node->uuid32);
113+
printf("node %"PRIu64"\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));
@@ -144,7 +144,7 @@ void gnb_ctl_dump_status(gnb_ctl_block_t *ctl_block, uint32_t in_nodeid, uint8_t
144144
printf("crypto_key %s\n",GNB_HEX1_BYTE128(node->crypto_key));
145145
printf("key512 %s\n",GNB_HEX1_BYTE64(node->key512));
146146

147-
if ( node->uuid32 != ctl_block->core_zone->local_uuid ) {
147+
if ( node->uuid64 != ctl_block->core_zone->local_uuid ) {
148148

149149
if ( (node->udp_addr_status & GNB_NODE_STATUS_IPV6_PONG) ) {
150150
printf("ipv6 Direct Point to Point\n");
@@ -243,7 +243,7 @@ void gnb_ctl_dump_status(gnb_ctl_block_t *ctl_block, uint32_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, "%u,", node->unified_forwarding_node_array[j].uuid32);
246+
wlen = snprintf(p, line_string_len-wlen, "%"PRIu64",", 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, uint32_t in_nodeid, uint8_t
280280
}
281281

282282

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

285285
gnb_address_t *gnb_address;
286286

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

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

314314
dump_all_node_address:
315315

316-
if ( node->uuid32 == ctl_block->core_zone->local_uuid ) {
317-
printf( "l|%u|%s\n", node->uuid32, GNB_SOCKADDR6STR1(&node->udp_sockaddr6) );
318-
printf( "l|%u|%s\n", node->uuid32, GNB_SOCKADDR4STR1(&node->udp_sockaddr4) );
316+
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) );
319319
continue;
320320
}
321321

@@ -326,11 +326,11 @@ void gnb_ctl_dump_address_list(gnb_ctl_block_t *ctl_block, uint32_t in_nodeid, u
326326
if ( 0 != online_opt ) {
327327

328328
if ( GNB_NODE_STATUS_IPV6_PONG & node->udp_addr_status ) {
329-
printf( "w|%u|%s\n", node->uuid32, GNB_SOCKADDR6STR1(&node->udp_sockaddr6) );
329+
printf( "w|%"PRIu64"|%s\n", node->uuid64, GNB_SOCKADDR6STR1(&node->udp_sockaddr6) );
330330
}
331331

332332
if ( GNB_NODE_STATUS_IPV4_PONG & node->udp_addr_status ) {
333-
printf( "w|%u|%s\n", node->uuid32, GNB_SOCKADDR4STR1(&node->udp_sockaddr4) );
333+
printf( "w|%"PRIu64"|%s\n", node->uuid64, GNB_SOCKADDR4STR1(&node->udp_sockaddr4) );
334334
}
335335

336336
continue;
@@ -353,9 +353,9 @@ void gnb_ctl_dump_address_list(gnb_ctl_block_t *ctl_block, uint32_t in_nodeid, u
353353
}
354354

355355
if ( AF_INET6 == gnb_address->type ) {
356-
printf( "a|%u|%s|%d\n", node->uuid32, GNB_ADDR6STR1(&gnb_address->address.addr6), ntohs(gnb_address->port) );
356+
printf( "a|%"PRIu64"|%s|%d\n", node->uuid64, GNB_ADDR6STR1(&gnb_address->address.addr6), ntohs(gnb_address->port) );
357357
} else if ( AF_INET == gnb_address->type ) {
358-
printf( "p|%u|%s|%d\n", node->uuid32, GNB_ADDR4STR1(&gnb_address->address.addr4), ntohs(gnb_address->port) );
358+
printf( "p|%"PRIu64"|%s|%d\n", node->uuid64, GNB_ADDR4STR1(&gnb_address->address.addr4), ntohs(gnb_address->port) );
359359
} else {
360360
continue;
361361
}
@@ -371,9 +371,9 @@ void gnb_ctl_dump_address_list(gnb_ctl_block_t *ctl_block, uint32_t in_nodeid, u
371371
}
372372

373373
if ( AF_INET6 == gnb_address->type ) {
374-
printf( "a|%u|%s|%d\n", node->uuid32, GNB_ADDR6STR1(&gnb_address->address.addr6), ntohs(gnb_address->port) );
374+
printf( "a|%"PRIu64"|%s|%d\n", node->uuid64, GNB_ADDR6STR1(&gnb_address->address.addr6), ntohs(gnb_address->port) );
375375
} else if ( AF_INET == gnb_address->type ) {
376-
printf( "p|%u|%s|%d\n", node->uuid32, GNB_ADDR4STR1(&gnb_address->address.addr4), ntohs(gnb_address->port) );
376+
printf( "p|%"PRIu64"|%s|%d\n", node->uuid64, GNB_ADDR4STR1(&gnb_address->address.addr4), ntohs(gnb_address->port) );
377377
} else {
378378
continue;
379379
}
@@ -389,9 +389,9 @@ void gnb_ctl_dump_address_list(gnb_ctl_block_t *ctl_block, uint32_t in_nodeid, u
389389
}
390390

391391
if ( AF_INET6 == gnb_address->type ) {
392-
printf( "s|%u|%s|%d\n", node->uuid32, GNB_ADDR6STR1(&gnb_address->address.addr6), ntohs(gnb_address->port) );
392+
printf( "s|%"PRIu64"|%s|%d\n", node->uuid64, GNB_ADDR6STR1(&gnb_address->address.addr6), ntohs(gnb_address->port) );
393393
} else if ( AF_INET == gnb_address->type ) {
394-
printf( "s|%u|%s|%d\n", node->uuid32, GNB_ADDR4STR1(&gnb_address->address.addr4), ntohs(gnb_address->port) );
394+
printf( "s|%"PRIu64"|%s|%d\n", node->uuid64, GNB_ADDR4STR1(&gnb_address->address.addr4), ntohs(gnb_address->port) );
395395
} else {
396396
continue;
397397
}
@@ -407,9 +407,9 @@ void gnb_ctl_dump_address_list(gnb_ctl_block_t *ctl_block, uint32_t in_nodeid, u
407407
}
408408

409409
if ( AF_INET6 == gnb_address->type ) {
410-
printf( "d|%u|%s|%d\n", node->uuid32, GNB_ADDR6STR1(&gnb_address->address.addr6), ntohs(gnb_address->port) );
410+
printf( "d|%"PRIu64"|%s|%d\n", node->uuid64, GNB_ADDR6STR1(&gnb_address->address.addr6), ntohs(gnb_address->port) );
411411
} else if ( AF_INET == gnb_address->type ) {
412-
printf( "d|%u|%s|%d\n", node->uuid32, GNB_ADDR4STR1(&gnb_address->address.addr4), ntohs(gnb_address->port) );
412+
printf( "d|%"PRIu64"|%s|%d\n", node->uuid64, GNB_ADDR4STR1(&gnb_address->address.addr4), ntohs(gnb_address->port) );
413413
} else {
414414
continue;
415415
}
@@ -425,9 +425,9 @@ void gnb_ctl_dump_address_list(gnb_ctl_block_t *ctl_block, uint32_t in_nodeid, u
425425
}
426426

427427
if ( AF_INET6 == gnb_address->type ) {
428-
printf( "r|%u|%s|%d\n", node->uuid32, GNB_ADDR6STR1(&gnb_address->address.addr6), ntohs(gnb_address->port) );
428+
printf( "r|%"PRIu64"|%s|%d\n", node->uuid64, GNB_ADDR6STR1(&gnb_address->address.addr6), ntohs(gnb_address->port) );
429429
} else if ( AF_INET == gnb_address->type ) {
430-
printf( "r|%u|%s|%d\n", node->uuid32, GNB_ADDR4STR1(&gnb_address->address.addr4), ntohs(gnb_address->port) );
430+
printf( "r|%"PRIu64"|%s|%d\n", node->uuid64, GNB_ADDR4STR1(&gnb_address->address.addr4), ntohs(gnb_address->port) );
431431
} else {
432432
continue;
433433
}
@@ -443,9 +443,9 @@ void gnb_ctl_dump_address_list(gnb_ctl_block_t *ctl_block, uint32_t in_nodeid, u
443443
}
444444

445445
if ( AF_INET6 == gnb_address->type ) {
446-
printf( "p|%u|%s|%d\n", node->uuid32, GNB_ADDR6STR1(&gnb_address->address.addr6), ntohs(gnb_address->port) );
446+
printf( "p|%"PRIu64"|%s|%d\n", node->uuid64, GNB_ADDR6STR1(&gnb_address->address.addr6), ntohs(gnb_address->port) );
447447
} else if ( AF_INET == gnb_address->type ) {
448-
printf( "p|%u|%s|%d\n", node->uuid32, GNB_ADDR4STR1(&gnb_address->address.addr4), ntohs(gnb_address->port) );
448+
printf( "p|%"PRIu64"|%s|%d\n", node->uuid64, GNB_ADDR4STR1(&gnb_address->address.addr4), ntohs(gnb_address->port) );
449449
} else {
450450
continue;
451451
}

src/es/gnb_discover_in_lan.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ static void send_broadcast4(gnb_es_ctx *es_ctx, struct sockaddr_in *src_address_
7171
int on;
7272

7373
#if 0
74-
local_node = (gnb_node_t *)GNB_HASH32_UINT32_GET_PTR(es_ctx->uuid_node_map, es_ctx->ctl_block->core_zone->local_uuid);
74+
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=%lu\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=%"PRIu64"\n", es_ctx->ctl_block->core_zone->local_uuid);
7878
return;
7979
}
8080
#endif
@@ -91,7 +91,7 @@ static void send_broadcast4(gnb_es_ctx *es_ctx, struct sockaddr_in *src_address_
9191

9292
memset(discover_lan_in_frame, 0, sizeof(discover_lan_in_frame_t));
9393
memcpy(discover_lan_in_frame->data.src_key512, local_node->key512, 64);
94-
discover_lan_in_frame->data.src_uuid32 = htonl(local_node->uuid32);
94+
discover_lan_in_frame->data.src_uuid64 = gnb_htonll(local_node->uuid64);
9595
memcpy(discover_lan_in_frame->data.src_addr4, &src_address_in->sin_addr.s_addr, sizeof(struct in_addr));
9696
discover_lan_in_frame->data.src_port4 = htons(es_ctx->ctl_block->conf_zone->conf_st.udp4_ports[0]);
9797
discover_lan_in_frame->data.src_ts_usec = gnb_htonll(es_ctx->now_time_usec);
@@ -107,8 +107,8 @@ 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=%u address=%s,port=%d,broadcast_address=%s",
111-
local_node->uuid32,
110+
snprintf(discover_lan_in_frame->data.text, 256, "GNB LAN DISCOVER node=%"PRIu64" address=%s,port=%d,broadcast_address=%s",
111+
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],
114114
gnb_get_address4string(&broadcast_address_st.sin_addr.s_addr, gnb_static_ip_port_string_buffer2, 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-
uint32_t in_src_uuid32;
141+
uint64_t in_src_uuid64;
142142
gnb_node_t *local_node;
143143
gnb_node_t *dst_node;
144144

@@ -157,28 +157,28 @@ static void handle_discover_lan_in_frame(gnb_es_ctx *es_ctx, gnb_payload16_t *in
157157
return;
158158
}
159159

160-
local_node = (gnb_node_t *)GNB_HASH32_UINT32_GET_PTR(es_ctx->uuid_node_map, es_ctx->ctl_block->core_zone->local_uuid);
160+
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=%lu\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=%"PRIu64"\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

169-
in_src_uuid32 = ntohl(discover_lan_in_frame->data.src_uuid32);
169+
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[%lu]\n", in_src_uuid32);
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);
172172

173-
if ( in_src_uuid32 == local_node->uuid32 ) {
174-
GNB_LOG1(es_ctx->log, GNB_LOG_ID_ES_DISCOVER_IN_LAN, "handle_discover_lan_in_frame error in_src_uuid32=%lu local_node->uuid32=%lu\n", in_src_uuid32, local_node->uuid32);
173+
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);
175175
return;
176176
}
177177

178-
dst_node = (gnb_node_t *)GNB_HASH32_UINT32_GET_PTR(es_ctx->uuid_node_map, in_src_uuid32);
178+
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[%lu] not found!\n", in_src_uuid32);
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);
182182
return;
183183
}
184184

@@ -191,14 +191,14 @@ static void handle_discover_lan_in_frame(gnb_es_ctx *es_ctx, gnb_payload16_t *in
191191
node_ping_frame = (node_ping_frame_t *)payload->data;
192192
memset(node_ping_frame, 0, sizeof(node_ping_frame_t));
193193

194-
node_ping_frame->data.src_uuid32 = htonl(local_node->uuid32);
195-
node_ping_frame->data.dst_uuid32 = discover_lan_in_frame->data.src_uuid32;
194+
node_ping_frame->data.src_uuid64 = gnb_htonll(local_node->uuid64);
195+
node_ping_frame->data.dst_uuid64 = discover_lan_in_frame->data.src_uuid64;
196196
node_ping_frame->data.src_ts_usec = gnb_htonll(es_ctx->now_time_usec);
197197

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)%d --PING-> %d", local_node->uuid32, dst_node->uuid32);
201+
snprintf((char *)node_ping_frame->data.text, 32, "(LAN)%"PRIu64" --PING-> %"PRIu64"", 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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,13 @@ gnb_es_ctx* gnb_es_ctx_create(int is_service, char *ctl_block_file, gnb_log_ctx_
145145

146146
for ( i=0; i<node_num; i++ ) {
147147
node = &es_ctx->ctl_block->node_zone->node[i];
148-
GNB_HASH32_UINT32_SET(es_ctx->uuid_node_map, node->uuid32, node);
148+
GNB_HASH32_UINT64_SET(es_ctx->uuid_node_map, node->uuid64, node);
149149
}
150150

151-
es_ctx->local_node = (gnb_node_t *)GNB_HASH32_UINT32_GET_PTR(es_ctx->uuid_node_map, es_ctx->ctl_block->core_zone->local_uuid);
151+
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=%lu\n", es_ctx->ctl_block->core_zone->local_uuid);
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);
155155
return NULL;
156156
}
157157

0 commit comments

Comments
 (0)