-using Hazel.Udp;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Linq;
using System.Net;
using System.Threading;
+using Impostor.Hazel.Udp;
namespace Hazel.UnitTests
{
-using Hazel.Crypto;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Text;
+using Impostor.Hazel;
+using Impostor.Hazel.Crypto;
namespace Hazel.UnitTests.Crypto
{
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-using Hazel.Crypto;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Security.Cryptography;
+using Impostor.Hazel;
+using Impostor.Hazel.Crypto;
namespace Hazel.UnitTests.Crypto
{
-using Hazel.Dtls;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Security.Cryptography;
using System.Text;
+using Impostor.Hazel;
+using Impostor.Hazel.Dtls;
namespace Hazel.UnitTests.Dtls
{
-using Hazel.Dtls;
-using Hazel.Udp;
-using Hazel.Udp.FewerThreads;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Net;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Threading;
+using Impostor.Hazel;
+using Impostor.Hazel.Dtls;
+using Impostor.Hazel.FewerThreads;
+using Impostor.Hazel.Udp;
+using Impostor.Hazel.UPnP;
namespace Hazel.UnitTests.Dtls
{
-using Hazel.Dtls;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Security.Cryptography;
+using Impostor.Hazel;
+using Impostor.Hazel.Dtls;
namespace Hazel.UnitTests.Dtls
{
using System;
using System.IO;
using System.Linq;
+using Impostor.Hazel;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Hazel.UnitTests
using System;
using System.IO;
+using Impostor.Hazel;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Hazel.UnitTests
using System;
+using Impostor.Hazel;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Hazel.UnitTests
using System.Net;
using System.Threading;
using System.Threading.Tasks;
-using Hazel.Udp;
+using Impostor.Hazel.Udp;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Hazel.UnitTests
using System.Net;
using System.Threading;
using System.Diagnostics;
-using Hazel.Udp.FewerThreads;
+using Impostor.Hazel;
+using Impostor.Hazel.FewerThreads;
+using DataReceivedEventArgs = Impostor.Hazel.DataReceivedEventArgs;
namespace Hazel.UnitTests
{
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Impostor.Hazel.UPnP;
namespace Hazel.UnitTests
{
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Net;
using System.Threading;
-using Hazel.Udp;
-using Hazel.Udp.FewerThreads;
using System.Net.Sockets;
+using Impostor.Hazel;
+using Impostor.Hazel.FewerThreads;
+using Impostor.Hazel.Udp;
+using Impostor.Hazel.UPnP;
namespace Hazel.UnitTests
{
using System;
-using Hazel.UPnP;
+using Impostor.Hazel.UPnP;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Hazel.UnitTests
-using Hazel.Udp;
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Impostor.Hazel;
+using Impostor.Hazel.Udp;
namespace Hazel.UnitTests
{
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Net;
using System.Threading;
-using Hazel.Udp;
using System.Net.Sockets;
+using Impostor.Hazel;
+using Impostor.Hazel.Udp;
namespace Hazel.UnitTests
{
using System;
using System.Collections.Generic;
-using Hazel.Udp;
+using Impostor.Hazel;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Hazel.UnitTests
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Net;
using System.Threading;
-using Hazel.Udp;
using System.Net.Sockets;
+using Impostor.Hazel;
+using Impostor.Hazel.Udp;
namespace Hazel.UnitTests
{
using System;
-namespace Hazel
+namespace Impostor.Hazel
{
/// <summary>
/// This is a minimal implementation of `System.Span` in .NET 5.0
-namespace Hazel
+namespace Impostor.Hazel
{
/// <summary>
/// Extension functions for (en/de)coding integer values
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Net.Sockets;
using System.Net;
-using System.Threading;
-namespace Hazel
+namespace Impostor.Hazel
{
/// <summary>
/// Base class for all connections.
using System;
-namespace Hazel
+namespace Impostor.Hazel
{
/// <summary>
/// Base class for all connection listeners.
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Hazel
+namespace Impostor.Hazel
{
/// <summary>
/// Represents the state a <see cref="Connection"/> is currently in.
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading;
+using System.Threading;
-
-namespace Hazel
+namespace Impostor.Hazel
{
/// <summary>
/// Holds statistics about the traffic through a <see cref="Connection"/>.
using System.Diagnostics;
using System.Security.Cryptography;
-namespace Hazel.Crypto
+namespace Impostor.Hazel.Crypto
{
/// <summary>
/// Implementation of AEAD_AES128_GCM based on:
using System.Diagnostics;
-namespace Hazel.Crypto
+namespace Impostor.Hazel.Crypto
{
public static class Const
{
using System;
using System.Security.Cryptography;
-namespace Hazel.Crypto
+namespace Impostor.Hazel.Crypto
{
public static class SpanCryptoExtensions
{
using System;
using System.Diagnostics;
-namespace Hazel.Crypto
+namespace Impostor.Hazel.Crypto
{
/// <summary>
/// The x25519 key agreement algorithm
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Hazel
+namespace Impostor.Hazel
{
public struct DataReceivedEventArgs
{
using System;
-namespace Hazel
+namespace Impostor.Hazel
{
public class DisconnectedEventArgs : EventArgs
{
-using Hazel.Crypto;
-using System;
using System.Diagnostics;
+using Impostor.Hazel.Crypto;
-namespace Hazel.Dtls
+namespace Impostor.Hazel.Dtls
{
/// <summary>
/// *_AES_128_GCM_* cipher suite
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Threading;
-using Hazel.Udp.FewerThreads;
-using Hazel.Crypto;
+using Impostor.Hazel.Crypto;
+using Impostor.Hazel.FewerThreads;
+using Impostor.Hazel.UPnP;
-namespace Hazel.Dtls
+namespace Impostor.Hazel.Dtls
{
/// <summary>
/// Listens for new UDP-DTLS connections and creates UdpConnections for them.
-using Hazel.Crypto;
-using Hazel.Udp;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Net;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
+using Impostor.Hazel.Crypto;
+using Impostor.Hazel.Udp;
+using Impostor.Hazel.UPnP;
-namespace Hazel.Dtls
+namespace Impostor.Hazel.Dtls
{
/// <summary>
/// Connects to a UDP-DTLS server
using System;
-using System.Collections.Generic;
using System.Diagnostics;
using System.Net;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
-namespace Hazel.Dtls
+namespace Impostor.Hazel.Dtls
{
/// <summary>
/// Handshake message type
using System;
-namespace Hazel.Dtls
+namespace Impostor.Hazel.Dtls
{
/// <summary>
/// DTLS cipher suite interface for the handshake portion of
using System;
-namespace Hazel.Dtls
+namespace Impostor.Hazel.Dtls
{
/// <summary>
/// DTLS cipher suite interface for protection of record payload.
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Hazel.Dtls
+namespace Impostor.Hazel.Dtls
{
/// <summary>
/// Passthrough record protection implementaion
-using System.Text;
using System.Security.Cryptography;
+using System.Text;
-namespace Hazel.Dtls
+namespace Impostor.Hazel.Dtls
{
/// <summary>
/// Common Psuedorandom Function labels for TLS
-namespace Hazel.Dtls
+namespace Impostor.Hazel.Dtls
{
/// <summary>
/// DTLS version constants
-using Hazel.Crypto;
using System;
using System.Diagnostics;
using System.Security.Cryptography;
+using Impostor.Hazel.Crypto;
-namespace Hazel.Dtls
+namespace Impostor.Hazel.Dtls
{
/// <summary>
/// ECDHE_RSA_*_256 cipher suite
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
+using System.Threading;
-namespace Hazel
+namespace Impostor.Hazel.FewerThreads
{
internal class HazelThreadPool
{
using System;
using System.Collections.Concurrent;
-using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
using System.Threading;
+using Impostor.Hazel.Udp;
+using Impostor.Hazel.UPnP;
-namespace Hazel.Udp.FewerThreads
+namespace Impostor.Hazel.FewerThreads
{
/// <summary>
/// Listens for new UDP connections and creates UdpConnections for them.
using System;
using System.Net;
+using Impostor.Hazel.Udp;
-namespace Hazel.Udp.FewerThreads
+namespace Impostor.Hazel.FewerThreads
{
/// <summary>
/// Represents a servers's connection to a client that uses the UDP protocol.
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFramework>net5.0</TargetFramework>
<DefineConstants>HAZEL_BAG</DefineConstants>
+ <RootNamespace>Impostor.Hazel</RootNamespace>
</PropertyGroup>
<ItemGroup>
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-namespace Hazel
+namespace Impostor.Hazel
{
/// <summary>
/// Wrapper for exceptions thrown from Hazel.
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-
-namespace Hazel
+namespace Impostor.Hazel
{
/// <summary>
/// Represents the IP version that a connection or listener will use.
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Hazel
+namespace Impostor.Hazel
{
/// <summary>
/// Interface for all items that can be returned to an object pool.
using System;
using System.IO;
-using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
-namespace Hazel
+namespace Impostor.Hazel
{
public class MessageReader : IRecyclable
{
using System;
using System.Collections.Generic;
-using System.IO;
using System.Text;
-namespace Hazel
+namespace Impostor.Hazel
{
///
public class MessageWriter : IRecyclable
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Net;
-using System.Text;
-
-namespace Hazel
+namespace Impostor.Hazel
{
public enum HazelInternalErrors
{
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Net;
-using System.Text;
+using System.Net;
-
-namespace Hazel
+namespace Impostor.Hazel
{
/// <summary>
/// Abstract base class for a <see cref="ConnectionListener"/> for network based connections.
-namespace Hazel
+namespace Impostor.Hazel
{
public struct NewConnectionEventArgs
{
using System;
using System.Collections.Concurrent;
-using System.Collections.Generic;
using System.Threading;
-namespace Hazel
+namespace Impostor.Hazel
{
/// <summary>
/// A fairly simple object pool for items that will be created a lot.
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-namespace Hazel
+namespace Impostor.Hazel
{
/// <summary>
/// Specifies how a message should be sent between connections.
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-namespace Hazel
+namespace Impostor.Hazel.UPnP
{
public interface ILogger
{
using System.Net.NetworkInformation;
using System.Net.Sockets;
-namespace Hazel.UPnP
+namespace Impostor.Hazel.UPnP
{
internal class NetUtility
{
using System;
using System.IO;
-using System.Xml;
using System.Net;
using System.Net.Sockets;
using System.Threading;
+using System.Xml;
-namespace Hazel.UPnP
+namespace Impostor.Hazel.UPnP
{
/// <summary>
/// Status of the UPnP capabilities
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-
-namespace Hazel.Udp
+namespace Impostor.Hazel.Udp
{
/// <summary>
/// Extra internal states for SendOption enumeration when using UDP.
using System.Net;
using System.Net.Sockets;
using System.Text;
-using System.Threading;
-namespace Hazel.Udp
+namespace Impostor.Hazel.Udp
{
public class BroadcastPacket
{
using System.Net.Sockets;
using System.Text;
-namespace Hazel.Udp
+namespace Impostor.Hazel.Udp
{
///
public class UdpBroadcaster : IDisposable
using System.Net.Sockets;
using System.Threading;
-
-namespace Hazel.Udp
+namespace Impostor.Hazel.Udp
{
/// <summary>
/// Represents a client's connection to a server that uses the UDP protocol.
using System.Diagnostics;
using System.Threading;
-
-namespace Hazel.Udp
+namespace Impostor.Hazel.Udp
{
partial class UdpConnection
{
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
-using System.Linq;
-using System.Text;
using System.Threading;
-
-namespace Hazel.Udp
+namespace Impostor.Hazel.Udp
{
partial class UdpConnection
{
using System;
using System.Net.Sockets;
-namespace Hazel.Udp
+namespace Impostor.Hazel.Udp
{
/// <summary>
/// Represents a connection that uses the UDP protocol.
using System.Net.Sockets;
using System.Threading;
-namespace Hazel.Udp
+namespace Impostor.Hazel.Udp
{
/// <summary>
/// Listens for new UDP connections and creates UdpConnections for them.
using System;
using System.Net;
-namespace Hazel.Udp
+namespace Impostor.Hazel.Udp
{
/// <summary>
/// Represents a servers's connection to a client that uses the UDP protocol.
using System.Net.Sockets;
using System.Threading;
-
-namespace Hazel.Udp
+namespace Impostor.Hazel.Udp
{
/// <summary>
/// Unity doesn't always get along with thread pools well, so this interface will hopefully suit that case better.