@Override protected int writeParametersWireFormat ( byte[] dst, int dstIndex ) { int start = dstIndex; byte[] descr; int which = getSubCommand() == NET_SERVER_ENUM2 ? 0 : 1; try { descr = DESCR[ which ].getBytes("ASCII"); } catch ( UnsupportedEncodingException uee ) { return 0; } SMBUtil.writeInt2(getSubCommand() & 0xFF, dst, dstIndex); dstIndex += 2; System.arraycopy(descr, 0, dst, dstIndex, descr.length); dstIndex += descr.length; SMBUtil.writeInt2(0x0001, dst, dstIndex); dstIndex += 2; SMBUtil.writeInt2(this.maxDataCount, dst, dstIndex); dstIndex += 2; SMBUtil.writeInt4(this.serverTypes, dst, dstIndex); dstIndex += 4; dstIndex += writeString(this.domain.toUpperCase(), dst, dstIndex, false); if ( which == 1 ) { dstIndex += writeString(this.lastName.toUpperCase(), dst, dstIndex, false); } return dstIndex - start; }
private FileEntry advance () throws CIFSException { int n = this.response.getStatus() == WinError.ERROR_MORE_DATA ? this.response.getNumEntries() - 1 : this.response.getNumEntries(); while ( this.ridx < n ) { FileEntry itm = this.response.getResults()[ this.ridx ]; this.ridx++; if ( filter(itm) ) { return itm; } } if ( this.workgroup && this.response.getStatus() == WinError.ERROR_MORE_DATA ) { this.request.reset(0, this.response.getLastName()); this.response.reset(); this.request.setSubCommand(SmbComTransaction.NET_SERVER_ENUM3); this.treeHandle.send(this.request, this.response); checkStatus(); this.ridx = 0; return advance(); } return null; }
this.workgroup = locator.getType() == SmbConstants.TYPE_WORKGROUP; if ( locator.getURL().getHost().isEmpty() ) { this.request = new NetServerEnum2(th.getConfig(), th.getOEMDomainName(), NetServerEnum2.SV_TYPE_DOMAIN_ENUM); this.response = new NetServerEnum2Response(th.getConfig()); this.request = new NetServerEnum2(th.getConfig(), locator.getURL().getHost(), NetServerEnum2.SV_TYPE_ALL); this.response = new NetServerEnum2Response(th.getConfig());
private FileEntry advance () throws CIFSException { int n = this.response.getStatus() == WinError.ERROR_MORE_DATA ? this.response.getNumEntries() - 1 : this.response.getNumEntries(); while ( this.ridx < n ) { FileEntry itm = this.response.getResults()[ this.ridx ]; this.ridx++; if ( filter(itm) ) { return itm; } } if ( this.workgroup && this.response.getStatus() == WinError.ERROR_MORE_DATA ) { this.request.reset(0, this.response.getLastName()); this.response.reset(); this.request.setSubCommand(SmbComTransaction.NET_SERVER_ENUM3); this.treeHandle.send(this.request, this.response); checkStatus(); this.ridx = 0; return advance(); } return null; }
this.workgroup = locator.getType() == SmbConstants.TYPE_WORKGROUP; if ( locator.getURL().getHost().isEmpty() ) { this.request = new NetServerEnum2(th.getConfig(), th.getOEMDomainName(), NetServerEnum2.SV_TYPE_DOMAIN_ENUM); this.response = new NetServerEnum2Response(th.getConfig()); this.request = new NetServerEnum2(th.getConfig(), locator.getURL().getHost(), NetServerEnum2.SV_TYPE_ALL); this.response = new NetServerEnum2Response(th.getConfig());
@Override protected int writeParametersWireFormat ( byte[] dst, int dstIndex ) { int start = dstIndex; byte[] descr; int which = getSubCommand() == NET_SERVER_ENUM2 ? 0 : 1; try { descr = DESCR[ which ].getBytes("ASCII"); } catch ( UnsupportedEncodingException uee ) { return 0; } SMBUtil.writeInt2(getSubCommand() & 0xFF, dst, dstIndex); dstIndex += 2; System.arraycopy(descr, 0, dst, dstIndex, descr.length); dstIndex += descr.length; SMBUtil.writeInt2(0x0001, dst, dstIndex); dstIndex += 2; SMBUtil.writeInt2(this.maxDataCount, dst, dstIndex); dstIndex += 2; SMBUtil.writeInt4(this.serverTypes, dst, dstIndex); dstIndex += 4; dstIndex += writeString(this.domain.toUpperCase(), dst, dstIndex, false); if ( which == 1 ) { dstIndex += writeString(this.lastName.toUpperCase(), dst, dstIndex, false); } return dstIndex - start; }