2000-07-01 14:25:25 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
2000-06-16 21:53:22 +04:00
|
|
|
*
|
2012-05-21 15:12:37 +04:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2000-06-16 21:53:22 +04:00
|
|
|
|
2003-09-12 00:32:33 +04:00
|
|
|
#ifndef nsSOCKSSocketProvider_h__
|
|
|
|
#define nsSOCKSSocketProvider_h__
|
2000-06-16 21:53:22 +04:00
|
|
|
|
2003-09-12 00:32:33 +04:00
|
|
|
#include "nsISocketProvider.h"
|
2000-06-16 21:53:22 +04:00
|
|
|
|
2003-09-12 00:32:33 +04:00
|
|
|
// values for ctor's |version| argument
|
|
|
|
enum {
|
|
|
|
NS_SOCKS_VERSION_4 = 4,
|
|
|
|
NS_SOCKS_VERSION_5 = 5
|
|
|
|
};
|
2000-06-16 21:53:22 +04:00
|
|
|
|
2003-09-12 00:32:33 +04:00
|
|
|
class nsSOCKSSocketProvider : public nsISocketProvider
|
2000-06-16 21:53:22 +04:00
|
|
|
{
|
2000-07-01 14:25:25 +04:00
|
|
|
public:
|
2013-07-19 06:24:13 +04:00
|
|
|
NS_DECL_THREADSAFE_ISUPPORTS
|
2000-07-01 14:25:25 +04:00
|
|
|
NS_DECL_NSISOCKETPROVIDER
|
2014-06-24 20:36:44 +04:00
|
|
|
|
2014-08-05 17:20:24 +04:00
|
|
|
explicit nsSOCKSSocketProvider(uint32_t version) : mVersion(version) {}
|
2014-06-24 20:36:44 +04:00
|
|
|
|
2010-06-10 22:11:40 +04:00
|
|
|
static nsresult CreateV4(nsISupports *, REFNSIID aIID, void **aResult);
|
|
|
|
static nsresult CreateV5(nsISupports *, REFNSIID aIID, void **aResult);
|
2014-06-24 20:36:44 +04:00
|
|
|
|
2003-09-12 00:32:33 +04:00
|
|
|
private:
|
2018-04-30 19:46:04 +03:00
|
|
|
virtual ~nsSOCKSSocketProvider() = default;
|
2014-06-24 20:36:44 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mVersion; // NS_SOCKS_VERSION_4 or 5
|
2000-06-16 21:53:22 +04:00
|
|
|
};
|
|
|
|
|
2003-09-12 00:32:33 +04:00
|
|
|
#endif /* nsSOCKSSocketProvider_h__ */
|