util: str_list_unique() bugfix
[sfrench/samba-autobuild/.git] / lib / util / util_net.h
1 /* 
2    Unix SMB/CIFS implementation.
3    Utility functions for Samba
4    Copyright (C) Andrew Tridgell 1992-1999
5    Copyright (C) Jelmer Vernooij 2005
6     
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 3 of the License, or
10    (at your option) any later version.
11    
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16    
17    You should have received a copy of the GNU General Public License
18    along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #ifndef _SAMBA_UTIL_NET_H_
22 #define _SAMBA_UTIL_NET_H_
23
24 #include "system/network.h"
25
26 /* The following definitions come from lib/util/util_net.c  */
27
28 void zero_sockaddr(struct sockaddr_storage *pss);
29
30 bool interpret_string_addr_internal(struct addrinfo **ppres,
31                                     const char *str, int flags);
32
33 bool interpret_string_addr(struct sockaddr_storage *pss,
34                            const char *str,
35                            int flags);
36
37 /*******************************************************************
38  Map a text hostname or IP address (IPv4 or IPv6) into a
39  struct sockaddr_storage. Version that prefers IPv4.
40 ******************************************************************/
41
42 bool interpret_string_addr_prefer_ipv4(struct sockaddr_storage *pss,
43                                        const char *str,
44                                        int flags);
45
46 #endif /* _SAMBA_UTIL_NET_H_ */