check_csgo.h 830 Bytes
#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"
#include "udp.h"

#define VERSION "1.0"
#define DATAGRAM_LENGTH 1400
#define HDR_SIZE 4

struct sourcedspacket_struct {
    ssize_t length;
    char* data;
};
typedef struct sourcedspacket_struct SOURCEDS_PACKET;

struct serverinfo_struct {
    string name;
    string game;
    string map;
    uint8_t players;
    uint8_t max_players;
};
typedef struct serverinfo_struct SERVERINFO;

SOURCEDS_PACKET* getSourceDSResponse(int s, sockaddr_in *server);
int check_csgo(char *hostname, uint16_t port, SERVERINFO *server_info);
void printVersion();
void printHelp(bool longVersion);

#endif