mcpinger/network_utils.h

23 lines
636 B
C
Raw Normal View History

2024-05-08 13:27:23 +02:00
//network_utils.h
2024-05-08 10:24:32 +02:00
#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)
2024-05-08 13:27:23 +02:00
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);
2024-05-08 10:24:32 +02:00
#endif // MCPINGER_NETWORK_UTILS_H