Init
This commit is contained in:
51
TorWebClient/TorClient/Streams/Enumerators/StreamPurpose.cs
Normal file
51
TorWebClient/TorClient/Streams/Enumerators/StreamPurpose.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Tor
|
||||
{
|
||||
/// <summary>
|
||||
/// An enumerator containing the different purposes for a stream, which is provided when extended events are enabled.
|
||||
/// </summary>
|
||||
public enum StreamPurpose
|
||||
{
|
||||
/// <summary>
|
||||
/// A purpose was not provided.
|
||||
/// </summary>
|
||||
[Description(null)]
|
||||
None,
|
||||
|
||||
/// <summary>
|
||||
/// The stream was generated internally for fetching directory information.
|
||||
/// </summary>
|
||||
[Description("DIR_FETCH")]
|
||||
DirectoryFetch,
|
||||
|
||||
/// <summary>
|
||||
/// The stream was generated internally for uploading information to a directory authority.
|
||||
/// </summary>
|
||||
[Description("DIR_READ")]
|
||||
DirectoryRead,
|
||||
|
||||
/// <summary>
|
||||
/// The stream is a user-initiated DNS request.
|
||||
/// </summary>
|
||||
[Description("DNS_REQUEST")]
|
||||
DNSRequest,
|
||||
|
||||
/// <summary>
|
||||
/// The stream is used explicitly for testing whether our hosted directory port is accessible.
|
||||
/// </summary>
|
||||
[Description("DIRPORT_TEST")]
|
||||
DirectoryPortTest,
|
||||
|
||||
/// <summary>
|
||||
/// The stream is likely handling a user request. This could also be an internal stream, and none of the other
|
||||
/// purposes match the real purpose of the stream.
|
||||
/// </summary>
|
||||
[Description("USER")]
|
||||
User,
|
||||
}
|
||||
}
|
||||
116
TorWebClient/TorClient/Streams/Enumerators/StreamReason.cs
Normal file
116
TorWebClient/TorClient/Streams/Enumerators/StreamReason.cs
Normal file
@@ -0,0 +1,116 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Tor
|
||||
{
|
||||
/// <summary>
|
||||
/// An enumerator containing the reasons for a stream's failed, closed or detached events.
|
||||
/// </summary>
|
||||
public enum StreamReason : int
|
||||
{
|
||||
/// <summary>
|
||||
/// No reason was provided.
|
||||
/// </summary>
|
||||
[Description(null)]
|
||||
None = 0,
|
||||
|
||||
/// <summary>
|
||||
/// A miscellaneous error occurred.
|
||||
/// </summary>
|
||||
[Description("MISC")]
|
||||
Misc = 1,
|
||||
|
||||
/// <summary>
|
||||
/// The stream failed to resolve an address.
|
||||
/// </summary>
|
||||
[Description("RESOLVEFAILED")]
|
||||
ResolveFailed = 2,
|
||||
|
||||
/// <summary>
|
||||
/// The stream connect attempt was refused.
|
||||
/// </summary>
|
||||
[Description("CONNECTREFUSED")]
|
||||
ConnectRefused = 3,
|
||||
|
||||
/// <summary>
|
||||
/// The exit policy failed.
|
||||
/// </summary>
|
||||
[Description("EXITPOLICY")]
|
||||
ExitPolicy = 4,
|
||||
|
||||
/// <summary>
|
||||
/// The stream was destroyed.
|
||||
/// </summary>
|
||||
[Description("DESTROY")]
|
||||
Destroy = 5,
|
||||
|
||||
/// <summary>
|
||||
/// The stream closed normally.
|
||||
/// </summary>
|
||||
[Description("DONE")]
|
||||
Done = 6,
|
||||
|
||||
/// <summary>
|
||||
/// The stream timed out.
|
||||
/// </summary>
|
||||
[Description("TIMEOUT")]
|
||||
Timeout = 7,
|
||||
|
||||
/// <summary>
|
||||
/// There is no route to the host.
|
||||
/// </summary>
|
||||
[Description("NOROUTE")]
|
||||
NoRoute = 8,
|
||||
|
||||
/// <summary>
|
||||
/// The server is hibernating.
|
||||
/// </summary>
|
||||
[Description("HIBERNATING")]
|
||||
Hibernating = 9,
|
||||
|
||||
/// <summary>
|
||||
/// An internal error occurred.
|
||||
/// </summary>
|
||||
[Description("INTERNAL")]
|
||||
Internal = 10,
|
||||
|
||||
/// <summary>
|
||||
/// The server ran out of resources.
|
||||
/// </summary>
|
||||
[Description("RESOURCELIMIT")]
|
||||
ResourceLimit = 11,
|
||||
|
||||
/// <summary>
|
||||
/// The connection was reset.
|
||||
/// </summary>
|
||||
[Description("CONNRESET")]
|
||||
ConnReset = 12,
|
||||
|
||||
/// <summary>
|
||||
/// There was a tor protocol error.
|
||||
/// </summary>
|
||||
[Description("TORPROTOCOL")]
|
||||
TorProtocol = 13,
|
||||
|
||||
/// <summary>
|
||||
/// The stream was not accessing a directory.
|
||||
/// </summary>
|
||||
[Description("NOTDIRECTORY")]
|
||||
NotDirectory = 14,
|
||||
|
||||
/// <summary>
|
||||
/// A relay-end cell was received.
|
||||
/// </summary>
|
||||
[Description("END")]
|
||||
End = -1,
|
||||
|
||||
/// <summary>
|
||||
/// The client tried to connect to a private address.
|
||||
/// </summary>
|
||||
[Description("PRIVATE_ADDR")]
|
||||
PrivateAddr = -1,
|
||||
}
|
||||
}
|
||||
74
TorWebClient/TorClient/Streams/Enumerators/StreamStatus.cs
Normal file
74
TorWebClient/TorClient/Streams/Enumerators/StreamStatus.cs
Normal file
@@ -0,0 +1,74 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Tor
|
||||
{
|
||||
/// <summary>
|
||||
/// An enumerator containing the different possible statuses for a stream.
|
||||
/// </summary>
|
||||
public enum StreamStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// The stream status was not provided.
|
||||
/// </summary>
|
||||
[Description(null)]
|
||||
None,
|
||||
|
||||
/// <summary>
|
||||
/// A new request to connect.
|
||||
/// </summary>
|
||||
[Description("NEW")]
|
||||
New,
|
||||
|
||||
/// <summary>
|
||||
/// A new request to resolve an address.
|
||||
/// </summary>
|
||||
[Description("NEWRESOLVE")]
|
||||
NewResolve,
|
||||
|
||||
/// <summary>
|
||||
/// An address was re-mapped to another.
|
||||
/// </summary>
|
||||
[Description("REMAP")]
|
||||
Remap,
|
||||
|
||||
/// <summary>
|
||||
/// A connect cell was sent along a circuit.
|
||||
/// </summary>
|
||||
[Description("SENTCONNECT")]
|
||||
SentConnect,
|
||||
|
||||
/// <summary>
|
||||
/// A resolve cell was sent along the circuit.
|
||||
/// </summary>
|
||||
[Description("SENTRESOLVE")]
|
||||
SentResolve,
|
||||
|
||||
/// <summary>
|
||||
/// A reply was received and the stream was established.
|
||||
/// </summary>
|
||||
[Description("SUCCEEDED")]
|
||||
Succeeded,
|
||||
|
||||
/// <summary>
|
||||
/// The stream failed and cannot be retried.
|
||||
/// </summary>
|
||||
[Description("FAILED")]
|
||||
Failed,
|
||||
|
||||
/// <summary>
|
||||
/// The stream is closed.
|
||||
/// </summary>
|
||||
[Description("CLOSED")]
|
||||
Closed,
|
||||
|
||||
/// <summary>
|
||||
/// The stream was detached from a circuit, but can be retried.
|
||||
/// </summary>
|
||||
[Description("DETACHED")]
|
||||
Detached,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user