Fix style in some header files.

* Enums must by typedef'd.
* Comments at end of `#define` must be `//` comments.
* Typedef structs must not be anonymous.
* `;` at the end of a `#define` is invalid.
* Callback typedefs must list their parameter names.
* No nested structs.
* No inline use of function pointer types. Only typedef'd callback types
  are allowed.
* Enum types are spelled in Camelsnake_Case.
* The argument to `#error` must be a string literal.
This commit is contained in:
iphydf 2018-07-09 17:19:41 +00:00
parent 0b7e29e019
commit 37f8f566d5
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9
9 changed files with 108 additions and 99 deletions

View File

@ -44,10 +44,10 @@
#define FRIEND_ADDRESS_SIZE (CRYPTO_PUBLIC_KEY_SIZE + sizeof(uint32_t) + sizeof(uint16_t))
enum {
typedef enum Message_Type {
MESSAGE_NORMAL,
MESSAGE_ACTION
};
} Message_Type;
/* NOTE: Packet ids below 24 must never be used. */
#define PACKET_ID_ONLINE 24
@ -57,7 +57,7 @@ enum {
#define PACKET_ID_USERSTATUS 50
#define PACKET_ID_TYPING 51
#define PACKET_ID_MESSAGE 64
#define PACKET_ID_ACTION (PACKET_ID_MESSAGE + MESSAGE_ACTION) /* 65 */
#define PACKET_ID_ACTION (PACKET_ID_MESSAGE + MESSAGE_ACTION) // 65
#define PACKET_ID_MSI 69
#define PACKET_ID_FILE_SENDREQUEST 80
#define PACKET_ID_FILE_CONTROL 81
@ -71,9 +71,9 @@ enum {
/* All packets starting with a byte in this range can be used for anything. */
#define PACKET_ID_LOSSLESS_RANGE_START 160
#define PACKET_ID_LOSSLESS_RANGE_SIZE 32
#define PACKET_LOSSY_AV_RESERVED 8 /* Number of lossy packet types at start of range reserved for A/V. */
#define PACKET_LOSSY_AV_RESERVED 8 // Number of lossy packet types at start of range reserved for A/V.
typedef struct {
typedef struct Messenger_Options {
bool ipv6enabled;
bool udp_disabled;
TCP_Proxy_Info proxy_info;
@ -95,18 +95,18 @@ struct Receipts {
};
/* Status definitions. */
enum {
typedef enum Friend_Status {
NOFRIEND,
FRIEND_ADDED,
FRIEND_REQUESTED,
FRIEND_CONFIRMED,
FRIEND_ONLINE,
};
} Friend_Status;
/* Errors for m_addfriend
* FAERR - Friend Add Error
*/
enum {
typedef enum Friend_Add_Error {
FAERR_TOOLONG = -1,
FAERR_NOMESSAGE = -2,
FAERR_OWNKEY = -3,
@ -114,24 +114,24 @@ enum {
FAERR_BADCHECKSUM = -6,
FAERR_SETNEWNOSPAM = -7,
FAERR_NOMEM = -8
};
} Friend_Add_Error;
/* Default start timeout in seconds between friend requests. */
#define FRIENDREQUEST_TIMEOUT 5;
#define FRIENDREQUEST_TIMEOUT 5
enum {
typedef enum Connection_Status {
CONNECTION_NONE,
CONNECTION_TCP,
CONNECTION_UDP,
CONNECTION_UNKNOWN
};
} Connection_Status;
/* USERSTATUS -
* Represents userstatuses someone can have.
*/
typedef enum {
typedef enum Userstatus {
USERSTATUS_NONE,
USERSTATUS_AWAY,
USERSTATUS_BUSY,
@ -150,57 +150,76 @@ struct File_Transfers {
unsigned int slots_allocated; /* number of slots allocated to this transfer. */
uint8_t id[FILE_ID_LENGTH];
};
enum {
typedef enum Filestatus {
FILESTATUS_NONE,
FILESTATUS_NOT_ACCEPTED,
FILESTATUS_TRANSFERRING,
//FILESTATUS_BROKEN,
// FILESTATUS_BROKEN,
FILESTATUS_FINISHED
};
} Filestatus;
enum {
typedef enum File_Pause {
FILE_PAUSE_NOT,
FILE_PAUSE_US,
FILE_PAUSE_OTHER,
FILE_PAUSE_BOTH
};
} File_Pause;
enum {
typedef enum Filecontrol {
FILECONTROL_ACCEPT,
FILECONTROL_PAUSE,
FILECONTROL_KILL,
FILECONTROL_SEEK
};
} Filecontrol;
enum {
typedef enum Filekind {
FILEKIND_DATA,
FILEKIND_AVATAR
};
} Filekind;
typedef struct Messenger Messenger;
typedef void m_self_connection_status_cb(Messenger *, unsigned int, void *);
typedef void m_friend_status_cb(Messenger *, uint32_t, unsigned int, void *);
typedef void m_friend_connection_status_cb(Messenger *, uint32_t, unsigned int, void *);
typedef void m_friend_message_cb(Messenger *, uint32_t, unsigned int, const uint8_t *, size_t, void *);
typedef void m_file_recv_control_cb(Messenger *, uint32_t, uint32_t, unsigned int, void *);
typedef void m_friend_request_cb(Messenger *, const uint8_t *, const uint8_t *, size_t, void *);
typedef void m_friend_name_cb(Messenger *m, uint32_t, const uint8_t *, size_t, void *);
typedef void m_friend_status_message_cb(Messenger *m, uint32_t, const uint8_t *, size_t, void *);
typedef void m_friend_typing_cb(Messenger *m, uint32_t, bool, void *);
typedef void m_friend_read_receipt_cb(Messenger *m, uint32_t, uint32_t, void *);
typedef void m_file_recv_cb(Messenger *m, uint32_t, uint32_t, uint32_t, uint64_t, const uint8_t *, size_t, void *);
typedef void m_file_chunk_request_cb(Messenger *m, uint32_t, uint32_t, uint64_t, size_t, void *);
typedef void m_file_recv_chunk_cb(Messenger *m, uint32_t, uint32_t, uint64_t, const uint8_t *, size_t, void *);
typedef void m_friend_lossy_packet_cb(Messenger *m, uint32_t, const uint8_t *, size_t, void *);
typedef void m_friend_lossless_packet_cb(Messenger *m, uint32_t, const uint8_t *, size_t, void *);
typedef void m_friend_connectionstatuschange_internal_cb(Messenger *m, uint32_t, uint8_t, void *);
typedef void m_conference_invite_cb(Messenger *m, uint32_t, const uint8_t *, uint16_t, void *);
typedef void m_msi_packet_cb(Messenger *m, uint32_t, const uint8_t *, uint16_t, void *);
typedef void m_self_connection_status_cb(Messenger *m, unsigned int connection_status, void *user_data);
typedef void m_friend_status_cb(Messenger *m, uint32_t friend_number, unsigned int status, void *user_data);
typedef void m_friend_connection_status_cb(Messenger *m, uint32_t friend_number, unsigned int connection_status,
void *user_data);
typedef void m_friend_message_cb(Messenger *m, uint32_t friend_number, unsigned int message_type,
const uint8_t *message, size_t length, void *user_data);
typedef void m_file_recv_control_cb(Messenger *m, uint32_t friend_number, uint32_t file_number, unsigned int control,
void *user_data);
typedef void m_friend_request_cb(Messenger *m, const uint8_t *public_key, const uint8_t *message, size_t length,
void *user_data);
typedef void m_friend_name_cb(Messenger *m, uint32_t friend_number, const uint8_t *name, size_t length,
void *user_data);
typedef void m_friend_status_message_cb(Messenger *m, uint32_t friend_number, const uint8_t *message, size_t length,
void *user_data);
typedef void m_friend_typing_cb(Messenger *m, uint32_t friend_number, bool is_typing, void *user_data);
typedef void m_friend_read_receipt_cb(Messenger *m, uint32_t friend_number, uint32_t message_id, void *user_data);
typedef void m_file_recv_cb(Messenger *m, uint32_t friend_number, uint32_t file_number, uint32_t kind,
uint64_t file_size, const uint8_t *filename, size_t filename_length, void *user_data);
typedef void m_file_chunk_request_cb(Messenger *m, uint32_t friend_number, uint32_t file_number, uint64_t position,
size_t length, void *user_data);
typedef void m_file_recv_chunk_cb(Messenger *m, uint32_t friend_number, uint32_t file_number, uint64_t position,
const uint8_t *data, size_t length, void *user_data);
typedef void m_friend_lossy_packet_cb(Messenger *m, uint32_t friend_number, const uint8_t *data, size_t length,
void *user_data);
typedef void m_friend_lossless_packet_cb(Messenger *m, uint32_t friend_number, const uint8_t *data, size_t length,
void *user_data);
typedef void m_friend_connectionstatuschange_internal_cb(Messenger *m, uint32_t friend_number,
uint8_t connection_status, void *user_data);
typedef void m_conference_invite_cb(Messenger *m, uint32_t friend_number, const uint8_t *cookie, uint16_t length,
void *user_data);
typedef void m_msi_packet_cb(Messenger *m, uint32_t friend_number, const uint8_t *data, uint16_t length,
void *user_data);
typedef int m_lossy_rtp_packet_cb(Messenger *m, uint32_t friendnumber, const uint8_t *data, uint16_t len, void *object);
typedef struct {
typedef struct RTP_Packet_Handler {
m_lossy_rtp_packet_cb *function;
void *object;
} RTP_Packet_Handler;
typedef struct Friend {
uint8_t real_pk[CRYPTO_PUBLIC_KEY_SIZE];
int friendcon_id;
@ -228,10 +247,7 @@ typedef struct {
uint32_t num_sending_files;
struct File_Transfers file_receiving[MAX_CONCURRENT_FILE_PIPES];
struct {
m_lossy_rtp_packet_cb *function;
void *object;
} lossy_rtp_packethandlers[PACKET_LOSSY_AV_RESERVED];
RTP_Packet_Handler lossy_rtp_packethandlers[PACKET_LOSSY_AV_RESERVED];
struct Receipts *receipts_start;
struct Receipts *receipts_end;
@ -494,37 +510,35 @@ void m_callback_log(Messenger *m, logger_cb *function, void *context, void *user
/* Set the function that will be executed when a friend request is received.
* Function format is function(uint8_t * public_key, uint8_t * data, size_t length)
*/
void m_callback_friendrequest(Messenger *m, void (*function)(Messenger *m, const uint8_t *, const uint8_t *, size_t,
void *));
void m_callback_friendrequest(Messenger *m, m_friend_request_cb *function);
/* Set the function that will be executed when a message from a friend is received.
* Function format is: function(uint32_t friendnumber, unsigned int type, uint8_t * message, uint32_t length)
*/
void m_callback_friendmessage(Messenger *m, void (*function)(Messenger *m, uint32_t, unsigned int, const uint8_t *,
size_t, void *));
void m_callback_friendmessage(Messenger *m, m_friend_message_cb *function);
/* Set the callback for name changes.
* Function(uint32_t friendnumber, uint8_t *newname, size_t length)
* You are not responsible for freeing newname.
*/
void m_callback_namechange(Messenger *m, void (*function)(Messenger *m, uint32_t, const uint8_t *, size_t, void *));
void m_callback_namechange(Messenger *m, m_friend_name_cb *function);
/* Set the callback for status message changes.
* Function(uint32_t friendnumber, uint8_t *newstatus, size_t length)
*
* You are not responsible for freeing newstatus
*/
void m_callback_statusmessage(Messenger *m, void (*function)(Messenger *m, uint32_t, const uint8_t *, size_t, void *));
void m_callback_statusmessage(Messenger *m, m_friend_status_message_cb *function);
/* Set the callback for status type changes.
* Function(uint32_t friendnumber, Userstatus kind)
*/
void m_callback_userstatus(Messenger *m, void (*function)(Messenger *m, uint32_t, unsigned int, void *));
void m_callback_userstatus(Messenger *m, m_friend_status_cb *function);
/* Set the callback for typing changes.
* Function(uint32_t friendnumber, uint8_t is_typing)
*/
void m_callback_typingchange(Messenger *m, void(*function)(Messenger *m, uint32_t, bool, void *));
void m_callback_typingchange(Messenger *m, m_friend_typing_cb *function);
/* Set the callback for read receipts.
* Function(uint32_t friendnumber, uint32_t receipt)
@ -535,7 +549,7 @@ void m_callback_typingchange(Messenger *m, void(*function)(Messenger *m, uint32_
* Since core doesn't track ids for you, receipt may not correspond to any message.
* In that case, you should discard it.
*/
void m_callback_read_receipt(Messenger *m, void (*function)(Messenger *m, uint32_t, uint32_t, void *));
void m_callback_read_receipt(Messenger *m, m_friend_read_receipt_cb *function);
/* Set the callback for connection status changes.
* function(uint32_t friendnumber, uint8_t status)
@ -548,17 +562,17 @@ void m_callback_read_receipt(Messenger *m, void (*function)(Messenger *m, uint32
* being previously online" part.
* It's assumed that when adding friends, their connection status is offline.
*/
void m_callback_connectionstatus(Messenger *m, void (*function)(Messenger *m, uint32_t, unsigned int, void *));
void m_callback_connectionstatus(Messenger *m, m_friend_connection_status_cb *function);
/* Same as previous but for internal A/V core usage only */
void m_callback_connectionstatus_internal_av(Messenger *m, void (*function)(Messenger *m, uint32_t, uint8_t, void *),
void m_callback_connectionstatus_internal_av(Messenger *m, m_friend_connectionstatuschange_internal_cb *function,
void *userdata);
/* Set the callback for typing changes.
* Function(unsigned int connection_status (0 = not connected, 1 = TCP only, 2 = UDP + TCP))
*/
void m_callback_core_connection(Messenger *m, void (*function)(Messenger *m, unsigned int, void *));
void m_callback_core_connection(Messenger *m, m_self_connection_status_cb *function);
/**********CONFERENCES************/
@ -566,8 +580,7 @@ void m_callback_core_connection(Messenger *m, void (*function)(Messenger *m, uns
*
* Function(Messenger *m, uint32_t friendnumber, uint8_t *data, uint16_t length, void *userdata)
*/
void m_callback_conference_invite(Messenger *m, void (*function)(Messenger *m, uint32_t, const uint8_t *, uint16_t,
void *));
void m_callback_conference_invite(Messenger *m, m_conference_invite_cb *function);
/* Send a conference invite packet.
*
@ -583,8 +596,7 @@ int send_conference_invite_packet(const Messenger *m, int32_t friendnumber, cons
*
* Function(Tox *tox, uint32_t friendnumber, uint32_t filenumber, uint32_t filetype, uint64_t filesize, uint8_t *filename, size_t filename_length, void *userdata)
*/
void callback_file_sendrequest(Messenger *m, void (*function)(Messenger *m, uint32_t, uint32_t, uint32_t, uint64_t,
const uint8_t *, size_t, void *));
void callback_file_sendrequest(Messenger *m, m_file_recv_cb *function);
/* Set the callback for file control requests.
@ -592,22 +604,21 @@ void callback_file_sendrequest(Messenger *m, void (*function)(Messenger *m, uin
* Function(Tox *tox, uint32_t friendnumber, uint32_t filenumber, unsigned int control_type, void *userdata)
*
*/
void callback_file_control(Messenger *m, void (*function)(Messenger *m, uint32_t, uint32_t, unsigned int, void *));
void callback_file_control(Messenger *m, m_file_recv_control_cb *function);
/* Set the callback for file data.
*
* Function(Tox *tox, uint32_t friendnumber, uint32_t filenumber, uint64_t position, uint8_t *data, size_t length, void *userdata)
*
*/
void callback_file_data(Messenger *m, void (*function)(Messenger *m, uint32_t, uint32_t, uint64_t, const uint8_t *,
size_t, void *));
void callback_file_data(Messenger *m, m_file_recv_chunk_cb *function);
/* Set the callback for file request chunk.
*
* Function(Tox *tox, uint32_t friendnumber, uint32_t filenumber, uint64_t position, size_t length, void *userdata)
*
*/
void callback_file_reqchunk(Messenger *m, void (*function)(Messenger *m, uint32_t, uint32_t, uint64_t, size_t, void *));
void callback_file_reqchunk(Messenger *m, m_file_chunk_request_cb *function);
/* Copy the file transfer file id to file_id
@ -686,8 +697,7 @@ uint64_t file_dataremaining(const Messenger *m, int32_t friendnumber, uint8_t fi
*
* Function(Messenger *m, uint32_t friendnumber, uint8_t *data, uint16_t length, void *userdata)
*/
void m_callback_msi_packet(Messenger *m, void (*function)(Messenger *m, uint32_t, const uint8_t *, uint16_t, void *),
void *userdata);
void m_callback_msi_packet(Messenger *m, m_msi_packet_cb *function, void *userdata);
/* Send an msi packet.
*
@ -701,16 +711,15 @@ int m_msi_packet(const Messenger *m, int32_t friendnumber, const uint8_t *data,
* return -1 on failure.
* return 0 on success.
*/
int m_callback_rtp_packet(Messenger *m, int32_t friendnumber, uint8_t byte, int (*packet_handler_callback)(Messenger *m,
uint32_t friendnumber, const uint8_t *data, uint16_t len, void *object), void *object);
int m_callback_rtp_packet(Messenger *m, int32_t friendnumber, uint8_t byte,
m_lossy_rtp_packet_cb *packet_handler_callback, void *object);
/**********************************************/
/* Set handlers for custom lossy packets.
*
*/
void custom_lossy_packet_registerhandler(Messenger *m, void (*packet_handler_callback)(Messenger *m,
uint32_t friendnumber, const uint8_t *data, size_t len, void *object));
void custom_lossy_packet_registerhandler(Messenger *m, m_friend_lossy_packet_cb *packet_handler_callback);
/* High level function to send custom lossy packets.
*
@ -727,8 +736,7 @@ int m_send_custom_lossy_packet(const Messenger *m, int32_t friendnumber, const u
/* Set handlers for custom lossless packets.
*
*/
void custom_lossless_packet_registerhandler(Messenger *m, void (*packet_handler_callback)(Messenger *m,
uint32_t friendnumber, const uint8_t *data, size_t len, void *object));
void custom_lossless_packet_registerhandler(Messenger *m, m_friend_lossless_packet_cb *packet_handler_callback);
/* High level function to send custom lossless packets.
*
@ -743,12 +751,12 @@ int send_custom_lossless_packet(const Messenger *m, int32_t friendnumber, const
/**********************************************/
enum {
typedef enum Messenger_Error {
MESSENGER_ERROR_NONE,
MESSENGER_ERROR_PORT,
MESSENGER_ERROR_TCP_SERVER,
MESSENGER_ERROR_OTHER
};
} Messenger_Error;
/* Run this at startup.
* return allocated instance of Messenger on success.

View File

@ -55,11 +55,11 @@
#define SHARE_RELAYS_INTERVAL (5 * 60)
enum {
typedef enum Friendconn_Status {
FRIENDCONN_STATUS_NONE,
FRIENDCONN_STATUS_CONNECTING,
FRIENDCONN_STATUS_CONNECTED
};
} Friendconn_Status;
typedef struct Friend_Connections Friend_Connections;

View File

@ -41,14 +41,15 @@ uint32_t get_nospam(const Friend_Requests *fr);
*/
int remove_request_received(Friend_Requests *fr, const uint8_t *real_pk);
typedef void fr_friend_request_cb(void *, const uint8_t *, const uint8_t *, size_t, void *);
typedef void fr_friend_request_cb(void *object, const uint8_t *public_key, const uint8_t *message, size_t length,
void *user_data);
/* Set the function that will be executed when a friend request for us is received.
* Function format is function(uint8_t * public_key, uint8_t * data, size_t length, void * userdata)
*/
void callback_friendrequest(Friend_Requests *fr, fr_friend_request_cb *function, void *object);
typedef int filter_function_cb(const uint8_t *, void *);
typedef int filter_function_cb(const uint8_t *public_key, void *user_data);
/* Set the function used to check if a friend request should be displayed to the user or not.
* Function format is int function(uint8_t * public_key, void * userdata)

View File

@ -28,12 +28,12 @@
#include <stdint.h>
typedef struct {
uint32_t n; //number of elements
uint32_t capacity; //number of elements memory is allocated for
uint32_t element_size; //size of the elements
uint8_t *data; //array of elements
int *ids; //array of element ids
typedef struct BS_List {
uint32_t n; // number of elements
uint32_t capacity; // number of elements memory is allocated for
uint32_t element_size; // size of the elements
uint8_t *data; // array of elements
int *ids; // array of element ids
} BS_List;
/* Initialize a list, element_size is the size of the elements in the list and

View File

@ -41,7 +41,7 @@ struct Logger {
};
#ifdef USE_STDERR_LOGGER
static const char *logger_level_name(LOGGER_LEVEL level)
static const char *logger_level_name(Logger_Level level)
{
switch (level) {
case LOG_TRACE:
@ -63,7 +63,7 @@ static const char *logger_level_name(LOGGER_LEVEL level)
return "<unknown>";
}
static void logger_stderr_handler(void *context, LOGGER_LEVEL level, const char *file, int line, const char *func,
static void logger_stderr_handler(void *context, Logger_Level level, const char *file, int line, const char *func,
const char *message, void *userdata)
{
// GL stands for "global logger".
@ -97,7 +97,7 @@ void logger_callback_log(Logger *log, logger_cb *function, void *context, void *
log->userdata = userdata;
}
void logger_write(const Logger *log, LOGGER_LEVEL level, const char *file, int line, const char *func,
void logger_write(const Logger *log, Logger_Level level, const char *file, int line, const char *func,
const char *format, ...)
{
if (!log) {

View File

@ -32,17 +32,17 @@
#define MIN_LOGGER_LEVEL LOG_INFO
#endif
typedef enum {
typedef enum Logger_Level {
LOG_TRACE,
LOG_DEBUG,
LOG_INFO,
LOG_WARNING,
LOG_ERROR
} LOGGER_LEVEL;
} Logger_Level;
typedef struct Logger Logger;
typedef void logger_cb(void *context, LOGGER_LEVEL level, const char *file, int line,
typedef void logger_cb(void *context, Logger_Level level, const char *file, int line,
const char *func, const char *message, void *userdata);
/**
@ -72,7 +72,7 @@ void logger_callback_log(Logger *log, logger_cb *function, void *context, void *
* assertion failure otherwise.
*/
void logger_write(
const Logger *log, LOGGER_LEVEL level, const char *file, int line, const char *func,
const Logger *log, Logger_Level level, const char *file, int line, const char *func,
const char *format, ...) GNU_PRINTF(6, 7);

View File

@ -26,7 +26,9 @@
#include "DHT.h"
typedef struct {
typedef int onion_recv_1_cb(void *object, IP_Port dest, const uint8_t *data, uint16_t length);
typedef struct Onion {
DHT *dht;
Networking_Core *net;
uint8_t secret_symmetric_key[CRYPTO_SYMMETRIC_KEY_SIZE];
@ -36,7 +38,7 @@ typedef struct {
Shared_Keys shared_keys_2;
Shared_Keys shared_keys_3;
int (*recv_1_function)(void *, IP_Port, const uint8_t *, uint16_t);
onion_recv_1_cb *recv_1_function;
void *callback_object;
} Onion;
@ -56,7 +58,7 @@ typedef struct {
#define ONION_PATH_LENGTH 3
typedef struct {
typedef struct Onion_Path {
uint8_t shared_key1[CRYPTO_SHARED_KEY_SIZE];
uint8_t shared_key2[CRYPTO_SHARED_KEY_SIZE];
uint8_t shared_key3[CRYPTO_SHARED_KEY_SIZE];
@ -150,8 +152,6 @@ int send_onion_response(Networking_Core *net, IP_Port dest, const uint8_t *data,
*/
int onion_send_1(const Onion *onion, const uint8_t *plain, uint16_t len, IP_Port source, const uint8_t *nonce);
typedef int onion_recv_1_cb(void *, IP_Port, const uint8_t *, uint16_t);
/* Set the callback to be called when the dest ip_port doesn't have TOX_AF_INET6 or TOX_AF_INET as the family.
*
* Format: function(void *object, IP_Port dest, uint8_t *data, uint16_t length)

View File

@ -40,7 +40,7 @@
#define ONION_DATA_RESPONSE_MIN_SIZE (1 + CRYPTO_NONCE_SIZE + CRYPTO_PUBLIC_KEY_SIZE + CRYPTO_MAC_SIZE)
#if ONION_PING_ID_SIZE != CRYPTO_PUBLIC_KEY_SIZE
#error announce response packets assume that ONION_PING_ID_SIZE is equal to CRYPTO_PUBLIC_KEY_SIZE
#error "announce response packets assume that ONION_PING_ID_SIZE is equal to CRYPTO_PUBLIC_KEY_SIZE"
#endif
#define ONION_DATA_REQUEST_MIN_SIZE (1 + CRYPTO_PUBLIC_KEY_SIZE + CRYPTO_NONCE_SIZE + CRYPTO_PUBLIC_KEY_SIZE + CRYPTO_MAC_SIZE)

View File

@ -30,7 +30,7 @@
#include "ping_array.h"
#define MAX_ONION_CLIENTS 8
#define MAX_ONION_CLIENTS_ANNOUNCE 12 /* Number of nodes to announce ourselves to. */
#define MAX_ONION_CLIENTS_ANNOUNCE 12 // Number of nodes to announce ourselves to.
#define ONION_NODE_PING_INTERVAL 15
#define ONION_NODE_TIMEOUT ONION_NODE_PING_INTERVAL