From 20cb29c2f8c5c87bc590896854a20b1473ceb358 Mon Sep 17 00:00:00 2001 From: "info@mode42.com" Date: Sat, 8 Aug 2026 03:54:55 +0000 Subject: #2 --- include/hybbx/bandwidth_policy.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 include/hybbx/bandwidth_policy.h (limited to 'include/hybbx/bandwidth_policy.h') diff --git a/include/hybbx/bandwidth_policy.h b/include/hybbx/bandwidth_policy.h new file mode 100644 index 0000000..6c12296 --- /dev/null +++ b/include/hybbx/bandwidth_policy.h @@ -0,0 +1,35 @@ +#ifndef HYBBX_BANDWIDTH_POLICY_H +#define HYBBX_BANDWIDTH_POLICY_H + +/** + * Per-user bandwidth limits when a low-bandwidth circuit link is under pressure. + * Circuit (secondary) sessions are never targeted. Among users, AX.25 sessions + * are sacrificed before full-duplex TCP/telnet; within each class, newest first. + */ + +#include "hybbx/circuit_balance.h" +#include "hybbx/types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define HYBBX_BANDWIDTH_DISCONNECT_MSG "You are disconnected by bandwidth limits." + +struct hybbx_service; + +/** Logged-in telnet and packet_radio users subject to limits (not circuit links). */ +unsigned hybbx_bandwidth_policy_user_count(struct hybbx_service *service); + +/** + * Apply pause / break / cancel / resume to online users (AX.25 before TCP, then LIFO). + * Circuit (secondary) sessions are never targeted. Returns users affected. + */ +unsigned hybbx_bandwidth_policy_apply(struct hybbx_service *service, + hybbx_circuit_balance_action_t action); + +#ifdef __cplusplus +} +#endif + +#endif /* HYBBX_BANDWIDTH_POLICY_H */ -- cgit v1.3.1