summaryrefslogtreecommitdiff
path: root/core/net_crypto.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/net_crypto.h')
-rw-r--r--core/net_crypto.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/net_crypto.h b/core/net_crypto.h
index 135e099d..570b9373 100644
--- a/core/net_crypto.h
+++ b/core/net_crypto.h
@@ -25,6 +25,7 @@
25#define NET_CRYPTO_H 25#define NET_CRYPTO_H
26 26
27#include "Lossless_UDP.h" 27#include "Lossless_UDP.h"
28#include "DHT.h"
28 29
29#ifdef __cplusplus 30#ifdef __cplusplus
30extern "C" { 31extern "C" {
@@ -88,11 +89,10 @@ int write_cryptpacket(int crypt_connection_id, uint8_t *data, uint32_t length);
88 returns the length of the created packet on success */ 89 returns the length of the created packet on success */
89int create_request(uint8_t *packet, uint8_t * public_key, uint8_t *data, uint32_t length, uint8_t request_id); 90int create_request(uint8_t *packet, uint8_t * public_key, uint8_t *data, uint32_t length, uint8_t request_id);
90 91
91/* puts the senders public key in the request in public_key, the data from the request 92
92 in data if a friend or ping request was sent to us and returns the length of the data. 93typedef int (*cryptopacket_handler_callback)(IP_Port ip_port, uint8_t * source_pubkey, uint8_t *data, uint32_t len);
93 packet is the request packet and length is its length 94/* Function to call when request beginning with byte is received */
94 return -1 if not valid request. */ 95void cryptopacket_registerhandler(uint8_t byte, cryptopacket_handler_callback cb);
95int handle_request(uint8_t *public_key, uint8_t *data, uint8_t *packet, uint16_t length);
96 96
97/* Start a secure connection with other peer who has public_key and ip_port 97/* Start a secure connection with other peer who has public_key and ip_port
98 returns -1 if failure 98 returns -1 if failure