summaryrefslogtreecommitdiff
path: root/toxcore/network.h
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2014-04-22 20:28:40 -0400
committerirungentoo <irungentoo@gmail.com>2014-04-22 20:28:40 -0400
commit1bfe15ee88844bdbd43052b4026202cf924ad6ca (patch)
treea740f16199cf0a263447e2084dd8906028a7b268 /toxcore/network.h
parentc46ab5821d0fa8c604de52e15009e2b8da5d9c07 (diff)
Decided pretty much how the handshake would work.
Started writing the code. Astyled some files.
Diffstat (limited to 'toxcore/network.h')
-rw-r--r--toxcore/network.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/toxcore/network.h b/toxcore/network.h
index c4fe0a7b..0e79954f 100644
--- a/toxcore/network.h
+++ b/toxcore/network.h
@@ -126,6 +126,8 @@ typedef int sock_t;
126#define NET_PACKET_HANDSHAKE 16 /* Handshake packet ID. */ 126#define NET_PACKET_HANDSHAKE 16 /* Handshake packet ID. */
127#define NET_PACKET_SYNC 17 /* SYNC packet ID. */ 127#define NET_PACKET_SYNC 17 /* SYNC packet ID. */
128#define NET_PACKET_DATA 18 /* Data packet ID. */ 128#define NET_PACKET_DATA 18 /* Data packet ID. */
129#define NET_PACKET_COOKIE_REQUEST 24 /* Cookie request packet */
130#define NET_PACKET_COOKIE_RESPONSE 25 /* Cookie response packet */
129#define NET_PACKET_CRYPTO 32 /* Encrypted data packet ID. */ 131#define NET_PACKET_CRYPTO 32 /* Encrypted data packet ID. */
130#define NET_PACKET_LAN_DISCOVERY 33 /* LAN discovery packet ID. */ 132#define NET_PACKET_LAN_DISCOVERY 33 /* LAN discovery packet ID. */
131#define NET_PACKET_GROUP_CHATS 48 /* Group chats packet ID. */ 133#define NET_PACKET_GROUP_CHATS 48 /* Group chats packet ID. */
@@ -158,6 +160,11 @@ typedef int sock_t;
158#define TOX_PORTRANGE_TO 33545 160#define TOX_PORTRANGE_TO 33545
159#define TOX_PORT_DEFAULT TOX_PORTRANGE_FROM 161#define TOX_PORT_DEFAULT TOX_PORTRANGE_FROM
160 162
163/* TCP related */
164#define TCP_ONION_FAMILY (AF_INET6 + 1)
165#define TCP_INET (AF_INET6 + 2)
166#define TCP_INET6 (AF_INET6 + 3)
167
161typedef union __attribute__ ((__packed__)) 168typedef union __attribute__ ((__packed__))
162{ 169{
163 uint8_t uint8[4]; 170 uint8_t uint8[4];