18 lines
584 B
C++
18 lines
584 B
C++
#ifndef MCPINGER_NETWORK_UTILS_H
|
|
#define MCPINGER_NETWORK_UTILS_H
|
|
|
|
#include <vector>
|
|
#include <string>
|
|
|
|
#define SUCCESS 0
|
|
#define ERROR_RESOLVING_HOSTNAME (-2)
|
|
#define ERROR_CONNECTION_FAILED (-3)
|
|
#define ERROR_SENDING_DATA (-4)
|
|
#define ERROR_RECEIVING_DATA (-5)
|
|
|
|
int sendData(int sockfd, const std::vector<unsigned char>& data);
|
|
int receiveData(int sockfd, std::vector<unsigned char>& buffer);
|
|
int pingMinecraftServer(const std::string& hostname, int port, const std::string& virtualHostname, int virtualPort, int protocolVersion, int nextState);
|
|
|
|
#endif // MCPINGER_NETWORK_UTILS_H
|