1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include
"nsISupports.idl"
8 [ptr] native PRFileDescStar
(struct PRFileDesc
);
13 [scriptable
, uuid(00b3df92
-e830
-11d8
-d48e
-0004e22243f8
)]
14 interface nsISocketProvider
: nsISupports
20 * The address family for this socket (PR_AF_INET or PR_AF_INET6).
22 * The hostname for this connection.
24 * The port for this connection.
26 * If non-null, the proxy hostname for this connection.
28 * The proxy port for this connection.
30 * Control flags that govern this connection (see below.)
32 * The resulting PRFileDesc.
33 * @param aSecurityInfo
34 * Any security info that should be associated with aFileDesc. This
35 * object typically implements nsITransportSecurityInfo.
38 void newSocket
(in long aFamily
,
43 in unsigned long aFlags
,
44 out PRFileDescStar aFileDesc
,
45 out nsISupports aSecurityInfo
);
50 * This function is called to allow the socket provider to layer a
51 * PRFileDesc on top of another PRFileDesc. For example, SSL via a SOCKS
54 * Parameters are the same as newSocket with the exception of aFileDesc,
55 * which is an in-param instead.
58 void addToSocket
(in long aFamily
,
63 in unsigned long aFlags
,
64 in PRFileDescStar aFileDesc
,
65 out nsISupports aSecurityInfo
);
70 * This flag is set if the proxy is to perform hostname resolution instead
71 * of the client. When set, the hostname parameter passed when in this
72 * interface will be used instead of the address structure passed for a
73 * later connect et al. request.
75 const long PROXY_RESOLVES_HOST
= 1 << 0;
78 * When setting this flag, the socket will not apply any
79 * credentials when establishing a connection. For example,
80 * an SSL connection would not send any client-certificates
81 * if this flag is set.
83 const long ANONYMOUS_CONNECT
= 1 << 1;
86 * If set, indicates that the connection was initiated from a source
87 * defined as being private in the sense of Private Browsing. Generally,
88 * there should be no state shared between connections that are private
89 * and those that are not; it is OK for multiple private connections
90 * to share state with each other, and it is OK for multiple non-private
91 * connections to share state with each other.
93 const unsigned long NO_PERMANENT_STORAGE
= 1 << 2;
98 * nsISocketProvider implementations should be registered with XPCOM under a
99 * contract ID of the form: "@mozilla.org/network/socket;2?type=foo"
101 #define NS_NETWORK_SOCKET_CONTRACTID_PREFIX \
102 "@mozilla.org/network/socket;2?type="