1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
23 * Malcolm Smith <malsmith@cs.rmit.edu.au>
25 * Alternatively, the contents of this file may be used under the terms of
26 * either the GNU General Public License Version 2 or later (the "GPL"), or
27 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 * in which case the provisions of the GPL or the LGPL are applicable instead
29 * of those above. If you wish to allow use of your version of this file only
30 * under the terms of either the GPL or the LGPL, and not to allow others to
31 * use your version of this file under the terms of the MPL, indicate your
32 * decision by deleting the provisions above and replace them with the notice
33 * and other provisions required by the GPL or the LGPL. If you do not delete
34 * the provisions above, a recipient may use your version of this file under
35 * the terms of any one of the MPL, the GPL or the LGPL.
37 * ***** END LICENSE BLOCK ***** */
39 #include
"nsISupports.idl"
41 [ptr] native PRFileDescStar
(struct PRFileDesc
);
46 [scriptable
, uuid(00b3df92
-e830
-11d8
-d48e
-0004e22243f8
)]
47 interface nsISocketProvider
: nsISupports
53 * The address family for this socket (PR_AF_INET or PR_AF_INET6).
55 * The hostname for this connection.
57 * The port for this connection.
59 * If non-null, the proxy hostname for this connection.
61 * The proxy port for this connection.
63 * Control flags that govern this connection (see below.)
65 * The resulting PRFileDesc.
66 * @param aSecurityInfo
67 * Any security info that should be associated with aFileDesc. This
68 * object typically implements nsITransportSecurityInfo.
71 void newSocket
(in long aFamily
,
76 in unsigned long aFlags
,
77 out PRFileDescStar aFileDesc
,
78 out nsISupports aSecurityInfo
);
83 * This function is called to allow the socket provider to layer a
84 * PRFileDesc on top of another PRFileDesc. For example, SSL via a SOCKS
87 * Parameters are the same as newSocket with the exception of aFileDesc,
88 * which is an in-param instead.
91 void addToSocket
(in long aFamily
,
96 in unsigned long aFlags
,
97 in PRFileDescStar aFileDesc
,
98 out nsISupports aSecurityInfo
);
101 * PROXY_RESOLVES_HOST
103 * This flag is set if the proxy is to perform hostname resolution instead
104 * of the client. When set, the hostname parameter passed when in this
105 * interface will be used instead of the address structure passed for a
106 * later connect et al. request.
108 const long PROXY_RESOLVES_HOST
= 1 << 0;
113 * nsISocketProvider implementations should be registered with XPCOM under a
114 * contract ID of the form: "@mozilla.org/network/socket;2?type=foo"
116 #define NS_NETWORK_SOCKET_CONTRACTID_PREFIX \
117 "@mozilla.org/network/socket;2?type="