OpenNMS API 1.2.9

## org.opennms.netmgt.capsd
Class SmbUtils

    java.lang.Object
      org.opennms.netmgt.capsd.SmbUtils

public class SmbUtils
extends java.lang.Object

This class contains several static convience methods utilized by Capsd while doing data collection via jCIFS and the SMB (Server Message Block) protocol.

Author:
  Mike , OpenNMS

Field Summary
`static int` `BROWSER_SERVICE_ELECTIONS`
`static int` `DCA_IRMALAN_GATEWAY_SERVER_SERVICE`
`static int` `DEC_PATHWORKS_TCPIP_SERVICE_A`
`static int` `DEC_PATHWORKS_TCPIP_SERVICE_B`
`static int` `DOMAIN_CONTROLLERS`
`static int` `DOMAIN_MASTER_BROWSER`
`static int` `DOMAIN_NAME`
`static int` `FILE_SERVER_SERVICE`
`static int` `INTERNET_INFORMATION_SERVER_G`
`static int` `INTERNET_INFORMATION_SERVER_U`
`static int` `LOTUS_NOTES_IRIS_MULTICAST`
`static int` `LOTUS_NOTES_IRIS_NAME_SERVER`
`static int` `LOTUS_NOTES_SERVER_SERVICE`
`static int` `MASTER_BROWSER_G`
`static int` `MASTER_BROWSER_U`
`static int` `MESSENGER_SERVICE`
`static int` `MESSENGER_SERVICE_A`
`static int` `MESSENGER_SERVICE_B`
`static int` `MODEM_SHARING_CLIENT_SERVICE`
`static int` `MODEM_SHARING_SERVER_SERVICE`
`static int` `MS_EXCHANGE_DIRECTORY`
`static int` `MS_EXCHANGE_IMC`
`static int` `MS_EXCHANGE_INTERCHANGE`
`static int` `MS_EXCHANGE_MTA`
`static int` `MS_EXCHANGE_STORE`
`static int` `NETDDE_SERVICE`
`static int` `NETWORK_MONITOR_AGENT`
`static int` `NETWORK_MONITOR_APPLICATION`
`static int` `RAS_CLIENT_SERVICE`
`static int` `RAS_SERVER_SERVICE`
`static int` `SMS_ADMIN_REMOTE_CONTROL_TOOL`
`static int` `SMS_CLIENT_REMOTE_CONTROL`
`static int` `SMS_CLIENTS_REMOTE_CHAT`
`static int` `SMS_CLIENTS_REMOTE_TRANSFER`
`static int` `WORKSTATION_SERVICE`

Constructor Summary
`SmbUtils()`

Method Summary
`(package private) static java.lang.String` `getAuthenticationDomainName(jcifs.netbios.NbtAddress[] addresses, java.lang.String cname)` This method attempts to determine the authentication domain for a remote host.
`(package private) static java.lang.String` `getOsLabel(java.lang.String nativeOS, jcifs.netbios.NbtAddress[] addresses, boolean isSamba, boolean hasExchange)` Returns the operating system label to be associated with a node in 'node' table in the databse.
`(package private) static java.lang.String` `getSmbURL(SmbAuth smbAuth, java.lang.String cname)` Convenience method which takes an SmbAuth object with userid and password information and the NetBIOS name for a remote server and builds the appropriate SMB url string which can be used to enumerate the server's shares.
`(package private) static boolean` `isNTServer(jcifs.netbios.NbtAddress[] addresses)` This method is responsible for taking an array of jCIFS NbtAddress objects associated with a particular node and determining if that node is an NT server versus an NT workstation based on the services it has registered.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### WORKSTATION_SERVICE

    public static final int WORKSTATION_SERVICE

See Also:
  Constant Field Values

### MESSENGER_SERVICE_A

    public static final int MESSENGER_SERVICE_A

See Also:
  Constant Field Values

### MASTER_BROWSER_G

    public static final int MASTER_BROWSER_G

See Also:
  Constant Field Values

### MESSENGER_SERVICE_B

    public static final int MESSENGER_SERVICE_B

See Also:
  Constant Field Values

### RAS_SERVER_SERVICE

    public static final int RAS_SERVER_SERVICE

See Also:
  Constant Field Values

### NETDDE_SERVICE

    public static final int NETDDE_SERVICE

See Also:
  Constant Field Values

### FILE_SERVER_SERVICE

    public static final int FILE_SERVER_SERVICE

See Also:
  Constant Field Values

### RAS_CLIENT_SERVICE

    public static final int RAS_CLIENT_SERVICE

See Also:
  Constant Field Values

### MS_EXCHANGE_INTERCHANGE

    public static final int MS_EXCHANGE_INTERCHANGE

See Also:
  Constant Field Values

### MS_EXCHANGE_STORE

    public static final int MS_EXCHANGE_STORE

See Also:
  Constant Field Values

### MS_EXCHANGE_DIRECTORY

    public static final int MS_EXCHANGE_DIRECTORY

See Also:
  Constant Field Values

### MODEM_SHARING_SERVER_SERVICE

    public static final int MODEM_SHARING_SERVER_SERVICE

See Also:
  Constant Field Values

### MODEM_SHARING_CLIENT_SERVICE

    public static final int MODEM_SHARING_CLIENT_SERVICE

See Also:
  Constant Field Values

### SMS_CLIENT_REMOTE_CONTROL

    public static final int SMS_CLIENT_REMOTE_CONTROL

See Also:
  Constant Field Values

### SMS_ADMIN_REMOTE_CONTROL_TOOL

    public static final int SMS_ADMIN_REMOTE_CONTROL_TOOL

