2016-11-16 18:56:52 +01:00
|
|
|
/***************************************************************************
|
|
|
|
* 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;
|
|
|
|
|
2016-11-23 23:49:48 +01:00
|
|
|
const int TIMEOUT_UNIDIR = 100; // s
|
|
|
|
const int TIMEOUT_SYM_RECV = 150; // s
|
|
|
|
const int TIMEOUT_SYM_IHU = 300; // s
|
2016-11-26 16:20:20 +01:00
|
|
|
const int TIMEOUT_DATA = 35*60; // s
|
2016-11-23 23:49:48 +01:00
|
|
|
const int TIME_RESEND_IHU = 90; // s
|
|
|
|
const int TIME_RESEND_EMPTY = 30; // s
|
2016-11-27 21:28:46 +01:00
|
|
|
const int TIME_REPUBLISH_DATA = 15*60; // s
|
2016-11-23 23:49:48 +01:00
|
|
|
const int TIME_PEER_PEEK = 30; // s
|
2016-11-26 16:20:20 +01:00
|
|
|
const int TIME_SEND_NR = 60; // s
|
|
|
|
const int TIME_RESEND_FLOOD = 3; // s
|
2016-11-23 23:49:48 +01:00
|
|
|
|
|
|
|
const int SYM_COUNT_BEFORE_PEEK = 5;
|
2016-11-26 16:20:20 +01:00
|
|
|
const int NB_NEIGH_PER_NR = 5;
|
2016-11-27 09:49:28 +01:00
|
|
|
const int DFT_MAX_MTU = 1460; // bytes
|
2016-11-26 16:20:20 +01:00
|
|
|
|
|
|
|
const int FLOOD_RETRIES = 3;
|
2016-11-16 18:56:52 +01:00
|
|
|
|
2016-11-20 00:15:09 +01:00
|
|
|
const u16 DEFAULT_PORT = 1192;
|
|
|
|
|
|
|
|
}
|
2016-11-16 18:56:52 +01:00
|
|
|
|