Freeciv-3.1: /fast/freeciv/nightly/S3_1/utility/net_types.h Source File

Freeciv-3.1

Loading...
Searching...
No Matches
net_types.h
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14/* This header contains some upper level types related to networking.
15 * The idea is that this header can be included without need to special
16 * handling of the conflicts of definitions of lower level types that
17 * appear in netintf.h */
18
19#ifndef FC__NET_TYPES_H
20#define FC__NET_TYPES_H
21
22#ifdef __cplusplus
23extern "C" {
24#endif /* __cplusplus */
25
26/* gen_headers */
27#include "freeciv_config.h"
28
29/* Map symbolic Winsock error names to symbolic errno names.
30 * Update also set_socket_errno() when changing this. */
31#ifdef FREECIV_HAVE_WINSOCK
32#undef EINTR
33#undef EINPROGRESS
34#undef EWOULDBLOCK
35#undef ECONNRESET
36#undef ECONNREFUSED
37#undef EADDRNOTAVAIL
38#undef ETIMEDOUT
39#undef ECONNABORTED
40#undef ENOTSOCK
41#define EINTR WSAEINTR
42#define EINPROGRESS WSAEINPROGRESS
43#define EWOULDBLOCK WSAEWOULDBLOCK
44#define ECONNRESET WSAECONNRESET
45#define ECONNREFUSED WSAECONNREFUSED
46#define EADDRNOTAVAIL WSAEADDRNOTAVAIL
47#define ETIMEDOUT WSAETIMEDOUT
48#define ECONNABORTED WSAECONNABORTED
49#define ENOTSOCK WSAENOTSOCK
50#endif /* FREECIV_HAVE_WINSOCK */
51
52/* Which protocol will be used for LAN announcements */
53 enum announce_type {
54 ANNOUNCE_NONE,
55 ANNOUNCE_IPV4,
56 ANNOUNCE_IPV6
57};
58
59#define ANNOUNCE_DEFAULT ANNOUNCE_IPV4
60
61 enum fc_addr_family {
62 FC_ADDR_IPV4,
63 FC_ADDR_IPV6,
64 FC_ADDR_ANY
65};
66
67void fc_init_network(void);
68void fc_shutdown_network(void);
69
70int addr_family_for_announce_type(enum announce_type announce);
71
72#ifdef __cplusplus
73}
74#endif /* __cplusplus */
75
76#endif /* FC__NET_TYPES_H */
announce
enum announce_type announce
Definition client_main.c:147
fc_shutdown_network
void fc_shutdown_network(void)
Definition netintf.c:217
announce_type
announce_type
Definition net_types.h:53
ANNOUNCE_IPV6
@ ANNOUNCE_IPV6
Definition net_types.h:56
ANNOUNCE_IPV4
@ ANNOUNCE_IPV4
Definition net_types.h:55
ANNOUNCE_NONE
@ ANNOUNCE_NONE
Definition net_types.h:54
fc_init_network
void fc_init_network(void)
Definition netintf.c:198
addr_family_for_announce_type
int addr_family_for_announce_type(enum announce_type announce)
Definition netintf.c:685
fc_addr_family
fc_addr_family
Definition net_types.h:61
FC_ADDR_IPV4
@ FC_ADDR_IPV4
Definition net_types.h:62
FC_ADDR_IPV6
@ FC_ADDR_IPV6
Definition net_types.h:63
FC_ADDR_ANY
@ FC_ADDR_ANY
Definition net_types.h:64