wip send file request

This commit is contained in:
2022-10-03 23:33:08 +02:00
parent 97a5241fad
commit 41150a0332
5 changed files with 243 additions and 32 deletions

View File

@ -20,13 +20,61 @@ struct NGC_FT1_options {
int tmp;
};
// uint16_t ?
// ffs c does not allow types
typedef enum NGC_FT1_file_kind /*: uint8_t*/ {
//INVALID = 0u,
// id:
// group (implicit)
// peer pub key + msg_id
NGC_HS1_MESSAGE_BY_ID = 1u, // history sync PoC 1
// :)
// draft for fun and profit
// id: infohash
TORRENT_V1_METAINFO,
// id: infohash
TORRENT_V2_METAINFO,
// id: sha1
TORRENT_V1_CHUNK,
// id: sha256
TORRENT_V2_CHUNK,
} NGC_FT1_file_kind;
// ========== init / kill ==========
// (see tox api)
bool NGC_FT1_init(NGC_EXT_CTX* ngc_ext_ctx, const struct NGC_FT1_options* options);
void NGC_FT1_kill(NGC_EXT_CTX* ngc_ext_ctx);
// ========== iterate ==========
void NGC_FT1_iterate(Tox *tox, NGC_FT1* ngc_hs1_ctx/*, void *user_data*/);
void NGC_FT1_iterate(Tox *tox, NGC_EXT_CTX* ngc_ext_ctx/*, void *user_data*/);
// ========== request ==========
// TODO: remove?
void NGC_FT1_request(
Tox *tox, NGC_EXT_CTX* ngc_ext_ctx,
uint32_t group_number,
NGC_FT1_file_kind file_kind,
const uint8_t* file_id,
size_t file_id_size
);
void NGC_FT1_request_private(
Tox *tox, NGC_EXT_CTX* ngc_ext_ctx,
uint32_t group_number,
uint32_t peer_number,
NGC_FT1_file_kind file_kind,
const uint8_t* file_id,
size_t file_id_size
);
// ========== peer online/offline ==========