clang format

pull/4/head
sachaaaaa 6 years ago
parent c7940076bf
commit 33586d385b

@ -9,73 +9,75 @@
#include <llarp/version.h>
#ifdef __cplusplus
extern "C" {
extern "C"
{
#endif
/// llarp application context for C api
struct llarp_main;
/// llarp application context for C api
struct llarp_main;
/// initialize application context and load config
struct llarp_main *
llarp_main_init(const char *fname, bool multiProcess);
/// initialize application context and load config
struct llarp_main *
llarp_main_init(const char *fname, bool multiProcess);
/// handle signal for main context
void
llarp_main_signal(struct llarp_main *ptr, int sig);
/// handle signal for main context
void
llarp_main_signal(struct llarp_main *ptr, int sig);
/// set custom dht message handler function
void
llarp_main_set_dht_handler(struct llarp_main *ptr, llarp_dht_msg_handler h);
/// set custom dht message handler function
void
llarp_main_set_dht_handler(struct llarp_main *ptr, llarp_dht_msg_handler h);
/// setup main context
int
llarp_main_setup(struct llarp_main *ptr);
/// setup main context
int
llarp_main_setup(struct llarp_main *ptr);
/// run main context
int
llarp_main_run(struct llarp_main *ptr);
/// run main context
int
llarp_main_run(struct llarp_main *ptr);
/// load nodeDB into memory
int
llarp_main_loadDatabase(struct llarp_main *ptr);
/// load nodeDB into memory
int
llarp_main_loadDatabase(struct llarp_main *ptr);
/// iterator on nodedb entries
int
llarp_main_iterateDatabase(struct llarp_main *ptr, struct llarp_nodedb_iter i);
/// iterator on nodedb entries
int
llarp_main_iterateDatabase(struct llarp_main *ptr,
struct llarp_nodedb_iter i);
/// put RC into nodeDB
bool
llarp_main_putDatabase(struct llarp_main *ptr, struct llarp_rc *rc);
/// put RC into nodeDB
bool
llarp_main_putDatabase(struct llarp_main *ptr, struct llarp_rc *rc);
/// get RC from nodeDB
struct llarp_rc *
llarp_main_getDatabase(struct llarp_main *ptr, byte_t *pk);
/// get RC from nodeDB
struct llarp_rc *
llarp_main_getDatabase(struct llarp_main *ptr, byte_t *pk);
// fwd declr
struct check_online_request;
// fwd declr
struct check_online_request;
/// check_online_request hook definition
typedef void (*check_online_request_hook_func)(struct check_online_request *);
/// check_online_request hook definition
typedef void (*check_online_request_hook_func)(struct check_online_request *);
struct check_online_request
{
struct llarp_main *ptr;
struct llarp_router_lookup_job *job;
bool online;
size_t nodes;
bool first;
check_online_request_hook_func hook;
};
/// get RC from DHT
void
llarp_main_queryDHT(struct check_online_request *request);
struct llarp_rc *
llarp_main_getLocalRC(struct llarp_main *ptr);
void
llarp_main_free(struct llarp_main *ptr);
struct check_online_request
{
struct llarp_main *ptr;
struct llarp_router_lookup_job *job;
bool online;
size_t nodes;
bool first;
check_online_request_hook_func hook;
};
/// get RC from DHT
void
llarp_main_queryDHT(struct check_online_request *request);
struct llarp_rc *
llarp_main_getLocalRC(struct llarp_main *ptr);
void
llarp_main_free(struct llarp_main *ptr);
#ifdef __cplusplus
}

@ -73,6 +73,6 @@ namespace llarp
std::ostream &out;
};
}
} // namespace llarp
#endif

@ -41,6 +41,6 @@ namespace llarp
typedef AlignedBuffer< 24 > SymmNonce;
typedef AlignedBuffer< 32 > SymmKey;
}
} // namespace llarp
#endif

@ -32,6 +32,6 @@ namespace llarp
char2int(char input);
void
HexDecode(const char* src, uint8_t* target);
}
} // namespace llarp
#endif

@ -9,6 +9,6 @@ namespace llarp
DecryptInPlace(const byte_t* symkey, const byte_t* nonce,
llarp_crypto* crypto);
};
}
} // namespace llarp
#endif

@ -75,6 +75,6 @@ namespace llarp
return true;
}
};
}
} // namespace llarp
#endif

@ -22,6 +22,6 @@ namespace llarp
bool
HandleMessage(llarp_router* router) const;
};
}
} // namespace llarp
#endif

@ -16,23 +16,23 @@ namespace llarp
struct IMessageHandler
{
virtual bool
HandlePathTransferMessage(const PathTransferMessage* msg,
llarp_router* r) = 0;
HandlePathTransferMessage(const PathTransferMessage *msg,
llarp_router *r) = 0;
virtual bool
HandleHiddenServiceData(llarp_buffer_t buf, llarp_router* r) = 0;
HandleHiddenServiceData(llarp_buffer_t buf, llarp_router *r) = 0;
virtual bool
HandlePathConfirmMessage(const PathConfirmMessage* msg,
llarp_router* r) = 0;
HandlePathConfirmMessage(const PathConfirmMessage *msg,
llarp_router *r) = 0;
virtual bool
HandlePathLatencyMessage(const PathLatencyMessage* msg,
llarp_router* r) = 0;
HandlePathLatencyMessage(const PathLatencyMessage *msg,
llarp_router *r) = 0;
virtual bool
HandleDHTMessage(const llarp::dht::IMessage* msg, llarp_router* r) = 0;
HandleDHTMessage(const llarp::dht::IMessage *msg, llarp_router *r) = 0;
};
} // namespace routing
} // namespace llarp

@ -13,6 +13,6 @@ namespace llarp
{
virtual ~IRoutingEndpoint(){};
};
}
} // namespace llarp
#endif

@ -37,6 +37,6 @@ namespace llarp
buff.sz = t.size();
return buff;
}
}
} // namespace llarp
#endif

@ -295,7 +295,7 @@ namespace llarp
configfile = fname;
return ReloadConfig();
}
}
} // namespace llarp
struct llarp_main
{

@ -6,4 +6,4 @@ namespace llarp
{
llarp::Debug("~DiscardMessage");
}
}
} // namespace llarp

@ -24,4 +24,4 @@ namespace llarp
src += 2;
}
}
}
} // namespace llarp

@ -10,7 +10,7 @@ namespace llarp
{
_glog.minlevel = lvl;
}
}
} // namespace llarp
void
cSetLogLevel(LogLevel lvl)

@ -14,7 +14,7 @@ namespace llarp
++p;
}
}
}
} // namespace llarp
void
llarp_mem_slab(struct llarp_alloc *mem, uint32_t *buf, size_t sz)

@ -459,4 +459,3 @@ llarp_nodedb_select_random_hop(struct llarp_nodedb *n, struct llarp_rc *prev,
llarp_rc_copy(result, &itr->second);
}
}

@ -82,4 +82,4 @@ namespace llarp
lram->decrypt->AsyncDecrypt(router->tp, &lram->frames[0], lram);
return true;
}
}
} // namespace llarp

@ -252,4 +252,4 @@ namespace llarp
}
done = true;
}
}
} // namespace llarp

Loading…
Cancel
Save