nsSOCKSSocketProvider.h 995 B

123456789101112131415161718192021222324252627282930313233343536
  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  2. *
  3. * This Source Code Form is subject to the terms of the Mozilla Public
  4. * License, v. 2.0. If a copy of the MPL was not distributed with this
  5. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  6. #ifndef nsSOCKSSocketProvider_h__
  7. #define nsSOCKSSocketProvider_h__
  8. #include "nsISocketProvider.h"
  9. // values for ctor's |version| argument
  10. enum {
  11. NS_SOCKS_VERSION_4 = 4,
  12. NS_SOCKS_VERSION_5 = 5
  13. };
  14. class nsSOCKSSocketProvider : public nsISocketProvider
  15. {
  16. public:
  17. NS_DECL_THREADSAFE_ISUPPORTS
  18. NS_DECL_NSISOCKETPROVIDER
  19. explicit nsSOCKSSocketProvider(uint32_t version) : mVersion(version) {}
  20. static nsresult CreateV4(nsISupports *, REFNSIID aIID, void **aResult);
  21. static nsresult CreateV5(nsISupports *, REFNSIID aIID, void **aResult);
  22. private:
  23. virtual ~nsSOCKSSocketProvider() {}
  24. uint32_t mVersion; // NS_SOCKS_VERSION_4 or 5
  25. };
  26. #endif /* nsSOCKSSocketProvider_h__ */