This commit is contained in:
2024-02-23 06:57:07 -05:00
commit 8fb7082f56
104 changed files with 284139 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
namespace Tor
{
/// <summary>
/// An enumerator containing the possible values specified against the BUILD_FLAGS parameter.
/// </summary>
[Flags]
public enum CircuitBuildFlags : int
{
/// <summary>
/// No build flags were specified.
/// </summary>
[Description(null)]
None = 0x000,
/// <summary>
/// The circuit is a one hop circuit used to fetch directory information.
/// </summary>
[Description("ONEHOP_TUNNEL")]
OneHopTunnel = 0x001,
/// <summary>
/// The circuit will not be used for client traffic.
/// </summary>
[Description("IS_INTERNAL")]
IsInternal = 0x002,
/// <summary>
/// The circuit only includes high capacity relays.
/// </summary>
[Description("NEED_CAPACITY")]
NeedCapacity = 0x004,
/// <summary>
/// The circuit only includes relays with high uptime.
/// </summary>
[Description("NEED_UPTIME")]
NeedUpTime = 0x008,
}
}

View File

@@ -0,0 +1,87 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
namespace Tor
{
/// <summary>
/// An enumerator containing the possible values specified against the HS_STATE parameter. The HS_STATE indicates the
/// different states that a hidden service circuit may have.
/// </summary>
public enum CircuitHSState
{
/// <summary>
/// No hidden service state was provided.
/// </summary>
[Description(null)]
None,
/// <summary>
/// The client-side hidden service is connecting to the introductory point.
/// </summary>
[Description("HSCI_CONNECTING")]
HSCIConnecting,
/// <summary>
/// The client-side hidden service has sent INTRODUCE1 and is awaiting a reply.
/// </summary>
[Description("HSCI_INTRO_SENT")]
HSCIIntroSent,
/// <summary>
/// The client-side hidden service has received a reply and the circuit is closing.
/// </summary>
[Description("HSCI_DONE")]
HSCIDone,
/// <summary>
/// The client-side hidden service is connecting to the rendezvous point.
/// </summary>
[Description("HSCR_CONNECTING")]
HSCRConnecting,
/// <summary>
/// The client-side hidden servicce has established connection to the rendezvous point and is awaiting an introduction.
/// </summary>
[Description("HSCR_ESTABLISHED_IDLE")]
HSCREstablishedIdle,
/// <summary>
/// The client-side hidden service has received an introduction and is awaiting a rend.
/// </summary>
[Description("HSCR_ESTABLISHED_WAITING")]
HSCREstablishedWaiting,
/// <summary>
/// The client-side hidden service is connected to the hidden service.
/// </summary>
[Description("HSCR_JOINED")]
HSCRJoined,
/// <summary>
/// The server-side hidden service is connecting to the introductory point.
/// </summary>
[Description("HSSI_CONNECTING")]
HSSIConnecting,
/// <summary>
/// The server-side hidden service has established connection to the introductory point.
/// </summary>
[Description("HSSI_ESTABLISHED")]
HSSIEstablished,
/// <summary>
/// The server-side hidden service is connecting to the rendezvous point.
/// </summary>
[Description("HSSR_CONNECTING")]
HSSRConnecting,
/// <summary>
/// The server-side hidden service has established connection to the rendezvous point.
/// </summary>
[Description("HSSR_JOINED")]
HSSRJoined,
}
}

View File

