-
Notifications
You must be signed in to change notification settings - Fork 136
/
demo_netxduo_dhcpv6_client.c
708 lines (533 loc) · 21.5 KB
/
demo_netxduo_dhcpv6_client.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
/* This is a small demo of the NetX Duo DHCPv6 Client for the high-performance NetX Duo stack. */
#include <stdio.h>
#include "tx_api.h"
#include "nx_api.h"
#include "nxd_dhcpv6_client.h"
#ifdef FEATURE_NX_IPV6
#define DEMO_STACK_SIZE 2048
/* Set the client address, and request these address from DHCPv6 Server. */
/*
#define NX_DHCPV6_REQUEST_IA_ADDRESS
*/
/* Set the list of DHCPv6 option data (timezone, DNS server, timer server, domain name)to get from the DHCPv6 server. */
#define NX_DHCPV6_REQUEST_OPTION
/* Add the fully qualified domain name to request whether the DHCPv6 server SHOULD or SHOULD NOT perform the AAAA RR or DNS updates. */
#define NX_DHCPV6_REQUEST_FQDN_OPTION
/* Define the ThreadX and NetX object control blocks... */
NX_PACKET_POOL pool_0;
TX_THREAD thread_client;
NX_IP client_ip;
/* Define the Client and Server instances. */
NX_DHCPV6 dhcp_client;
/* Define the error counter used in the demo application... */
ULONG error_counter;
CHAR *pointer;
/* Define thread prototypes. */
void thread_client_entry(ULONG thread_input);
/***** Substitute your ethernet driver entry function here *********/
extern VOID _nx_ram_network_driver(NX_IP_DRIVER *driver_req_ptr);
/* Declare DHCPv6 Client callbacks */
VOID dhcpv6_state_change_notify(NX_DHCPV6 *dhcpv6_ptr, UINT old_state, UINT new_state);
VOID dhcpv6_server_error_handler(NX_DHCPV6 *dhcpv6_ptr, UINT op_code, UINT status_code, UINT message_type);
/* Set up globals for tracking changes to DHCPv6 Client from callback services. */
UINT state_changes = 0;
UINT address_expired = 0;
UINT address_failed_dad = 0;
UINT bound_addresses = 0;
UINT address_not_assigned = 0;
UINT server_errors = 0;
/* Define some DHCPv6 parameters. */
#define DHCPV6_IANA_ID 0xABCDEFAB
#define DHCPV6_T1 NX_DHCPV6_INFINITE_LEASE
#define DHCPV6_T2 NX_DHCPV6_INFINITE_LEASE
#define DHCPV6_RENEW_TIME NX_DHCPV6_INFINITE_LEASE
#define DHCPV6_REBIND_TIME NX_DHCPV6_INFINITE_LEASE
#define PACKET_PAYLOAD 500
#define PACKET_POOL_SIZE (5*PACKET_PAYLOAD)
/* Define main entry point. */
int main()
{
/* Enter the ThreadX kernel. */
tx_kernel_enter();
}
/* Define what the initial system looks like. */
void tx_application_define(void *first_unused_memory)
{
UINT status;
/* Setup the working pointer. */
pointer = (CHAR *) first_unused_memory;
/* Create the Client thread. */
status = tx_thread_create(&thread_client, "Client thread", thread_client_entry, 0,
pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START);
/* Check for IP create errors. */
if (status)
{
error_counter++;
return;
}
pointer = pointer + DEMO_STACK_SIZE;
/* Initialize the NetX system. */
nx_system_initialize();
/* Create a packet pool. */
status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1024, pointer, PACKET_POOL_SIZE);
pointer = pointer + PACKET_POOL_SIZE;
/* Check for pool creation error. */
if (status)
{
error_counter++;
return;
}
/* Create a Client IP instance. */
status = nx_ip_create(&client_ip, "Client IP", IP_ADDRESS(0, 0, 0, 0),
0xFFFFFF00UL, &pool_0, _nx_ram_network_driver,
pointer, 2048, 1);
pointer = pointer + 2048;
/* Check for IP create errors. */
if (status)
{
error_counter++;
return;
}
/* Enable UDP traffic for sending DHCPv6 messages. */
status = nx_udp_enable(&client_ip);
/* Check for UDP enable errors. */
if (status)
{
error_counter++;
return;
}
/* Enable ICMP. */
status = nx_icmp_enable(&client_ip);
/* Check for ICMP enable errors. */
if (status)
{
error_counter++;
return;
}
/* Create the DHCPv6 Client. */
status = nx_dhcpv6_client_create(&dhcp_client, &client_ip, "DHCPv6 Client",
&pool_0, pointer, 2048, dhcpv6_state_change_notify,
dhcpv6_server_error_handler);
/* Check for errors. */
if (status)
{
error_counter++;
return;
}
/* Update the stack pointer because we need it again. */
pointer = pointer + 2048;
/* Yield control to DHCPv6 threads and ThreadX. */
return;
}
/* Define the Client host application thread. */
void thread_client_entry(ULONG thread_input)
{
UINT status;
ULONG T1, T2;
UINT address_count;
UINT address_index = 0;
NXD_ADDRESS valid_ipv6_address;
ULONG preferred_lifetime;
ULONG valid_lifetime;
UINT ia_count = 1;
#ifdef NX_DHCPV6_REQUEST_IA_ADDRESS
NXD_ADDRESS ipv6_address;
#endif
#ifdef NX_DHCPV6_REQUEST_OPTION
UCHAR buffer[200];
NXD_ADDRESS dns_server;
#endif
#ifdef NX_DHCPV6_CLIENT_RESTORE_STATE
ULONG current_time;
ULONG elapsed_time;
NX_DHCPV6_CLIENT_RECORD dhcpv6_client_record;
#endif
NX_PARAMETER_NOT_USED(thread_input);
state_changes = 0;
/* Establish the link local address for the host. The RAM driver creates
a virtual MAC address of 0x1122334456. */
status = nxd_ipv6_address_set(&client_ip, 0, NX_NULL, 10, NULL);
if (status)
{
error_counter++;
return;
}
/* Let NetX Duo get initialized. */
tx_thread_sleep(5 * NX_IP_PERIODIC_RATE);
/* Enable the Client IP for IPv6 and ICMPv6 services. */
nxd_ipv6_enable(&client_ip);
nxd_icmp_enable(&client_ip);
/* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field
to NULL; the DHCPv6 Client API will supply one. */
status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME,
NX_DHCPV6_CLIENT_HARDWARE_TYPE_ETHERNET, 0);
if (status != NX_SUCCESS)
{
error_counter++;
return;
}
/* Create the DHCPv6 client's Identity Association (IA-NA) now.
Note that if this host had already been assigned in IPv6 lease, it
would have to use the assigned T1 and T2 values in loading the DHCPv6
client with an IANA block.
*/
status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, DHCPV6_T1, DHCPV6_T2);
if (status != NX_SUCCESS)
{
error_counter++;
return;
}
#ifdef NX_DHCPV6_REQUEST_IA_ADDRESS
memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS));
ipv6_address.nxd_ip_version = NX_IP_VERSION_V6;
ipv6_address.nxd_ip_address.v6[0] = 0x3ffe0501;
ipv6_address.nxd_ip_address.v6[1] = 0xffff0100;
ipv6_address.nxd_ip_address.v6[2] = 0x00000000;
ipv6_address.nxd_ip_address.v6[3] = 0x0000abcd;
/* Create an IA address option.
Note that if this host had already been assigned in IPv6 lease, it
would have to use the assigned IPv6 address, preferred and valid lifetime
values in loading the DHCPv6 Client with an IA block.
*/
status = nx_dhcpv6_add_client_ia(&dhcp_client, &ipv6_address,DHCPV6_RENEW_TIME, DHCPV6_REBIND_TIME);
if (status != NX_SUCCESS)
{
error_counter++;
return;
}
/* If the DHCPv6 Client is configured for a maximum number of IA addresses
greater than 1, we can add another IA address if the device requires
multiple global IPv6 addresses. */
if(NX_DHCPV6_MAX_IA_ADDRESS >= 2)
{
memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS));
ipv6_address.nxd_ip_version = NX_IP_VERSION_V6;
ipv6_address.nxd_ip_address.v6[0] = 0x3ffe0501;
ipv6_address.nxd_ip_address.v6[1] = 0xffff0100;
ipv6_address.nxd_ip_address.v6[2] = 0x00000000;
ipv6_address.nxd_ip_address.v6[3] = 0x00001234;
/* Add another IA address option. */
status = nx_dhcpv6_add_client_ia(&dhcp_client, &ipv6_address, DHCPV6_RENEW_TIME, DHCPV6_REBIND_TIME);
if (status != NX_SUCCESS)
{
error_counter++;
return;
}
}
#endif /* NX_DHCPV6_REQUEST_IA_ADDRESS */
#ifdef NX_DHCPV6_REQUEST_OPTION
/* Set the list of DHCPv6 option data to get from the DHCPv6 server if needed. */
nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE);
nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE);
nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE);
nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE);
#endif /* NX_DHCPV6_REQUEST_OPTION */
#ifdef NX_DHCPV6_REQUEST_FQDN_OPTION
/* Set the DHCPv6 Client FQDN option.
operation: NX_DHCPV6_CLIENT_DESIRES_UPDATE_AAAA_RR DHCPv6 Client choose to updating the FQDN-to-IPv6 address mapping for FQDN and address(es) used by the client.
NX_DHCPV6_CLIENT_DESIRES_SERVER_DO_DNS_UPDATE DHCPv6 Client choose to updating the FQDN-to-IPv6 address mapping for FQDN and address(es) used by the client to the server.
NX_DHCPV6_CLIENT_DESIRES_NO_SERVER_DNS_UPDATE DHCPv6 Client choose to request that the server perform no DNS updatest on its behalf. */
nx_dhcpv6_request_option_FQDN(&dhcp_client, "DHCPv6-Client", NX_DHCPV6_CLIENT_DESIRES_UPDATE_AAAA_RR);
#endif /* NX_DHCPV6_REQUEST_FQDN_OPTION */
/* Start up the NetX DHCPv6 Client thread task. */
status = nx_dhcpv6_start(&dhcp_client);
/* Check for errors. */
if (status != NX_SUCCESS)
{
error_counter++;
return;
}
/* Start the DHCPv6 by sending a Solicit message out on the network. */
status = nx_dhcpv6_request_solicit(&dhcp_client);
/* Check status. */
if (status != NX_SUCCESS)
{
error_counter++;
return;
}
/* Is the DHCPv6 Client request for address assignment successfully started? */
if (status == NX_SUCCESS)
{
/* If Duplicate Address Detection (DAD) is enabled in NetX Duo, e.g. #NX_DISABLE_IPV6_DAD
not defined, allow time for NetX Duo to verify the address is unique on our network.
*/
tx_thread_sleep(5 * NX_IP_PERIODIC_RATE);
/* Check the bound address. */
if (bound_addresses != ia_count)
{
/* Attempt to find out why DHCPv6 failed, where...*/
if (server_errors > 0)
{
/* Actually you would compare server_error count with number of IA's added
to determine if any addresses were assigned. */
printf("Server error, not all address assigned\n");
}
if (address_not_assigned > 0)
{
/* Actually you would compare address not assigned count with number of IA's added
to determine if any addresses were assigned. */
printf("No servers responded to some or all of our IAs\n");
}
}
/* Regardless if the DHCPv6 Client achieved a bound state, check for DAD
failures. */
if (address_failed_dad > 0)
{
/* Actually you would compare failed dad count with number of IA's added
to determine if any addresses were assigned. */
printf("Some or all of our IAs failed DAD\n");
}
/* Successfully assigned IPv6 addresses! */
/* Get the count of valid IPv6 address obtained by DHCPv6. */
status = nx_dhcpv6_get_valid_ip_address_count(&dhcp_client, &address_count);
/* Check status. */
if (status != NX_SUCCESS)
{
error_counter++;
}
/* Get the IPv6 address and related lifetimes by address index. This index is the
index into the DHCPv6 Client address table. Not to be confused with the IP
instance address table! */
status = nx_dhcpv6_get_valid_ip_address_lease_time(&dhcp_client, address_index,
&valid_ipv6_address, &preferred_lifetime,
&valid_lifetime);
/* Check status. */
if (status != NX_SUCCESS)
{
error_counter++;
}
/* Get the IANA options for when to start renew/rebind requests. These time
parameters are the same for all IPv6 addresses assigned in the Client
e.g. IANA returned from Server. */
status = nx_dhcpv6_get_iana_lease_time(&dhcp_client, &T1, &T2);
/* Check status. */
if (status != NX_SUCCESS)
{
error_counter++;
}
/*****************************************************************************/
/* These are 'legacy' DHCPv6 services and are for the most part identical to the services
above except they default to the primary global IPv6 address regardless if the
Client was assigned more than one global IPv6 address. */
/* Now check the assigned lease times. */
status = nx_dhcpv6_get_lease_time_data(&dhcp_client, &T1, &T2,
&preferred_lifetime, &valid_lifetime);
/* Check status. */
if (status != NX_SUCCESS)
{
error_counter++;
}
/* Get the IP address. */
status = nx_dhcpv6_get_IP_address(&dhcp_client, &valid_ipv6_address);
/* Check status. */
if (status != NX_SUCCESS)
{
error_counter++;
}
/* Bound state. */
#ifdef NX_DHCPV6_CLIENT_RESTORE_STATE
/* Get the DHCPv6 Client record. */
nx_dhcpv6_client_get_record(&dhcp_client, &dhcpv6_client_record);
/* Delete DHCPv6 instance. */
nx_dhcpv6_client_delete(&dhcp_client);
/* Delete IP instance. */
status = nx_ip_delete(&client_ip);
/* Check for error. */
if (status)
{
error_counter++;
return;
}
/* Create a Client IP instance. */
status = nx_ip_create(&client_ip, "Client IP", IP_ADDRESS(0, 0, 0, 0),
0xFFFFFF00UL, &pool_0, _nx_ram_network_driver,
pointer, 2048, 1);
pointer = pointer + 2048;
/* Check for IP create errors. */
if (status)
{
error_counter++;
return;
}
/* Enable UDP traffic for sending DHCPv6 messages. */
status = nx_udp_enable(&client_ip);
/* Check for UDP enable errors. */
if (status)
{
error_counter++;
return;
}
/* Enable ICMP. */
status = nx_icmp_enable(&client_ip);
/* Check for ICMP enable errors. */
if (status)
{
error_counter++;
return;
}
/* Enable the Client IP for IPv6 and ICMPv6 services. */
status = nxd_ipv6_enable(&client_ip);
status += nxd_icmp_enable(&client_ip);
/* Check for IPv6 and ICMPv6 enable errors. */
if (status)
{
error_counter++;
return;
}
/* Establish the link local address for the host. The RAM driver creates
a virtual MAC address of 0x1122334456. */
status = nxd_ipv6_address_set(&client_ip, 0, NX_NULL, 10, NULL);
if (status)
{
error_counter++;
return;
}
/* If Duplicate Address Detection (DAD) is enabled in NetX Duo, e.g. #NX_DISABLE_IPV6_DAD
not defined, allow time for NetX Duo to verify the address is unique on our network.
*/
tx_thread_sleep(5 * NX_IP_PERIODIC_RATE);
/* Create the DHCPv6 Client. */
status = nx_dhcpv6_client_create(&dhcp_client, &client_ip, "DHCPv6 Client",
&pool_0, pointer, 2048, dhcpv6_state_change_notify,
dhcpv6_server_error_handler);
/* Check for errors. */
if (status)
{
error_counter++;
return;
}
/* Update the stack pointer because we need it again. */
pointer = pointer + 2048;
/* Restore the DHCPv6 record. */
nx_dhcpv6_client_restore_record(&dhcp_client, &dhcpv6_client_record, 5);
/* Resume the DHCPv6 service. */
nx_dhcpv6_resume(&dhcp_client);
#endif
#ifdef NX_DHCPV6_REQUEST_OPTION
/* Get the DNS Server address. */
nx_dhcpv6_get_DNS_server_address(&dhcp_client, 0, &dns_server);
/* Reset the buffer. */
memset(buffer, 0, sizeof(buffer));
/* Get DNS domain name. */
nx_dhcpv6_get_other_option_data(&dhcp_client, NX_DHCPV6_DOMAIN_NAME_OPTION, buffer, 200);
/* Reset the buffer. */
memset(buffer, 0, sizeof(buffer));
/* Get the time zone. */
nx_dhcpv6_get_other_option_data(&dhcp_client, NX_DHCPV6_NEW_POSIX_TIMEZONE_OPTION, buffer, 200); // Try to get DNS info got from DHCPv6 Server
#endif
/* At some point, we may wish to release the IPv6 address lease e.g. the device
is leaving the network or powering down. In that case we inform the
DHCPv6 Server that we are releasing the address lease. */
status = nx_dhcpv6_request_release(&dhcp_client);
/* Check status. */
if (status != NX_SUCCESS)
{
error_counter++;
return;
}
/* Send the release message. */
tx_thread_sleep(NX_IP_PERIODIC_RATE);
}
/* Stopping the Client task. */
status = nx_dhcpv6_stop(&dhcp_client);
/* Check status. */
if (status != NX_SUCCESS)
{
error_counter++;
return;
}
/* Clear the previously assigned IPv6 addresses from the Client and IP address table. */
status = nx_dhcpv6_reinitialize(&dhcp_client);
/* Check status. */
if (status != NX_SUCCESS)
{
error_counter++;
return;
}
/* Start up the Client task again. */
status = nx_dhcpv6_start(&dhcp_client);
/* Check status. */
if (status != NX_SUCCESS)
{
error_counter++;
return;
}
/* Begin the request process by sending a Solicit message with the IA created above
with our preferred IPv6 address. */
status = nx_dhcpv6_request_solicit(&dhcp_client);
/* Check status. */
if (status != NX_SUCCESS)
{
error_counter++;
return;
}
/* Wait a bit before releasing the IP address and terminating the client. */
tx_thread_sleep(5 * NX_IP_PERIODIC_RATE);
/* Ok, lets stop the application. Again we DO NOT plan
to keep the IPv6 address we were assigned and need to release it
back to the DHCPv6 server. */
status = nx_dhcpv6_request_release(&dhcp_client);
/* Check for error. */
if (status != NX_SUCCESS)
{
error_counter++;
}
/* Now delete the DHCPv6 client and release ThreadX and
NetX Duo resources back to the system. */
nx_dhcpv6_client_delete(&dhcp_client);
return;
}
/* This is the notification from the DHCPv6 Client task that it has changed
state in the DHCPv6 protocol, for example getting assigned an IPv6 lease and
achieving the bound state or an IPv6 lease expires and being reset to
the init state.
*/
VOID dhcpv6_state_change_notify(NX_DHCPV6 *dhcpv6_ptr, UINT old_state, UINT new_state)
{
NX_PARAMETER_NOT_USED(dhcpv6_ptr);
/* Increment state change counter. */
state_changes++;
/* Check if the Client attempted to request an IPv6 lease but no servers
responded. */
if ((old_state == NX_DHCPV6_STATE_SENDING_SOLICIT) && (new_state == NX_DHCPV6_STATE_INIT))
{
/* Indication that either DAD failed or IP lease expired. */
address_not_assigned++;
}
/* Check if the Client has been assigned an IPv6 lease. */
if (new_state == NX_DHCPV6_STATE_BOUND_TO_ADDRESS)
{
bound_addresses++;
}
/* Check if the Client was bound, but failed the uniqueness check
(Duplicate Address Detection) and was reset to the INIT state. */
if ((old_state == NX_DHCPV6_STATE_SENDING_DECLINE) && (new_state == NX_DHCPV6_STATE_INIT))
{
/* Indication that DAD failed on Client IA. */
address_failed_dad++;
}
/* Check if the Client was bound, attempted renew the lease but the
IPv6 address renewal/rebinding failed. */
if ((old_state == NX_DHCPV6_STATE_SENDING_REBIND) && (new_state == NX_DHCPV6_STATE_INIT))
{
/* Indication that the IP lease expired. */
address_expired++;
}
/* Other checks are possible. */
}
/* This is the notification from the DHCPv6 Client task that it received an error
from the server (status code) in response to the Client's last DHCPv6 message.
*/
VOID dhcpv6_server_error_handler(NX_DHCPV6 *dhcpv6_ptr, UINT op_code, UINT status_code, UINT message_type)
{
NX_PARAMETER_NOT_USED(dhcpv6_ptr);
NX_PARAMETER_NOT_USED(op_code);
NX_PARAMETER_NOT_USED(status_code);
NX_PARAMETER_NOT_USED(message_type);
/* Increment the server error count. */
server_errors++;
/* This should distinguish between receiving a server error and no server
available to assign the Client an IPv6 address if the Client fails
to get assigned an address. */
}
#endif /* FEATURE_NX_IPV6 */