Interface NetbiosAddress
-
- All Superinterfaces:
Address
- All Known Implementing Classes:
NbtAddress
public interface NetbiosAddress extends Address
This class represents a NetBIOS over TCP/IP address. Under normal conditions, users of jCIFS need not be concerned with this class as name resolution and session services are handled internally by the smb package.Applications can use the methods
getLocalHost
,getByName
, andgetAllByAddress
to create a new NbtAddress instance. This class is symmetric withInetAddress
.About NetBIOS: The NetBIOS name service is a dynamic distributed service that allows hosts to resolve names by broadcasting a query, directing queries to a server such as Samba or WINS. NetBIOS is currently the primary networking layer for providing name service, datagram service, and session service to the Microsoft Windows platform. A NetBIOS name can be 15 characters long and hosts usually registers several names on the network. From a Windows command prompt you can see what names a host registers with the nbtstat command.
C:\>nbtstat -a 192.168.1.15 NetBIOS Remote Machine Name Table Name Type Status --------------------------------------------- JMORRIS2 <00> UNIQUE Registered BILLING-NY <00> GROUP Registered JMORRIS2 <03> UNIQUE Registered JMORRIS2 <20> UNIQUE Registered BILLING-NY <1E> GROUP Registered JMORRIS <03> UNIQUE Registered MAC Address = 00-B0-34-21-FA-3B
The hostname of this machine is
JMORRIS2
. It is a member of the group(a.k.a workgroup and domain)BILLING-NY
. To obtain anInetAddress
for a host one might do:InetAddress addr = NbtAddress.getByName("jmorris2").getInetAddress();
From a UNIX platform with Samba installed you can perform similar diagnostics using the
nmblookup
utility.- Since:
- jcifs-0.1
- Author:
- Michael B. Allen
- See Also:
InetAddress
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byte[]
getMacAddress(CIFSContext tc)
Retrieves the MAC address of the remote network interface.NetbiosName
getName()
int
getNameType()
Returned the hex code associated with this name(e.g.int
getNodeType(CIFSContext tc)
Checks the node type of this address.boolean
isActive(CIFSContext tc)
Determines if this address is active.boolean
isBeingDeleted(CIFSContext tc)
Determines if this address in the process of being deleted.boolean
isGroupAddress(CIFSContext tc)
Determines if the address is a group address.boolean
isInConflict(CIFSContext tc)
Determines if this address in conflict with another address.boolean
isPermanent(CIFSContext tc)
Determines if this address is set to be permanent.-
Methods inherited from interface jcifs.Address
firstCalledName, getHostAddress, getHostName, nextCalledName, toInetAddress, unwrap
-
-
-
-
Method Detail
-
isGroupAddress
boolean isGroupAddress(CIFSContext tc) throws UnknownHostException
Determines if the address is a group address. This is also known as a workgroup name or group name.- Parameters:
tc
- context to use- Returns:
- whether the given address is a group address
- Throws:
UnknownHostException
- if the host cannot be resolved to find out.
-
getNodeType
int getNodeType(CIFSContext tc) throws UnknownHostException
Checks the node type of this address.- Parameters:
tc
- context to use- Returns:
NbtAddress.B_NODE
,NbtAddress.P_NODE
,NbtAddress.M_NODE
,NbtAddress.H_NODE
- Throws:
UnknownHostException
- if the host cannot be resolved to find out.
-
isBeingDeleted
boolean isBeingDeleted(CIFSContext tc) throws UnknownHostException
Determines if this address in the process of being deleted.- Parameters:
tc
- context to use- Returns:
- whether this address is in the process of being deleted
- Throws:
UnknownHostException
- if the host cannot be resolved to find out.
-
isInConflict
boolean isInConflict(CIFSContext tc) throws UnknownHostException
Determines if this address in conflict with another address.- Parameters:
tc
- context to use- Returns:
- whether this address is in conflict with another address
- Throws:
UnknownHostException
- if the host cannot be resolved to find out.
-
isActive
boolean isActive(CIFSContext tc) throws UnknownHostException
Determines if this address is active.- Parameters:
tc
- context to use- Returns:
- whether this address is active
- Throws:
UnknownHostException
- if the host cannot be resolved to find out.
-
isPermanent
boolean isPermanent(CIFSContext tc) throws UnknownHostException
Determines if this address is set to be permanent.- Parameters:
tc
- context to use- Returns:
- whether this address is permanent
- Throws:
UnknownHostException
- if the host cannot be resolved to find out.
-
getMacAddress
byte[] getMacAddress(CIFSContext tc) throws UnknownHostException
Retrieves the MAC address of the remote network interface. Samba returns all zeros.- Parameters:
tc
- context to use- Returns:
- the MAC address as an array of six bytes
- Throws:
UnknownHostException
- if the host cannot be resolved to determine the MAC address.
-
getNameType
int getNameType()
Returned the hex code associated with this name(e.g. 0x20 is for the file service)- Returns:
- the name type
-
getName
NetbiosName getName()
- Returns:
- the name for this address
-
-