Merge branch 'master' of ssh://github.com/loki-project/loki-network

This commit is contained in:
Jeff Becker 2019-05-17 07:20:33 -04:00
commit 895e5659bb
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05
3 changed files with 7 additions and 27 deletions

View File

@ -121,9 +121,7 @@ llarp_ev_udp_sendto(struct llarp_udp_io *udp, const sockaddr *to,
return ret;
}
#ifndef _WIN32
#include <string.h>
bool
llarp_ev_add_tun(struct llarp_ev_loop *loop, struct llarp_tun_io *tun)
{
@ -166,24 +164,14 @@ llarp_ev_add_tun(struct llarp_ev_loop *loop, struct llarp_tun_io *tun)
llarp::LogDebug("IfAddr: ", tun->ifaddr);
llarp::LogDebug("IfName: ", tun->ifname);
llarp::LogDebug("IfNMsk: ", tun->netmask);
#ifndef _WIN32
auto dev = loop->create_tun(tun);
tun->impl = dev;
if(dev)
{
return loop->add_ev(dev, false);
}
llarp::LogWarn("Loop could not create tun");
return false;
}
#else
// OK, now it's time to do it my way.
// we're not even going to use the existing llarp::tun
// we still use the llarp_tun_io struct
// since we still need to branch to the
// packet processing functions
bool
llarp_ev_add_tun(llarp_ev_loop *loop, llarp_tun_io *tun)
{
UNREFERENCED_PARAMETER(loop);
auto dev = new win32_tun_io(tun);
tun->impl = dev;
@ -193,11 +181,11 @@ llarp_ev_add_tun(llarp_ev_loop *loop, llarp_tun_io *tun)
dev->setup();
return dev->add_ev(); // start up tun and add to event queue
}
#endif
llarp::LogWarn("Loop could not create tun");
return false;
}
#endif
#ifndef _WIN32
bool
llarp_ev_tun_async_write(struct llarp_tun_io *tun, const llarp_buffer_t &buf)
{
@ -206,21 +194,13 @@ llarp_ev_tun_async_write(struct llarp_tun_io *tun, const llarp_buffer_t &buf)
llarp::LogWarn("packet too big, ", buf.sz, " > ", EV_WRITE_BUF_SZ);
return false;
}
#ifndef _WIN32
return static_cast< llarp::tun * >(tun->impl)->queue_write(buf.base, buf.sz);
}
#else
bool
llarp_ev_tun_async_write(struct llarp_tun_io *tun, const llarp_buffer_t &buf)
{
if(buf.sz > EV_WRITE_BUF_SZ)
{
llarp::LogWarn("packet too big, ", buf.sz, " > ", EV_WRITE_BUF_SZ);
return false;
}
return static_cast< win32_tun_io * >(tun->impl)->queue_write(buf.base,
buf.sz);
}
#endif
}
bool
llarp_tcp_conn_async_write(struct llarp_tcp_conn *conn, const llarp_buffer_t &b)

View File

@ -1,4 +1,4 @@
REM this requires some kind of cygwin toolset in $PATH
REM or just having sed(1) at a minimum
set /P RELEASE_NAME=<..\..\..\motto.txt
sed -i 's/RELEASE_CODENAME/%RELEASE_NAME%/g' ..\..\Properties\AssemblyInfo.cs
sed -i "s/RELEASE_CODENAME/%RELEASE_NAME%/g" ..\..\Properties\AssemblyInfo.cs

View File

@ -1,4 +1,4 @@
REM this requires some kind of cygwin toolset in $PATH
REM or just having sed(1) at a minimum
set /P RELEASE_NAME=<..\..\..\motto.txt
sed -i 's/%RELEASE_NAME%/RELEASE_CODENAME/g' ..\..\Properties\AssemblyInfo.cs
sed -i "s/%RELEASE_NAME%/RELEASE_CODENAME/g" ..\..\Properties\AssemblyInfo.cs