mbedtls_x509_crt_parse_cn_inet_pton() function
This function parses a CN string as an IP address.
Syntax
size_t mbedtls_x509_crt_parse_cn_inet_pton(const char *cn,
void *dst);
Arguments
cn
The CN string to parse. CN string MUST be null-terminated.
dst
The target buffer to populate with the binary IP address. The buffer MUST be 16 bytes to save IPv6, and should be 4-byte aligned if the result will be used as struct in_addr. e.g. uint32_t dst[4]
Return value
Length of binary IP address; num bytes written to target. \c 0 on failure to parse CN string as an IP address.
Notes
\p cn is parsed as an IPv6 address if string contains ':', else \p cn is parsed as an IPv4 address.
mbedtls_x509_crt_parse_cn_inet_pton() is called by 1 function and calls 2 functions:
![]()
mbedtls_x509_crt_parse_cn_inet_pton()
mbedtls_x509_crt_parse_cn_inet_pton():
![]()
mbedtls_x509_crt_parse_cn_inet_pton()