@@ -0,0 +1,68 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
namespace Tor
{
/// <summary>
/// An enumerator containing the possible values specified against the PURPOSE parameter.
/// </summary>
public enum CircuitPurpose
{
/// <summary>
/// No purpose parameter was specified.
/// </summary>
[Description(null)]
None,
/// <summary>
/// The circuit is intended for traffic or fetching directory information.
/// </summary>
[Description("GENERAL")]
General,
/// <summary>
/// The circuit is a client-side introduction point for a hidden service circuit.
/// </summary>
[Description("HS_CLIENT_INTRO")]
HSClientIntro,
/// <summary>
/// The circuit is a client-side hidden service rendezvous circuit.
/// </summary>
[Description("HS_CLIENT_REND")]
HSClientRend,
/// <summary>
/// The circuit is a server-side introduction point for a hidden service circuit.
/// </summary>
[Description("HS_SERVICE_INTRO")]
HSServiceIntro,
/// <summary>
/// The circuit is a server-side hidden service rendezvous circuit.
/// </summary>
[Description("HS_SERVICE_REND")]
HSServiceRend,
/// <summary>
/// The circuit is a test circuit to verify that the service can be used as a relay.
/// </summary>
[Description("TESTING")]
Testing,
/// <summary>
/// The circuit was built by a controller.
/// </summary>
[Description("CONTROLLER")]
Controller,
/// <summary>
/// The circuit was built to measure the time taken.
/// </summary>
[Description("MEASURE_TIMEOUT")]
MeasureTimeout,
}
}

View File

@@ -0,0 +1,104 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
namespace Tor
{
/// <summary>
/// An enumerator containing the possible values for a field which uses the REASON parameter.
/// </summary>
public enum CircuitReason
{
/// <summary>
/// No reason was provided.
/// </summary>
[Description(null)]
None,
/// <summary>
/// There was a violation in the Tor protocol.
/// </summary>
[Description("TORPROTOCOL")]
TorProtocol,
/// <summary>
/// There was an internal error.
/// </summary>
[Description("INTERNAL")]
Internal,
/// <summary>
/// Requested by the client via a TRUNCATE command.
/// </summary>
[Description("REQUESTED")]
Requested,
/// <summary>
/// The relay is currently hibernating.
/// </summary>
[Description("HIBERNATING")]
Hibernating,
/// <summary>
/// The relay is out of memory, sockets, or circuit IDs.
/// </summary>
[Description("RESOURCELIMIT")]
ResourceLimit,
/// <summary>
/// Unable to contact the relay.
/// </summary>
[Description("CONNECTFAILED")]
ConnectFailed,
/// <summary>
/// The relay had the wrong OR identification.
/// </summary>
[Description("OR_IDENTITY")]
ORIdentity,
/// <summary>
/// The connection failed after being established.
/// </summary>
[Description("OR_CONN_CLOSED")]
ORConnectionClosed,
/// <summary>
/// The circuit has expired.
/// </summary>
[Description("FINISHED")]
Finished,
/// <summary>
/// The circuit construction timed out.
/// </summary>
[Description("TIMEOUT")]
Timeout,
/// <summary>
/// The circuit was unexpectedly closed.
/// </summary>
[Description("DESTROYED")]
Destroyed,
/// <summary>
/// There are not enough relays to make a circuit.
/// </summary>
[Description("NOPATH")]
NoPath,
/// <summary>
/// The requested hidden service does not exist.
/// </summary>
[Description("NOSUCHSERVICE")]
NoSuchService,
/// <summary>
/// The circuit construction timed out, except that the circuit was left open for measurement purposes.
/// </summary>
[Description("MEASUREMENT_EXPIRED")]
MeasurementExpired,
}
}

View File

@@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
namespace Tor
{
/// <summary>
/// An enumerator containing the possible statuses of a circuit.
/// </summary>
public enum CircuitStatus
{
/// <summary>
/// The circuit ID was assigned to a new circuit.
/// </summary>
[Description("LAUNCHED")]
Launched,
/// <summary>
/// The circuit has completed all hops and can accept streams.
/// </summary>
[Description("BUILT")]
Built,
/// <summary>
/// The circuit has been extended with an additional hop.
/// </summary>
[Description("EXTENDED")]
Extended,
/// <summary>
/// The circuit is closed because it was not built.
/// </summary>
[Description("FAILED")]
Failed,
/// <summary>
/// The circuit is closed.
/// </summary>
[Description("CLOSED")]
Closed
}
}