]> git.meshlink.io Git - catta/blob - avahi-core/addr-util.h
b4785d7ed866d36cbd426305a2bae126c738d989
[catta] / avahi-core / addr-util.h
1 #ifndef fooaddrutilhfoo
2 #define fooaddrutilhfoo
3
4 /* $Id$ */
5
6 /***
7   This file is part of avahi.
8
9   avahi is free software; you can redistribute it and/or modify it
10   under the terms of the GNU Lesser General Public License as
11   published by the Free Software Foundation; either version 2.1 of the
12   License, or (at your option) any later version.
13
14   avahi is distributed in the hope that it will be useful, but WITHOUT
15   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
17   Public License for more details.
18
19   You should have received a copy of the GNU Lesser General Public
20   License along with avahi; if not, write to the Free Software
21   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22   USA.
23 ***/
24
25 #include <inttypes.h>
26 #include <sys/socket.h>
27
28 #include <avahi-common/cdecl.h>
29 #include <avahi-common/address.h>
30
31 AVAHI_C_DECL_BEGIN
32
33 /** Make an address structture of a sockaddr structure */
34 AvahiAddress *avahi_address_from_sockaddr(const struct sockaddr* sa, AvahiAddress *ret_addr);
35
36 /** Return the port number of a sockaddr structure (either IPv4 or IPv6) */
37 uint16_t avahi_port_from_sockaddr(const struct sockaddr* sa);
38
39 /** Check whether the specified IPv6 address is in fact an
40  * encapsulated IPv4 address, returns 1 if yes, 0 otherwise */
41 int avahi_address_is_ipv4_in_ipv6(const AvahiAddress *a);
42
43 /** Check whether the specified address is a link-local IPv4 or IPv6 address;
44  * returns 1 if yes, 0 otherwise */
45 int avahi_address_is_link_local(const AvahiAddress *a);
46
47 AVAHI_C_DECL_END
48
49 #endif