Blame gio/gnetworking.h.win32

Packit ae235b
/* GIO - GLib Input, Output and Streaming Library
Packit ae235b
 *
Packit ae235b
 * Copyright (C) 2008-2011 Red Hat, Inc.
Packit ae235b
 *
Packit ae235b
 * This library is free software; you can redistribute it and/or
Packit ae235b
 * modify it under the terms of the GNU Lesser General Public
Packit ae235b
 * License as published by the Free Software Foundation; either
Packit ae235b
 * version 2.1 of the License, or (at your option) any later version.
Packit ae235b
 *
Packit ae235b
 * This library is distributed in the hope that it will be useful,
Packit ae235b
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit ae235b
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit ae235b
 * Lesser General Public License for more details.
Packit ae235b
 *
Packit ae235b
 * You should have received a copy of the GNU Lesser General Public
Packit ae235b
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
Packit ae235b
 */
Packit ae235b
Packit ae235b
#ifndef __G_NETWORKING_H__
Packit ae235b
#define __G_NETWORKING_H__
Packit ae235b
Packit ae235b
#include <glib.h>
Packit ae235b
Packit ae235b
#ifdef G_OS_WIN32
Packit ae235b
Packit ae235b
#ifndef _WIN32_WINNT
Packit ae235b
#define _WIN32_WINNT 0x0501
Packit ae235b
#endif
Packit ae235b
#include <winsock2.h>
Packit ae235b
#include <ws2tcpip.h>
Packit ae235b
#include <windns.h>
Packit ae235b
#include <mswsock.h>
Packit ae235b
#include <wspiapi.h>
Packit ae235b
#include <iphlpapi.h>
Packit ae235b
#undef interface
Packit ae235b
Packit ae235b
#else /* !G_OS_WIN32 */
Packit ae235b
Packit ae235b
#include <sys/types.h>
Packit ae235b
Packit ae235b
#include <netdb.h>
Packit ae235b
#include <netinet/in.h>
Packit ae235b
#include <netinet/tcp.h>
Packit ae235b
#include <resolv.h>
Packit ae235b
#include <sys/socket.h>
Packit ae235b
#include <sys/un.h>
Packit ae235b
#include <net/if.h>
Packit ae235b
Packit ae235b
#include <arpa/inet.h>
Packit ae235b
#include <arpa/nameser.h>
Packit ae235b
Packit ae235b
#ifndef T_SRV
Packit ae235b
#define T_SRV 33
Packit ae235b
#endif
Packit ae235b
Packit ae235b
#ifndef _PATH_RESCONF
Packit ae235b
#define _PATH_RESCONF "/etc/resolv.conf"
Packit ae235b
#endif
Packit ae235b
Packit ae235b
#ifndef CMSG_LEN
Packit ae235b
/* CMSG_LEN and CMSG_SPACE are defined by RFC 2292, but missing on
Packit ae235b
 * some older platforms.
Packit ae235b
 */
Packit ae235b
#define CMSG_LEN(len) ((size_t)CMSG_DATA((struct cmsghdr *)NULL) + (len))
Packit ae235b
Packit ae235b
/* CMSG_SPACE must add at least as much padding as CMSG_NXTHDR()
Packit ae235b
 * adds. We overestimate here.
Packit ae235b
 */
Packit ae235b
#define GLIB_ALIGN_TO_SIZEOF(len, obj) (((len) + sizeof (obj) - 1) & ~(sizeof (obj) - 1))
Packit ae235b
#define CMSG_SPACE(len) GLIB_ALIGN_TO_SIZEOF (CMSG_LEN (len), struct cmsghdr)
Packit ae235b
#endif
Packit ae235b
#endif
Packit ae235b
Packit ae235b
G_BEGIN_DECLS
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_2_36
Packit ae235b
void g_networking_init (void);
Packit ae235b
Packit ae235b
G_END_DECLS
Packit ae235b
Packit ae235b
#endif /* __G_NETWORKING_H__ */