mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-04-30 02:37:49 +02:00
NetBiosSuffix.FileServiceService: Corrected typo
This commit is contained in:
parent
d3f69c2b09
commit
1d4484ff7e
5 changed files with 8 additions and 12 deletions
|
@ -32,7 +32,7 @@ namespace SMBLibrary.Client
|
|||
foreach (KeyValuePair<string, NameFlags> entry in response.Names)
|
||||
{
|
||||
NetBiosSuffix suffix = NetBiosUtils.GetSuffixFromMSNetBiosName(entry.Key);
|
||||
if (suffix == NetBiosSuffix.FileServiceService)
|
||||
if (suffix == NetBiosSuffix.FileServerService)
|
||||
{
|
||||
return entry.Key;
|
||||
}
|
||||
|
|
|
@ -103,7 +103,7 @@ namespace SMBLibrary.Client
|
|||
if (transport == SMBTransportType.NetBiosOverTCP)
|
||||
{
|
||||
SessionRequestPacket sessionRequest = new SessionRequestPacket();
|
||||
sessionRequest.CalledName = NetBiosUtils.GetMSNetBiosName("*SMBSERVER", NetBiosSuffix.FileServiceService);
|
||||
sessionRequest.CalledName = NetBiosUtils.GetMSNetBiosName("*SMBSERVER", NetBiosSuffix.FileServerService);
|
||||
sessionRequest.CallingName = NetBiosUtils.GetMSNetBiosName(Environment.MachineName, NetBiosSuffix.WorkstationService);
|
||||
TrySendPacket(m_clientSocket, sessionRequest);
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ namespace SMBLibrary.Client
|
|||
if (transport == SMBTransportType.NetBiosOverTCP)
|
||||
{
|
||||
SessionRequestPacket sessionRequest = new SessionRequestPacket();
|
||||
sessionRequest.CalledName = NetBiosUtils.GetMSNetBiosName("*SMBSERVER", NetBiosSuffix.FileServiceService);
|
||||
sessionRequest.CalledName = NetBiosUtils.GetMSNetBiosName("*SMBSERVER", NetBiosSuffix.FileServerService);
|
||||
sessionRequest.CallingName = NetBiosUtils.GetMSNetBiosName(Environment.MachineName, NetBiosSuffix.WorkstationService);
|
||||
TrySendPacket(m_clientSocket, sessionRequest);
|
||||
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace SMBLibrary.NetBios
|
||||
{
|
||||
/// <summary>
|
||||
/// 16th character suffix for netbios name.
|
||||
/// see http://support.microsoft.com/kb/163409/en-us
|
||||
/// see https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-nbte/6dbf0972-bb15-4f29-afeb-baaae98416ed
|
||||
/// </summary>
|
||||
public enum NetBiosSuffix : byte
|
||||
{
|
||||
|
@ -15,6 +11,6 @@ namespace SMBLibrary.NetBios
|
|||
DomainMasterBrowser = 0x1B,
|
||||
MasterBrowser = 0x1D,
|
||||
BrowserServiceElections = 0x1E,
|
||||
FileServiceService = 0x20,
|
||||
FileServerService = 0x20,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ namespace SMBLibrary.Server
|
|||
|
||||
bool nameMatch = String.Equals(name, Environment.MachineName, StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
if (nameMatch && ((suffix == NetBiosSuffix.WorkstationService) || (suffix == NetBiosSuffix.FileServiceService)))
|
||||
if (nameMatch && ((suffix == NetBiosSuffix.WorkstationService) || (suffix == NetBiosSuffix.FileServerService)))
|
||||
{
|
||||
PositiveNameQueryResponse response = new PositiveNameQueryResponse();
|
||||
response.Header.TransactionID = request.Header.TransactionID;
|
||||
|
@ -129,7 +129,7 @@ namespace SMBLibrary.Server
|
|||
response.Resource.Name = request.Question.Name;
|
||||
NameFlags nameFlags = new NameFlags();
|
||||
string name1 = NetBiosUtils.GetMSNetBiosName(Environment.MachineName, NetBiosSuffix.WorkstationService);
|
||||
string name2 = NetBiosUtils.GetMSNetBiosName(Environment.MachineName, NetBiosSuffix.FileServiceService);
|
||||
string name2 = NetBiosUtils.GetMSNetBiosName(Environment.MachineName, NetBiosSuffix.FileServerService);
|
||||
NameFlags nameFlags3 = new NameFlags();
|
||||
nameFlags3.WorkGroup = true;
|
||||
string name3 = NetBiosUtils.GetMSNetBiosName(WorkgroupName, NetBiosSuffix.WorkstationService);
|
||||
|
@ -164,7 +164,7 @@ namespace SMBLibrary.Server
|
|||
private void RegisterNetBIOSName()
|
||||
{
|
||||
NameRegistrationRequest request1 = new NameRegistrationRequest(Environment.MachineName, NetBiosSuffix.WorkstationService, m_serverAddress);
|
||||
NameRegistrationRequest request2 = new NameRegistrationRequest(Environment.MachineName, NetBiosSuffix.FileServiceService, m_serverAddress);
|
||||
NameRegistrationRequest request2 = new NameRegistrationRequest(Environment.MachineName, NetBiosSuffix.FileServerService, m_serverAddress);
|
||||
NameRegistrationRequest request3 = new NameRegistrationRequest(WorkgroupName, NetBiosSuffix.WorkstationService, m_serverAddress);
|
||||
request3.NameFlags.WorkGroup = true;
|
||||
RegisterName(request1);
|
||||
|
|
Loading…
Add table
Reference in a new issue