forked from voipmonitor/sniffer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
voipmonitor.h
128 lines (106 loc) · 2.89 KB
/
voipmonitor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/* Martin Vit [email protected]
* This program is free software, distributed under the terms of
* the GNU General Public License Version 2.
*/
#include <sys/types.h>
#include <string>
#ifndef VOIPMONITOR_H
#define VOIPMONITOR_H
#define RTPSENSOR_VERSION "9.0-SVN1246"
#define NAT
#define FORMAT_WAV 1
#define FORMAT_OGG 2
#define REGISTER_CLEAN_PERIOD 60 // clean register table for expired items every 60 seconds
#define TYPE_SIP 1
#define TYPE_RTP 2
#define TYPE_RTCP 3
#define TYPE_SKINNY 4
#define STORE_PROC_ID_HTTP 71
#define STORE_PROC_ID_IPACC_1 81
#define STORE_PROC_ID_IPACC_2 82
#define STORE_PROC_ID_IPACC_3 83
#define STORE_PROC_ID_IPACC_AGR_INTERVAL 91
#define STORE_PROC_ID_IPACC_AGR_HOUR 92
#define STORE_PROC_ID_IPACC_AGR_DAY 93
#define STORE_PROC_ID_IPACC_AGR2_HOUR_1 94
#define STORE_PROC_ID_IPACC_AGR2_HOUR_2 95
#define STORE_PROC_ID_IPACC_AGR2_HOUR_3 96
#define STORE_PROC_ID_IPACC_AGR2_DAY_1 97
#define STORE_PROC_ID_IPACC_AGR2_DAY_2 98
#define STORE_PROC_ID_IPACC_AGR2_DAY_3 99
#define GRAPH_DELIMITER 4294967295
#define GRAPH_VERSION 4294967294
/* choose what method wil be used to synchronize threads. NONBLOCK is the fastest. Do not enable both at once */
// this is now defined in Makefile
//#define QUEUE_NONBLOCK
//#define QUEUE_MUTEX
/* if you want to see all new calls in syslog enable DEBUG_INVITE */
//#define DEBUG_INVITE
using namespace std;
void reload_config();
void reload_capture_rules();
void convert_filesindex();
void mysqlquerypush(string);
/* For compatibility with Linux definitions... */
#if ( defined( __FreeBSD__ ) || defined ( __NetBSD__ ) )
# ifndef FREEBSD
# define FREEBSD
# endif
#endif
#ifdef FREEBSD
# include <sys/endian.h>
# define __BYTE_ORDER _BYTE_ORDER
# define __BIG_ENDIAN _BIG_ENDIAN
# define __LITTLE_ENDIAN _LITTLE_ENDIAN
#else
# include <endian.h>
#endif
#if __BYTE_ORDER == __BIG_ENDIAN
# ifndef __BIG_ENDIAN_BITFIELD
# define __BIG_ENDIAN_BITFIELD
# endif
#else
# ifndef __LITTLE_ENDIAN_BITFIELD
# define __LITTLE_ENDIAN_BITFIELD
# endif
#endif
#if defined(__BIG_ENDIAN_BITFIELD) && defined(__LITTLE_ENDIAN_BITFIELD)
# error Cannot define both __BIG_ENDIAN_BITFIELD and __LITTLE_ENDIAN_BITFIELD
#endif
#ifndef ulong
#define ulong unsigned long
#endif
struct tcphdr2
{
u_int16_t source;
u_int16_t dest;
u_int32_t seq;
u_int32_t ack_seq;
# if __BYTE_ORDER == __LITTLE_ENDIAN
u_int16_t res1:4;
u_int16_t doff:4;
u_int16_t fin:1;
u_int16_t syn:1;
u_int16_t rst:1;
u_int16_t psh:1;
u_int16_t ack:1;
u_int16_t urg:1;
u_int16_t res2:2;
# elif __BYTE_ORDER == __BIG_ENDIAN
u_int16_t doff:4;
u_int16_t res1:4;
u_int16_t res2:2;
u_int16_t urg:1;
u_int16_t ack:1;
u_int16_t psh:1;
u_int16_t rst:1;
u_int16_t syn:1;
u_int16_t fin:1;
# else
# error "Adjust your <bits/endian.h> defines"
# endif
u_int16_t window;
u_int16_t check;
u_int16_t urg_ptr;
};
#endif