defines.h 919 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

#define PRRT_MAX_RECEIVER_COUNT 255

Andreas Schmidt's avatar
Andreas Schmidt committed
25
#define MAX_PAYLOAD_LENGTH 65507 // maximum UDP packet length (2^16 - 1 - 8 (UDP Header) - 20 (IP Header))
26

Andreas Schmidt's avatar
Andreas Schmidt committed
27
#define SEQNO_SPACE (((uint32_t) UINT16_MAX)+1) // 2**16 as seqno is uint16_t
28

Andreas Schmidt's avatar
Andreas Schmidt committed
29
#define TIMESTAMP_SPACE (((uint64_t) UINT32_MAX)+1)
30

31 32
#define GF_BITS 8

Andreas Schmidt's avatar
Andreas Schmidt committed
33 34
#define K_START 1
#define N_START 1
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