-
Notifications
You must be signed in to change notification settings - Fork 108
/
generator.h
61 lines (51 loc) · 1.16 KB
/
generator.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
#ifndef GENERATOR_H
#define GENERATOR_H
#include "voipmonitor.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <sys/time.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#ifndef FREEBSD
#include <netinet/ether.h>
#endif
#include <sys/times.h>
#include <sys/param.h>
#include <sys/signal.h>
#include <netinet/ip.h>
#include <syslog.h>
#include <errno.h>
#include <netinet/udp.h>
#include <netinet/ip_icmp.h>
#ifndef FREEBSD
#include <features.h> /* for the glibc version number */
#if __GLIBC__ >= 2 && __GLIBC_MINOR >= 1
#include <netpacket/packet.h>
#include <net/ethernet.h> /* the L2 protocols */
#else
#include <asm/types.h>
#include <linux/if_packet.h>
#include <linux/if_ether.h> /* The L2 protocols */
#endif
#endif
using namespace std;
void *gensiprtp(void *);
class Generator {
public:
Generator(const char*, const char*);
int send(char *, int);
private:
int sockraw;
char generator_packet[4092];
struct sockaddr_in src_addr;
struct sockaddr_in dest_addr;
void socket_broadcast(int);
void socket_iphdrincl(int);
};
#endif