2022-01-20 18:27:56 +00:00
|
|
|
// This file Copyright © 2009-2010 Juliusz Chroboczek.
|
|
|
|
// It may be used under the MIT (SPDX: MIT) license.
|
|
|
|
// License text can be found in the licenses/ folder.
|
2009-05-19 18:38:26 +00:00
|
|
|
|
2017-11-14 20:21:28 +00:00
|
|
|
#pragma once
|
|
|
|
|
2009-12-15 00:51:39 +00:00
|
|
|
#ifndef __TRANSMISSION__
|
2017-04-19 12:04:45 +00:00
|
|
|
#error only libtransmission should #include this header.
|
2009-12-15 00:51:39 +00:00
|
|
|
#endif
|
|
|
|
|
2022-09-29 14:12:33 +00:00
|
|
|
#include <optional>
|
|
|
|
|
2022-04-25 01:49:52 +00:00
|
|
|
#include "transmission.h"
|
|
|
|
|
2022-07-09 23:44:20 +00:00
|
|
|
#include "net.h" // tr_port
|
2022-04-25 01:49:52 +00:00
|
|
|
|
2017-04-19 12:04:45 +00:00
|
|
|
int tr_dhtInit(tr_session*);
|
2022-09-29 14:12:33 +00:00
|
|
|
void tr_dhtUninit(tr_session const*);
|
2017-04-20 16:02:19 +00:00
|
|
|
bool tr_dhtEnabled(tr_session const*);
|
2022-09-29 14:12:33 +00:00
|
|
|
std::optional<tr_port> tr_dhtPort(tr_session const*);
|
|
|
|
bool tr_dhtAddNode(tr_session*, tr_address const&, tr_port, bool bootstrap);
|
2017-04-19 12:04:45 +00:00
|
|
|
void tr_dhtUpkeep(tr_session*);
|
2022-09-29 14:12:33 +00:00
|
|
|
void tr_dhtCallback(tr_session*, unsigned char* buf, int buflen, struct sockaddr* from, socklen_t fromlen);
|