summaryrefslogtreecommitdiff
path: root/toxdns/toxdns.h
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2017-12-29 00:29:14 +0000
committeriphydf <iphydf@users.noreply.github.com>2017-12-29 00:32:18 +0000
commit2c8fb05f6e1631403053ef8648d5860e0ec15cc3 (patch)
tree82dd81e89f1785126067c38ffedb7060d1835aef /toxdns/toxdns.h
parentf2b6090eca42f4a364ef7517c5eec6d472e9b5f6 (diff)
Remove deprecated ToxDNS
Based on #331. Fixes #42.
Diffstat (limited to 'toxdns/toxdns.h')
-rw-r--r--toxdns/toxdns.h96
1 files changed, 0 insertions, 96 deletions
diff --git a/toxdns/toxdns.h b/toxdns/toxdns.h
deleted file mode 100644
index b280925e..00000000
--- a/toxdns/toxdns.h
+++ /dev/null
@@ -1,96 +0,0 @@
1/*
2 * Tox secure username DNS toxid resolving functions.
3 */
4
5/*
6 * Copyright © 2016-2017 The TokTok team.
7 * Copyright © 2014 Tox project.
8 *
9 * This file is part of Tox, the free peer to peer instant messenger.
10 *
11 * Tox is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation, either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * Tox is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with Tox. If not, see <http://www.gnu.org/licenses/>.
23 */
24#ifndef TOXDNS_H
25#define TOXDNS_H
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31#include <stdint.h>
32
33/* Clients are encouraged to set this as the maximum length names can have. */
34#define TOXDNS_MAX_RECOMMENDED_NAME_LENGTH 32
35
36/* How to use this api to make secure tox dns3 requests:
37 *
38 * 1. Get the public key of a server that supports tox dns3.
39 * 2. use tox_dns3_new() to create a new object to create DNS requests
40 * and handle responses for that server.
41 * 3. Use tox_generate_dns3_string() to generate a string based on the name we want to query and a request_id
42 * that must be stored somewhere for when we want to decrypt the response.
43 * 4. take the string and use it for your DNS request like this:
44 * _4haaaaipr1o3mz0bxweox541airydbovqlbju51mb4p0ebxq.rlqdj4kkisbep2ks3fj2nvtmk4daduqiueabmexqva1jc._tox.utox.org
45 * 5. The TXT in the DNS you receive should look like this:
46 * v=tox3;id=2vgcxuycbuctvauik3plsv3d3aadv4zfjfhi3thaizwxinelrvigchv0ah3qjcsx5qhmaksb2lv2hm5cwbtx0yp
47 * 6. Take the id string and use it with tox_decrypt_dns3_TXT() and the request_id corresponding to the
48 * request we stored earlier to get the Tox id returned by the DNS server.
49 */
50
51/* Create a new tox_dns3 object for server with server_public_key of size TOX_CLIENT_ID_SIZE.
52 *
53 * return Null on failure.
54 * return pointer object on success.
55 */
56void *tox_dns3_new(uint8_t *server_public_key);
57
58/* Destroy the tox dns3 object.
59 */
60void tox_dns3_kill(void *dns3_object);
61
62/* Generate a dns3 string of string_max_len used to query the dns server referred to by to
63 * dns3_object for a tox id registered to user with name of name_len.
64 *
65 * the uint32_t pointed by request_id will be set to the request id which must be passed to
66 * tox_decrypt_dns3_TXT() to correctly decode the response.
67 *
68 * This is what the string returned looks like:
69 * 4haaaaipr1o3mz0bxweox541airydbovqlbju51mb4p0ebxq.rlqdj4kkisbep2ks3fj2nvtmk4daduqiueabmexqva1jc
70 *
71 * returns length of string on success.
72 * returns -1 on failure.
73 */
74int tox_generate_dns3_string(void *dns3_object, uint8_t *string, uint16_t string_max_len, uint32_t *request_id,
75 uint8_t *name, uint8_t name_len);
76
77/* Decode and decrypt the id_record returned of length id_record_len into
78 * tox_id (needs to be at least TOX_FRIEND_ADDRESS_SIZE).
79 *
80 * request_id is the request id given by tox_generate_dns3_string() when creating the request.
81 *
82 * the id_record passed to this function should look somewhat like this:
83 * 2vgcxuycbuctvauik3plsv3d3aadv4zfjfhi3thaizwxinelrvigchv0ah3qjcsx5qhmaksb2lv2hm5cwbtx0yp
84 *
85 * returns -1 on failure.
86 * returns 0 on success.
87 *
88 */
89int tox_decrypt_dns3_TXT(void *dns3_object, uint8_t *tox_id, uint8_t *id_record, uint32_t id_record_len,
90 uint32_t request_id);
91
92#ifdef __cplusplus
93}
94#endif
95
96#endif