23 lines
636 B
C++
23 lines
636 B
C++
//network_utils.h
|
|
#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);
|
|
|
|
std::string
|
|
pingMinecraftServer(const std::string &hostname, int port, const std::string &virtualHostname, int virtualPort,
|
|
int protocolVersionIn, int nextStateIn);
|
|
|
|
#endif // MCPINGER_NETWORK_UTILS_H
|