]> git.meshlink.io Git - catta/blob - avahi-compat-howl/include/salt/address.h
fix avahi_netlink_new to allow multiple netlinks per process
[catta] / avahi-compat-howl / include / salt / address.h
1 #ifndef _salt_address_h
2 #define _salt_address_h
3
4 /*
5  * Copyright 2003, 2004 Porchdog Software. All rights reserved.
6  *
7  *      Redistribution and use in source and binary forms, with or without modification,
8  *      are permitted provided that the following conditions are met:
9  *
10  *              1. Redistributions of source code must retain the above copyright notice,
11  *                 this list of conditions and the following disclaimer.
12  *              2. Redistributions in binary form must reproduce the above copyright notice,
13  *                 this list of conditions and the following disclaimer in the documentation
14  *                 and/or other materials provided with the distribution.
15  *
16  *      THIS SOFTWARE IS PROVIDED BY PORCHDOG SOFTWARE ``AS IS'' AND ANY
17  *      EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18  *      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19  *      IN NO EVENT SHALL THE HOWL PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
20  *      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21  *      BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22  *      DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
23  *      OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
24  *      OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
25  *      OF THE POSSIBILITY OF SUCH DAMAGE.
26  *
27  *      The views and conclusions contained in the software and documentation are those
28  *      of the authors and should not be interpreted as representing official policies,
29  *      either expressed or implied, of Porchdog Software.
30  */
31
32
33 #include <salt/salt.h>
34
35
36 #if defined(__cplusplus)
37 extern "C"
38 {
39 #endif
40
41
42 typedef struct _sw_ipv4_address
43 {
44         sw_uint32       m_addr;
45 } sw_ipv4_address;
46
47 typedef sw_uint32 sw_saddr;
48
49
50 sw_ipv4_address HOWL_API
51 sw_ipv4_address_any(void);
52
53
54 sw_ipv4_address HOWL_API
55 sw_ipv4_address_loopback(void);
56
57
58 sw_result HOWL_API
59 sw_ipv4_address_init(
60                                 sw_ipv4_address *       self);
61
62
63 sw_result HOWL_API
64 sw_ipv4_address_init_from_saddr(
65                                 sw_ipv4_address *       self,
66                                 sw_saddr                        saddr);
67
68
69 sw_result HOWL_API
70 sw_ipv4_address_init_from_name(
71                                 sw_ipv4_address         *       self,
72                                 sw_const_string name);
73
74
75 sw_result HOWL_API
76 sw_ipv4_address_init_from_address(
77                                 sw_ipv4_address         *       self,
78                                 sw_ipv4_address                 addr);
79
80
81 sw_result HOWL_API
82 sw_ipv4_address_init_from_this_host(
83                                 sw_ipv4_address         *       self);
84
85
86 sw_result HOWL_API
87 sw_ipv4_address_fina(
88                                 sw_ipv4_address self);
89
90
91 sw_bool HOWL_API
92 sw_ipv4_address_is_any(
93                                 sw_ipv4_address self);
94
95
96 sw_saddr HOWL_API
97 sw_ipv4_address_saddr(
98                                 sw_ipv4_address self);
99
100
101 sw_string HOWL_API
102 sw_ipv4_address_name(
103                                 sw_ipv4_address self,
104                                 sw_string                       name,
105                                 sw_uint32                               len);
106
107
108 sw_result HOWL_API
109 sw_ipv4_address_decompose(
110                                 sw_ipv4_address self,
111                                 sw_uint8                        *       a1,
112                                 sw_uint8                        *       a2,
113                                 sw_uint8                        *       a3,
114                                 sw_uint8                        *       a4);
115
116
117 sw_bool HOWL_API
118 sw_ipv4_address_equals(
119                                 sw_ipv4_address self,
120                                 sw_ipv4_address addr);
121
122
123 #if defined(__cplusplus)
124 }
125 #endif
126
127
128 #endif