| 
									
										
										
										
											2008-12-12 13:13:55 -05:00
										 |  |  | /* GIO - GLib Input, Output and Streaming Library
 | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Copyright (C) 2008 Red Hat, Inc. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * 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 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., 59 Temple Place, Suite 330, | 
					
						
							|  |  |  |  * Boston, MA 02111-1307, USA. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef __G_NETWORKINGPRIVATE_H__
 | 
					
						
							|  |  |  | #define __G_NETWORKINGPRIVATE_H__
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifdef G_OS_WIN32
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-06-01 14:04:49 +03:00
										 |  |  | #define _WIN32_WINNT 0x0501
 | 
					
						
							| 
									
										
										
										
											2008-12-12 13:13:55 -05:00
										 |  |  | #include <winsock2.h>
 | 
					
						
							|  |  |  | #undef interface
 | 
					
						
							|  |  |  | #include <ws2tcpip.h>
 | 
					
						
							|  |  |  | #include <windns.h>
 | 
					
						
							| 
									
										
										
										
											2009-04-27 17:35:04 -04:00
										 |  |  | #include <mswsock.h>
 | 
					
						
							| 
									
										
										
										
											2008-12-12 13:13:55 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | #else /* !G_OS_WIN32 */
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-04-27 17:35:04 -04:00
										 |  |  | #include <sys/types.h>
 | 
					
						
							| 
									
										
										
										
											2008-12-12 13:13:55 -05:00
										 |  |  | #include <arpa/inet.h>
 | 
					
						
							|  |  |  | #include <arpa/nameser.h>
 | 
					
						
							| 
									
										
										
										
											2009-04-27 17:35:04 -04:00
										 |  |  | #if defined(HAVE_ARPA_NAMESER_COMPAT_H) && !defined(GETSHORT)
 | 
					
						
							| 
									
										
										
										
											2009-04-26 12:18:42 -04:00
										 |  |  | #include <arpa/nameser_compat.h>
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-04-27 17:35:04 -04:00
										 |  |  | #ifndef T_SRV
 | 
					
						
							|  |  |  | #define T_SRV 33
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-12 13:13:55 -05:00
										 |  |  | /* We're supposed to define _GNU_SOURCE to get EAI_NODATA, but that
 | 
					
						
							|  |  |  |  * won't actually work since <features.h> has already been included at | 
					
						
							|  |  |  |  * this point. So we define __USE_GNU instead. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | #define __USE_GNU
 | 
					
						
							|  |  |  | #include <netdb.h>
 | 
					
						
							|  |  |  | #undef __USE_GNU
 | 
					
						
							|  |  |  | #include <netinet/in.h>
 | 
					
						
							|  |  |  | #include <netinet/tcp.h>
 | 
					
						
							|  |  |  | #include <resolv.h>
 | 
					
						
							|  |  |  | #include <sys/socket.h>
 | 
					
						
							|  |  |  | #include <sys/un.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-08-19 12:07:53 -04:00
										 |  |  | #ifndef _PATH_RESCONF
 | 
					
						
							|  |  |  | #define _PATH_RESCONF "/etc/resolv.conf"
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-12 13:13:55 -05:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-29 12:53:47 -05:00
										 |  |  | G_BEGIN_DECLS | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | extern struct addrinfo _g_resolver_addrinfo_hints; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | GList *_g_resolver_addresses_from_addrinfo (const char       *hostname, | 
					
						
							|  |  |  | 					    struct addrinfo  *res, | 
					
						
							|  |  |  | 					    gint              gai_retval, | 
					
						
							|  |  |  | 					    GError          **error); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void   _g_resolver_address_to_sockaddr     (GInetAddress            *address, | 
					
						
							|  |  |  | 					    struct sockaddr_storage *sa, | 
					
						
							| 
									
										
										
										
											2009-12-18 10:26:09 +01:00
										 |  |  | 					    gsize                   *len); | 
					
						
							| 
									
										
										
										
											2008-12-29 12:53:47 -05:00
										 |  |  | char  *_g_resolver_name_from_nameinfo      (GInetAddress     *address, | 
					
						
							|  |  |  | 					    const gchar      *name, | 
					
						
							|  |  |  | 					    gint              gni_retval, | 
					
						
							|  |  |  | 					    GError          **error); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #if defined(G_OS_UNIX)
 | 
					
						
							|  |  |  | GList *_g_resolver_targets_from_res_query  (const gchar      *rrname, | 
					
						
							|  |  |  | 					    guchar           *answer, | 
					
						
							|  |  |  | 					    gint              len, | 
					
						
							|  |  |  | 					    gint              herr, | 
					
						
							|  |  |  | 					    GError          **error); | 
					
						
							|  |  |  | #elif defined(G_OS_WIN32)
 | 
					
						
							|  |  |  | GList *_g_resolver_targets_from_DnsQuery   (const gchar      *rrname, | 
					
						
							|  |  |  | 					    DNS_STATUS        status, | 
					
						
							|  |  |  | 					    DNS_RECORD       *results, | 
					
						
							|  |  |  | 					    GError          **error); | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | G_END_DECLS | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-12 13:13:55 -05:00
										 |  |  | #endif /* __G_NETWORKINGPRIVATE_H__ */
 |