@@ -93,7 +93,7 @@ int DHCPv6_server_respond_client(dhcpv6_gua_server_entry_s *serverBase, dhcpv6_r
93
93
//Validate Client DUID
94
94
dhcp_link_options_params_t clientDUID ;
95
95
if (libdhcpv6_get_link_address_from_duid (replyPacket -> clientDUID .duid , replyPacket -> clientDUID .duid_length , replyPacket -> clientDUID .type , & clientDUID ) == 0 ) {
96
- dhcp_allocated_address = libdhcpv6_address_allocated_list_scan (serverBase , clientDUID .link_id , clientDUID .link_type , dhcp_ia_non_temporal_params -> iaId , dhcp_ia_non_temporal_params -> T0 , dhcp_ia_non_temporal_params -> T1 , allocateNew );
96
+ dhcp_allocated_address = libdhcpv6_address_allocate (serverBase , clientDUID .link_id , clientDUID .link_type , dhcp_ia_non_temporal_params -> iaId , dhcp_ia_non_temporal_params -> T0 , dhcp_ia_non_temporal_params -> T1 , allocateNew );
97
97
}
98
98
if (dhcp_allocated_address ) {
99
99
address_allocated = true;
@@ -109,7 +109,7 @@ int DHCPv6_server_respond_client(dhcpv6_gua_server_entry_s *serverBase, dhcpv6_r
109
109
110
110
if (!serverBase -> addCb (serverBase -> interfaceId , & update_info , serverBase -> guaPrefix )) {
111
111
address_allocated = false;
112
- libdhcpv6_address_rm_from_allocated_list (serverBase , dhcp_allocated_address -> nonTemporalAddress );
112
+ libdhcpv6_address_delete (serverBase , dhcp_allocated_address -> nonTemporalAddress );
113
113
}
114
114
}
115
115
}
@@ -299,9 +299,9 @@ void DHCPv6_server_service_delete(int8_t interface, uint8_t guaPrefix[static 8],
299
299
ns_list_foreach_safe (dhcpv6_allocated_address_entry_t , cur , & serverInfo -> allocatedAddressList ) {
300
300
//Delete Server data base
301
301
if (serverInfo -> removeCb ) {
302
- uint8_t allocated_address [16 ];
303
- libdhcpv6_allocated_address_write (allocated_address , cur , serverInfo );
304
- serverInfo -> removeCb (interface , allocated_address , NULL );
302
+ uint8_t ipAddress [16 ];
303
+ libdhcpv6_allocated_address_write (ipAddress , cur , serverInfo );
304
+ serverInfo -> removeCb (interface , ipAddress , NULL );
305
305
}
306
306
}
307
307
@@ -327,25 +327,33 @@ void DHCPv6_server_service_delete(int8_t interface, uint8_t guaPrefix[static 8],
327
327
328
328
/* Control GUA address for client by DUI.Default value is true
329
329
*
330
+ * Anonymous and disable address list can optimize either
331
+ * Using 16 bit suffix to optimize data amount in network
332
+ * and having list of assigned addresses meaning larger RAM usage at border router
333
+ *
334
+ * or Using SLAAC type address generation and not have a list of addresses at Border router
335
+ * -> Less RAM usage, but more bandwidth used
330
336
*
331
337
* /param interface interface id of this thread instance.
332
338
* /param guaPrefix Prefix which will be removed
333
- * /param mode true trig autonous mode, false define address by default suffics + client id
339
+ * /param mode true assign addresses anonymously. false define address by Prefix + client id
340
+ * /param disable_address_list Dont keep track of assigned Addresses (Can't be used if anonymous)
334
341
*/
335
- int DHCPv6_server_service_set_address_autonous_flag (int8_t interface , uint8_t guaPrefix [static 16 ], bool mode , bool autonomous_skip_list )
342
+ int DHCPv6_server_service_set_address_generation_anonymous (int8_t interface , uint8_t guaPrefix [static 16 ], bool mode , bool disable_address_list )
336
343
{
337
344
dhcpv6_gua_server_entry_s * serverInfo = libdhcpv6_server_data_get_by_prefix_and_interfaceid (interface , guaPrefix );
338
345
if (!serverInfo ) {
339
346
return -1 ;
340
347
341
348
}
342
349
343
- serverInfo -> enableAddressAutonous = mode ;
350
+ serverInfo -> anonymousAddress = mode ;
344
351
if (mode ) {
345
- serverInfo -> disableAddressListAllocation = autonomous_skip_list ;
352
+ serverInfo -> disableAddressList = disable_address_list ;
346
353
} else {
347
- serverInfo -> disableAddressListAllocation = false;
354
+ serverInfo -> disableAddressList = false;
348
355
}
356
+ tr_info ("DHCPv6 %s, address list %s" , mode ? "anonymous address" : "address mode SLAAC" , disable_address_list ? "Not Stored" : "Stored" );
349
357
350
358
return 0 ;
351
359
}
@@ -375,6 +383,7 @@ int DHCPv6_server_service_duid_update(int8_t interface, uint8_t guaPrefix[static
375
383
if (!serverInfo ) {
376
384
return -1 ;
377
385
}
386
+ tr_info ("DHCPv6 duid %s" , trace_array (duid_ptr , duid_length ));
378
387
379
388
return libdhcpv6_server_duid_set (serverInfo , duid_ptr , duid_type , duid_length );
380
389
}
@@ -399,6 +408,7 @@ int DHCPv6_server_service_set_max_clients_accepts_count(int8_t interface, uint8_
399
408
}
400
409
401
410
serverInfo -> maxSupportedClients = maxClientCount ;
411
+ tr_info ("DHCPv6 maximum clients %" PRIu32 , serverInfo -> maxSupportedClients );
402
412
403
413
return 0 ;
404
414
}
@@ -421,6 +431,7 @@ int DHCPv6_server_service_set_address_validlifetime(int8_t interface, uint8_t gu
421
431
return -1 ;
422
432
}
423
433
serverInfo -> validLifetime = validLifeTimne ;
434
+ tr_info ("DHCPv6 Valid lifetime %" PRIu32 , serverInfo -> validLifetime );
424
435
425
436
return 0 ;
426
437
}
@@ -510,7 +521,7 @@ void DHCPv6_server_service_timeout_cb(uint32_t timeUpdateInSeconds)
510
521
{
511
522
(void ) timeUpdateInSeconds ;
512
523
}
513
- int DHCPv6_server_service_set_address_autonous_flag (int8_t interface , uint8_t guaPrefix [static 16 ], bool mode , bool autonomous_skip_list )
524
+ int DHCPv6_server_service_set_address_generation_anonymous (int8_t interface , uint8_t guaPrefix [static 16 ], bool mode , bool autonomous_skip_list )
514
525
{
515
526
(void ) interface ;
516
527
(void ) guaPrefix ;
0 commit comments