summaryrefslogtreecommitdiff
path: root/protocols/Tox/libtox/src/toxcore/onion_client.h
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Tox/libtox/src/toxcore/onion_client.h')
-rw-r--r--protocols/Tox/libtox/src/toxcore/onion_client.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/protocols/Tox/libtox/src/toxcore/onion_client.h b/protocols/Tox/libtox/src/toxcore/onion_client.h
index 2a30005c69..23a48ef5e6 100644
--- a/protocols/Tox/libtox/src/toxcore/onion_client.h
+++ b/protocols/Tox/libtox/src/toxcore/onion_client.h
@@ -43,6 +43,8 @@
#define MAX_PATH_NODES 32
+#define GCA_MAX_DATA_LENGTH GCA_PUBLIC_ANNOUNCE_MAX_SIZE
+
/**
* If no announce response packets are received within this interval tox will
* be considered offline. We give time for a node to be pinged often enough
@@ -195,6 +197,13 @@ typedef int oniondata_handler_cb(void *object, const uint8_t *source_pubkey, con
non_null(1) nullable(3, 4)
void oniondata_registerhandler(Onion_Client *onion_c, uint8_t byte, oniondata_handler_cb *cb, void *object);
+typedef bool onion_group_announce_cb(Onion_Client *onion_c, uint32_t sendback_num, const uint8_t *data,
+ size_t data_length, void *user_data);
+
+/** Function to call when the onion gets a group announce response. */
+non_null(1) nullable(2, 3)
+void onion_group_announce_register(Onion_Client *onion_c, onion_group_announce_cb *func, void *user_data);
+
non_null()
void do_onion_client(Onion_Client *onion_c);
@@ -217,4 +226,15 @@ typedef enum Onion_Connection_Status {
non_null()
Onion_Connection_Status onion_connection_status(const Onion_Client *onion_c);
+typedef struct Onion_Friend Onion_Friend;
+
+non_null() uint16_t onion_get_friend_count(const Onion_Client *const onion_c);
+non_null() Onion_Friend *onion_get_friend(const Onion_Client *const onion_c, uint16_t friend_num);
+non_null() const uint8_t *onion_friend_get_gc_public_key(const Onion_Friend *const onion_friend);
+non_null() const uint8_t *onion_friend_get_gc_public_key_num(const Onion_Client *const onion_c, uint32_t num);
+non_null() void onion_friend_set_gc_public_key(Onion_Friend *const onion_friend, const uint8_t *public_key);
+non_null(1) nullable(2)
+void onion_friend_set_gc_data(Onion_Friend *const onion_friend, const uint8_t *gc_data, uint16_t gc_data_length);
+non_null() bool onion_friend_is_groupchat(const Onion_Friend *const onion_friend);
+
#endif