M1-nw-project/nw_constants.h
Théophile Bastian 1527c1c6fe Proper handling of neighbours updates.
Still have to interface it cleanly with the inbound network packets
2016-11-23 23:49:48 +01:00

40 lines
950 B
C++

/***************************************************************************
* By Théophile Bastian, 2017
* M1 Network course project at ENS Cachan, Juliusz Chroboczek.
* License: WTFPL v2 <http://www.wtfpl.net/>
**************************************************************************/
#pragma once
#include "data.h"
namespace csts {
const u8 MAGIC = 57;
const u8 VERSION = 0;
const u8 TLV_PAD1 = 0;
const u8 TLV_PADN = 1;
const u8 TLV_IHU = 2;
const u8 TLV_NR = 3;
const u8 TLV_NEIGH = 4;
const u8 TLV_DATA = 5;
const u8 TLV_IHAVE = 6;
const u8 TLV_DATA_TEXT = 32;
const u8 TLV_DATA_PNG = 33;
const u8 TLV_DATA_JPG = 34;
const int TIMEOUT_UNIDIR = 100; // s
const int TIMEOUT_SYM_RECV = 150; // s
const int TIMEOUT_SYM_IHU = 300; // s
const int TIME_RESEND_IHU = 90; // s
const int TIME_RESEND_EMPTY = 30; // s
const int TIME_PEER_PEEK = 30; // s
const int SYM_COUNT_BEFORE_PEEK = 5;
const u16 DEFAULT_PORT = 1192;
}