* Try to get our IPv4 address. * * @param[out] pipv4Addr The in_addr struct to which to copy. * * @returns Whether or not the operation was successful, in particular, whether * or not our address was an IPv4 address. * * @see CNetAddr::IsIPv4() */
| 621 | * @see CNetAddr::IsIPv4() |
| 622 | */ |
| 623 | bool CNetAddr::GetInAddr(struct in_addr* pipv4Addr) const |
| 624 | { |
| 625 | if (!IsIPv4()) |
| 626 | return false; |
| 627 | assert(sizeof(*pipv4Addr) == m_addr.size()); |
| 628 | memcpy(pipv4Addr, m_addr.data(), m_addr.size()); |
| 629 | return true; |
| 630 | } |
| 631 | |
| 632 | /** |
| 633 | * Try to get our IPv6 (or CJDNS) address. |
no test coverage detected