re-import missing addr functionality, make compile

pull/40/head
Ryan Tharp 6 years ago
parent 5d90cbe895
commit 1957916170

@ -492,12 +492,9 @@ set(CLIENT_SRC
include_directories(include)
# TODO: exclude this from includes and expose stuff properly for rcutil
include_directories(llarp)
<<<<<<< HEAD
#include_directories(include)
#include_directories(vendor/cppbackport-master/lib)
#include_directories(${sodium_INCLUDE_DIR})
=======
>>>>>>> 2fb8d734613b5665d789c99afd06e7223b073c2c
set(RC_EXE rcutil)
set(DNS_EXE dns)

@ -3,6 +3,7 @@
#include <string>
#include <llarp/net.h>
#include <llarp/address_info.hpp>
#include <llarp/string_view.hpp>
#include <llarp/net.hpp>
@ -43,6 +44,8 @@ namespace llarp
Addr(const std::string str, const uint16_t p_port);
Addr(string_view addr_str, string_view port_str);
bool
from_char_array(const char* str);

@ -1,6 +1,7 @@
#include <llarp/net_addr.hpp>
#include <llarp/net.hpp>
#include <llarp/string_view.hpp>
// for addrinfo
#ifndef _WIN32
@ -106,6 +107,12 @@ namespace llarp
this->port(p_port);
}
Addr::Addr(string_view addr_str, string_view port_str)
{
this->from_char_array(llarp::string_view_string(addr_str).c_str());
this->port(std::stoi(llarp::string_view_string(port_str)));
}
bool
Addr::from_char_array(const char* str)
{

Loading…
Cancel
Save