netwerk/socket/nsSOCKSSocketProvider.h

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:fc0ae1320568
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
7 #ifndef nsSOCKSSocketProvider_h__
8 #define nsSOCKSSocketProvider_h__
9
10 #include "nsISocketProvider.h"
11
12 // values for ctor's |version| argument
13 enum {
14 NS_SOCKS_VERSION_4 = 4,
15 NS_SOCKS_VERSION_5 = 5
16 };
17
18 class nsSOCKSSocketProvider : public nsISocketProvider
19 {
20 public:
21 NS_DECL_THREADSAFE_ISUPPORTS
22 NS_DECL_NSISOCKETPROVIDER
23
24 nsSOCKSSocketProvider(uint32_t version) : mVersion(version) {}
25 virtual ~nsSOCKSSocketProvider() {}
26
27 static nsresult CreateV4(nsISupports *, REFNSIID aIID, void **aResult);
28 static nsresult CreateV5(nsISupports *, REFNSIID aIID, void **aResult);
29
30 private:
31 uint32_t mVersion; // NS_SOCKS_VERSION_4 or 5
32 };
33
34 #endif /* nsSOCKSSocketProvider_h__ */

mercurial