clang format

pull/16/head
Ryan Tharp 6 years ago
parent 6ba51c7cc0
commit 3138610253

@ -37,7 +37,7 @@ struct llarp_router_lookup_job
void* user;
llarp_router_lookup_handler hook;
struct llarp_dht_context* dht;
//byte_t target[PUBKEYSIZE];
// byte_t target[PUBKEYSIZE];
llarp::PubKey target;
bool found;
// make sure you initialize addr and exits

@ -46,7 +46,7 @@ struct llarp_xi
operator<<(std::ostream &out, const llarp_xi &xi)
{
char tmp[128] = {0};
if(inet_ntop(AF_INET6, (void*)&xi.address, tmp, sizeof(tmp)))
if(inet_ntop(AF_INET6, (void *)&xi.address, tmp, sizeof(tmp)))
out << std::string(tmp);
else
return out;

@ -5,7 +5,7 @@
#include <llarp/net.hpp>
#ifndef _WIN32
#include <sys/types.h> // FreeBSD needs this for uchar for ip.h
#include <sys/types.h> // FreeBSD needs this for uchar for ip.h
#include <netinet/in.h>
#include <netinet/ip.h>
#else
@ -58,27 +58,27 @@ typedef struct ip_hdr
struct ip_header
{
#if __BYTE_ORDER == __LITTLE_ENDIAN
unsigned int ihl:4;
unsigned int version:4;
unsigned int ihl : 4;
unsigned int version : 4;
#elif __BYTE_ORDER == __BIG_ENDIAN
unsigned int version:4;
unsigned int ihl:4;
unsigned int version : 4;
unsigned int ihl : 4;
#else
# error "Please fix <bits/endian.h>"
#error "Please fix <bits/endian.h>"
#endif
#if defined(__linux__)
#define ip_version version
#endif
uint8_t tos;
uint16_t tot_len;
uint16_t id;
uint16_t frag_off;
uint8_t ttl;
uint8_t protocol;
uint16_t check;
uint32_t saddr;
uint32_t daddr;
uint8_t tos;
uint16_t tot_len;
uint16_t id;
uint16_t frag_off;
uint8_t ttl;
uint8_t protocol;
uint16_t check;
uint32_t saddr;
uint32_t daddr;
};
namespace llarp

@ -202,7 +202,8 @@ extern "C"
*/
TUNTAP_EXPORT int
tuntap_set_ip(struct device *, const char * srcaddr, const char *dstaddr, int netmask);
tuntap_set_ip(struct device *, const char *srcaddr, const char *dstaddr,
int netmask);
// TUNTAP_EXPORT int tuntap_set_ip_old(struct device *, const char
// *, int);
/*TUNTAP_EXPORT int tuntap_set_ip_old(struct device *, const char

@ -51,7 +51,7 @@ namespace iwp
llarp::SymmNonce n;
// copy nonce
memcpy(n, intro->nonce, 32); // was 24 bytes
memcpy(n, intro->nonce, 32); // was 24 bytes
char ftmpN[68] = {0};
const char *hexN =
llarp::HexEncode< llarp::SymmNonce, decltype(ftmpN) >(n, ftmpN);
@ -134,7 +134,7 @@ namespace iwp
buf.sz = 32;
// was using remote_pubkey directly (use buffer wrapper? directly?)
//memcpy(intro->remote_pubkey, intro->buf + 64, 32);
// memcpy(intro->remote_pubkey, intro->buf + 64, 32);
memcpy(buf.base, intro->buf + 64, 32);
crypto->xchacha20(buf, e_K, intro->nonce);

@ -46,7 +46,7 @@ llarp_dht_lookup_router(struct llarp_dht_context *ctx,
job->dht = ctx;
job->found = false;
job->result.Clear();
//llarp_rc_clear(&job->result);
// llarp_rc_clear(&job->result);
llarp::LogError("implement me llarp_dht_lookup_router");
/*
llarp_logic_queue_job(ctx->parent->logic,

Loading…
Cancel
Save