/
System.Net.Primitives.cs
541 lines (540 loc) · 23.8 KB
/
System.Net.Primitives.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// ------------------------------------------------------------------------------
// Changes to this file must follow the https://aka.ms/api-review process.
// ------------------------------------------------------------------------------
namespace System.Net
{
[System.FlagsAttribute]
public enum AuthenticationSchemes
{
None = 0,
Digest = 1,
Negotiate = 2,
Ntlm = 4,
IntegratedWindowsAuthentication = 6,
Basic = 8,
Anonymous = 32768,
}
public sealed partial class Cookie
{
public Cookie() { }
public Cookie(string name, string? value) { }
public Cookie(string name, string? value, string? path) { }
public Cookie(string name, string? value, string? path, string? domain) { }
[System.Diagnostics.CodeAnalysis.AllowNullAttribute]
public string Comment { get { throw null; } set { } }
public System.Uri? CommentUri { get { throw null; } set { } }
public bool Discard { get { throw null; } set { } }
[System.Diagnostics.CodeAnalysis.AllowNullAttribute]
public string Domain { get { throw null; } set { } }
public bool Expired { get { throw null; } set { } }
public System.DateTime Expires { get { throw null; } set { } }
public bool HttpOnly { get { throw null; } set { } }
public string Name { get { throw null; } set { } }
[System.Diagnostics.CodeAnalysis.AllowNullAttribute]
public string Path { get { throw null; } set { } }
[System.Diagnostics.CodeAnalysis.AllowNullAttribute]
public string Port { get { throw null; } set { } }
public bool Secure { get { throw null; } set { } }
public System.DateTime TimeStamp { get { throw null; } }
[System.Diagnostics.CodeAnalysis.AllowNullAttribute]
public string Value { get { throw null; } set { } }
public int Version { get { throw null; } set { } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? comparand) { throw null; }
public override int GetHashCode() { throw null; }
public override string ToString() { throw null; }
}
public partial class CookieCollection : System.Collections.Generic.ICollection<System.Net.Cookie>, System.Collections.Generic.IEnumerable<System.Net.Cookie>, System.Collections.Generic.IReadOnlyCollection<System.Net.Cookie>, System.Collections.ICollection, System.Collections.IEnumerable
{
public CookieCollection() { }
public int Count { get { throw null; } }
public bool IsReadOnly { get { throw null; } }
public bool IsSynchronized { get { throw null; } }
public System.Net.Cookie this[int index] { get { throw null; } }
public System.Net.Cookie? this[string name] { get { throw null; } }
public object SyncRoot { get { throw null; } }
public void Add(System.Net.Cookie cookie) { }
public void Add(System.Net.CookieCollection cookies) { }
public void Clear() { }
public bool Contains(System.Net.Cookie cookie) { throw null; }
public void CopyTo(System.Array array, int index) { }
public void CopyTo(System.Net.Cookie[] array, int index) { }
public System.Collections.IEnumerator GetEnumerator() { throw null; }
public bool Remove(System.Net.Cookie cookie) { throw null; }
System.Collections.Generic.IEnumerator<System.Net.Cookie> System.Collections.Generic.IEnumerable<System.Net.Cookie>.GetEnumerator() { throw null; }
}
public partial class CookieContainer
{
public const int DefaultCookieLengthLimit = 4096;
public const int DefaultCookieLimit = 300;
public const int DefaultPerDomainCookieLimit = 20;
public CookieContainer() { }
public CookieContainer(int capacity) { }
public CookieContainer(int capacity, int perDomainCapacity, int maxCookieSize) { }
public int Capacity { get { throw null; } set { } }
public int Count { get { throw null; } }
public int MaxCookieSize { get { throw null; } set { } }
public int PerDomainCapacity { get { throw null; } set { } }
public void Add(System.Net.Cookie cookie) { }
public void Add(System.Net.CookieCollection cookies) { }
public void Add(System.Uri uri, System.Net.Cookie cookie) { }
public void Add(System.Uri uri, System.Net.CookieCollection cookies) { }
public string GetCookieHeader(System.Uri uri) { throw null; }
public System.Net.CookieCollection GetCookies(System.Uri uri) { throw null; }
public System.Net.CookieCollection GetAllCookies() { throw null; }
public void SetCookies(System.Uri uri, string cookieHeader) { }
}
public partial class CookieException : System.FormatException, System.Runtime.Serialization.ISerializable
{
public CookieException() { }
protected CookieException(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext) { }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext) { }
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext) { }
}
public partial class CredentialCache : System.Collections.IEnumerable, System.Net.ICredentials, System.Net.ICredentialsByHost
{
public CredentialCache() { }
public static System.Net.ICredentials DefaultCredentials { get { throw null; } }
public static System.Net.NetworkCredential DefaultNetworkCredentials { get { throw null; } }
public void Add(string host, int port, string authenticationType, System.Net.NetworkCredential credential) { }
public void Add(System.Uri uriPrefix, string authType, System.Net.NetworkCredential cred) { }
public System.Net.NetworkCredential? GetCredential(string host, int port, string authenticationType) { throw null; }
public System.Net.NetworkCredential? GetCredential(System.Uri uriPrefix, string authType) { throw null; }
public System.Collections.IEnumerator GetEnumerator() { throw null; }
public void Remove(string? host, int port, string? authenticationType) { }
public void Remove(System.Uri? uriPrefix, string? authType) { }
}
[System.FlagsAttribute]
public enum DecompressionMethods
{
All = -1,
None = 0,
GZip = 1,
Deflate = 2,
Brotli = 4,
}
public partial class DnsEndPoint : System.Net.EndPoint
{
public DnsEndPoint(string host, int port) { }
public DnsEndPoint(string host, int port, System.Net.Sockets.AddressFamily addressFamily) { }
public override System.Net.Sockets.AddressFamily AddressFamily { get { throw null; } }
public string Host { get { throw null; } }
public int Port { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? comparand) { throw null; }
public override int GetHashCode() { throw null; }
public override string ToString() { throw null; }
}
public abstract partial class EndPoint
{
protected EndPoint() { }
public virtual System.Net.Sockets.AddressFamily AddressFamily { get { throw null; } }
public virtual System.Net.EndPoint Create(System.Net.SocketAddress socketAddress) { throw null; }
public virtual System.Net.SocketAddress Serialize() { throw null; }
}
public enum HttpStatusCode
{
Continue = 100,
SwitchingProtocols = 101,
Processing = 102,
EarlyHints = 103,
OK = 200,
Created = 201,
Accepted = 202,
NonAuthoritativeInformation = 203,
NoContent = 204,
ResetContent = 205,
PartialContent = 206,
MultiStatus = 207,
AlreadyReported = 208,
IMUsed = 226,
Ambiguous = 300,
MultipleChoices = 300,
Moved = 301,
MovedPermanently = 301,
Found = 302,
Redirect = 302,
RedirectMethod = 303,
SeeOther = 303,
NotModified = 304,
UseProxy = 305,
Unused = 306,
RedirectKeepVerb = 307,
TemporaryRedirect = 307,
PermanentRedirect = 308,
BadRequest = 400,
Unauthorized = 401,
PaymentRequired = 402,
Forbidden = 403,
NotFound = 404,
MethodNotAllowed = 405,
NotAcceptable = 406,
ProxyAuthenticationRequired = 407,
RequestTimeout = 408,
Conflict = 409,
Gone = 410,
LengthRequired = 411,
PreconditionFailed = 412,
RequestEntityTooLarge = 413,
RequestUriTooLong = 414,
UnsupportedMediaType = 415,
RequestedRangeNotSatisfiable = 416,
ExpectationFailed = 417,
MisdirectedRequest = 421,
UnprocessableEntity = 422,
Locked = 423,
FailedDependency = 424,
UpgradeRequired = 426,
PreconditionRequired = 428,
TooManyRequests = 429,
RequestHeaderFieldsTooLarge = 431,
UnavailableForLegalReasons = 451,
InternalServerError = 500,
NotImplemented = 501,
BadGateway = 502,
ServiceUnavailable = 503,
GatewayTimeout = 504,
HttpVersionNotSupported = 505,
VariantAlsoNegotiates = 506,
InsufficientStorage = 507,
LoopDetected = 508,
NotExtended = 510,
NetworkAuthenticationRequired = 511,
}
public static partial class HttpVersion
{
public static readonly System.Version Unknown;
public static readonly System.Version Version10;
public static readonly System.Version Version11;
public static readonly System.Version Version20;
public static readonly System.Version Version30;
}
public partial interface ICredentials
{
System.Net.NetworkCredential? GetCredential(System.Uri uri, string authType);
}
public partial interface ICredentialsByHost
{
System.Net.NetworkCredential? GetCredential(string host, int port, string authenticationType);
}
public partial class IPAddress
{
public static readonly System.Net.IPAddress Any;
public static readonly System.Net.IPAddress Broadcast;
public static readonly System.Net.IPAddress IPv6Any;
public static readonly System.Net.IPAddress IPv6Loopback;
public static readonly System.Net.IPAddress IPv6None;
public static readonly System.Net.IPAddress Loopback;
public static readonly System.Net.IPAddress None;
public IPAddress(byte[] address) { }
public IPAddress(byte[] address, long scopeid) { }
public IPAddress(long newAddress) { }
public IPAddress(System.ReadOnlySpan<byte> address) { }
public IPAddress(System.ReadOnlySpan<byte> address, long scopeid) { }
[System.ObsoleteAttribute("IPAddress.Address is address family dependent and has been deprecated. Use IPAddress.Equals to perform comparisons.")]
public long Address { get { throw null; } set { } }
public System.Net.Sockets.AddressFamily AddressFamily { get { throw null; } }
public bool IsIPv4MappedToIPv6 { get { throw null; } }
public bool IsIPv6LinkLocal { get { throw null; } }
public bool IsIPv6Multicast { get { throw null; } }
public bool IsIPv6SiteLocal { get { throw null; } }
public bool IsIPv6Teredo { get { throw null; } }
public bool IsIPv6UniqueLocal { get { throw null; } }
public long ScopeId { get { throw null; } set { } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? comparand) { throw null; }
public byte[] GetAddressBytes() { throw null; }
public override int GetHashCode() { throw null; }
public static short HostToNetworkOrder(short host) { throw null; }
public static int HostToNetworkOrder(int host) { throw null; }
public static long HostToNetworkOrder(long host) { throw null; }
public static bool IsLoopback(System.Net.IPAddress address) { throw null; }
public System.Net.IPAddress MapToIPv4() { throw null; }
public System.Net.IPAddress MapToIPv6() { throw null; }
public static short NetworkToHostOrder(short network) { throw null; }
public static int NetworkToHostOrder(int network) { throw null; }
public static long NetworkToHostOrder(long network) { throw null; }
public static System.Net.IPAddress Parse(System.ReadOnlySpan<char> ipSpan) { throw null; }
public static System.Net.IPAddress Parse(string ipString) { throw null; }
public override string ToString() { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> ipSpan, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Net.IPAddress? address) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? ipString, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Net.IPAddress? address) { throw null; }
public bool TryWriteBytes(System.Span<byte> destination, out int bytesWritten) { throw null; }
}
public partial class IPEndPoint : System.Net.EndPoint
{
public const int MaxPort = 65535;
public const int MinPort = 0;
public IPEndPoint(long address, int port) { }
public IPEndPoint(System.Net.IPAddress address, int port) { }
public System.Net.IPAddress Address { get { throw null; } set { } }
public override System.Net.Sockets.AddressFamily AddressFamily { get { throw null; } }
public int Port { get { throw null; } set { } }
public override System.Net.EndPoint Create(System.Net.SocketAddress socketAddress) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? comparand) { throw null; }
public override int GetHashCode() { throw null; }
public static System.Net.IPEndPoint Parse(System.ReadOnlySpan<char> s) { throw null; }
public static System.Net.IPEndPoint Parse(string s) { throw null; }
public override System.Net.SocketAddress Serialize() { throw null; }
public override string ToString() { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Net.IPEndPoint? result) { throw null; }
public static bool TryParse(string s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Net.IPEndPoint? result) { throw null; }
}
public partial interface IWebProxy
{
System.Net.ICredentials? Credentials { get; set; }
System.Uri? GetProxy(System.Uri destination);
bool IsBypassed(System.Uri host);
}
public partial class NetworkCredential : System.Net.ICredentials, System.Net.ICredentialsByHost
{
public NetworkCredential() { }
[System.CLSCompliantAttribute(false)]
public NetworkCredential(string? userName, System.Security.SecureString? password) { }
[System.CLSCompliantAttribute(false)]
public NetworkCredential(string? userName, System.Security.SecureString? password, string? domain) { }
public NetworkCredential(string? userName, string? password) { }
public NetworkCredential(string? userName, string? password, string? domain) { }
[System.Diagnostics.CodeAnalysis.AllowNullAttribute]
public string Domain { get { throw null; } set { } }
[System.Diagnostics.CodeAnalysis.AllowNullAttribute]
public string Password { get { throw null; } set { } }
[System.CLSCompliantAttribute(false)]
[System.Diagnostics.CodeAnalysis.AllowNullAttribute]
public System.Security.SecureString SecurePassword { get { throw null; } set { } }
[System.Diagnostics.CodeAnalysis.AllowNullAttribute]
public string UserName { get { throw null; } set { } }
public System.Net.NetworkCredential GetCredential(string? host, int port, string? authenticationType) { throw null; }
public System.Net.NetworkCredential GetCredential(System.Uri? uri, string? authenticationType) { throw null; }
}
public partial class SocketAddress
{
public SocketAddress(System.Net.Sockets.AddressFamily family) { }
public SocketAddress(System.Net.Sockets.AddressFamily family, int size) { }
public System.Net.Sockets.AddressFamily Family { get { throw null; } }
public byte this[int offset] { get { throw null; } set { } }
public int Size { get { throw null; } }
public override bool Equals(object? comparand) { throw null; }
public override int GetHashCode() { throw null; }
public override string ToString() { throw null; }
}
public abstract partial class TransportContext
{
protected TransportContext() { }
public abstract System.Security.Authentication.ExtendedProtection.ChannelBinding? GetChannelBinding(System.Security.Authentication.ExtendedProtection.ChannelBindingKind kind);
}
}
namespace System.Net.Cache
{
public enum RequestCacheLevel
{
Default = 0,
BypassCache = 1,
CacheOnly = 2,
CacheIfAvailable = 3,
Revalidate = 4,
Reload = 5,
NoCacheNoStore = 6,
}
public partial class RequestCachePolicy
{
public RequestCachePolicy() { }
public RequestCachePolicy(System.Net.Cache.RequestCacheLevel level) { }
public System.Net.Cache.RequestCacheLevel Level { get { throw null; } }
public override string ToString() { throw null; }
}
}
namespace System.Net.NetworkInformation
{
public partial class IPAddressCollection : System.Collections.Generic.ICollection<System.Net.IPAddress>, System.Collections.Generic.IEnumerable<System.Net.IPAddress>, System.Collections.IEnumerable
{
protected internal IPAddressCollection() { }
public virtual int Count { get { throw null; } }
public virtual bool IsReadOnly { get { throw null; } }
public virtual System.Net.IPAddress this[int index] { get { throw null; } }
public virtual void Add(System.Net.IPAddress address) { }
public virtual void Clear() { }
public virtual bool Contains(System.Net.IPAddress address) { throw null; }
public virtual void CopyTo(System.Net.IPAddress[] array, int offset) { }
public virtual System.Collections.Generic.IEnumerator<System.Net.IPAddress> GetEnumerator() { throw null; }
public virtual bool Remove(System.Net.IPAddress address) { throw null; }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
}
}
namespace System.Net.Security
{
public enum AuthenticationLevel
{
None = 0,
MutualAuthRequested = 1,
MutualAuthRequired = 2,
}
[System.FlagsAttribute]
public enum SslPolicyErrors
{
None = 0,
RemoteCertificateNotAvailable = 1,
RemoteCertificateNameMismatch = 2,
RemoteCertificateChainErrors = 4,
}
}
namespace System.Net.Sockets
{
public enum AddressFamily
{
Unknown = -1,
Unspecified = 0,
Unix = 1,
InterNetwork = 2,
ImpLink = 3,
Pup = 4,
Chaos = 5,
Ipx = 6,
NS = 6,
Iso = 7,
Osi = 7,
Ecma = 8,
DataKit = 9,
Ccitt = 10,
Sna = 11,
DecNet = 12,
DataLink = 13,
Lat = 14,
HyperChannel = 15,
AppleTalk = 16,
NetBios = 17,
VoiceView = 18,
FireFox = 19,
Banyan = 21,
Atm = 22,
InterNetworkV6 = 23,
Cluster = 24,
Ieee12844 = 25,
Irda = 26,
NetworkDesigners = 28,
Max = 29,
Packet = 65536,
ControllerAreaNetwork = 65537,
}
public enum SocketError
{
SocketError = -1,
Success = 0,
OperationAborted = 995,
IOPending = 997,
Interrupted = 10004,
AccessDenied = 10013,
Fault = 10014,
InvalidArgument = 10022,
TooManyOpenSockets = 10024,
WouldBlock = 10035,
InProgress = 10036,
AlreadyInProgress = 10037,
NotSocket = 10038,
DestinationAddressRequired = 10039,
MessageSize = 10040,
ProtocolType = 10041,
ProtocolOption = 10042,
ProtocolNotSupported = 10043,
SocketNotSupported = 10044,
OperationNotSupported = 10045,
ProtocolFamilyNotSupported = 10046,
AddressFamilyNotSupported = 10047,
AddressAlreadyInUse = 10048,
AddressNotAvailable = 10049,
NetworkDown = 10050,
NetworkUnreachable = 10051,
NetworkReset = 10052,
ConnectionAborted = 10053,
ConnectionReset = 10054,
NoBufferSpaceAvailable = 10055,
IsConnected = 10056,
NotConnected = 10057,
Shutdown = 10058,
TimedOut = 10060,
ConnectionRefused = 10061,
HostDown = 10064,
HostUnreachable = 10065,
ProcessLimit = 10067,
SystemNotReady = 10091,
VersionNotSupported = 10092,
NotInitialized = 10093,
Disconnecting = 10101,
TypeNotFound = 10109,
HostNotFound = 11001,
TryAgain = 11002,
NoRecovery = 11003,
NoData = 11004,
}
public partial class SocketException : System.ComponentModel.Win32Exception
{
public SocketException() { }
public SocketException(int errorCode) { }
protected SocketException(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext) { }
public override int ErrorCode { get { throw null; } }
public override string Message { get { throw null; } }
public System.Net.Sockets.SocketError SocketErrorCode { get { throw null; } }
}
}
namespace System.Security.Authentication
{
public enum CipherAlgorithmType
{
None = 0,
Null = 24576,
Des = 26113,
Rc2 = 26114,
TripleDes = 26115,
Aes128 = 26126,
Aes192 = 26127,
Aes256 = 26128,
Aes = 26129,
Rc4 = 26625,
}
public enum ExchangeAlgorithmType
{
None = 0,
RsaSign = 9216,
RsaKeyX = 41984,
DiffieHellman = 43522,
}
public enum HashAlgorithmType
{
None = 0,
Md5 = 32771,
Sha1 = 32772,
Sha256 = 32780,
Sha384 = 32781,
Sha512 = 32782,
}
[System.FlagsAttribute]
public enum SslProtocols
{
None = 0,
[System.ObsoleteAttribute("SslProtocols.Ssl2 has been deprecated and is not supported.")]
Ssl2 = 12,
[System.ObsoleteAttribute("SslProtocols.Ssl3 has been deprecated and is not supported.")]
Ssl3 = 48,
Tls = 192,
[System.ObsoleteAttribute("SslProtocols.Default has been deprecated and is not supported.")]
Default = 240,
Tls11 = 768,
Tls12 = 3072,
Tls13 = 12288,
}
}
namespace System.Security.Authentication.ExtendedProtection
{
public abstract partial class ChannelBinding : Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid
{
protected ChannelBinding() : base (default(bool)) { }
protected ChannelBinding(bool ownsHandle) : base (default(bool)) { }
public abstract int Size { get; }
}
public enum ChannelBindingKind
{
Unknown = 0,
Unique = 25,
Endpoint = 26,
}
}