2
0
mirror of https://github.com/s1lentq/revoice.git synced 2024-10-16 22:46:48 +03:00
revoice/dep/rehlsdk/common/netapi.h
s1lent 2f2b7fe48a
Fixed some bugs.
Add "rev status" to print detailed info
Update rehlsdk
2017-10-26 20:30:31 +07:00

26 lines
808 B
C++

#ifndef NETAPI_H
#define NETAPI_H
#ifdef _WIN32
#pragma once
#endif
#include "netadr.h"
class INetAPI {
public:
virtual void NetAdrToSockAddr(netadr_t *a, struct sockaddr *s) = 0; // Convert a netadr_t to sockaddr
virtual void SockAddrToNetAdr(struct sockaddr *s, netadr_t *a) = 0; // Convert a sockaddr to netadr_t
virtual char *AdrToString(netadr_t *a) = 0; // Convert a netadr_t to a string
virtual bool StringToAdr(const char *s, netadr_t *a) = 0; // Convert a string address to a netadr_t, doing DNS if needed
virtual void GetSocketAddress(int socket, netadr_t *a) = 0; // Look up IP address for socket
virtual bool CompareAdr(netadr_t *a, netadr_t *b) = 0;
// return the IP of the local host
virtual void GetLocalIP(netadr_t *a) = 0;
};
extern INetAPI *net;
#endif // NETAPI_H