Function nrfxlib_sys::nrf_inet_pton[][src]

pub unsafe extern "C" fn nrf_inet_pton(
    family: c_int,
    p_src: *const c_char,
    p_dst: *mut c_void
) -> c_int

Function for converting a human-readable IP address to a form usable by the socket API.

s This function will convert a string form of addresses and encode it into a byte array in network byte order.

@note Currently not supporting mixed IPv4 and IPv6 format strings.

  • family - Address family. NRF_AF_INET or NRF_AF_INET6.
  • p_src - Null-terminated string containing the address to convert.
  • p_dst - Pointer to a struct nrf_in_addr or nrf_in6_addr where the address will be stored.

Returns 1 on success, 0 if p_src does not contain a valid address, -1 and errno set in case of error.