i2pd/api.h

37 lines
1.4 KiB
C
Raw Normal View History

2014-11-17 17:37:40 +00:00
#ifndef API_H__
#define API_H__
2014-11-23 16:33:58 +00:00
#include <memory>
#include <iostream>
2014-11-17 22:00:30 +00:00
#include "Identity.h"
2014-11-18 14:33:58 +00:00
#include "Destination.h"
#include "Streaming.h"
2014-11-17 22:00:30 +00:00
2014-11-17 17:37:40 +00:00
namespace i2p
{
namespace api
{
2014-11-18 14:33:58 +00:00
// initialization start and stop
void InitI2P (int argc, char* argv[], const char * appName);
void StartI2P (std::ostream * logStream = nullptr);
// write system log to logStream, if not specified to <appName>.log in application's folder
2014-11-17 19:42:45 +00:00
void StopI2P ();
2014-11-17 22:00:30 +00:00
2014-11-18 14:33:58 +00:00
// destinations
2014-12-11 18:28:37 +00:00
i2p::client::ClientDestination * CreateLocalDestination (const i2p::data::PrivateKeys& keys, bool isPublic = true,
const std::map<std::string, std::string> * params = nullptr);
i2p::client::ClientDestination * CreateLocalDestination (bool isPublic = false, i2p::data::SigningKeyType sigType = i2p::data::SIGNING_KEY_TYPE_ECDSA_SHA256_P256,
const std::map<std::string, std::string> * params = nullptr); // transient destinations usually not published
2014-12-08 16:45:13 +00:00
void DestroyLocalDestination (i2p::client::ClientDestination * dest);
2014-11-18 14:33:58 +00:00
// streams
void RequestLeaseSet (i2p::client::ClientDestination * dest, const i2p::data::IdentHash& remote);
2014-11-23 16:33:58 +00:00
std::shared_ptr<i2p::stream::Stream> CreateStream (i2p::client::ClientDestination * dest, const i2p::data::IdentHash& remote);
2014-11-18 14:33:58 +00:00
void AcceptStream (i2p::client::ClientDestination * dest, const i2p::stream::StreamingDestination::Acceptor& acceptor);
2014-11-23 16:33:58 +00:00
void DestroyStream (std::shared_ptr<i2p::stream::Stream> stream);
2014-11-17 17:37:40 +00:00
}
}
#endif