backup
[lcr.git] / trace.h
1 /*****************************************************************************\
2 **                                                                           **
3 ** Linux Call Router                                                         **
4 **                                                                           **
5 **---------------------------------------------------------------------------**
6 ** Copyright: Andreas Eversberg                                              **
7 **                                                                           **
8 ** trace header file                                                         **
9 **                                                                           **
10 \*****************************************************************************/ 
11
12 struct trace_element {
13         char name[10];
14         char sub[10];
15         char value[64];
16 };
17
18 #define MAX_NESTED_TRACES       1
19
20 #define MAX_TRACE_ELEMENTS      32
21 struct trace {
22         /* header */
23         int port;
24         char interface[32];
25         char caller[64];
26         char dialing[64];
27         int direction;
28         unsigned long sec, usec;
29         
30         /* type */
31         char category[32];
32         char name[64];
33
34         /* elements */
35         int elements;
36         struct trace_element element[MAX_TRACE_ELEMENTS];
37 };
38
39
40 #define CATEGORY_L1     0x01
41 #define CATEGORY_L2     0x02
42 #define CATEGORY_L3     0x04
43 #define CATEGORY_CH     0x08
44 #define CATEGORY_EP     0x10
45 #define CATEGORY_AP     0x20
46 #define CATEGORY_RO     0x40
47
48
49 void start_trace(int port, char *interface, char *caller, char *dialing, int direction, char *category, char *name);
50 void add_trace(char *name, char *sub, char *value);
51 void end_trace(void);
52 //char *print_trace(int port, char *interface, char *caller, char *dialing, int direction, char *category, char *name);