]> rtime.felk.cvut.cz Git - frescor/fwp.git/blob - wme_test/common.h
Merge branch 'master' of rtime:/var/git/frescor
[frescor/fwp.git] / wme_test / common.h
1 #ifndef COMMON_H
2 #define COMMON_H
3
4 #define BASE_PORT       5100
5 #define AC_NUM          4
6 #define MTU             800 
7 #define BUFFSIZE        65536
8
9 #define Kbit 1000
10 #define Mbit (Kbit*Kbit)
11
12 #define SEC_TO_USEC        1000000LL
13 #define MSEC_TO_USEC       1000LL
14 #define USEC_TO_NSEC       1000LL
15
16 enum ac {
17         AC_VO = 0,
18         AC_VI = 1,
19         AC_BE = 2,
20         AC_BK = 3
21 };
22
23 struct msg_t {
24         unsigned int tos;
25         struct timespec send_timestamp, sendback_timestamp;
26         unsigned long int seqn;
27         int stream;
28 };
29
30 union msg_buff {
31         struct msg_t msg;
32         char nonsense[BUFFSIZE];
33 };
34
35
36 extern const int prio_to_ac[8];
37 extern const unsigned int ac_to_tos[4];
38 extern const char *ac_to_text[4];
39
40 void block_signals(void);
41 void set_rt_prio(int priority);
42 char *bandwidth_to_text(char *buf, unsigned bandwidth_bps);
43 char *usec_to_text(char *buf, unsigned usec);
44
45
46 #endif