diff --git a/SMBLibrary/Server/ConnectionState/ConnectionState.cs b/SMBLibrary/Server/ConnectionState/ConnectionState.cs index a6a65bd..0645dc2 100644 --- a/SMBLibrary/Server/ConnectionState/ConnectionState.cs +++ b/SMBLibrary/Server/ConnectionState/ConnectionState.cs @@ -13,9 +13,9 @@ using Utilities; namespace SMBLibrary.Server { - public delegate void LogDelegate(Severity severity, string message); + internal delegate void LogDelegate(Severity severity, string message); - public class ConnectionState + internal class ConnectionState { public Socket ClientSocket; public IPEndPoint ClientEndPoint; diff --git a/SMBLibrary/Server/ConnectionState/OpenFileObject.cs b/SMBLibrary/Server/ConnectionState/OpenFileObject.cs index c5d3aea..d4ac9ae 100644 --- a/SMBLibrary/Server/ConnectionState/OpenFileObject.cs +++ b/SMBLibrary/Server/ConnectionState/OpenFileObject.cs @@ -11,7 +11,7 @@ using System.Text; namespace SMBLibrary.Server { - public class OpenFileObject + internal class OpenFileObject { public string Path; public object Handle; diff --git a/SMBLibrary/Server/ConnectionState/OpenSearch.cs b/SMBLibrary/Server/ConnectionState/OpenSearch.cs index 6722343..3519213 100644 --- a/SMBLibrary/Server/ConnectionState/OpenSearch.cs +++ b/SMBLibrary/Server/ConnectionState/OpenSearch.cs @@ -10,7 +10,7 @@ using Utilities; namespace SMBLibrary.Server { - public class OpenSearch + internal class OpenSearch { public List Entries; public int EnumerationLocation; diff --git a/SMBLibrary/Server/ConnectionState/ProcessStateObject.cs b/SMBLibrary/Server/ConnectionState/ProcessStateObject.cs index 1b812d0..03b2d24 100644 --- a/SMBLibrary/Server/ConnectionState/ProcessStateObject.cs +++ b/SMBLibrary/Server/ConnectionState/ProcessStateObject.cs @@ -10,7 +10,7 @@ using System.Text; namespace SMBLibrary.Server { - public class ProcessStateObject + internal class ProcessStateObject { public ushort SubcommandID; public string Name; // The pathname of the [..] named pipe to which the transaction subcommand applies, or a client-supplied [..] name for the transaction. diff --git a/SMBLibrary/Server/ConnectionState/SMB1ConnectionState.cs b/SMBLibrary/Server/ConnectionState/SMB1ConnectionState.cs index a08d3cd..b73cd14 100644 --- a/SMBLibrary/Server/ConnectionState/SMB1ConnectionState.cs +++ b/SMBLibrary/Server/ConnectionState/SMB1ConnectionState.cs @@ -11,7 +11,7 @@ using Utilities; namespace SMBLibrary.Server { - public class SMB1ConnectionState : ConnectionState + internal class SMB1ConnectionState : ConnectionState { public int MaxBufferSize; public bool LargeRead; diff --git a/SMBLibrary/Server/ConnectionState/SMB1Session.cs b/SMBLibrary/Server/ConnectionState/SMB1Session.cs index 524175a..4650d72 100644 --- a/SMBLibrary/Server/ConnectionState/SMB1Session.cs +++ b/SMBLibrary/Server/ConnectionState/SMB1Session.cs @@ -11,7 +11,7 @@ using Utilities; namespace SMBLibrary.Server { - public class SMB1Session + internal class SMB1Session { private const int MaxSearches = 2048; // Windows servers initialize Server.MaxSearches to 2048. diff --git a/SMBLibrary/Server/ConnectionState/SMB2ConnectionState.cs b/SMBLibrary/Server/ConnectionState/SMB2ConnectionState.cs index 71255cd..3840fac 100644 --- a/SMBLibrary/Server/ConnectionState/SMB2ConnectionState.cs +++ b/SMBLibrary/Server/ConnectionState/SMB2ConnectionState.cs @@ -14,7 +14,7 @@ namespace SMBLibrary.Server { public delegate ulong? AllocatePersistentFileID(); - public class SMB2ConnectionState : ConnectionState + internal class SMB2ConnectionState : ConnectionState { // Key is SessionID private Dictionary m_sessions = new Dictionary(); diff --git a/SMBLibrary/Server/ConnectionState/SMB2Session.cs b/SMBLibrary/Server/ConnectionState/SMB2Session.cs index 40ac787..4c2f1de 100644 --- a/SMBLibrary/Server/ConnectionState/SMB2Session.cs +++ b/SMBLibrary/Server/ConnectionState/SMB2Session.cs @@ -12,7 +12,7 @@ using Utilities; namespace SMBLibrary.Server { - public class SMB2Session + internal class SMB2Session { private SMB2ConnectionState m_connection; private ulong m_sessionID; diff --git a/SMBLibrary/Server/SMBServer.SMB1.cs b/SMBLibrary/Server/SMBServer.SMB1.cs index 67d5f92..6ee5ffc 100644 --- a/SMBLibrary/Server/SMBServer.SMB1.cs +++ b/SMBLibrary/Server/SMBServer.SMB1.cs @@ -15,7 +15,7 @@ namespace SMBLibrary.Server { public partial class SMBServer { - public void ProcessSMB1Message(SMB1Message message, ref ConnectionState state) + private void ProcessSMB1Message(SMB1Message message, ref ConnectionState state) { SMB1Header header = new SMB1Header(); PrepareResponseHeader(header, message.Header); @@ -65,7 +65,7 @@ namespace SMBLibrary.Server /// /// May return an empty list /// - public List ProcessSMB1Command(SMB1Header header, SMB1Command command, ref ConnectionState state) + private List ProcessSMB1Command(SMB1Header header, SMB1Command command, ref ConnectionState state) { if (state.ServerDialect == SMBDialect.NotSet) { @@ -301,7 +301,7 @@ namespace SMBLibrary.Server return new ErrorResponse(command.CommandName); } - public static void TrySendMessage(ConnectionState state, SMB1Message response) + private static void TrySendMessage(ConnectionState state, SMB1Message response) { SessionMessagePacket packet = new SessionMessagePacket(); packet.Trailer = response.GetBytes(); diff --git a/SMBLibrary/Server/SMBServer.SMB2.cs b/SMBLibrary/Server/SMBServer.SMB2.cs index b8c27bb..72258d2 100644 --- a/SMBLibrary/Server/SMBServer.SMB2.cs +++ b/SMBLibrary/Server/SMBServer.SMB2.cs @@ -37,7 +37,7 @@ namespace SMBLibrary.Server return null; } - public void ProcessSMB2RequestChain(List requestChain, ref ConnectionState state) + private void ProcessSMB2RequestChain(List requestChain, ref ConnectionState state) { List responseChain = new List(); FileID? fileID = null; @@ -67,7 +67,7 @@ namespace SMBLibrary.Server /// /// May return null /// - public SMB2Command ProcessSMB2Command(SMB2Command command, ref ConnectionState state) + private SMB2Command ProcessSMB2Command(SMB2Command command, ref ConnectionState state) { if (state.ServerDialect == SMBDialect.NotSet) { @@ -105,7 +105,7 @@ namespace SMBLibrary.Server } } - public SMB2Command ProcessSMB2Command(SMB2Command command, SMB2ConnectionState state) + private SMB2Command ProcessSMB2Command(SMB2Command command, SMB2ConnectionState state) { if (command is SessionSetupRequest) { @@ -222,7 +222,7 @@ namespace SMBLibrary.Server return new ErrorResponse(command.CommandName, NTStatus.STATUS_NOT_SUPPORTED); } - public static void TrySendResponse(ConnectionState state, SMB2Command response) + private static void TrySendResponse(ConnectionState state, SMB2Command response) { SessionMessagePacket packet = new SessionMessagePacket(); packet.Trailer = response.GetBytes(); @@ -230,7 +230,7 @@ namespace SMBLibrary.Server state.LogToServer(Severity.Verbose, "SMB2 response sent: {0}, Packet length: {1}", response.CommandName.ToString(), packet.Length); } - public static void TrySendResponseChain(ConnectionState state, List responseChain) + private static void TrySendResponseChain(ConnectionState state, List responseChain) { byte[] sessionKey = null; if (state is SMB2ConnectionState) diff --git a/SMBLibrary/Server/SMBServer.cs b/SMBLibrary/Server/SMBServer.cs index d2178ac..10a6902 100644 --- a/SMBLibrary/Server/SMBServer.cs +++ b/SMBLibrary/Server/SMBServer.cs @@ -181,7 +181,7 @@ namespace SMBLibrary.Server } } - public void ProcessConnectionBuffer(ref ConnectionState state) + private void ProcessConnectionBuffer(ref ConnectionState state) { Socket clientSocket = state.ClientSocket; @@ -207,7 +207,7 @@ namespace SMBLibrary.Server } } - public void ProcessPacket(SessionPacket packet, ref ConnectionState state) + private void ProcessPacket(SessionPacket packet, ref ConnectionState state) { if (packet is SessionRequestPacket && m_transport == SMBTransportType.NetBiosOverTCP) { @@ -311,7 +311,7 @@ namespace SMBLibrary.Server } } - public static void TrySendPacket(ConnectionState state, SessionPacket response) + private static void TrySendPacket(ConnectionState state, SessionPacket response) { Socket clientSocket = state.ClientSocket; try @@ -326,7 +326,7 @@ namespace SMBLibrary.Server } } - public void Log(Severity severity, string message) + private void Log(Severity severity, string message) { // To be thread-safe we must capture the delegate reference first EventHandler handler = OnLogEntry; @@ -336,7 +336,7 @@ namespace SMBLibrary.Server } } - public void Log(Severity severity, string message, params object[] args) + private void Log(Severity severity, string message, params object[] args) { Log(severity, String.Format(message, args)); }