Freeciv-3.2: /fast/freeciv/nightly/S3_2/common/networking/conn_types.h Source File

Freeciv-3.2

Loading...
Searching...
No Matches
conn_types.h
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 2023 - The Freeciv 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)
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#ifndef FC__CONN_TYPES_H
14#define FC__CONN_TYPES_H
15
16#ifdef __cplusplus
17extern "C" {
18#endif /* __cplusplus */
19
20/* common/networking/ related type definitions.
21 *
22 * Like common/fc_types.h,
23 * this file serves to reduce the cross-inclusion of header files which
24 * occurs when a type which is defined in one file is needed for a function
25 * definition in another file.
26 */
27
28/* Used in the network protocol. */
29#define MAX_LEN_PACKET 4096
30#define MAX_LEN_CAPSTR 512
31#define MAX_LEN_PASSWORD 512 /* Do not change this under any circumstances */
32#define MAX_LEN_CONTENT (MAX_LEN_PACKET - 20)
33
34#define MAX_LEN_BUFFER (MAX_LEN_PACKET * 128)
35
36/* Used in network protocol. */
37#define MAX_LEN_MSG 1536
38#define MAX_LEN_ROUTE 2000 /* MAX_LEN_PACKET / 2 - header */
39
40/* Used in network protocol. */
41 enum authentication_type {
42 AUTH_LOGIN_FIRST, /* Request a password for a returning user */
43 AUTH_NEWUSER_FIRST, /* Request a password for a new user */
44 AUTH_LOGIN_RETRY, /* Inform the client to try a different password */
45 AUTH_NEWUSER_RETRY /* Inform the client to try a different [new] password */
46};
47
48/* Used in network protocol. */
49 enum report_type {
50 REPORT_WONDERS_OF_THE_WORLD,
51 REPORT_WONDERS_OF_THE_WORLD_LONG,
52 REPORT_TOP_CITIES,
53 REPORT_DEMOGRAPHIC,
54 REPORT_ACHIEVEMENTS
55};
56
57/* The size of opaque (void *) data sent in the network packet. To avoid
58 * fragmentation issues, this SHOULD NOT be larger than the standard
59 * ethernet or PPP 1500 byte frame size (with room for headers).
60 *
61 * Do not spend much time optimizing, you have no idea of the actual dynamic
62 * path characteristics between systems, such as VPNs and tunnels.
63 *
64 * Used in network protocol.
65 */
66#define ATTRIBUTE_CHUNK_SIZE (1400)
67
68#ifdef __cplusplus
69}
70#endif /* __cplusplus */
71
72#endif /* FC__CONN_TYPES_H */
report_type
report_type
Definition conn_types.h:49
REPORT_WONDERS_OF_THE_WORLD
@ REPORT_WONDERS_OF_THE_WORLD
Definition conn_types.h:50
REPORT_DEMOGRAPHIC
@ REPORT_DEMOGRAPHIC
Definition conn_types.h:53
REPORT_WONDERS_OF_THE_WORLD_LONG
@ REPORT_WONDERS_OF_THE_WORLD_LONG
Definition conn_types.h:51
REPORT_ACHIEVEMENTS
@ REPORT_ACHIEVEMENTS
Definition conn_types.h:54
REPORT_TOP_CITIES
@ REPORT_TOP_CITIES
Definition conn_types.h:52
authentication_type
authentication_type
Definition conn_types.h:41
AUTH_NEWUSER_RETRY
@ AUTH_NEWUSER_RETRY
Definition conn_types.h:45
AUTH_NEWUSER_FIRST
@ AUTH_NEWUSER_FIRST
Definition conn_types.h:43
AUTH_LOGIN_RETRY
@ AUTH_LOGIN_RETRY
Definition conn_types.h:44
AUTH_LOGIN_FIRST
@ AUTH_LOGIN_FIRST
Definition conn_types.h:42