@Override public NbtAddress[] getNbtAllByAddress ( NetbiosAddress addr ) throws UnknownHostException { try { NbtAddress[] addrs = getNodeStatus(addr); cacheAddressArray(addrs); return addrs; } catch ( UnknownHostException uhe ) { throw new UnknownHostException( "no name with type 0x" + Hexdump.toHexString(addr.getNameType(), 2) + ( ( ( addr.getName().getScope() == null ) || ( addr.getName().getScope().isEmpty() ) ) ? " with no scope" : " with scope " + addr.getName().getScope() ) + " for host " + addr.getHostAddress()); } }
if ( this.getNameType() == 0x1D ) { for ( int i = 0; i < addrs.length; i++ ) { if ( addrs[ i ].getNameType() == 0x20 ) { return addrs[ i ].getHostName();
@Override public NbtAddress[] getNodeStatus ( NetbiosAddress addr ) throws UnknownHostException { NodeStatusResponse response = new NodeStatusResponse(this.transportContext.getConfig(), addr.unwrap(NbtAddress.class)); NodeStatusRequest request = new NodeStatusRequest( this.transportContext.getConfig(), new Name(this.transportContext.getConfig(), NbtAddress.ANY_HOSTS_NAME, 0x00, null)); request.addr = addr.toInetAddress(); throw new UnknownHostException(addr.getHostName());
String host = tc.getNameServiceClient().getLocalHost().getHostName(); if ( host != null ) { try {
/** * {@inheritDoc} * * @see jcifs.SmbResourceLocator#isWorkgroup() */ @Override public boolean isWorkgroup () throws CIFSException { if ( this.type == SmbConstants.TYPE_WORKGROUP || this.url.getHost().length() == 0 ) { this.type = SmbConstants.TYPE_WORKGROUP; return true; } if ( getShare() == null ) { NetbiosAddress addr = getAddress().unwrap(NetbiosAddress.class); if ( addr != null ) { int code = addr.getNameType(); if ( code == 0x1d || code == 0x1b ) { this.type = SmbConstants.TYPE_WORKGROUP; return true; } } this.type = SmbConstants.TYPE_SERVER; } return false; }
NameServiceClient nameServiceClient = getTransportContext().getNameServiceClient(); if ( pathInfo == null || server == null ) { String mb = nameServiceClient.getNbtByName(NbtAddress.MASTER_BROWSER_NAME, 0x01, null).getHostAddress(); dc = nameServiceClient.getByName(mb);
@Override public NbtAddress[] getNodeStatus ( NetbiosAddress addr ) throws UnknownHostException { NodeStatusResponse response = new NodeStatusResponse(this.transportContext.getConfig(), addr.unwrap(NbtAddress.class)); NodeStatusRequest request = new NodeStatusRequest( this.transportContext.getConfig(), new Name(this.transportContext.getConfig(), NbtAddress.ANY_HOSTS_NAME, 0x00, null)); request.addr = addr.toInetAddress(); throw new UnknownHostException(addr.getHostName());
String host = tc.getNameServiceClient().getLocalHost().getHostName(); if ( host != null ) { try {
/** * {@inheritDoc} * * @see jcifs.SmbResourceLocator#isWorkgroup() */ @Override public boolean isWorkgroup () throws CIFSException { if ( this.type == SmbConstants.TYPE_WORKGROUP || this.url.getHost().length() == 0 ) { this.type = SmbConstants.TYPE_WORKGROUP; return true; } if ( getShare() == null ) { NetbiosAddress addr = getAddress().unwrap(NetbiosAddress.class); if ( addr != null ) { int code = addr.getNameType(); if ( code == 0x1d || code == 0x1b ) { this.type = SmbConstants.TYPE_WORKGROUP; return true; } } this.type = SmbConstants.TYPE_SERVER; } return false; }
NameServiceClient nameServiceClient = getTransportContext().getNameServiceClient(); if ( pathInfo == null || server == null ) { String mb = nameServiceClient.getNbtByName(NbtAddress.MASTER_BROWSER_NAME, 0x01, null).getHostAddress(); dc = nameServiceClient.getByName(mb);
@Override public NbtAddress[] getNbtAllByAddress ( NetbiosAddress addr ) throws UnknownHostException { try { NbtAddress[] addrs = getNodeStatus(addr); cacheAddressArray(addrs); return addrs; } catch ( UnknownHostException uhe ) { throw new UnknownHostException( "no name with type 0x" + Hexdump.toHexString(addr.getNameType(), 2) + ( ( ( addr.getName().getScope() == null ) || ( addr.getName().getScope().isEmpty() ) ) ? " with no scope" : " with scope " + addr.getName().getScope() ) + " for host " + addr.getHostAddress()); } }
/** * Creates a Type-1 message using default values from the current * environment. * * @param tc * context to use */ public Type1Message ( CIFSContext tc ) { this(tc, getDefaultFlags(tc), tc.getConfig().getDefaultDomain(), tc.getNameServiceClient().getLocalHost().getHostName()); }
if ( this.getNameType() == 0x1D ) { for ( int i = 0; i < addrs.length; i++ ) { if ( addrs[ i ].getNameType() == 0x20 ) { return addrs[ i ].getHostName();
NetbiosAddress nbaddr = getAddress().unwrap(NetbiosAddress.class); if ( nbaddr != null ) { int code = nbaddr.getNameType(); if ( code == 0x1d || code == 0x1b ) { this.type = SmbConstants.TYPE_WORKGROUP;
/** * Creates a Type-1 message using default values from the current * environment. * * @param tc * context to use */ public Type1Message ( CIFSContext tc ) { this(tc, getDefaultFlags(tc), tc.getConfig().getDefaultDomain(), tc.getNameServiceClient().getLocalHost().getHostName()); }
NetbiosAddress nbaddr = getAddress().unwrap(NetbiosAddress.class); if ( nbaddr != null ) { int code = nbaddr.getNameType(); if ( code == 0x1d || code == 0x1b ) { this.type = SmbConstants.TYPE_WORKGROUP;
domain, user, this.transportContext.getNameServiceClient().getLocalHost().getHostName(), 0);
domain, user, this.transportContext.getNameServiceClient().getLocalHost().getHostName(), 0);
/** * Creates a Type-3 message using default values from the current * environment. * * @param tc * context to use */ public Type3Message ( CIFSContext tc ) { setFlags(getDefaultFlags(tc)); setDomain(tc.getConfig().getDefaultDomain()); setUser(tc.getConfig().getDefaultUsername()); setWorkstation(tc.getNameServiceClient().getLocalHost().getHostName()); }
/** * Creates a Type-3 message using default values from the current * environment. * * @param tc * context to use */ public Type3Message ( CIFSContext tc ) { setFlags(getDefaultFlags(tc)); setDomain(tc.getConfig().getDefaultDomain()); setUser(tc.getConfig().getDefaultUsername()); setWorkstation(tc.getNameServiceClient().getLocalHost().getHostName()); }