com.dalsemi.tininet
Class TININet

java.lang.Object
  |
  +--com.dalsemi.tininet.TININet

public class TININet
extends java.lang.Object


Constructor Summary
TININet()
           
 
Method Summary
static boolean checkAccessRights()
          Checks to determine if the user has the rights to set network settings.
static java.lang.String getDHCPServerIP()
          Gets the IP address of DHCP server
static void getDHCPServerIP(byte[] address)
          Gets the DHCP Server IP.
static int getDNSTimeout()
          Gets the timeout value for DNS query.
static java.lang.String getDomainname()
          Gets the Domain name for TINI.
static java.lang.String getEthernetAddress()
          Gets the ethernet address as a String.
static void getEthernetAddress(byte[] address)
          Gets the ethernet address.
static java.lang.String getGatewayIP()
          Gets the gateway IP as a String.
static void getGatewayIP(byte[] address)
          Get the gateway IP
static java.lang.String getHostname()
          Gets the host name of TINI.
static java.lang.String getIPAddress()
          Get the IP address of TINI as a String
static void getIPAddress(byte[] address)
          Gets the IP address of TINI.
static java.lang.String getMailhost()
          Gets the mail host address.
static java.lang.String getPrimaryDNS()
          Gets the primary DNS address.
static int getProxyPort()
          Gets the proxy port.
static java.lang.String getProxyServer()
          Gets the proxy server.
static java.lang.String getSecondaryDNS()
          Gets the secondary DNS address.
static java.lang.String getSubnetMask()
          Gets the subnet IP as a String.
static void getSubnetMask(byte[] address)
          Gets the subnet mask.
static boolean setDHCPServerIP(java.lang.String toThis)
          Sets the DHCP server IP
static boolean setDNSTimeout(int toThis)
          Sets the DNS timeout.
static boolean setDomainname(java.lang.String toThis)
          Sets the domain name to the given string.
static boolean setEthernetAddress(byte[] toThis)
          Sets the ethernet address
static boolean setEthernetAddress(java.lang.String toThis)
          Sets the ethernet address
static boolean setGatewayIP(byte[] toThis)
          Sets the gateway address for TINI
static boolean setGatewayIP(java.lang.String toThis)
          Sets the gateway IP
static boolean setHostname(java.lang.String toThis)
          Sets the host name to the given string.
static boolean setIPAddress(byte[] toThis)
          Sets the IP address of the TINI board.
static boolean setIPAddress(java.lang.String toThis)
          Sets the IP address of the TINI board.
static boolean setMailhost(java.lang.String toThis)
          Sets the mail host.
static boolean setOptions(java.lang.String dhcp, byte[] ip, byte[] gateway, byte[] subnet, java.lang.String dns1, java.lang.String dns2, java.lang.String domain)
          Sets multiple network options
static boolean setPrimaryDNS(java.lang.String toThis)
          Sets the primary DNS address to the given string.
static boolean setProxyPort(int toThis)
          Sets the proxy port
static boolean setProxyServer(java.lang.String toThis)
          Sets the proxy server
static boolean setSecondaryDNS(java.lang.String toThis)
          Sets the secondary DNS address to the given string.
static boolean setSubnetMask(byte[] toThis)
          Sets the subnet mask
static boolean setSubnetMask(java.lang.String toThis)
          Sets the subnet mask
static void update()
          Method to force a reload of network settings from the file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TININet

public TININet()
Method Detail

update

public static void update()
Method to force a reload of network settings from the file.

checkAccessRights

public static boolean checkAccessRights()
Checks to determine if the user has the rights to set network settings. NOTE: If slush is not running, this method always returns true.
Returns:
boolean - true is user has access rights.

getHostname

public static java.lang.String getHostname()
Gets the host name of TINI.
Returns:
the host name.

getDomainname

public static java.lang.String getDomainname()
Gets the Domain name for TINI.
Returns:
domain name.

getPrimaryDNS

public static java.lang.String getPrimaryDNS()
Gets the primary DNS address.
Returns:
DNS address

getSecondaryDNS

public static java.lang.String getSecondaryDNS()
Gets the secondary DNS address.
Returns:
DNS address

getMailhost

public static java.lang.String getMailhost()
Gets the mail host address.
Returns:
mail host address

getDNSTimeout

public static int getDNSTimeout()
Gets the timeout value for DNS query.
Returns:
int timeout in millis

getDHCPServerIP

public static void getDHCPServerIP(byte[] address)
Gets the DHCP Server IP.
Parameters:
- - a byte array of length four to be filled with the IP address.

getDHCPServerIP

public static java.lang.String getDHCPServerIP()
Gets the IP address of DHCP server
Returns:
the IP address of the DHCP server.

getIPAddress

