1 17 package org.alfresco.filesys.smb.dcerpc; 18 19 23 public class DCEPipeType 24 { 25 26 28 private static final String [] _pipeNames = { "\\PIPE\\srvsvc", 29 "\\PIPE\\samr", 30 "\\PIPE\\winreg", 31 "\\PIPE\\wkssvc", 32 "\\PIPE\\NETLOGON", 33 "\\PIPE\\lsarpc", 34 "\\PIPE\\spoolss", 35 "\\PIPE\\netdfs", 36 "\\PIPE\\svcctl", 37 "\\PIPE\\EVENTLOG", 38 "\\PIPE\\NETLOGON" 39 }; 40 41 43 private static final String [] _srvNames = { "\\PIPE\\ntsvcs", 44 "\\PIPE\\lsass", 45 "\\PIPE\\winreg", 46 "\\PIPE\\ntsvcs", 47 "\\PIPE\\lsass", 48 "\\PIPE\\lsass", 49 "\\PIPE\\spoolss", 50 "\\PIPE\\netdfs", 51 "\\PIPE\\svcctl", 52 "\\PIPE\\EVENTLOG" 53 }; 54 55 57 public static final int PIPE_SRVSVC = 0; 58 public static final int PIPE_SAMR = 1; 59 public static final int PIPE_WINREG = 2; 60 public static final int PIPE_WKSSVC = 3; 61 public static final int PIPE_NETLOGON = 4; 62 public static final int PIPE_LSARPC = 5; 63 public static final int PIPE_SPOOLSS = 6; 64 public static final int PIPE_NETDFS = 7; 65 public static final int PIPE_SVCCTL = 8; 66 public static final int PIPE_EVENTLOG = 9; 67 public static final int PIPE_NETLOGON1= 10; 68 69 71 private static UUID _uuidNetLogon = new UUID("8a885d04-1ceb-11c9-9fe8-08002b104860", 2); 72 private static UUID _uuidWinReg = new UUID("338cd001-2244-31f1-aaaa-900038001003", 1); 73 private static UUID _uuidSvcCtl = new UUID("367abb81-9844-35f1-ad32-98f038001003", 2); 74 private static UUID _uuidLsaRpc = new UUID("12345678-1234-abcd-ef00-0123456789ab", 0); 75 private static UUID _uuidSrvSvc = new UUID("4b324fc8-1670-01d3-1278-5a47bf6ee188", 3); 76 private static UUID _uuidWksSvc = new UUID("6bffd098-a112-3610-9833-46c3f87e345a", 1); 77 private static UUID _uuidSamr = new UUID("12345778-1234-abcd-ef00-0123456789ac", 1); 78 private static UUID _uuidSpoolss = new UUID("12345778-1234-abcd-ef00-0123456789ab", 1); 79 private static UUID _uuidSvcctl = new UUID("367abb81-9844-35f1-ad32-98f038001003", 2); 80 private static UUID _uuidEventLog = new UUID("82273FDC-E32A-18C3-3F78-827929DC23EA", 0); 81 private static UUID _uuidNetLogon1= new UUID("12345678-1234-abcd-ef00-01234567cffb", 1); 82 83 85 91 public final static int getNameAsType(String name) 92 { 93 for (int i = 0; i < _pipeNames.length; i++) 94 { 95 if (_pipeNames[i].equals(name)) 96 return i; 97 } 98 return -1; 99 } 100 101 107 public final static String getTypeAsString(int typ) 108 { 109 if (typ >= 0 && typ < _pipeNames.length) 110 return _pipeNames[typ]; 111 return null; 112 } 113 114 120 public final static String getTypeAsStringShort(int typ) 121 { 122 if (typ >= 0 && typ < _pipeNames.length) 123 { 124 String name = _pipeNames[typ]; 125 return name.substring(5); 126 } 127 return null; 128 } 129 130 136 public final static UUID getUUIDForType(int typ) 137 { 138 UUID ret = null; 139 140 switch (typ) 141 { 142 case PIPE_NETLOGON: 143 ret = _uuidNetLogon; 144 break; 145 case PIPE_NETLOGON1: 146 ret = _uuidNetLogon1; 147 break; 148 case PIPE_WINREG: 149 ret = _uuidWinReg; 150 break; 151 case PIPE_LSARPC: 152 ret = _uuidLsaRpc; 153 break; 154 case PIPE_WKSSVC: 155 ret = _uuidWksSvc; 156 break; 157 case PIPE_SAMR: 158 ret = _uuidSamr; 159 break; 160 case PIPE_SRVSVC: 161 ret = _uuidSrvSvc; 162 break; 163 case PIPE_SPOOLSS: 164 ret = _uuidSpoolss; 165 break; 166 case PIPE_SVCCTL: 167 ret = _uuidSvcCtl; 168 break; 169 case PIPE_EVENTLOG: 170 ret = _uuidEventLog; 171 break; 172 } 173 return ret; 174 } 175 176 182 public final static String getServerPipeName(int typ) 183 { 184 if (typ >= 0 && typ < _srvNames.length) 185 return _srvNames[typ]; 186 return null; 187 } 188 } 189 | Popular Tags |