summaryrefslogtreecommitdiff
path: root/include/hybbx/networks.h
blob: b58642d571d2ff0c2b1ee91da49e1f0cc302394c (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
#ifndef HYBBX_NETWORKS_H
#define HYBBX_NETWORKS_H

#include "hybbx/config.h"
#include "hybbx/types.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
 * Connection / link adapter switches from INI `[networks]`.
 *
 * Static transport depends on instance role (see hybbx/instance.h):
 *   Main      — websocket (always on when built)
 *   Secondary — mains_proxy
 *   Proxy     — none (optional TCP transports)
 */
typedef struct hybbx_networks_config {
    /** Telnet (`transport.telnet`) — not used on Main (WebSocket only). */
    int telnet;
    /** AX.25 / packet radio — always forced off (MAX25-Stack owns RF). */
    int ax25;
    /** BayCom — always forced off (MAX25-Stack owns RF). */
    int baycom;
    /** ARDOP — always forced off (MAX25-Stack owns RF / soft-modem). */
    int ardop;
    /** CRDOP — always forced off (MAX25-Stack owns RF / soft-modem). */
    int crdop;
    /** SSH transport (`transport.ssh`). */
    int ssh;
    /** WebSocket forward-proxy (`transport.websocket`) — Main static path. */
    int websocket;
    /** Internal HBX circuit hub / attach. */
    int circuit;
    /** Main-to-Main mesh (`transport.mains_proxy`) — Secondary primary. */
    int mains_proxy;
    /** Entertain feature plugin (chess, …) — Main / standalone Main only. */
    int entertain;
} hybbx_networks_config_t;

void hybbx_networks_config_defaults(hybbx_networks_config_t *networks);

/** Load `[networks]` from an INI file. */
void hybbx_networks_config_apply(hybbx_networks_config_t *networks,
                                 const hybbx_config_t *config);

/**
 * Non-zero when @p plugin_name is the role's static core transport.
 * Ignores `[transport.*] enabled` and is started when built.
 */
int hybbx_networks_is_static_transport(const char *plugin_name);

/**
 * Non-zero when transport @p plugin_name should be started for this config.
 * Respects instance plugin allow-list and `[networks]` toggles.
 */
int hybbx_networks_transport_wanted(const char *plugin_name,
                                    const hybbx_networks_config_t *networks);

#ifdef __cplusplus
}
#endif

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

info@mode42.com