21#include <freeciv_config.h>
27#ifdef FREECIV_HAVE_NETINET_IN_H
28#include <netinet/in.h>
30#ifdef FREECIV_HAVE_SYS_SELECT_H
31#include <sys/select.h>
33#ifdef FREECIV_HAVE_SYS_SOCKET_H
34#include <sys/socket.h>
36#ifdef FREECIV_HAVE_SYS_TIME_H
39#ifdef FREECIV_HAVE_SYS_TYPES_H
42#ifdef FREECIV_HAVE_UNISTD_H
45#ifdef FREECIV_HAVE_WS2TCPIP_H
55#define FC_FD_ZERO FD_ZERO
57#define FC_FD_ZERO(p) memset((void *)(p), 0, sizeof(*(p)))
60#ifdef IPV6_ADD_MEMBERSHIP
61#define FC_IPV6_ADD_MEMBERSHIP IPV6_ADD_MEMBERSHIP
63#define FC_IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
66#ifndef FREECIV_HAVE_SOCKLEN_T
73#ifdef FREECIV_IPV6_SUPPORT
79#define SPECLIST_TAG fc_sockaddr
80#define SPECLIST_TYPE union fc_sockaddr
83#define fc_sockaddr_list_iterate(sockaddrlist, paddr) \
84 TYPED_LIST_ITERATE(union fc_sockaddr, sockaddrlist, paddr)
85#define fc_sockaddr_list_iterate_end LIST_ITERATE_END
87#ifdef FREECIV_MSWINDOWS
struct timeval fc_timeval
bool fc_inet_aton(const char *cp, struct in_addr *inp, bool addr_none_ok)
bool sockaddr_ipv6(union fc_sockaddr *addr)
struct fc_sockaddr_list * net_lookup_service(const char *name, int port, enum fc_addr_family family)
void fc_closesocket(int sock)
void sockaddr_debug(union fc_sockaddr *addr, enum log_level lvl)
int find_next_free_port(int starting_port, int highest_port, enum fc_addr_family family, char *net_interface, bool not_avail_ok)
int sockaddr_size(union fc_sockaddr *addr)
int fc_connect(int sockfd, const struct sockaddr *serv_addr, socklen_t addrlen)
int fc_readsocket(int sock, void *buf, size_t size)
int fc_writesocket(int sock, const void *buf, size_t size)
void fc_nonblock(int sockfd)
int fc_select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, fc_timeval *timeout)
fz_FILE * fc_querysocket(int sock, void *buf, size_t size)
struct sockaddr_in saddr_in4