libressl-X509v3_addr_get_range3
Parse helpers for the ip address delegation extension
Usage
Crypto Library (libcrypto, -lcrypto)
#include <openssl/x509v3.h>
unsigned
X509v3_addr_get_afi(const IPAddressFamily *af);
int
X509v3_addr_get_range(IPAddressOrRange *aor, const unsigned afi, unsigned char *min, unsigned char *max, const int length);
Overview
X509v3_addr_get_afi() returns the address family identifier (AFI) of af.
X509v3_addr_get_range() converts the minimum and maximum addresses in the address prefix or range aor from internal encoding to IP addresses in network byte order and places copies in the arrays min and max, of size length. The length must be large enough to accommodate an address for afi, which is at least 4 for IANA_AFI_IPV4 and at least 16 for IANA_AFI_IPV6.
Return values
X509v3_addr_get_afi() returns the AFI encoded in af or 0 if af does not contain a valid AFI, or if the AFI is not IPv4 or IPv6.
X509v3_addr_get_range() returns the number of bytes copied into min and max or 0 on error. An error occurs if aor is malformed, if afi is not IANA_AFI_IPV4 or IANA_AFI_IPV6, if either min or max is NULL, or if length is smaller than 4 or 16, respectively.