---
name: "ipsec_anyaddr"
section: "3"
platform: "linux"
package: "openswan"
version: "1:2.6.37-3+deb7u1"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/ipsec_anyaddr"
---

# ipsec\_anyaddr(3)

get and test for addresses of type "any", "unspecified" and loopback get "any" address

## NAME

ipsec\_anyaddr, ipsec\_isanyaddr, ipsec\_unspecaddr, ipsec\_isunspecaddr, ipsec\_loopbackaddr, ipsec\_isloopbackaddr - get and test for addresses of type "any", "unspecified" and loopback get "any" address

## SYNOPSIS

**#include \<freeswan.h\>**

**const char \*anyaddr(int af, ip\_address \*dst);**\
 **int isanyaddr(const ip\_address \*src);**\
 **const char \*unspecaddr(int af, ip\_address \*dst);**\
 **int isunspecaddr(const ip\_address \*src);**\
 **const char \*loopbackaddr(int af, ip\_address \*dst);**\
 **int isloopbackaddr(const ip\_address \*src);**

## DESCRIPTION

These functions fill in, and test for, special values of the *ip\_address* type.

*Anyaddr* fills in the destination *\*dst* with the \`\`any'' address of address family *af* (normally **AF\_INET** or **AF\_INET6**). The IPv4 \`\`any'' address is the one embodied in the old **INADDR\_ANY** macro.

*Isanyaddr* returns **1** if the *src* address equals the \`\`any'' address, and **0** otherwise.

Similarly, *unspecaddr* supplies, and *isunspecaddr* tests for, the \`\`unspecified'' address, which may be the same as the \`\`any'' address.

Similarly, *loopbackaddr* supplies, and *islookbackaddr* tests for, the loopback address.

*Anyaddr*, *unspecaddr*, and *loopbackaddr* return **NULL** for success and a pointer to a string-literal error message for failure; see DIAGNOSTICS.

## SEE ALSO

[inet(3)](/inet/3.md), [ipsec\_addrtot(3)](/ipsec_addrtot/3.md), [ipsec\_sameaddr(3)](/ipsec_sameaddr/3.md)

## DIAGNOSTICS

Fatal errors in the address-supplying functions are: unknown address family.

## HISTORY

Written for the FreeS/WAN project by Henry Spencer.
