Define per-stream automatic selection settings and diagnostic manual mode
This commit is contained in:
1 parent
0b9b395879
commit
3db2130b56
2 files changed
+27
No files matched your search
@@ -49,6 +49,13 @@ struct stream_candidate {
|
||||
uint8_t source;
|
||||
};
|
||||
|
||||
struct stream_selection_settings { uint32_t migration_confirm_ms, minimum_hold_ms, rtt_hysteresis_ms; };
|
||||
struct stream_selection_info {
|
||||
uint64_t probes_started, cycles, migrations, failures, restarts;
|
||||
unsigned candidates, probes_active, subflows, overlaps, providers;
|
||||
int automatic, protected_by_fec;
|
||||
};
|
||||
|
||||
int stream_service_init(struct UTUN_INSTANCE *inst);
|
||||
void stream_service_destroy(struct UTUN_INSTANCE *inst);
|
||||
void stream_cancel_group(struct UTUN_INSTANCE *inst, uint64_t group_id);
|
||||
@@ -61,6 +68,11 @@ int stream_publish_open(struct UTUN_INSTANCE *inst, uint64_t group_id, const str
|
||||
/* Параметры берутся из подписанного профиля источника; дубликаты локальных владельцев делят один буфер.
|
||||
* WAIT — источник ещё не объявил/не подтвердил трансляцию. Offline не создаёт ложного онлайн-кандидата. */
|
||||
int stream_subscribe_open(struct UTUN_INSTANCE *inst, uint64_t group_id, uint64_t source_id, struct STREAM_HANDLE **out);
|
||||
/* Ручные выдачи для диагностики/явного управления; режим общий для всех owners экземпляра и не смешивается с automatic. */
|
||||
int stream_subscribe_manual_open(struct UTUN_INSTANCE *inst, uint64_t group_id, uint64_t source_id, struct STREAM_HANDLE **out);
|
||||
/* По умолчанию: подтверждение улучшения 2000 мс, удержание 5000 мс, гистерезис RTT 20 мс. */
|
||||
int stream_selection_configure(struct STREAM_HANDLE *handle, const struct stream_selection_settings *settings);
|
||||
int stream_selection_get_info(const struct STREAM_HANDLE *handle, struct stream_selection_info *info);
|
||||
void stream_close(struct STREAM_HANDLE *handle);
|
||||
int stream_handle_active(const struct STREAM_HANDLE *handle);
|
||||
int stream_handle_reason(const struct STREAM_HANDLE *handle);
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
/* Один планировщик на локальный экземпляр; handles владельцев не размножают пробы/выдачи.
|
||||
* tick вызывается общим stream network timer, destroy отменяет все свои receive/probe handles. */
|
||||
#ifndef STREAM_OPTIMIZER_H
|
||||
#define STREAM_OPTIMIZER_H
|
||||
|
||||
#include "stream.h"
|
||||
|
||||
struct stream_optimizer;
|
||||
int stream_optimizer_create(struct UTUN_INSTANCE *inst, const struct stream_descriptor *descriptor, struct stream_optimizer **out);
|
||||
void stream_optimizer_destroy(struct stream_optimizer *optimizer);
|
||||
void stream_optimizer_tick(struct stream_optimizer *optimizer, struct STREAM_HANDLE *subscription, uint64_t now_ms);
|
||||
int stream_optimizer_configure(struct stream_optimizer *optimizer, const struct stream_selection_settings *settings);
|
||||
void stream_optimizer_info(struct stream_optimizer *optimizer, struct stream_selection_info *info);
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user