2000-07-01 10:25:25 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
2000-06-16 17:53:22 +00:00
|
|
|
*
|
2012-05-21 11:12:37 +00: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 17:53:22 +00:00
|
|
|
|
2003-09-11 20:32:33 +00:00
|
|
|
#ifndef nsSOCKSSocketProvider_h__
|
|
|
|
#define nsSOCKSSocketProvider_h__
|
2000-06-16 17:53:22 +00:00
|
|
|
|
2003-09-11 20:32:33 +00:00
|
|
|
#include "nsISocketProvider.h"
|
2000-06-16 17:53:22 +00:00
|
|
|
|
2003-09-11 20:32:33 +00:00
|
|
|
// values for ctor's |version| argument
|
|
|
|
enum {
|
|
|
|
NS_SOCKS_VERSION_4 = 4,
|
|
|
|
NS_SOCKS_VERSION_5 = 5
|
|
|
|
};
|
2000-06-16 17:53:22 +00:00
|
|
|
|
2003-09-11 20:32:33 +00:00
|
|
|
class nsSOCKSSocketProvider : public nsISocketProvider
|
2000-06-16 17:53:22 +00:00
|
|
|
{
|
2000-07-01 10:25:25 +00:00
|
|
|
public:
|
2013-07-19 02:24:13 +00:00
|
|
|
NS_DECL_THREADSAFE_ISUPPORTS
|
2000-07-01 10:25:25 +00:00
|
|
|
NS_DECL_NSISOCKETPROVIDER
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
nsSOCKSSocketProvider(uint32_t version) : mVersion(version) {}
|
2003-09-11 20:32:33 +00:00
|
|
|
virtual ~nsSOCKSSocketProvider() {}
|
2000-07-01 10:25:25 +00:00
|
|
|
|
2010-06-10 18:11:40 +00:00
|
|
|
static nsresult CreateV4(nsISupports *, REFNSIID aIID, void **aResult);
|
|
|
|
static nsresult CreateV5(nsISupports *, REFNSIID aIID, void **aResult);
|
2000-07-01 10:25:25 +00:00
|
|
|
|
2003-09-11 20:32:33 +00:00
|
|
|
private:
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t mVersion; // NS_SOCKS_VERSION_4 or 5
|
2000-06-16 17:53:22 +00:00
|
|
|
};
|
|
|
|
|
2003-09-11 20:32:33 +00:00
|
|
|
#endif /* nsSOCKSSocketProvider_h__ */
|