1
1
Fork 0
mirror of https://github.com/oxen-io/lokinet synced 2023-12-14 06:53:00 +01:00

make format

This commit is contained in:
Jeff Becker 2018-07-09 08:30:01 -04:00
parent 6cb31ecb1a
commit 30c14dfda5
No known key found for this signature in database
GPG key ID: F357B3B42F6F9B05
2 changed files with 56 additions and 60 deletions

View file

@ -1,8 +1,5 @@
invisible wire protocol: invisible wire protocol version 0:
as of version 0 dtls is used, future versions will use this encrypted udp
transport protocol.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this

View file

@ -805,61 +805,60 @@ llarp_dht_context::llarp_dht_context(llarp_router *router)
parent = router; parent = router;
} }
extern "C" extern "C" {
struct llarp_dht_context *
llarp_dht_context_new(struct llarp_router *router)
{ {
struct llarp_dht_context * return new llarp_dht_context(router);
llarp_dht_context_new(struct llarp_router *router) }
{
return new llarp_dht_context(router); void
} llarp_dht_context_free(struct llarp_dht_context *ctx)
{
void delete ctx;
llarp_dht_context_free(struct llarp_dht_context *ctx) }
{
delete ctx; void
} llarp_dht_put_peer(struct llarp_dht_context *ctx, struct llarp_rc *rc)
void {
llarp_dht_put_peer(struct llarp_dht_context *ctx, struct llarp_rc *rc) llarp::dht::RCNode n(rc);
ctx->impl.nodes->PutNode(n);
{ }
llarp::dht::RCNode n(rc);
ctx->impl.nodes->PutNode(n); void
} llarp_dht_remove_peer(struct llarp_dht_context *ctx, const byte_t *id)
{
void llarp::dht::Key_t k = id;
llarp_dht_remove_peer(struct llarp_dht_context *ctx, const byte_t *id) ctx->impl.nodes->DelNode(k);
{ }
llarp::dht::Key_t k = id;
ctx->impl.nodes->DelNode(k); void
} llarp_dht_set_msg_handler(struct llarp_dht_context *ctx,
llarp_dht_msg_handler handler)
void {
llarp_dht_set_msg_handler(struct llarp_dht_context *ctx, ctx->impl.custom_handler = handler;
llarp_dht_msg_handler handler) }
{
ctx->impl.custom_handler = handler; void
} llarp_dht_allow_transit(llarp_dht_context *ctx)
{
void ctx->impl.allowTransit = true;
llarp_dht_allow_transit(llarp_dht_context *ctx) }
{
ctx->impl.allowTransit = true; void
} llarp_dht_context_start(struct llarp_dht_context *ctx, const byte_t *key)
{
void ctx->impl.Init(key, ctx->parent);
llarp_dht_context_start(struct llarp_dht_context *ctx, const byte_t *key) }
{
ctx->impl.Init(key, ctx->parent); void
} llarp_dht_lookup_router(struct llarp_dht_context *ctx,
struct llarp_router_lookup_job *job)
void {
llarp_dht_lookup_router(struct llarp_dht_context *ctx, job->dht = ctx;
struct llarp_router_lookup_job *job) job->found = false;
{ llarp_logic_queue_job(ctx->parent->logic,
job->dht = ctx; {job, &llarp::dht::Context::queue_router_lookup});
job->found = false; }
llarp_logic_queue_job(ctx->parent->logic,
{job, &llarp::dht::Context::queue_router_lookup});
}
} }