make it compile

pull/15/head
Jeff Becker 6 years ago
parent 085563ac2f
commit 2a8fc53ca6
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -101,6 +101,7 @@ llarp_buffer_put_uint32(llarp_buffer_t* buf, uint32_t i)
buf->cur += sizeof(uint32_t); buf->cur += sizeof(uint32_t);
return true; return true;
} }
bool bool
llarp_buffer_read_uint16(llarp_buffer_t* buf, uint16_t* i) llarp_buffer_read_uint16(llarp_buffer_t* buf, uint16_t* i)
{ {
@ -111,6 +112,16 @@ llarp_buffer_read_uint16(llarp_buffer_t* buf, uint16_t* i)
return true; return true;
} }
bool
llarp_buffer_read_uint32(llarp_buffer_t* buf, uint32_t* i)
{
if(llarp_buffer_size_left(*buf) < sizeof(uint32_t))
return false;
*i = bufbe32toh(buf->cur);
buf->cur += sizeof(uint32_t);
return true;
}
bool bool
llarp_buffer_put_uint32(llarp_buffer_t* buf, uint32_t* i) llarp_buffer_put_uint32(llarp_buffer_t* buf, uint32_t* i)
{ {

@ -185,7 +185,13 @@ namespace llarp
const byte_t* const byte_t*
ILinkLayer::TransportPubKey() const ILinkLayer::TransportPubKey() const
{ {
return llarp::seckey_topublic(m_SecretKey); return llarp::seckey_topublic(TransportSecretKey());
}
const byte_t*
ILinkLayer::TransportSecretKey() const
{
return m_SecretKey;
} }
bool bool

@ -2,7 +2,7 @@
#include <llarp/proto.h> #include <llarp/proto.h>
#include <llarp/iwp.hpp> #include <llarp/iwp.hpp>
#include <llarp/link_message.hpp> #include <llarp/link_message.hpp>
#include <llarp/link/curvecp.hpp> #include <llarp/link/utp.hpp>
#include "buffer.hpp" #include "buffer.hpp"
#include "encode.hpp" #include "encode.hpp"
@ -725,7 +725,7 @@ llarp_router::InitOutboundLink()
if(outboundLink) if(outboundLink)
return true; return true;
auto link = llarp::curvecp::NewServer(this); auto link = llarp::utp::NewServer(this);
if(!link->EnsureKeys(transport_keyfile.string().c_str())) if(!link->EnsureKeys(transport_keyfile.string().c_str()))
{ {
@ -916,7 +916,7 @@ namespace llarp
{ {
if(!StrEq(key, "*")) if(!StrEq(key, "*"))
{ {
auto server = llarp::curvecp::NewServer(self); auto server = llarp::utp::NewServer(self);
if(!server->EnsureKeys(self->transport_keyfile.string().c_str())) if(!server->EnsureKeys(self->transport_keyfile.string().c_str()))
{ {
llarp::LogError("failed to ensure keyfile ", self->transport_keyfile); llarp::LogError("failed to ensure keyfile ", self->transport_keyfile);

Loading…
Cancel
Save