public static void getIPAddress(byte[] address)
Gets the IP address of TINI.
Parameters:
a - byte array of length four to be filled with the IP address

getIPAddress

public static java.lang.String getIPAddress()
Get the IP address of TINI as a String
Returns:
a String containing the IP address

getGatewayIP

public static void getGatewayIP(byte[] address)
Get the gateway IP
Parameters:
a - byte array of length four to be filled with the IP address.

getGatewayIP

public static java.lang.String getGatewayIP()
Gets the gateway IP as a String.
Returns:
the gateway IP address

getSubnetMask

public static void getSubnetMask(byte[] address)
Gets the subnet mask.
Parameters:
a - byte array of length four to be filled with the IP address.

getSubnetMask

public static java.lang.String getSubnetMask()
Gets the subnet IP as a String.
Returns:
the subnet IP address

getEthernetAddress

public static void getEthernetAddress(byte[] address)
Gets the ethernet address.
Parameters:
a - byte array of length four to be filled with the ethernet address.

getEthernetAddress

public static java.lang.String getEthernetAddress()
Gets the ethernet address as a String.
Returns:
the ethernet address

getProxyServer

public static java.lang.String getProxyServer()
Gets the proxy server.
Returns:
the proxy address.

getProxyPort

public static int getProxyPort()
Gets the proxy port.
Returns:
the port number of the proxy.

setHostname

public static boolean setHostname(java.lang.String toThis)
Sets the host name to the given string.
Parameters:
String - - the host name.
Returns:
true if successful.

setDomainname

public static boolean setDomainname(java.lang.String toThis)
Sets the domain name to the given string.
Parameters:
the - name to be set
Returns:
true if successful

setPrimaryDNS

public static boolean setPrimaryDNS(java.lang.String toThis)
Sets the primary DNS address to the given string.
Parameters:
the - name to be set.
Returns:
true if successful

setSecondaryDNS

public static boolean setSecondaryDNS(java.lang.String toThis)
Sets the secondary DNS address to the given string.
Parameters:
the - name to be set
Returns:
true if successful.

setMailhost

public static boolean setMailhost(java.lang.String toThis)
Sets the mail host.
Parameters:
String - containing the mail host address.
Returns:
true on success.

setDNSTimeout

public static boolean setDNSTimeout(int toThis)
Sets the DNS timeout.
Parameters:
int - timeout value in milliseconds.
Returns:
true on success

setDHCPServerIP

public static boolean setDHCPServerIP(java.lang.String toThis)
Sets the DHCP server IP
Parameters:
String - containing the DHCP server IP
Returns:
true on success.

setIPAddress

public static boolean setIPAddress(byte[] toThis)
Sets the IP address of the TINI board.
Parameters:
byte[] - containing the IP address
Returns:
true on success

setIPAddress

public static boolean setIPAddress(java.lang.String toThis)
Sets the IP address of the TINI board.
Parameters:
String - containing the IP address
Returns:
true on success

setGatewayIP

public static boolean setGatewayIP(byte[] toThis)
Sets the gateway address for TINI
Parameters:
byte[] - the IP to be set
Returns:
true on success

setGatewayIP

public static boolean setGatewayIP(java.lang.String toThis)
Sets the gateway IP
Parameters:
String - containing the IP address
Returns:
true on success

setSubnetMask

public static boolean setSubnetMask(byte[] toThis)
Sets the subnet mask
Parameters:
byte[] - containing the subnet mask
Returns:
true on success

setSubnetMask

public static boolean setSubnetMask(java.lang.String toThis)
Sets the subnet mask
Parameters:
String - containing the subnet mask
Returns:
true on success

setEthernetAddress

public static boolean setEthernetAddress(byte[] toThis)
Sets the ethernet address
Parameters:
byte[] - containing the ethernet address
Returns:
true on success

setEthernetAddress

public static boolean setEthernetAddress(java.lang.String toThis)
Sets the ethernet address
Parameters:
String - containing the ethernet address
Returns:
true on success

setProxyServer

public static boolean setProxyServer(java.lang.String toThis)
Sets the proxy server
Parameters:
String - containing the proxy server
Returns:
true on success

setProxyPort

public static boolean setProxyPort(int toThis)
Sets the proxy port
Parameters:
int - the port to be used for proxy
Returns:
true on success

setOptions

public static boolean setOptions(java.lang.String dhcp,
                                 byte[] ip,
                                 byte[] gateway,
                                 byte[] subnet,
                                 java.lang.String dns1,
                                 java.lang.String dns2,
                                 java.lang.String domain)
Sets multiple network options
Parameters:
String - - dhcp server
byte[] - - ip address
byte[] - - gateway address
byte[] - - subnet mask
String - - primary dns
String - - secondary dns
String - - domain name
Returns:
true on success