IPSEC_RANGETOSUBNETSection: C Library Functions (3)Updated: 8 Sept 2000 |
IPSEC_RANGETOSUBNETSection: C Library Functions (3)Updated: 8 Sept 2000 |
const char *rangetosubnet(const ip_address *start,
const ip_address *stop, ip_subnet *dst);
Rangetosubnet returns NULL for success and a pointer to a string-literal error message for failure; see DIAGNOSTICS.
The error-reporting convention lends itself to slightly obscure code, because many readers will not think of NULL as signifying success. A good way to make it clearer is to write something like:
const char *error;
error = rangetosubnet( /* ... */ );
if (error != NULL) {
/* something went wrong */