Browse Source

Added ServerServiceOpName and WorkstationServiceOpName enums

Tal Aloni 7 years ago
parent
commit
86d0089a30

+ 2 - 0
SMBLibrary/SMBLibrary.csproj

@@ -257,6 +257,7 @@
     <Compile Include="Services\RemoteServiceHelper.cs" />
     <Compile Include="Services\RPCPipeStream.cs" />
     <Compile Include="Services\ServerService\Enums\Permissions.cs" />
+    <Compile Include="Services\ServerService\Enums\ServerServiceOpName.cs" />
     <Compile Include="Services\ServerService\Enums\ServerType.cs" />
     <Compile Include="Services\ServerService\EnumStructures\ShareTypeExtended.cs" />
     <Compile Include="Services\ServerService\NetrServerGetInfoRequest.cs" />
@@ -279,6 +280,7 @@
     <Compile Include="Services\ServerService\Structures\ShareInfo\ShareInfo1Container.cs" />
     <Compile Include="Services\ServerService\Structures\ShareInfo\ShareInfo1Entry.cs" />
     <Compile Include="Services\ServerService\Structures\ShareInfo\ShareInfo2Entry.cs" />
+    <Compile Include="Services\WorkstationService\Enums\WorkstationServiceOpName.cs" />
     <Compile Include="Services\WorkstationService\NetrWkstaGetInfoRequest.cs" />
     <Compile Include="Services\WorkstationService\NetrWkstaGetInfoResponse.cs" />
     <Compile Include="Services\WorkstationService\Structures\WorkstationInfo.cs" />

+ 54 - 0
SMBLibrary/Services/ServerService/Enums/ServerServiceOpName.cs

@@ -0,0 +1,54 @@
+
+namespace SMBLibrary.Services
+{
+    public enum ServerServiceOpName : ushort
+    {
+        NetrConnectionEnum = 8,
+        NetrFileEnum = 9,
+        NetrFileGetInfo = 10,
+        NetrFileClose = 11,
+        NetrSessionEnum = 12,
+        NetrSessionDel = 13,
+        NetrShareAdd = 14,
+        NetrShareEnum = 15,
+        NetrShareGetInfo = 16,
+        NetrShareSetInfo = 17,
+        NetrShareDel = 18,
+        NetrShareDelSticky = 19,
+        NetrShareCheck = 20,
+        NetrServerGetInfo = 21,
+        NetrServerSetInfo = 22,
+        NetrServerDiskEnum = 23,
+        NetrServerStatisticsGet = 24,
+        NetrServerTransportAdd = 25,
+        NetrServerTransportEnum = 26,
+        NetrServerTransportDel = 27,
+        NetrRemoteTOD = 28,
+        NetprPathType = 30,
+        NetprPathCanonicalize = 31,
+        NetprPathCompare = 32,
+        NetprNameValidate = 33,
+        NetprNameCanonicalize = 34,
+        NetprNameCompare = 35,
+        NetrShareEnumSticky = 36,
+        NetrShareDelStart = 37,
+        NetrShareDelCommit = 38,
+        NetrpGetFileSecurity = 39,
+        NetrpSetFileSecurity = 40,
+        NetrServerTransportAddEx = 41,
+        NetrDfsGetVersion = 43,
+        NetrDfsCreateLocalPartition = 44,
+        NetrDfsDeleteLocalPartition = 45,
+        NetrDfsSetLocalVolumeState = 46,
+        NetrDfsCreateExitPoint = 48,
+        NetrDfsDeleteExitPoin = 49,
+        NetrDfsModifyPrefix = 50,
+        NetrDfsFixLocalVolume = 51,
+        NetrDfsManagerReportSiteInfo = 52,
+        NetrServerTransportDelEx = 53,
+        NetrServerAliasAdd = 54,
+        NetrServerAliasEnum = 55,
+        NetrServerAliasDel = 56,
+        NetrShareDelEx = 57,
+    }
+}

+ 4 - 4
SMBLibrary/Services/ServerService/ServerService.cs

@@ -40,21 +40,21 @@ namespace SMBLibrary.Services
 
         public override byte[] GetResponseBytes(ushort opNum, byte[] requestBytes)
         {
-            switch (opNum)
+            switch ((ServerServiceOpName)opNum)
             {
-                case 15:
+                case ServerServiceOpName.NetrShareEnum:
                     {
                         NetrShareEnumRequest request = new NetrShareEnumRequest(requestBytes);
                         NetrShareEnumResponse response = GetNetrShareEnumResponse(request);
                         return response.GetBytes();
                     }
-                case 16:
+                case ServerServiceOpName.NetrShareGetInfo:
                     {
                         NetrShareGetInfoRequest request = new NetrShareGetInfoRequest(requestBytes);
                         NetrShareGetInfoResponse response = GetNetrShareGetInfoResponse(request);
                         return response.GetBytes();
                     }
-                case 21:
+                case ServerServiceOpName.NetrServerGetInfo:
                     {
                         NetrServerGetInfoRequest request = new NetrServerGetInfoRequest(requestBytes);
                         NetrServerGetInfoResponse response = GetNetrWkstaGetInfoResponse(request);

+ 28 - 0
SMBLibrary/Services/WorkstationService/Enums/WorkstationServiceOpName.cs

@@ -0,0 +1,28 @@
+
+namespace SMBLibrary.Services
+{
+    public enum WorkstationServiceOpName : ushort
+    {
+        NetrWkstaGetInfo = 0,
+        NetrWkstaSetInfo = 1,
+        NetrWkstaUserEnum = 2,
+        NetrWkstaTransportEnum = 5,
+        NetrWkstaTransportAdd = 6,
+        NetrWkstaTransportDel = 7,
+        NetrUseAdd = 8,
+        NetrUseGetInfo = 9,
+        NetrUseDel = 10,
+        NetrUseEnum = 11,
+        NetrWorkstationStatisticsGet = 13,
+        NetrGetJoinInformation = 20,
+        NetrJoinDomain2 = 22,
+        NetrUnjoinDomain2 = 23,
+        NetrRenameMachineInDomain2 = 24,
+        NetrValidateName2 = 25,
+        NetrGetJoinableOUs2 = 26,
+        NetrAddAlternateComputerName = 27,
+        NetrRemoveAlternateComputerName = 28,
+        NetrSetPrimaryComputerName = 29,
+        NetrEnumerateComputerNames = 30,
+    }
+}

+ 2 - 2
SMBLibrary/Services/WorkstationService/WorkstationService.cs

@@ -32,9 +32,9 @@ namespace SMBLibrary.Services
 
         public override byte[] GetResponseBytes(ushort opNum, byte[] requestBytes)
         {
-            switch (opNum)
+            switch ((WorkstationServiceOpName)opNum)
             {
-                case 0:
+                case WorkstationServiceOpName.NetrWkstaGetInfo:
                     NetrWkstaGetInfoRequest request = new NetrWkstaGetInfoRequest(requestBytes);
                     NetrWkstaGetInfoResponse response = GetNetrWkstaGetInfoResponse(request);
                     return response.GetBytes();