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