Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.3 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #if !defined( INETAPI_H )
  8. #define INETAPI_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "tier0/platform.h"
  13. #include "tier1/netadr.h"
  14. //-----------------------------------------------------------------------------
  15. // Purpose: Internal winsock helpers for launcher
  16. //-----------------------------------------------------------------------------
  17. abstract_class INetAPI
  18. {
  19. public:
  20. // Convert a netadr_t to sockaddr
  21. virtual void NetAdrToSockAddr( netadr_t *a, struct sockaddr *s ) = 0;
  22. // Convert a sockaddr to netadr_t
  23. virtual void SockAddrToNetAdr( struct sockaddr *s, netadr_t *a ) = 0;
  24. // Convert a netadr_t to a string
  25. virtual char *AdrToString( netadr_t *a ) = 0;
  26. // Convert a string address to a netadr_t, doing DNS if needed
  27. virtual bool StringToAdr( const char *s, netadr_t *a ) = 0;
  28. // Look up IP address for socket
  29. virtual void GetSocketAddress( int socket, netadr_t *a ) = 0;
  30. virtual bool CompareAdr( netadr_t *a, netadr_t *b ) =0;
  31. // return the IP of the local host
  32. virtual void GetLocalIP(netadr_t *a)=0;
  33. };
  34. extern INetAPI *net;
  35. #endif // INETAPI_H