9 #include "../inc/libchat6.h" 10 #include "../inc/lc6_helpers.h" 13 #include "../inc/lc6_debug.h" 16 #define LC6_CRYPTO_HASHLEN crypto_generichash_BYTES 17 #define LC6_CRYPTO_HASHSIGNLEN (crypto_secretbox_NONCEBYTES+crypto_box_MACBYTES+crypto_generichash_BYTES) 18 #define LC6_CRYPTO_PUBLEN crypto_kx_PUBLICKEYBYTES 19 #define LC6_CRYPTO_PRIVLEN crypto_kx_SECRETKEYBYTES 20 #define LC6_CRYPTO_RXLEN crypto_kx_SESSIONKEYBYTES 21 #define LC6_CRYPTO_TXLEN crypto_kx_SESSIONKEYBYTES 23 #define LC6_EVENT_MAXPEERS_OUT 5 24 #define LC6_EVENT_MAXPEERS_IN 5 27 unsigned char *pub_key;
28 unsigned char *priv_key;
34 unsigned char bufi[65536];
35 unsigned char bufo[65536];
41 unsigned char nickname[256];
42 unsigned char pub_key[LC6_CRYPTO_PUBLEN];
43 unsigned char priv_key[LC6_CRYPTO_PRIVLEN];
50 unsigned char nickname[256];
51 unsigned char pub_key[LC6_CRYPTO_PUBLEN];
52 unsigned char key_rx[LC6_CRYPTO_RXLEN];
53 unsigned char key_tx[LC6_CRYPTO_TXLEN];
69 enum LC6_MSG_TYPE_ENUM {
70 LC6_MSG_TYPE_CLIENT_ONLINE,
71 LC6_MSG_TYPE_CLIENT_UPDATE,
72 LC6_MSG_TYPE_CLIENT_OFFLINE,
73 LC6_MSG_TYPE_KEEPALIVE_REQUEST,
74 LC6_MSG_TYPE_KEEPALIVE_RESPONSE,
75 LC6_MSG_TYPE_FRIEND_REQUEST,
76 LC6_MSG_TYPE_FRIEND_RESPONSE,
77 LC6_MSG_TYPE_MESSAGE_SEND,
78 LC6_MSG_TYPE_MESSAGE_RECV,
79 LC6_MSG_TYPE_MESSAGE_READ,
80 LC6_MSG_TYPE_NEIGHBOURS_REQUEST,
81 LC6_MSG_TYPE_NEIGHBOURS_RESPONSE
84 enum LC6_MSG_TLV_ENUM {
95 enum LC6_MSG_TLV_TYPE_ENUM {
96 LC6_MSG_TLV_TYPE_UTF8,
97 LC6_MSG_TLV_TYPE_BINARY,
98 LC6_MSG_TLV_TYPE_INTEGER,
99 LC6_MSG_TLV_TYPE_UUID,
100 LC6_MSG_TLV_TYPE_IPPORT
104 #define LC6_CONFIG_BOOTSTRAP "bootstrap.bin" 105 #define LC6_CONFIG_USER "user.bin" 106 #define LC6_CONFIG_FRIEND "friends.bin" 107 #define LC6_CONFIG_MAXLEN 50 113 unsigned char inet6[16];
120 uint64_t last_contact;
126 char path[MAXPATHLEN-LC6_CONFIG_MAXLEN];
127 LIBCHAT_CB *callback;
135 extern int LC6_MSG_TLV_TYPE_INT[8];
136 extern unsigned char LC6_MSG_TYPE_STR[13][30];
137 extern unsigned char LC6_MSG_TLV_STR[8][20];
Definition: lc6_common.h:109
Definition: lc6_common.h:57
Definition: lc6_common.h:31
Definition: lc6_common.h:125
Definition: lc6_common.h:117
Definition: lc6_common.h:111
Definition: lc6_common.h:63
Definition: lc6_common.h:38
Definition: lc6_common.h:47
Definition: lc6_common.h:26