update sharpcifs

This commit is contained in:
Luke Pulverenti
2017-07-07 23:12:21 -04:00
parent a30e22c3a2
commit 0d10dfe471
221 changed files with 23704 additions and 25614 deletions

View File

@@ -19,147 +19,146 @@ using System.IO;
namespace SharpCifs.Netbios
{
public class NbtException : IOException
{
public const int Success = 0;
public class NbtException : IOException
{
public const int Success = 0;
public const int ErrNamSrvc = unchecked(0x01);
public const int ErrNamSrvc = unchecked(0x01);
public const int ErrSsnSrvc = unchecked(0x02);
public const int ErrSsnSrvc = unchecked(0x02);
public const int FmtErr = unchecked(0x1);
public const int FmtErr = unchecked(0x1);
public const int SrvErr = unchecked(0x2);
public const int SrvErr = unchecked(0x2);
public const int ImpErr = unchecked(0x4);
public const int ImpErr = unchecked(0x4);
public const int RfsErr = unchecked(0x5);
public const int RfsErr = unchecked(0x5);
public const int ActErr = unchecked(0x6);
public const int ActErr = unchecked(0x6);
public const int CftErr = unchecked(0x7);
public const int CftErr = unchecked(0x7);
public const int ConnectionRefused = -1;
public const int ConnectionRefused = -1;
public const int NotListeningCalled = unchecked(0x80);
public const int NotListeningCalled = unchecked(0x80);
public const int NotListeningCalling = unchecked(0x81);
public const int NotListeningCalling = unchecked(0x81);
public const int CalledNotPresent = unchecked(0x82);
public const int CalledNotPresent = unchecked(0x82);
public const int NoResources = unchecked(0x83);
public const int NoResources = unchecked(0x83);
public const int Unspecified = unchecked(0x8F);
public const int Unspecified = unchecked(0x8F);
public int ErrorClass;
public int ErrorClass;
public int ErrorCode;
public int ErrorCode;
// error classes
// name service error codes
// session service error codes
public static string GetErrorString(int errorClass, int errorCode)
{
string result = string.Empty;
switch (errorClass)
{
case Success:
{
result += "SUCCESS";
break;
}
// error classes
// name service error codes
// session service error codes
public static string GetErrorString(int errorClass, int errorCode)
{
string result = string.Empty;
switch (errorClass)
{
case Success:
{
result += "SUCCESS";
break;
}
case ErrNamSrvc:
{
result += "ERR_NAM_SRVC/";
switch (errorCode)
{
case FmtErr:
{
result += "FMT_ERR: Format Error";
goto default;
}
case ErrNamSrvc:
{
result += "ERR_NAM_SRVC/";
switch (errorCode)
{
case FmtErr:
{
result += "FMT_ERR: Format Error";
goto default;
}
default:
{
result += "Unknown error code: " + errorCode;
break;
}
}
break;
}
default:
{
result += "Unknown error code: " + errorCode;
break;
}
}
break;
}
case ErrSsnSrvc:
{
result += "ERR_SSN_SRVC/";
switch (errorCode)
{
case ConnectionRefused:
{
result += "Connection refused";
break;
}
case ErrSsnSrvc:
{
result += "ERR_SSN_SRVC/";
switch (errorCode)
{
case ConnectionRefused:
{
result += "Connection refused";
break;
}
case NotListeningCalled:
{
result += "Not listening on called name";
break;
}
case NotListeningCalled:
{
result += "Not listening on called name";
break;
}
case NotListeningCalling:
{
result += "Not listening for calling name";
break;
}
case NotListeningCalling:
{
result += "Not listening for calling name";
break;
}
case CalledNotPresent:
{
result += "Called name not present";
break;
}
case CalledNotPresent:
{
result += "Called name not present";
break;
}
case NoResources:
{
result += "Called name present, but insufficient resources";
break;
}
case NoResources:
{
result += "Called name present, but insufficient resources";
break;
}
case Unspecified:
{
result += "Unspecified error";
break;
}
case Unspecified:
{
result += "Unspecified error";
break;
}
default:
{
result += "Unknown error code: " + errorCode;
break;
}
}
break;
}
default:
{
result += "Unknown error code: " + errorCode;
break;
}
}
break;
}
default:
{
result += "unknown error class: " + errorClass;
break;
}
}
return result;
}
default:
{
result += "unknown error class: " + errorClass;
break;
}
}
return result;
}
public NbtException(int errorClass, int errorCode) : base(GetErrorString(errorClass
, errorCode))
{
this.ErrorClass = errorClass;
this.ErrorCode = errorCode;
}
public NbtException(int errorClass, int errorCode) : base(GetErrorString(errorClass
, errorCode))
{
this.ErrorClass = errorClass;
this.ErrorCode = errorCode;
}
public override string ToString()
{
return "errorClass=" + ErrorClass
+ ",errorCode=" + ErrorCode
+ ",errorString=" + GetErrorString(ErrorClass, ErrorCode);
}
}
public override string ToString()
{
return "errorClass=" + ErrorClass + ",errorCode=" + ErrorCode + ",errorString="
+ GetErrorString(ErrorClass, ErrorCode);
}
}
}