summaryrefslogtreecommitdiff
path: root/include/hybbx/bandwidth_policy.h
diff options
context:
space:
mode:
authorinfo@mode42.com <info@mode42.com>2026-08-08 03:54:55 +0000
committerinfo@mode42.com <info@mode42.com>2026-08-08 03:54:55 +0000
commit20cb29c2f8c5c87bc590896854a20b1473ceb358 (patch)
tree2857f41513a56ad41af97b57362639298aa7f033 /include/hybbx/bandwidth_policy.h
#2
Diffstat (limited to 'include/hybbx/bandwidth_policy.h')
-rw-r--r--include/hybbx/bandwidth_policy.h35
1 files changed, 35 insertions, 0 deletions
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 */
git clone -b <branch> https://cgit.mode42.com/<repo>.git
git clone -b <branch> git://cgit.mode42.com/<repo>.git

info@mode42.com