#include <sofia-sip/su.h>
Include dependency graph for su_localinfo.h:
Go to the source code of this file.
Data Structures | |
struct | su_localinfo_s |
Local address info structure. More... | |
Typedefs | |
typedef su_localinfo_s | su_localinfo_t |
Local address info structure. | |
Enumerations | |
enum | { LI_V4MAPPED, LI_CANONNAME, LI_NAMEREQD, LI_NUMERIC, LI_DOWN, LI_IFNAME } |
Flags for su_getlocalinfo() - li_flags. More... | |
enum | { LI_SCOPE_HOST, LI_SCOPE_LINK, LI_SCOPE_SITE, LI_SCOPE_GLOBAL } |
Localinfo scope - li_scope. More... | |
enum | { ELI_NOADDRESS, ELI_MEMORY, ELI_FAMILY, ELI_RESOLVER, ELI_SYSTEM, ELI_BADHINTS, ELI_NOERROR } |
Localinfo error codes. More... | |
Functions | |
int | su_getlocalinfo (su_localinfo_t const *hints, su_localinfo_t **res) |
Request local address information. | |
void | su_freelocalinfo (su_localinfo_t *) |
Free local address information. | |
char const * | su_gli_strerror (int error) |
Describe su_localinfo errors. | |
su_localinfo_t * | su_copylocalinfo (su_localinfo_t const *li0) |
Copy a localinfo structure. | |
int | su_sockaddr_scope (su_sockaddr_t const *su, socklen_t sulen) |
Return the scope of address in the sockaddr structure. |
typedef struct su_localinfo_s su_localinfo_t |
Local address info structure.
anonymous enum |
Flags for su_getlocalinfo() - li_flags.
LI_V4MAPPED | IPv4 addresses will be mapped as IPv6. |
LI_CANONNAME | Get domain name corresponding to the local address. |
LI_NAMEREQD |
Do not return addresses not in DNS.
Implies LI_CANONNAME. |
LI_NUMERIC | Instead of domain name, use numeric form. |
LI_DOWN |
Include interfaces even if they are down (new in 1.12.2).
|
LI_IFNAME | Get interface name. |
anonymous enum |
anonymous enum |
void su_freelocalinfo | ( | su_localinfo_t * | tbf | ) |
Free local address information.
Free a list of su_localinfo_t structures obtained with su_getlocalinfo() or su_copylocalinfo() along with socket addresses and strings associated with them.
int su_getlocalinfo | ( | su_localinfo_t const * | hints, | |
su_localinfo_t ** | return_localinfo | |||
) |
Request local address information.
Gather the network interfaces and the addresses corresponding to them, check if they match to the search criteria specifed by hints and return a list of matching local address information in the return_localinfo. The local address information may include IPv4/IPv6 addresses, interface name, interface index, address scope, and domain names corresponding to the local addresses.
[in] | hints | specifies selection criteria |
[out] | return_localinfo | return list of local addresses |
AF_INET6
.
su_if_names()
.
su_if_names()
.
For instance, setting hints->li_scope to LI_SCOPE_GLOBAL
| LI_SCOPE_SITE
, both the global and site-local addresses are returned.
char const* su_gli_strerror | ( | int | error | ) |
Describe su_localinfo errors.
The function su_gli_strerror() returns a string describing the error condition indicated by the code that was returned by the function su_getlocalinfo().
error | error code returned by su_getlocalinfo() |