make it compile on windows

pull/871/head
jeff 5 years ago
parent c69165dad3
commit ff8c167362

@ -35,11 +35,9 @@
#if !defined Linux
#include <netinet/in.h>
#endif
#if defined Linux
#include <linux/if.h>
#else
#include <net/if.h>
#endif
#if defined Linux
#include <netinet/in.h>
#elif defined(iOS)

@ -184,9 +184,9 @@ namespace llarp
CryptoLibSodium::seed_to_secretkey(llarp::SecretKey &secret,
const llarp::IdentitySecret &seed)
{
PubKey pk;
byte_t *sk = secret.data();
byte_t *pk = sk + 32;
return crypto_sign_ed25519_seed_keypair(pk, sk, seed.data()) != -1;
return crypto_sign_ed25519_seed_keypair(pk.data(), sk, seed.data()) != -1;
}
void
@ -204,9 +204,9 @@ namespace llarp
void
CryptoLibSodium::identity_keygen(llarp::SecretKey &keys)
{
PubKey pk;
byte_t *sk = keys.data();
byte_t *pk = sk + 32;
crypto_sign_keypair(pk, sk);
crypto_sign_keypair(pk.data(), sk);
}
void

@ -1,6 +1,6 @@
#ifndef LLARP_NET_NET_IF_HPP
#define LLARP_NET_NET_IF_HPP
#ifndef _WIN32
// this file is a shim include for #include <net/if.h>
// Work around for broken glibc/linux header definitions in xenial that makes
@ -23,3 +23,4 @@ if_nametoindex(const char* __ifname) __THROW;
#include <net/if.h>
#endif
#endif
#endif

@ -25,6 +25,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <tuntap.h>
#ifdef __sun
#define BSD_COMP
#define TUNSDEBUG _IOW('t', 90, int)
@ -39,6 +41,7 @@
#if defined(Linux)
#include <linux/if_tun.h>
#include <linux/if_ether.h>
#include <linux/if.h>
#else
#include <net/if.h>
@ -62,7 +65,6 @@
#include <time.h>
#include <unistd.h>
#include <tuntap.h>
int
tuntap_start(struct device *dev, int mode, int tun)
@ -380,7 +382,7 @@ tuntap_set_debug(struct device *dev, int set)
}
#ifndef Darwin
if(ioctl(dev->tun_fd, TUNSDEBUG, &set) == -1)
if(ioctl(dev->tun_fd, TUNSETDEBUG, &set) == -1)
{
switch(set)
{

Loading…
Cancel
Save