Files
utun2/src/stream/stream_priv.h
T

27 lines
1.5 KiB
C

/* Внутренний вход проверенного DATA-dispatcher: авторизация пира/handle/пути делается сетевым протоколом.
* Подпись источника проверяется кольцом. Отсутствие локальной подписки отсекается до crypto/FEC.
* Внешний frontend использует stream.h, а не прямую вставку сетевых блоков. */
#ifndef STREAM_PRIV_H
#define STREAM_PRIV_H
#include "stream.h"
#include "stream_network.h"
struct stream_local {
struct stream_descriptor descriptor;
struct stream_buffer *buffer;
uint64_t start, last;
int anchored, publisher, finished;
const uint8_t *end;
};
/* Заимствованные буфер/END действуют только до следующего callback/мутации сервиса. */
struct stream_network *stream_network_get(struct UTUN_INSTANCE *inst);
int stream_local_get(struct UTUN_INSTANCE *inst, const struct stream_descriptor *key, struct stream_local *local);
int stream_handle_context(struct STREAM_HANDLE *handle, struct UTUN_INSTANCE **inst, struct stream_descriptor *descriptor);
int stream_ingest_path(struct UTUN_INSTANCE *inst, const uint8_t *wire, size_t length, const struct stream_path *path);
int stream_ingest_end(struct UTUN_INSTANCE *inst, const struct stream_descriptor *key, const uint8_t *wire, size_t length);
int stream_ingest_block(struct UTUN_INSTANCE *inst, const uint8_t *wire, size_t length);
#endif