See Also:
  Constant Field Values

### SMS_CLIENTS_REMOTE_CHAT

    public static final int SMS_CLIENTS_REMOTE_CHAT

See Also:
  Constant Field Values

### SMS_CLIENTS_REMOTE_TRANSFER

    public static final int SMS_CLIENTS_REMOTE_TRANSFER

See Also:
  Constant Field Values

### DEC_PATHWORKS_TCPIP_SERVICE_A

    public static final int DEC_PATHWORKS_TCPIP_SERVICE_A

See Also:
  Constant Field Values

### DEC_PATHWORKS_TCPIP_SERVICE_B

    public static final int DEC_PATHWORKS_TCPIP_SERVICE_B

See Also:
  Constant Field Values

### MS_EXCHANGE_MTA

    public static final int MS_EXCHANGE_MTA

See Also:
  Constant Field Values

### MS_EXCHANGE_IMC

    public static final int MS_EXCHANGE_IMC

See Also:
  Constant Field Values

### NETWORK_MONITOR_AGENT

    public static final int NETWORK_MONITOR_AGENT

See Also:
  Constant Field Values

### NETWORK_MONITOR_APPLICATION

    public static final int NETWORK_MONITOR_APPLICATION

See Also:
  Constant Field Values

### MESSENGER_SERVICE

    public static final int MESSENGER_SERVICE

See Also:
  Constant Field Values

### DOMAIN_NAME

    public static final int DOMAIN_NAME

See Also:
  Constant Field Values

### DOMAIN_MASTER_BROWSER

    public static final int DOMAIN_MASTER_BROWSER

See Also:
  Constant Field Values

### DOMAIN_CONTROLLERS

    public static final int DOMAIN_CONTROLLERS

See Also:
  Constant Field Values

### MASTER_BROWSER_U

    public static final int MASTER_BROWSER_U

See Also:
  Constant Field Values

### BROWSER_SERVICE_ELECTIONS

    public static final int BROWSER_SERVICE_ELECTIONS

See Also:
  Constant Field Values

### INTERNET_INFORMATION_SERVER_G

    public static final int INTERNET_INFORMATION_SERVER_G

See Also:
  Constant Field Values

### INTERNET_INFORMATION_SERVER_U

    public static final int INTERNET_INFORMATION_SERVER_U

See Also:
  Constant Field Values

### LOTUS_NOTES_SERVER_SERVICE

    public static final int LOTUS_NOTES_SERVER_SERVICE

See Also:
  Constant Field Values

### LOTUS_NOTES_IRIS_MULTICAST

    public static final int LOTUS_NOTES_IRIS_MULTICAST

See Also:
  Constant Field Values

### LOTUS_NOTES_IRIS_NAME_SERVER

    public static final int LOTUS_NOTES_IRIS_NAME_SERVER

See Also:
  Constant Field Values

### DCA_IRMALAN_GATEWAY_SERVER_SERVICE

    public static final int DCA_IRMALAN_GATEWAY_SERVER_SERVICE

See Also:
  Constant Field Values

Constructor Detail

### SmbUtils

    public SmbUtils()

Method Detail

### getAuthenticationDomainName

    static java.lang.String getAuthenticationDomainName(jcifs.netbios.NbtAddress[] addresses,
                                                        java.lang.String cname)

  This method attempts to determine the authentication domain for a remote host. The list of NbtAddress objects is processed in order to find an entry with a DOMAIN_NAME (0x00) suffix. WORKSTATION_SERVICE and INTERNET_INFORMATION_SERVER share the same 0x00 suffix so these entries must be ignored while processing the address list.

  Parameters:
    `addresses` - List of NbtAddress objects associated with the remote host.
    `cname` - NetBIOS name of the remote host.
  Returns:
    remote host's authentication domain or null if unavailable.

### getOsLabel

    static java.lang.String getOsLabel(java.lang.String nativeOS,
                                       jcifs.netbios.NbtAddress[] addresses,
                                       boolean isSamba,
                                       boolean hasExchange)

  Returns the operating system label to be associated with a node in 'node' table in the databse. This call should be made after an attempt to determine if the interface supports Microsoft Exchange. This is determined by the `MSExchangePlugin`class.

  Parameters:
    `nativeOS` - OS string returned by jCIFS following SMB session establishment with the remote host.
    `addresses` - array of NbtAddress objects associated with the remote host being tested.
    `isSamba` - true if it has been derived that the remote system is running Samba.
    `hasExchange` - true if the service supports microsoft exhange.
  Returns:
    The Operating system label

### isNTServer

    static boolean isNTServer(jcifs.netbios.NbtAddress[] addresses)

  This method is responsible for taking an array of jCIFS NbtAddress objects associated with a particular node and determining if that node is an NT server versus an NT workstation based on the services it has registered. If the remote host is registered as a DOMAIN_CONTROLLERS or a MS_EXCHANGE_MTA we return 'true'; otherwise, 'false' is returned.

  Parameters:
    `addresses` - Array of NbtAddress objects associated with the remote host being tested.
  Returns:
    true if NT Server, false otherwise.

### getSmbURL

    static java.lang.String getSmbURL(SmbAuth smbAuth,
                                      java.lang.String cname)

  Convenience method which takes an SmbAuth object with userid and password information and the NetBIOS name for a remote server and builds the appropriate SMB url string which can be used to enumerate the server's shares.

  Parameters:
    `smbAuth` - SMB Authentication object w/ userid/password info
    `cname` - NetBIOS address of remote server
  Returns:
    URL string which can be used in a subsequent SmbFile() call.

OpenNMS API 1.2.9

Generated by ranger on May 19 2007 2335.