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
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
2017-04-19 12:04:45 +00:00
|
|
|
TR_DHT_STOPPED = 0,
|
|
|
|
TR_DHT_BROKEN = 1,
|
|
|
|
TR_DHT_POOR = 2,
|
|
|
|
TR_DHT_FIREWALLED = 3,
|
|
|
|
TR_DHT_GOOD = 4
|
2009-12-15 00:51:39 +00:00
|
|
|
};
|
2009-05-19 18:38:26 +00:00
|
|
|
|
2017-04-19 12:04:45 +00:00
|
|
|
int tr_dhtInit(tr_session*);
|
|
|
|
void tr_dhtUninit(tr_session*);
|
2017-04-20 16:02:19 +00:00
|
|
|
bool tr_dhtEnabled(tr_session const*);
|
2022-02-01 17:30:51 +00:00
|
|
|
tr_port tr_dhtPort(tr_session*);
|
2017-04-19 12:04:45 +00:00
|
|
|
int tr_dhtStatus(tr_session*, int af, int* setme_nodeCount);
|
2017-04-20 16:02:19 +00:00
|
|
|
char const* tr_dhtPrintableStatus(int status);
|
|
|
|
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*);
|
|
|
|
void tr_dhtCallback(unsigned char* buf, int buflen, struct sockaddr* from, socklen_t fromlen, void* sv);
|