diff options
author | irungentoo <irungentoo@gmail.com> | 2014-07-02 15:41:59 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2014-07-02 15:41:59 -0400 |
commit | 6d4fdb3597ce334d6f63437deeb1b7338bb87759 (patch) | |
tree | 7f195de1654b8bd79baf9807bd771ca17361e51d /toxcore/onion_announce.h | |
parent | d6b6ae4b48ab2387a29b0f9e4753cc57908733df (diff) | |
parent | 53d731b4f16be75a5289fd53267444abb0f732e9 (diff) |
Merge branch 'const_correctness' of https://github.com/schuetzm/ProjectTox-Core
Diffstat (limited to 'toxcore/onion_announce.h')
-rw-r--r-- | toxcore/onion_announce.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/toxcore/onion_announce.h b/toxcore/onion_announce.h index 42f63ccd..d31355e5 100644 --- a/toxcore/onion_announce.h +++ b/toxcore/onion_announce.h | |||
@@ -75,9 +75,9 @@ typedef struct { | |||
75 | * return -1 on failure. | 75 | * return -1 on failure. |
76 | * return packet length on success. | 76 | * return packet length on success. |
77 | */ | 77 | */ |
78 | int create_announce_request(uint8_t *packet, uint16_t max_packet_length, Onion_Path *path, Node_format dest, | 78 | int create_announce_request(uint8_t *packet, uint16_t max_packet_length, const Onion_Path *path, Node_format dest, |
79 | uint8_t *public_key, uint8_t *secret_key, uint8_t *ping_id, uint8_t *client_id, uint8_t *data_public_key, | 79 | const uint8_t *public_key, const uint8_t *secret_key, const uint8_t *ping_id, const uint8_t *client_id, |
80 | uint64_t sendback_data); | 80 | const uint8_t *data_public_key, uint64_t sendback_data); |
81 | 81 | ||
82 | /* Create an onion data request packet in packet of max_packet_length (recommended size ONION_MAX_PACKET_SIZE). | 82 | /* Create an onion data request packet in packet of max_packet_length (recommended size ONION_MAX_PACKET_SIZE). |
83 | * | 83 | * |
@@ -93,8 +93,9 @@ int create_announce_request(uint8_t *packet, uint16_t max_packet_length, Onion_P | |||
93 | * return -1 on failure. | 93 | * return -1 on failure. |
94 | * return 0 on success. | 94 | * return 0 on success. |
95 | */ | 95 | */ |
96 | int create_data_request(uint8_t *packet, uint16_t max_packet_length, Onion_Path *path, IP_Port dest, | 96 | int create_data_request(uint8_t *packet, uint16_t max_packet_length, const Onion_Path *path, IP_Port dest, |
97 | uint8_t *public_key, uint8_t *encrypt_public_key, uint8_t *nonce, uint8_t *data, uint16_t length); | 97 | const uint8_t *public_key, const uint8_t *encrypt_public_key, const uint8_t *nonce, const uint8_t *data, |
98 | uint16_t length); | ||
98 | 99 | ||
99 | /* Create and send an onion announce request packet. | 100 | /* Create and send an onion announce request packet. |
100 | * | 101 | * |
@@ -110,8 +111,9 @@ int create_data_request(uint8_t *packet, uint16_t max_packet_length, Onion_Path | |||
110 | * return -1 on failure. | 111 | * return -1 on failure. |
111 | * return 0 on success. | 112 | * return 0 on success. |
112 | */ | 113 | */ |
113 | int send_announce_request(Networking_Core *net, Onion_Path *path, Node_format dest, uint8_t *public_key, | 114 | int send_announce_request(Networking_Core *net, const Onion_Path *path, Node_format dest, const uint8_t *public_key, |
114 | uint8_t *secret_key, uint8_t *ping_id, uint8_t *client_id, uint8_t *data_public_key, uint64_t sendback_data); | 115 | const uint8_t *secret_key, const uint8_t *ping_id, const uint8_t *client_id, const uint8_t *data_public_key, |
116 | uint64_t sendback_data); | ||
115 | 117 | ||
116 | /* Create and send an onion data request packet. | 118 | /* Create and send an onion data request packet. |
117 | * | 119 | * |
@@ -129,8 +131,8 @@ int send_announce_request(Networking_Core *net, Onion_Path *path, Node_format de | |||
129 | * return -1 on failure. | 131 | * return -1 on failure. |
130 | * return 0 on success. | 132 | * return 0 on success. |
131 | */ | 133 | */ |
132 | int send_data_request(Networking_Core *net, Onion_Path *path, IP_Port dest, uint8_t *public_key, | 134 | int send_data_request(Networking_Core *net, const Onion_Path *path, IP_Port dest, const uint8_t *public_key, |
133 | uint8_t *encrypt_public_key, uint8_t *nonce, uint8_t *data, uint16_t length); | 135 | const uint8_t *encrypt_public_key, const uint8_t *nonce, const uint8_t *data, uint16_t length); |
134 | 136 | ||
135 | 137 | ||
136 | Onion_Announce *new_onion_announce(DHT *dht); | 138 | Onion_Announce *new_onion_announce(DHT *dht); |