summaryrefslogtreecommitdiff
path: root/include/hybbx/limits.h
blob: 081af1ff144bf7603c28f4e8bb094b05eb48d3e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#ifndef HYBBX_LIMITS_H
#define HYBBX_LIMITS_H

#include "hybbx/traffic.h"

/** INI parser line buffer size. */
#define HYBBX_CONFIG_LINE_MAX 512

/** Maximum path length for files and directories. */
#define HYBBX_PATH_MAX 512

/** Relative paths under the HyBBX install root (see @ref HYBBX_ENV_ROOT). */
#define HYBBX_DIR_DATA "data"
#define HYBBX_DIR_TEXT "text"
#define HYBBX_DIR_LOGS "logs"
#define HYBBX_FILE_CONFIG "hybbx.ini"
#define HYBBX_FILE_COMMANDS "commands.yaml"
#define HYBBX_FILE_AREAS    "areas.yaml"
#define HYBBX_DAEMON_BINARY "hybbxd"

/** Command registry (share/commands.yaml + share/areas.yaml). */
#define HYBBX_COMMANDS_MAX             64u
#define HYBBX_AREAS_MAX                12u
#define HYBBX_AREAS_SUB_MAX             4u
#define HYBBX_COMMANDS_VERBS_PER_GROUP 16u
#define HYBBX_COMMANDS_ALIASES_MAX     48u
#define HYBBX_COMMANDS_ALIAS_PER      8u
#define HYBBX_COMMANDS_ALIAS_LINES    8u
#define HYBBX_MENU_LEVELS_MAX           5u
#define HYBBX_MENU_AREAS_PER_LEVEL     12u
#define HYBBX_RIGHTS_TARGET_RULES_MAX  16u
#define HYBBX_RIGHTS_PROMOTE_RULES_MAX  8u
#define HYBBX_RIGHTS_DEMOTE_RULES_MAX   4u
#define HYBBX_COMMANDS_HELP_LINE_MAX  96u
#define HYBBX_COMMANDS_HEADER_MAX     128u

/** Environment variable: absolute path to the HyBBX install directory. */
#define HYBBX_ENV_ROOT "HYBBX_ROOT"

#define HYBBX_CONFIG_SECTION_MAX 128
#define HYBBX_CONFIG_KEY_MAX 128
#define HYBBX_CONFIG_VALUE_MAX 256

/** Maximum tokens per HyBBX command line (verb + args). */
#define HYBBX_CMD_TOKEN_MAX 16

#define HYBBX_CMD_VERB_MAX 32

/** Maximum registered transport plugins. */
#define HYBBX_MAX_PLUGINS 16

/** Maximum length of the global session prompt (empty = no visible prompt). */
#define HYBBX_PROMPT_MAX 32

/** Maximum single allocation for duplicated strings (bytes). */
#define HYBBX_ALLOC_MAX (256u * 1024u)

/** Default maximum simultaneous online sessions (guests included). */
#define HYBBX_DEFAULT_MAX_ONLINE 35u

/** Maximum concurrent HBX circuit links (secondaries) on Main. */
#define HYBBX_CIRCUIT_MAX_LINKS 16u

/** Default [circuit] max_links when not set in INI. */
#define HYBBX_CIRCUIT_DEFAULT_MAX_LINKS 8u

/** Maximum concurrent TNC devices in one packet_radio transport. */
#define HYBBX_PACKET_RADIO_MAX_INSTANCES 8u

/** Separates multiple INI sections in one packet_radio start config. */
#define HYBBX_PACKET_RADIO_INSTANCE_SEP '\x1e'

/** Maximum concurrent BayCom modems in one baycom transport. */
#define HYBBX_BAYCOM_MAX_INSTANCES 4u

/** Separates multiple INI sections in one baycom start config. */
#define HYBBX_BAYCOM_INSTANCE_SEP '\x1e'

/** Separates multiple INI sections in one mains_proxy start config. */
#define HYBBX_MAINS_PROXY_INSTANCE_SEP '\x1e'

/** Default guest session lifetime before auto-disconnect (minutes). */
#define HYBBX_DEFAULT_GUEST_TIMEOUT_MINUTES 30u

/** Command history depth for interactive line editors. */
#define HYBBX_HISTORY_MAX 25u

/** AX.25 auto-beacon minimum interval (seconds); INI may only increase this. */
#define HYBBX_BROADCAST_AX25_INTERVAL_MIN_SEC 900u

/** Per-link minimum between any AX.25 broadcast TX (manual or auto). */
#define HYBBX_BROADCAST_AX25_LINK_MIN_SEC 900u

/** RF channel must be idle this long before an auto AX.25 beacon may TX. */
#define HYBBX_BROADCAST_AX25_BAND_IDLE_SEC 180u

/** Minimum pause between successive link TX in one broadcast (seconds). */
#define HYBBX_BROADCAST_AX25_LINK_GAP_SEC 180u

/** Retry delay when a sequential broadcast step is deferred (band busy, etc.). */
#define HYBBX_BROADCAST_AX25_DEFER_RETRY_SEC 30u

/** Default max25d TCP listen port (MAX25 max25d.ini.example). */
#define HYBBX_MAX25_DEFAULT_PORT 7325u

/** Default TCP connect timeout for max25d reachability probe (ms). */
#define HYBBX_MAX25_PROBE_TIMEOUT_MS 3000u

/** Wait up to this long for max25d when [max25] check=yes (ms). */
#define HYBBX_MAX25_PROBE_WAIT_MS 120000u

/** AX.25 on-air payload cap (1200 baud; keep UI frames short). */
#define HYBBX_BROADCAST_AX25_MESSAGE_MAX 48u

/** SQLite fallback copy suffix (see `[storage] backup_path`). */
#define HYBBX_STORAGE_BACKUP_SUFFIX ".flb"

/** Default seconds between SQLite DB fallback copies. */
#define HYBBX_STORAGE_BACKUP_INTERVAL_DEFAULT_SEC 300u

/** [security] defaults — short cool-down bans (seconds). */
#define HYBBX_SECURITY_DEFAULT_MAXRETRY 5u
#define HYBBX_SECURITY_DEFAULT_FINDTIME_SEC 600u
#define HYBBX_SECURITY_DEFAULT_BANTIME_SEC 600u
/** Abuse (excessive spam/flood) — higher bar than login failures; no ban for normal use. */
#define HYBBX_SECURITY_DEFAULT_ABUSE_MAXRETRY 30u
#define HYBBX_SECURITY_DEFAULT_ABUSE_FINDTIME_SEC 600u
#define HYBBX_SECURITY_DEFAULT_RATE_LIMIT 30u
#define HYBBX_SECURITY_DEFAULT_RATE_WINDOW_SEC 60u
#define HYBBX_SECURITY_BAN_MAX 256u
#define HYBBX_SECURITY_TRACK_MAX 512u

/** AX.25 CALL-SSID or HBX link_id (same ban table). */
#define HYBBX_CALLID_MAX 64u

#endif /* HYBBX_LIMITS_H */
git clone -b <branch> https://cgit.mode42.com/<repo>.git
git clone -b <branch> git://cgit.mode42.com/<repo>.git

info@mode42.com