Blame view

check_csgo/check_csgo.h 830 Bytes
Imanol-Mikel Barba Sabariego authored
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#ifndef CHECK_CSGO_H
#define CHECK_CSGO_H

#include <iostream>
#include <sstream>
#include <fstream>
#include <limits>

#include <ctype.h>
#include <cstdlib>
#include <unistd.h>
#include <cstring>

#include <sys/time.h>

#include "auxiliar.h"
Imanol-Mikel Barba Sabariego authored
17
#include "udp.h"
Imanol-Mikel Barba Sabariego authored
18
19

#define VERSION "1.0"
Imanol-Mikel Barba Sabariego authored
20
21
#define DATAGRAM_LENGTH 1400
#define HDR_SIZE 4
Imanol-Mikel Barba Sabariego authored
22
Imanol-Mikel Barba Sabariego authored
23
24
25
26
27
struct sourcedspacket_struct {
    ssize_t length;
    char* data;
};
typedef struct sourcedspacket_struct SOURCEDS_PACKET;
Imanol-Mikel Barba Sabariego authored
28
29

struct serverinfo_struct {
Imanol-Mikel Barba Sabariego authored
30
31
32
33
    string name;
    string game;
    string map;
    uint8_t players;
Imanol-Mikel Barba Sabariego authored
34
    uint8_t max_players;
Imanol-Mikel Barba Sabariego authored
35
36
37
};
typedef struct serverinfo_struct SERVERINFO;
Imanol-Mikel Barba Sabariego authored
38
SOURCEDS_PACKET* getSourceDSResponse(int s, sockaddr_in *server);
Imanol-Mikel Barba Sabariego authored
39
40
41
42
43
int check_csgo(char *hostname, uint16_t port, SERVERINFO *server_info);
void printVersion();
void printHelp(bool longVersion);

#endif