defines.h 851 Bytes
Newer Older
1 2 3
#ifndef PRRT_DEFINES_H
#define PRRT_DEFINES_H

4 5 6 7
#if defined __arm__
#   define __builtin_ia32_rdtsc() (0)
#endif

Andreas Schmidt's avatar
Andreas Schmidt committed
8 9 10 11 12 13 14
#ifndef __cplusplus
# include <stdatomic.h>
#else
# include <atomic>
# define _Atomic(X) std::atomic< X >
#endif

15
#ifndef MAX
16
#define MAX(x, y) (((x) > (y)) ? (x) : (y))
17 18 19
#endif

#ifndef MIN
20
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
21
#endif
22 23 24 25 26

#define PRRT_MAX_RECEIVER_COUNT 255

#define MAX_PAYLOAD_LENGTH 65528 // maximum UDP packet length (2^16 - 8)

27 28
#define SEQNO_SPACE UINT16_MAX // 2**16 as seqno is uint16_t

29 30
#define TIMESTAMP_SPACE UINT32_MAX

31 32
#define GF_BITS 8

33 34
#define K_START 4
#define N_START 7
35 36
#define N_P_START 1

37 38
#define RRT_ALPHA 0.125

39 40
#define MIN_RTT 300

Andreas Schmidt's avatar
Andreas Schmidt committed
41 42 43 44 45
// Uncomment the line below if you are compiling on Windows.
// #define WINDOWS
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
46

47
#endif //PRRT_DEFINES_H