diff options
author | Gregory Mullen (grayhatter) <greg@grayhatter.com> | 2016-10-26 00:21:07 -0700 |
---|---|---|
committer | Gregory Mullen (grayhatter) <greg@grayhatter.com> | 2016-11-05 15:12:04 -0700 |
commit | ee3121c3f6025562972c167d4db2e8ed38860479 (patch) | |
tree | f684588daacae09380d98a239bfb79d7fe6733af /toxcore/network.h | |
parent | 64870b6fd2646837b8d61aee712491209cec2864 (diff) |
Convert series of NET_PACKET_* defines into a typedef enum
fixup! TravisCI shorten IRC message
Diffstat (limited to 'toxcore/network.h')
-rw-r--r-- | toxcore/network.h | 52 |
1 files changed, 25 insertions, 27 deletions
diff --git a/toxcore/network.h b/toxcore/network.h index dd654b8d..3f4d77da 100644 --- a/toxcore/network.h +++ b/toxcore/network.h | |||
@@ -102,33 +102,31 @@ typedef int sock_t; | |||
102 | 102 | ||
103 | #define MAX_UDP_PACKET_SIZE 2048 | 103 | #define MAX_UDP_PACKET_SIZE 2048 |
104 | 104 | ||
105 | #define NET_PACKET_PING_REQUEST 0 /* Ping request packet ID. */ | 105 | typedef enum NET_PACKET_TYPE { |
106 | #define NET_PACKET_PING_RESPONSE 1 /* Ping response packet ID. */ | 106 | NET_PACKET_PING_REQUEST = 0, /* Ping request packet ID. */ |
107 | #define NET_PACKET_GET_NODES 2 /* Get nodes request packet ID. */ | 107 | NET_PACKET_PING_RESPONSE = 1, /* Ping response packet ID. */ |
108 | #define NET_PACKET_SEND_NODES_IPV6 4 /* Send nodes response packet ID for other addresses. */ | 108 | NET_PACKET_GET_NODES = 2, /* Get nodes request packet ID. */ |
109 | #define NET_PACKET_COOKIE_REQUEST 24 /* Cookie request packet */ | 109 | NET_PACKET_SEND_NODES_IPV6 = 4, /* Send nodes response packet ID for other addresses. */ |
110 | #define NET_PACKET_COOKIE_RESPONSE 25 /* Cookie response packet */ | 110 | NET_PACKET_COOKIE_REQUEST = 24, /* Cookie request packet */ |
111 | #define NET_PACKET_CRYPTO_HS 26 /* Crypto handshake packet */ | 111 | NET_PACKET_COOKIE_RESPONSE = 25, /* Cookie response packet */ |
112 | #define NET_PACKET_CRYPTO_DATA 27 /* Crypto data packet */ | 112 | NET_PACKET_CRYPTO_HS = 26, /* Crypto handshake packet */ |
113 | #define NET_PACKET_CRYPTO 32 /* Encrypted data packet ID. */ | 113 | NET_PACKET_CRYPTO_DATA = 27, /* Crypto data packet */ |
114 | #define NET_PACKET_LAN_DISCOVERY 33 /* LAN discovery packet ID. */ | 114 | NET_PACKET_CRYPTO = 32, /* Encrypted data packet ID. */ |
115 | 115 | NET_PACKET_LAN_DISCOVERY = 33, /* LAN discovery packet ID. */ | |
116 | /* See: docs/Prevent_Tracking.txt and onion.{c, h} */ | 116 | NET_PACKET_ONION_SEND_INITIAL = 128, |
117 | #define NET_PACKET_ONION_SEND_INITIAL 128 | 117 | NET_PACKET_ONION_SEND_1 = 129, |
118 | #define NET_PACKET_ONION_SEND_1 129 | 118 | NET_PACKET_ONION_SEND_2 = 130, |
119 | #define NET_PACKET_ONION_SEND_2 130 | 119 | NET_PACKET_ANNOUNCE_REQUEST = 131, |
120 | 120 | NET_PACKET_ANNOUNCE_RESPONSE = 132, | |
121 | #define NET_PACKET_ANNOUNCE_REQUEST 131 | 121 | NET_PACKET_ONION_DATA_REQUEST = 133, |
122 | #define NET_PACKET_ANNOUNCE_RESPONSE 132 | 122 | NET_PACKET_ONION_DATA_RESPONSE = 134, |
123 | #define NET_PACKET_ONION_DATA_REQUEST 133 | 123 | NET_PACKET_ONION_RECV_3 = 140, |
124 | #define NET_PACKET_ONION_DATA_RESPONSE 134 | 124 | NET_PACKET_ONION_RECV_2 = 141, |
125 | 125 | NET_PACKET_ONION_RECV_1 = 142, | |
126 | #define NET_PACKET_ONION_RECV_3 140 | 126 | BOOTSTRAP_INFO_PACKET_ID = 240, /* Only used for bootstrap nodes */ |
127 | #define NET_PACKET_ONION_RECV_2 141 | 127 | |
128 | #define NET_PACKET_ONION_RECV_1 142 | 128 | NET_PACKET_MAX = 255, /* This type must remain within a single uint8. */ |
129 | 129 | } NET_PACKET_TYPE; | |
130 | /* Only used for bootstrap nodes */ | ||
131 | #define BOOTSTRAP_INFO_PACKET_ID 240 | ||
132 | 130 | ||
133 | 131 | ||
134 | #define TOX_PORTRANGE_FROM 33445 | 132 | #define TOX_PORTRANGE_FROM 33445 |