Loading...
Searching...
No Matches
su_localinfo.h
Go to the documentation of this file.
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia-email.address.hidden>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef SU_LOCALINFO_H
#define SU_LOCALINFO_H
#ifndef SU_H
#include <sofia-sip/su.h>
#endif
SOFIA_BEGIN_DECLS
typedef struct su_localinfo_s su_localinfo_t;
struct su_localinfo_s {
int li_flags;
int li_family;
int li_index;
int li_scope;
socklen_t li_addrlen;
su_sockaddr_t *li_addr;
char *li_canonname;
su_localinfo_t *li_next;
char *li_ifname;
};
enum {
LI_V4MAPPED = 1,
LI_CANONNAME = 2,
LI_NAMEREQD = 6,
LI_NUMERIC = 8,
LI_DOWN = 16,
LI_IFNAME = 256
};
enum {
LI_SCOPE_HOST = 0x10,
LI_SCOPE_LINK = 0x20,
LI_SCOPE_SITE = 0x40,
LI_SCOPE_GLOBAL = 0x80
};
enum {
ELI_NOADDRESS = -1,
ELI_MEMORY = -2,
ELI_FAMILY = -3,
ELI_RESOLVER = -4,
ELI_SYSTEM = -5,
ELI_BADHINTS = -6,
ELI_NOERROR = 0
};
SOFIAPUBFUN int su_getlocalinfo(su_localinfo_t const *hints,
su_localinfo_t **res);
SOFIAPUBFUN void su_freelocalinfo(su_localinfo_t *);
SOFIAPUBFUN char const *su_gli_strerror(int error);
SOFIAPUBFUN su_localinfo_t *su_copylocalinfo(su_localinfo_t const *li0);
SOFIAPUBFUN int su_sockaddr_scope(su_sockaddr_t const *su, socklen_t sulen);
SOFIA_END_DECLS
#endif /* !defined(SU_LOCALINFO_H) */
su_localinfo_s
Local address info structure.
Definition su_localinfo.h:48
su_localinfo_s::li_ifname
char * li_ifname
Network interface name.
Definition su_localinfo.h:60
su_localinfo_s::li_addrlen
socklen_t li_addrlen
Length of li_addr.
Definition su_localinfo.h:56
su_localinfo_s::li_index
int li_index
Network interface index.
Definition su_localinfo.h:54
su_localinfo_s::li_family
int li_family
Address family.
Definition su_localinfo.h:53
su_localinfo_s::li_scope
int li_scope
Address scope.
Definition su_localinfo.h:55
su_localinfo_s::li_canonname
char * li_canonname
Canonical name for address.
Definition su_localinfo.h:58
su_localinfo_s::li_next
su_localinfo_t * li_next
Next structure in linked list.
Definition su_localinfo.h:59
su_localinfo_s::li_flags
int li_flags
Bitwise or of flags: LI_V4MAPPED, LI_CANONNAME, LI_NAMEREQD, LI_NUMERIC, LI_DOWN, LI_IFNAME.
Definition su_localinfo.h:52
su_localinfo_s::li_addr
su_sockaddr_t * li_addr
Binary address.
Definition su_localinfo.h:57
su.h
Socket and network address interface.
SOFIAPUBFUN
#define SOFIAPUBFUN
SOFIAPUBFUN declares an exported function.
Definition su_config.h:66
su_sockaddr_scope
int su_sockaddr_scope(su_sockaddr_t const *su, socklen_t sulen)
Return the scope of address in the sockaddr structure.
Definition su_localinfo.c:419
su_copylocalinfo
su_localinfo_t * su_copylocalinfo(su_localinfo_t const *li0)
Copy a localinfo structure.
Definition su_localinfo.c:323
ELI_BADHINTS
@ ELI_BADHINTS
Invalid value for hints.
Definition su_localinfo.h:94
ELI_NOERROR
@ ELI_NOERROR
No error.
Definition su_localinfo.h:95
ELI_RESOLVER
@ ELI_RESOLVER
Error when resolving address.
Definition su_localinfo.h:92
ELI_NOADDRESS
@ ELI_NOADDRESS
No matching address.
Definition su_localinfo.h:89
ELI_SYSTEM
@ ELI_SYSTEM
System error.
Definition su_localinfo.h:93
ELI_MEMORY
@ ELI_MEMORY
Memory allocation error.
Definition su_localinfo.h:90
ELI_FAMILY
@ ELI_FAMILY
Unknown address family.
Definition su_localinfo.h:91
su_gli_strerror
char const * su_gli_strerror(int error)
Describe su_localinfo errors.
Definition su_localinfo.c:307
LI_SCOPE_SITE
@ LI_SCOPE_SITE
Site-local address.
Definition su_localinfo.h:83
LI_SCOPE_HOST
@ LI_SCOPE_HOST
Host-local address, valid within host.
Definition su_localinfo.h:81
LI_SCOPE_LINK
@ LI_SCOPE_LINK
Link-local address.
Definition su_localinfo.h:82
LI_SCOPE_GLOBAL
@ LI_SCOPE_GLOBAL
Global address.
Definition su_localinfo.h:84
su_freelocalinfo
void su_freelocalinfo(su_localinfo_t *)
Free local address information.
Definition su_localinfo.c:284
su_getlocalinfo
int su_getlocalinfo(su_localinfo_t const *hints, su_localinfo_t **res)
Request local address information.
Definition su_localinfo.c:194
su_localinfo_t
struct su_localinfo_s su_localinfo_t
Local address info structure.
Definition su_localinfo.h:45
LI_NUMERIC
@ LI_NUMERIC
Instead of domain name, use numeric form.
Definition su_localinfo.h:72
LI_NAMEREQD
@ LI_NAMEREQD
Do not return addresses not in DNS.
Definition su_localinfo.h:70
LI_IFNAME
@ LI_IFNAME
Get interface name.
Definition su_localinfo.h:76
LI_DOWN
@ LI_DOWN
Include interfaces even if they are down (new in 1.12.2).
Definition su_localinfo.h:74
LI_CANONNAME
@ LI_CANONNAME
Get domain name corresponding to the local address.
Definition su_localinfo.h:68
LI_V4MAPPED
@ LI_V4MAPPED
IPv4 addresses will be mapped as IPv6.
Definition su_localinfo.h:66

Sofia-SIP 1.12.11devel - Copyright (C) 2006 Nokia Corporation. All rights reserved. Licensed under the terms of the GNU Lesser General Public License.