exit(EXIT_FAILURE);
}
+ struct loc_network* subnet5;
+ err = loc_network_new_from_string(ctx, &subnet5, "2001:db8:e::/48");
+ if (err) {
+ fprintf(stderr, "Could not create the subnet5\n");
+ exit(EXIT_FAILURE);
+ }
+
+ struct loc_network* subnet6;
+ err = loc_network_new_from_string(ctx, &subnet6, "2001:db8:1::/48");
+ if (err) {
+ fprintf(stderr, "Could not create the subnet6\n");
+ exit(EXIT_FAILURE);
+ }
+
// Make a list with both subnets
struct loc_network_list* subnets;
err = loc_network_list_new(ctx, &subnets);
exit(EXIT_FAILURE);
}
+ // Add more subnets
+ err = loc_network_list_push(subnets, subnet5);
+ if (err) {
+ fprintf(stderr, "Could not add subnet5 to subnets list\n");
+ exit(EXIT_FAILURE);
+ }
+
+ err = loc_network_list_push(subnets, subnet6);
+ if (err) {
+ fprintf(stderr, "Could not add subnet6 to subnets list\n");
+ exit(EXIT_FAILURE);
+ }
+
loc_network_list_dump(subnets);
size = loc_network_list_size(subnets);
- if (size != 4) {
+ if (size != 6) {
fprintf(stderr, "Network list is reporting an incorrect size: %zu\n", size);
exit(EXIT_FAILURE);
}