C# Class SharpCifs.UniAddress

Under normal conditions it is not necessary to use this class to use jCIFS properly.

Under normal conditions it is not necessary to use this class to use jCIFS properly. Name resolusion is handled internally to the jcifs.smb package.

This class is a wrapper for both Jcifs.Netbios.NbtAddress and System.Net.IPAddress . The name resolution mechanisms used will systematically query all available configured resolution services including WINS, broadcasts, DNS, and LMHOSTS. See Setting Name Resolution Properties and the jcifs.resolveOrder property. Changing jCIFS name resolution properties can greatly affect the behavior of the client and may be necessary for proper operation.

This class should be used in favor of InetAddress to resolve hostnames on LANs and WANs that support a mixture of NetBIOS/WINS and DNS resolvable hosts.

Show file Open project: brandonprry/Potato Class Usage Examples

Public Methods

Method Description
Equals ( object obj ) : bool

Compare two addresses for equality.

Compare two addresses for equality. Two UniAddresss are equal if they are both UniAddress' and refer to the same IP address.

FirstCalledName ( ) : string

Guess first called name to try for session establishment.

Guess first called name to try for session establishment. This method is used exclusively by the jcifs.smb package.

GetAddress ( ) : object

Return the underlying NbtAddress or InetAddress.

Return the underlying NbtAddress or InetAddress.

GetAllByName ( string hostname, bool possibleNtDomainOrWorkgroup ) : SharpCifs.UniAddress[]
GetByName ( string hostname ) : UniAddress

Determines the address of a host given it's host name.

Determines the address of a host given it's host name. The name can be a machine name like "jcifs.samba.org", or an IP address like "192.168.1.15".

GetByName ( string hostname, bool possibleNtDomainOrWorkgroup ) : UniAddress

Lookup hostname and return it's UniAddress.

Lookup hostname and return it's UniAddress. If the possibleNTDomainOrWorkgroup parameter is true an addtional name query will be performed to locate a master browser.

GetHashCode ( ) : int

Return the IP address of this address as a 32 bit integer.

Return the IP address of this address as a 32 bit integer.

GetHostAddress ( ) : string

Return the IP address as text such as "192.168.1.15".

Return the IP address as text such as "192.168.1.15".

GetHostIpAddress ( ) : IPAddress
GetHostName ( ) : string

Return the hostname of this address such as "MYCOMPUTER".

Return the hostname of this address such as "MYCOMPUTER".

NextCalledName ( ) : string

Guess next called name to try for session establishment.

Guess next called name to try for session establishment. This method is used exclusively by the jcifs.smb package.

ToString ( ) : string

Return the a text representation of this address such as MYCOMPUTER/192.168.1.15.

Return the a text representation of this address such as MYCOMPUTER/192.168.1.15.

UniAddress ( object addr ) : System

Create a UniAddress by wrapping an InetAddress or NbtAddress.

Create a UniAddress by wrapping an InetAddress or NbtAddress.

Private Methods

Method Description
IsAllDigits ( string hostname ) : bool
IsDotQuadIp ( string hostname ) : bool
LookupServerOrWorkgroup ( string name, IPAddress svr ) : SharpCifs.Netbios.NbtAddress[]
UniAddress ( ) : System

Method Details

Equals() public method

Compare two addresses for equality.
Compare two addresses for equality. Two UniAddresss are equal if they are both UniAddress' and refer to the same IP address.
public Equals ( object obj ) : bool
obj object
return bool

FirstCalledName() public method

Guess first called name to try for session establishment.
Guess first called name to try for session establishment. This method is used exclusively by the jcifs.smb package.
public FirstCalledName ( ) : string
return string

GetAddress() public method

Return the underlying NbtAddress or InetAddress.
Return the underlying NbtAddress or InetAddress.
public GetAddress ( ) : object
return object

GetAllByName() public static method

public static GetAllByName ( string hostname, bool possibleNtDomainOrWorkgroup ) : SharpCifs.UniAddress[]
hostname string
possibleNtDomainOrWorkgroup bool
return SharpCifs.UniAddress[]

GetByName() public static method

Determines the address of a host given it's host name.
Determines the address of a host given it's host name. The name can be a machine name like "jcifs.samba.org", or an IP address like "192.168.1.15".
if there is an error resolving the name ///
public static GetByName ( string hostname ) : UniAddress
hostname string NetBIOS or DNS hostname to resolve
return UniAddress

GetByName() public static method

Lookup hostname and return it's UniAddress.
Lookup hostname and return it's UniAddress. If the possibleNTDomainOrWorkgroup parameter is true an addtional name query will be performed to locate a master browser.
public static GetByName ( string hostname, bool possibleNtDomainOrWorkgroup ) : UniAddress
hostname string
possibleNtDomainOrWorkgroup bool
return UniAddress

GetHashCode() public method

Return the IP address of this address as a 32 bit integer.
Return the IP address of this address as a 32 bit integer.
public GetHashCode ( ) : int
return int

GetHostAddress() public method

Return the IP address as text such as "192.168.1.15".
Return the IP address as text such as "192.168.1.15".
public GetHostAddress ( ) : string
return string

GetHostIpAddress() public method

public GetHostIpAddress ( ) : IPAddress
return System.Net.IPAddress

GetHostName() public method

Return the hostname of this address such as "MYCOMPUTER".
Return the hostname of this address such as "MYCOMPUTER".
public GetHostName ( ) : string
return string

NextCalledName() public method

Guess next called name to try for session establishment.
Guess next called name to try for session establishment. This method is used exclusively by the jcifs.smb package.
public NextCalledName ( ) : string
return string

ToString() public method

Return the a text representation of this address such as MYCOMPUTER/192.168.1.15.
Return the a text representation of this address such as MYCOMPUTER/192.168.1.15.
public ToString ( ) : string
return string

UniAddress() public method

Create a UniAddress by wrapping an InetAddress or NbtAddress.
Create a UniAddress by wrapping an InetAddress or NbtAddress.
public UniAddress ( object addr ) : System
addr object
return System