int readWireFormat( byte[] src, int srcIndex ) { byte tmp[] = new byte[SCOPE_OFFSET]; int length = 15; for( int i = 0; i < 15; i++ ) { tmp[i] = (byte)((( src[srcIndex + ( 2 * i + 1 )] & 0xFF ) - 0x41 ) << 4 ); tmp[i] |= (byte)((( src[srcIndex + ( 2 * i + 2 )] & 0xFF ) - 0x41 ) & 0x0F ); if( tmp[i] != (byte)' ' ) { length = i + 1; } } try { name = new String( tmp, 0, length, Name.OEM_ENCODING ); } catch( UnsupportedEncodingException uee ) { } hexCode = (( src[srcIndex + TYPE_OFFSET] & 0xFF ) - 0x41 ) << 4; hexCode |= (( src[srcIndex + TYPE_OFFSET + 1] & 0xFF ) - 0x41 ) & 0x0F; return SCOPE_OFFSET + readScopeWireFormat( src, srcIndex + SCOPE_OFFSET ); } int writeScopeWireFormat( byte[] dst, int dstIndex ) {
@Override int readTrailerWireFormat ( InputStream in, byte[] buffer, int bufferIndex ) throws IOException { int start = bufferIndex; if ( in.read(buffer, bufferIndex, this.length) != this.length ) { throw new IOException("invalid session request wire format"); } bufferIndex += this.calledName.readWireFormat(buffer, bufferIndex); bufferIndex += this.callingName.readWireFormat(buffer, bufferIndex); return bufferIndex - start; } }
int writeTrailerWireFormat( byte[] dst, int dstIndex ) { int start = dstIndex; dstIndex += calledName.writeWireFormat( dst, dstIndex ); dstIndex += callingName.writeWireFormat( dst, dstIndex ); return dstIndex - start; } int readTrailerWireFormat( InputStream in,
/** * Returns the {@link java.lang.String} representaion of this address. */ public String toString() { return hostName.toString() + "/" + getHostAddress(); } }
int writeWireFormat( byte[] dst, int dstIndex ) { // write 0x20 in first byte dst[dstIndex] = 0x20; // write name try { byte tmp[] = name.getBytes( Name.OEM_ENCODING ); int i; for( i = 0; i < tmp.length; i++ ) { dst[dstIndex + ( 2 * i + 1 )] = (byte)((( tmp[i] & 0xF0 ) >> 4 ) + 0x41 ); dst[dstIndex + ( 2 * i + 2 )] = (byte)(( tmp[i] & 0x0F ) + 0x41 ); } for( ; i < 15; i++ ) { dst[dstIndex + ( 2 * i + 1 )] = (byte)0x43; dst[dstIndex + ( 2 * i + 2 )] = (byte)0x41; } dst[dstIndex + TYPE_OFFSET] = (byte)((( hexCode & 0xF0 ) >> 4 ) + 0x41 ); dst[dstIndex + TYPE_OFFSET + 1] = (byte)(( hexCode & 0x0F ) + 0x41 ); } catch( UnsupportedEncodingException uee ) { } return SCOPE_OFFSET + writeScopeWireFormat( dst, dstIndex + SCOPE_OFFSET ); }
/** * The hostname of this address. If the hostname is null the local machines * IP address is returned. * * @return the text representation of the hostname associated with this address */ @Override public String getHostName () { /* * 2010 - We no longer try a Node Status to get the * hostname because apparently some servers do not respond * anymore. I think everyone post Windows 98 will accept * an IP address as the tconHostName which is the principal * use of this method. */ if ( this.hostName.isUnknown() ) { return getHostAddress(); } return this.hostName.name; }
int writeTrailerWireFormat( byte[] dst, int dstIndex ) { int start = dstIndex; dstIndex += calledName.writeWireFormat( dst, dstIndex ); dstIndex += callingName.writeWireFormat( dst, dstIndex ); return dstIndex - start; } int readTrailerWireFormat( InputStream in,
/** * Returns the {@link java.lang.String} representaion of this address. */ public String toString() { return hostName.toString() + "/" + getHostAddress(); } }
int writeWireFormat( byte[] dst, int dstIndex ) { // write 0x20 in first byte dst[dstIndex] = 0x20; // write name try { byte tmp[] = name.getBytes( Name.OEM_ENCODING ); int i; for( i = 0; i < tmp.length; i++ ) { dst[dstIndex + ( 2 * i + 1 )] = (byte)((( tmp[i] & 0xF0 ) >> 4 ) + 0x41 ); dst[dstIndex + ( 2 * i + 2 )] = (byte)(( tmp[i] & 0x0F ) + 0x41 ); } for( ; i < 15; i++ ) { dst[dstIndex + ( 2 * i + 1 )] = (byte)0x43; dst[dstIndex + ( 2 * i + 2 )] = (byte)0x41; } dst[dstIndex + TYPE_OFFSET] = (byte)((( hexCode & 0xF0 ) >> 4 ) + 0x41 ); dst[dstIndex + TYPE_OFFSET + 1] = (byte)(( hexCode & 0x0F ) + 0x41 ); } catch( UnsupportedEncodingException uee ) { } return SCOPE_OFFSET + writeScopeWireFormat( dst, dstIndex + SCOPE_OFFSET ); }
/** * The hostname of this address. If the hostname is null the local machines * IP address is returned. * * @return the text representation of the hostname associated with this address */ @Override public String getHostName () { /* * 2010 - We no longer try a Node Status to get the * hostname because apparently some servers do not respond * anymore. I think everyone post Windows 98 will accept * an IP address as the tconHostName which is the principal * use of this method. */ if ( this.hostName.isUnknown() ) { return getHostAddress(); } return this.hostName.name; }
int writeTrailerWireFormat( byte[] dst, int dstIndex ) { int start = dstIndex; dstIndex += calledName.writeWireFormat( dst, dstIndex ); dstIndex += callingName.writeWireFormat( dst, dstIndex ); return dstIndex - start; } int readTrailerWireFormat( InputStream in,
@Override int readTrailerWireFormat ( InputStream in, byte[] buffer, int bufferIndex ) throws IOException { int start = bufferIndex; if ( in.read(buffer, bufferIndex, this.length) != this.length ) { throw new IOException("invalid session request wire format"); } bufferIndex += this.calledName.readWireFormat(buffer, bufferIndex); bufferIndex += this.callingName.readWireFormat(buffer, bufferIndex); return bufferIndex - start; } }
/** * Returns the {@link java.lang.String} representaion of this address. */ @Override public String toString () { return this.hostName.toString() + "/" + getHostAddress(); } }
int readWireFormat( byte[] src, int srcIndex ) { byte tmp[] = new byte[SCOPE_OFFSET]; int length = 15; for( int i = 0; i < 15; i++ ) { tmp[i] = (byte)((( src[srcIndex + ( 2 * i + 1 )] & 0xFF ) - 0x41 ) << 4 ); tmp[i] |= (byte)((( src[srcIndex + ( 2 * i + 2 )] & 0xFF ) - 0x41 ) & 0x0F ); if( tmp[i] != (byte)' ' ) { length = i + 1; } } try { name = new String( tmp, 0, length, Name.OEM_ENCODING ); } catch( UnsupportedEncodingException uee ) { } hexCode = (( src[srcIndex + TYPE_OFFSET] & 0xFF ) - 0x41 ) << 4; hexCode |= (( src[srcIndex + TYPE_OFFSET + 1] & 0xFF ) - 0x41 ) & 0x0F; return SCOPE_OFFSET + readScopeWireFormat( src, srcIndex + SCOPE_OFFSET ); } int writeScopeWireFormat( byte[] dst, int dstIndex ) {
int writeWireFormat( byte[] dst, int dstIndex ) { // write 0x20 in first byte dst[dstIndex] = 0x20; // write name try { byte tmp[] = name.getBytes( Name.OEM_ENCODING ); int i; for( i = 0; i < tmp.length; i++ ) { dst[dstIndex + ( 2 * i + 1 )] = (byte)((( tmp[i] & 0xF0 ) >> 4 ) + 0x41 ); dst[dstIndex + ( 2 * i + 2 )] = (byte)(( tmp[i] & 0x0F ) + 0x41 ); } for( ; i < 15; i++ ) { dst[dstIndex + ( 2 * i + 1 )] = (byte)0x43; dst[dstIndex + ( 2 * i + 2 )] = (byte)0x41; } dst[dstIndex + TYPE_OFFSET] = (byte)((( hexCode & 0xF0 ) >> 4 ) + 0x41 ); dst[dstIndex + TYPE_OFFSET + 1] = (byte)(( hexCode & 0x0F ) + 0x41 ); } catch( UnsupportedEncodingException uee ) { } return SCOPE_OFFSET + writeScopeWireFormat( dst, dstIndex + SCOPE_OFFSET ); }
void checkData ( CIFSContext tc ) throws UnknownHostException { if ( this.hostName.isUnknown() ) { tc.getNameServiceClient().getNbtAllByAddress(this); } }