Blame view

check_openvpn/tcp.h 488 Bytes
Imanol-Mikel Barba Sabariego authored
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#ifndef TCP_H
#define TCP_H

#define MAX_TCP 65535

#include <iostream>

#include <string.h>
#include <cstdlib>

#include <errno.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <netdb.h>
#include <fcntl.h>
Imanol-Mikel Barba Sabariego authored
16
17
18
19
20

#ifdef __FreeBSD__
#include <netinet/in.h>
#endif
Imanol-Mikel Barba Sabariego authored
21
22
23
24
25
26
27
28
using namespace std;

int createSocket();
void connect(int s, uint16_t port, char *hostname, int timeout);
int sendMsg(int s, const char *msg, size_t msgLength);
int recvMsg(int s, char *msg, size_t msgLength);

#endif