Source code of Windows XP (NT5)
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.

51 lines
1.2 KiB

  1. #ifndef __h323ics_sockinfo_h_
  2. #define __h323ics_sockinfo_h_
  3. // This class abstracts a winsock socket
  4. // contains the socket descriptor, local and remote addresses and ports
  5. // corresponding to a winsock socket
  6. struct SOCKET_INFO
  7. {
  8. public:
  9. SOCKET Socket;
  10. SOCKADDR_IN LocalAddress;
  11. SOCKADDR_IN RemoteAddress;
  12. SOCKADDR_IN TrivialRedirectSourceAddress;
  13. SOCKADDR_IN TrivialRedirectDestAddress;
  14. BOOL IsNatRedirectActive;
  15. SOCKET_INFO();
  16. void Init (
  17. IN SOCKET ArgSocket,
  18. IN SOCKADDR_IN * ArgLocalAddress,
  19. IN SOCKADDR_IN * ArgRemoteAddress);
  20. int Init (
  21. IN SOCKET ArgSocket,
  22. IN SOCKADDR_IN * ArgRemoteAddress);
  23. BOOLEAN IsSocketValid (void);
  24. void SetListenInfo (
  25. IN SOCKET ListenSocket,
  26. IN SOCKADDR_IN * ListenAddress);
  27. int Connect (
  28. IN SOCKADDR_IN * RemoteAddress);
  29. HRESULT CreateTrivialNatRedirect (
  30. IN SOCKADDR_IN * ArgTrivialRedirectDestAddress,
  31. IN SOCKADDR_IN * ArgTrivialRedirectSourceAddress,
  32. IN ULONG RestrictedAdapterIndex);
  33. void Clear (BOOL CancelTrivialRedirect);
  34. ~SOCKET_INFO();
  35. };
  36. #endif __h323ics_sockinfo_h_