su
1.12.11
|
00001 /* 00002 * This file is part of the Sofia-SIP package 00003 * 00004 * Copyright (C) 2005 Nokia Corporation. 00005 * 00006 * Contact: Pekka Pessi <pekka.pessi@nokia-email.address.hidden> 00007 * 00008 * This library is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU Lesser General Public License 00010 * as published by the Free Software Foundation; either version 2.1 of 00011 * the License, or (at your option) any later version. 00012 * 00013 * This library is distributed in the hope that it will be useful, but 00014 * WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 * Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public 00019 * License along with this library; if not, write to the Free Software 00020 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 00021 * 02110-1301 USA 00022 * 00023 */ 00024 00025 #ifndef SU_LOCALINFO_H 00026 00027 #define SU_LOCALINFO_H 00028 00029 00038 #ifndef SU_H 00039 #include <sofia-sip/su.h> 00040 #endif 00041 00042 SOFIA_BEGIN_DECLS 00043 00045 typedef struct su_localinfo_s su_localinfo_t; 00046 00048 struct su_localinfo_s { 00052 int li_flags; 00053 int li_family; 00054 int li_index; 00055 int li_scope; 00056 socklen_t li_addrlen; 00057 su_sockaddr_t *li_addr; 00058 char *li_canonname; 00059 su_localinfo_t *li_next; 00060 char *li_ifname; 00061 }; 00062 00064 enum { 00066 LI_V4MAPPED = 1, 00068 LI_CANONNAME = 2, 00070 LI_NAMEREQD = 6, 00072 LI_NUMERIC = 8, 00074 LI_DOWN = 16, 00076 LI_IFNAME = 256 00077 }; 00078 00080 enum { 00081 LI_SCOPE_HOST = 0x10, 00082 LI_SCOPE_LINK = 0x20, 00083 LI_SCOPE_SITE = 0x40, 00084 LI_SCOPE_GLOBAL = 0x80 00085 }; 00086 00088 enum { 00089 ELI_NOADDRESS = -1, 00090 ELI_MEMORY = -2, 00091 ELI_FAMILY = -3, 00092 ELI_RESOLVER = -4, 00093 ELI_SYSTEM = -5, 00094 ELI_BADHINTS = -6, 00095 ELI_NOERROR = 0 00096 }; 00097 00099 SOFIAPUBFUN int su_getlocalinfo(su_localinfo_t const *hints, 00100 su_localinfo_t **res); 00102 SOFIAPUBFUN void su_freelocalinfo(su_localinfo_t *); 00104 SOFIAPUBFUN char const *su_gli_strerror(int error); 00106 SOFIAPUBFUN su_localinfo_t *su_copylocalinfo(su_localinfo_t const *li0); 00107 00109 SOFIAPUBFUN int su_sockaddr_scope(su_sockaddr_t const *su, socklen_t sulen); 00110 00111 SOFIA_END_DECLS 00112 00113 #endif /* !defined(SU_LOCALINFO_H) */