1 /**********************************************************************
2 Freeciv - Copyright (C) 1996-2005 - Freeciv Development Team
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)
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 ***********************************************************************/
19 #endif /* __cplusplus */
24 #define SERVER_LAN_PORT 4555
25 #define SERVER_LAN_TTL 1
26 #define SERVER_LAN_VERSION 2
51 #define SPECLIST_TAG server
52 #define SPECLIST_TYPE struct server
55 #define server_list_iterate(serverlist, pserver) \
56 TYPED_LIST_ITERATE(struct server, serverlist, pserver)
57 #define server_list_iterate_end LIST_ITERATE_END
63 struct server_list
*servers
;
67 enum server_scan_type
{
68 SERVER_SCAN_LOCAL
, /* Local servers, detected through a LAN scan */
69 SERVER_SCAN_GLOBAL
, /* Global servers, read from the metaserver */
73 typedef void (*ServerScanErrorFunc
)(struct server_scan
*scan
,
76 struct server_scan
*server_scan_begin(enum server_scan_type type
,
77 ServerScanErrorFunc error_func
);
78 enum server_scan_type
server_scan_get_type(const struct server_scan
*scan
);
79 enum server_scan_status
{
80 SCAN_STATUS_ERROR
= 0,
86 enum server_scan_status
server_scan_poll(struct server_scan
*scan
);
88 server_scan_get_list(struct server_scan
*scan
);
89 void server_scan_finish(struct server_scan
*scan
);
93 #endif /* __cplusplus */
95 #endif /* FC__SERVERS_H */