diff options
Diffstat (limited to 'include/hybbx/bandwidth_policy.h')
| -rw-r--r-- | include/hybbx/bandwidth_policy.h | 35 |
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 */ |
