summaryrefslogtreecommitdiff
path: root/toxcore/onion.h
diff options
context:
space:
mode:
authorMarc Schütz <schuetzm@gmx.net>2014-06-13 22:55:15 +0200
committerMarc Schütz <schuetzm@gmx.net>2014-06-13 22:55:15 +0200
commit4940c4c62b6014d1f0586aa6aca7bf6e4ecfcf29 (patch)
tree7936a06cc5aec8fb6ec42c9680801a9a878d5fd7 /toxcore/onion.h
parent714b2aeaee09ca04b73cfd05eb42c0cdd57e0f57 (diff)
Const correctness for various packet callbacks
Diffstat (limited to 'toxcore/onion.h')
-rw-r--r--toxcore/onion.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/toxcore/onion.h b/toxcore/onion.h
index 13dc8f52..07d5b6d9 100644
--- a/toxcore/onion.h
+++ b/toxcore/onion.h
@@ -35,7 +35,7 @@ typedef struct {
35 Shared_Keys shared_keys_2; 35 Shared_Keys shared_keys_2;
36 Shared_Keys shared_keys_3; 36 Shared_Keys shared_keys_3;
37 37
38 int (*recv_1_function)(void *, IP_Port, uint8_t *, uint16_t); 38 int (*recv_1_function)(void *, IP_Port, const uint8_t *, uint16_t);
39 void *callback_object; 39 void *callback_object;
40} Onion; 40} Onion;
41 41
@@ -94,7 +94,7 @@ int send_onion_packet(Networking_Core *net, Onion_Path *path, IP_Port dest, uint
94 * return -1 on failure. 94 * return -1 on failure.
95 * return 0 on success. 95 * return 0 on success.
96 */ 96 */
97int send_onion_response(Networking_Core *net, IP_Port dest, uint8_t *data, uint32_t length, uint8_t *ret); 97int send_onion_response(Networking_Core *net, IP_Port dest, const uint8_t *data, uint32_t length, const uint8_t *ret);
98 98
99/* Function to handle/send received decrypted versions of the packet sent with send_onion_packet. 99/* Function to handle/send received decrypted versions of the packet sent with send_onion_packet.
100 * 100 *
@@ -106,13 +106,13 @@ int send_onion_response(Networking_Core *net, IP_Port dest, uint8_t *data, uint3
106 * Source family must be set to something else than AF_INET6 or AF_INET so that the callback gets called 106 * Source family must be set to something else than AF_INET6 or AF_INET so that the callback gets called
107 * when the response is received. 107 * when the response is received.
108 */ 108 */
109int onion_send_1(Onion *onion, uint8_t *plain, uint32_t len, IP_Port source, uint8_t *nonce); 109int onion_send_1(Onion *onion, uint8_t *plain, uint32_t len, IP_Port source, const uint8_t *nonce);
110 110
111/* Set the callback to be called when the dest ip_port doesn't have AF_INET6 or AF_INET as the family. 111/* Set the callback to be called when the dest ip_port doesn't have AF_INET6 or AF_INET as the family.
112 * 112 *
113 * Format: function(void *object, IP_Port dest, uint8_t *data, uint32_t length) 113 * Format: function(void *object, IP_Port dest, uint8_t *data, uint32_t length)
114 */ 114 */
115void set_callback_handle_recv_1(Onion *onion, int (*function)(void *, IP_Port, uint8_t *, uint16_t), void *object); 115void set_callback_handle_recv_1(Onion *onion, int (*function)(void *, IP_Port, const uint8_t *, uint16_t), void *object);
116 116
117Onion *new_onion(DHT *dht); 117Onion *new_onion(DHT *dht);
118 118