mirror of https://github.com/PurpleI2P/i2pd.git
I2P: End-to-End encrypted and anonymous Internet
https://i2pd.website/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.6 KiB
39 lines
1.6 KiB
10 years ago
|
#ifndef API_H__
|
||
|
#define API_H__
|
||
|
|
||
10 years ago
|
#include <memory>
|
||
10 years ago
|
#include <iostream>
|
||
10 years ago
|
#include "Identity.h"
|
||
10 years ago
|
#include "Destination.h"
|
||
|
#include "Streaming.h"
|
||
10 years ago
|
|
||
10 years ago
|
namespace i2p
|
||
|
{
|
||
|
namespace api
|
||
|
{
|
||
10 years ago
|
// initialization start and stop
|
||
|
void InitI2P (int argc, char* argv[], const char * appName);
|
||
9 years ago
|
void TerminateI2P ();
|
||
9 years ago
|
void StartI2P (std::shared_ptr<std::ostream> logStream = nullptr);
|
||
10 years ago
|
// write system log to logStream, if not specified to <appName>.log in application's folder
|
||
10 years ago
|
void StopI2P ();
|
||
9 years ago
|
void RunPeerTest (); // should be called after UPnP
|
||
|
|
||
10 years ago
|
// destinations
|
||
9 years ago
|
std::shared_ptr<i2p::client::ClientDestination> CreateLocalDestination (const i2p::data::PrivateKeys& keys, bool isPublic = true,
|
||
10 years ago
|
const std::map<std::string, std::string> * params = nullptr);
|
||
9 years ago
|
std::shared_ptr<i2p::client::ClientDestination> CreateLocalDestination (bool isPublic = false, i2p::data::SigningKeyType sigType = i2p::data::SIGNING_KEY_TYPE_ECDSA_SHA256_P256,
|
||
10 years ago
|
const std::map<std::string, std::string> * params = nullptr); // transient destinations usually not published
|
||
9 years ago
|
void DestroyLocalDestination (std::shared_ptr<i2p::client::ClientDestination> dest);
|
||
10 years ago
|
|
||
|
// streams
|
||
9 years ago
|
void RequestLeaseSet (std::shared_ptr<i2p::client::ClientDestination> dest, const i2p::data::IdentHash& remote);
|
||
|
std::shared_ptr<i2p::stream::Stream> CreateStream (std::shared_ptr<i2p::client::ClientDestination> dest, const i2p::data::IdentHash& remote);
|
||
|
void AcceptStream (std::shared_ptr<i2p::client::ClientDestination> dest, const i2p::stream::StreamingDestination::Acceptor& acceptor);
|
||
10 years ago
|
void DestroyStream (std::shared_ptr<i2p::stream::Stream> stream);
|
||
10 years ago
|
}
|
||
|
}
|
||
|
|
||
|
#endif
|
||
|
|