|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.dalsemi.tininet.TININet
This class is used to set up parameters for TINI networking.
Field Summary | |
static int |
COMMITTED
Network configuration is committed to flash memory. |
static int |
ETH_STATUS_LINK
Ethernet controller status flags. |
static int |
ETH_STATUS_RX
|
static int |
ETH_STATUS_TX
|
static int |
RESTORE_DISABLED
Network configuration restore is disabled. |
static int |
UNCOMMITTED
Network configuration is not committed to flash memory. |
Constructor Summary | |
TININet()
|
Method Summary | |
static void |
addInterfaceEntry(byte[] name,
byte[] ipAddr,
byte[] subnet,
byte[] gateway,
byte flags,
byte type,
int transmitter)
Adds an interface to the network interface list with the given parameters. |
static void |
commitNetworkState()
Commits the current network configuration to flash. |
static byte[] |
createIPFromString(String fromThis)
Creates an array that stores the IP address represented by the String argument. |
static String |
createIPString(byte[] fromThis)
Creates a standard IP String from the given byte array. |
static void |
disableNetworkRestore()
Disables the ability to commit or restore network configuration until the bank 7 application is re-flashed. |
static byte[] |
getARPCacheTable()
Gets the current ARP cache table. |
static byte[] |
getConnectionTable()
Gets the current connection table. |
static String |
getDHCPServerIP()
Gets the IP address of DHCP server. |
static void |
getDHCPServerIP(byte[] address)
Gets the IP address of the DHCP server. |
static int |
getDNSTimeout()
Gets the timeout value for DNS queries. |
static String |
getDomainname()
Gets the domain name of TINI. |
static String |
getEthernetAddress()
Gets the ethernet MAC address in dotted decimal notation. |
static void |
getEthernetAddress(byte[] address)
Gets the ethernet MAC address into the given byte array, with the most significant byte first. |
static int |
getEthernetStatus()
Returns status from the Ethernet controller. |
static String |
getGatewayIP()
Gets the gateway IP address of the default interface as a String. |
static void |
getGatewayIP(byte[] address)
Gets the gateway IP address of the default interface. |
static String |
getGatewayIP(String interfaceName)
Gets the IP address of the gateway for the specified interface as a string in dotted decimal notation. |
static void |
getGatewayIP(String interfaceName,
byte[] address)
Gets the IP address of the gateway for the specified interface. |
static String |
getHostname()
Gets the hostname of TINI. |
static boolean |
getInterfaceInfo(int interfaceNum,
byte[] data)
Gets interface information for given interface and stores it in byte array. |
static String |
getIPAddress()
Gets the IP address of the default interface as a String. |
static void |
getIPAddress(byte[] address)
Gets the IP address of the default interface. |
static String |
getIPAddress(String interfaceName)
Gets the IP address of the specified interface as a String. |
static void |
getIPAddress(String interfaceName,
byte[] address)
Gets the IP address of the specified interface. |
static String |
getMailhost()
Gets the IP address of the default mailhost. |
static int |
getNetworkCommitState()
Returns the commit state as UNCOMMITED, COMMITTED or RESTORE_DISABLED |
static String |
getPrimaryDNS()
Gets the primary DNS server address. |
static int |
getProxyPort()
Gets the proxy server port number. |
static String |
getProxyServer()
Gets the IP address of the proxy server. |
static String |
getSecondaryDNS()
Gets the secondary DNS server address. |
static String |
getSubnetMask()
Gets the subnet mask of the default interface as a String. |
static void |
getSubnetMask(byte[] address)
Gets the subnet mask of the default interface. |
static String |
getSubnetMask(String interfaceName)
Gets the subnet mask of the specified interface as a String. |
static void |
getSubnetMask(String interfaceName,
byte[] address)
Gets the subnet mask of the specified interface. |
static void |
removeInterfaceEntry(byte[] name)
Removes specified interface from the network interface list. |
static boolean |
setDefaultInterface(byte[] name)
Sets the default network interface. |
static boolean |
setDHCPServerIP(String dhcpServer)
Sets the IP address of the DHCP server to the given string. |
static boolean |
setDNSTimeout(int dnsTimeout)
Sets the DNS timeout in milliseconds. |
static boolean |
setDomainname(String domain)
Sets the domain name to the given string. |
static boolean |
setGatewayIP(byte[] gateway)
Sets the gateway address for the default interface. |
static boolean |
setGatewayIP(String gateway)
Sets the gateway IP for the default interface. |
static boolean |
setGatewayIP(String interfaceName,
byte[] gateway)
Sets the gateway IP address for the specified interface. |
static boolean |
setGatewayIP(String interfaceName,
String gateway)
Sets the gateway IP for the specified interface. |
static boolean |
setHostname(String host)
Sets the host name to the given string. |
static boolean |
setIPAddress(byte[] localIP)
Sets the IP address of the default interface. |
static boolean |
setIPAddress(String localIP)
Sets the IP address of the default interface. |
static boolean |
setIPAddress(String interfaceName,
byte[] localIP)
Sets the IP address of the specified interface. |
static boolean |
setIPAddress(String interfaceName,
String localIP)
Sets the IP address of the specified interface. |
static boolean |
setMailhost(String mailhost)
Sets the mail host to the given IP address. |
static boolean |
setOptions(byte[] dhcp,
byte[] ip,
byte[] gateway,
byte[] subnet,
byte[] dns1,
byte[] dns2,
byte[] domain,
byte[] mailhost)
Sets multiple network configuration settings. |
static boolean |
setPrimaryDNS(String primaryDNS)
Sets the primary DNS IP address to the given string. |
static boolean |
setProxyPort(int proxyPort)
Sets the proxy port. |
static boolean |
setProxyServer(String proxyServer)
Sets the proxy server IP address |
static boolean |
setSecondaryDNS(String secondDNS)
Sets the secondary DNS IP address to the given string. |
static boolean |
setSubnetMask(byte[] subnetMask)
Sets the subnet mask of the default interface. |
static boolean |
setSubnetMask(String subnetMask)
Sets the subnet mask of the default interface. |
static boolean |
setSubnetMask(String interfaceName,
byte[] subnetMask)
Sets the subnet mask of the specified interface. |
static boolean |
setSubnetMask(String interfaceName,
String subnetMask)
Sets the subnet mask of the specified interface. |
static void |
update()
Forces a reload of network settings from the configuration file /etc/.tininet |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int UNCOMMITTED
public static final int COMMITTED
public static final int RESTORE_DISABLED
public static final int ETH_STATUS_LINK
public static final int ETH_STATUS_TX
public static final int ETH_STATUS_RX
Constructor Detail |
public TININet()
Method Detail |
public static void update()
public static String createIPString(byte[] fromThis)
String
from the given byte array.
The first four bytes are written as unsigned decimal digits,
separated by periods. For instance, if the input array consists
of all 0's, the returned String
would be "0.0.0.0"
.fromThis
- byte array with the IP address to convert to a String
createIPFromString(String)
public static byte[] createIPFromString(String fromThis)
String
argument. If fromThis
is "180.0.16.52", then the bytes in the array returned by
this method are 180, 0, 16, and 52, starting at offset 0
of the returned array.fromThis
- String
reporesentation of the IP addresscreateIPString(byte[])
public static String getHostname()
public static String getDomainname()
public static String getPrimaryDNS()
public static String getSecondaryDNS()
public static String getMailhost()
public static int getDNSTimeout()
public static void getDHCPServerIP(byte[] address)
address
- byte array of length four to be filled with the IP DHCP server address, most significant
byte of address is stored at index zeropublic static String getDHCPServerIP()
public static void getIPAddress(String interfaceName, byte[] address)
interfaceName
- network interface (lo, eth0 or pppn)address
- byte array of length four to be filled in with the IP address, most significant
byte of address is stored at index zeropublic static String getIPAddress(String interfaceName)
interfaceName
- network interface (lo, eth or ppp)public static String getIPAddress()
public static void getIPAddress(byte[] address)
address
- byte array of length four to be filled with the IP address, most significant
byte of address is stored at index zeropublic static void getGatewayIP(byte[] address)
address
- byte array of length four to be filled with the IP address, most significant
byte of address is stored at index zeropublic static String getGatewayIP()
public static void getGatewayIP(String interfaceName, byte[] address)
interfaceName
- network interface (lo, eth or ppp)address
- byte array of length four to be filled with the IP address, most significant
byte of address is stored at index zeropublic static String getGatewayIP(String interfaceName)
public static void getSubnetMask(byte[] address)
address
- byte array of length four to be filled with the subnet mask, most significant
byte of mask is stored at index zeropublic static String getSubnetMask()
public static void getSubnetMask(String interfaceName, byte[] address)
interfaceName
- network interface (lo, eth or ppp)address
- byte array of length four to be filled with the subnet mask, most significant
byte of mask is stored at index zeropublic static String getSubnetMask(String interfaceName)
public static void getEthernetAddress(byte[] address)
address
- byte array of length six to be filled with the ethernet addresspublic static String getEthernetAddress()
public static String getProxyServer()
public static int getProxyPort()
public static boolean setHostname(String host)
host
- hostnamepublic static boolean setDomainname(String domain)
domain
- domain name to be setpublic static boolean setPrimaryDNS(String primaryDNS)
primaryDNS
- primary DNS IP address in dotted decimal notationpublic static boolean setSecondaryDNS(String secondDNS)
secondDNS
- secondary DNS IP address in dotted decimal notationpublic static boolean setMailhost(String mailhost)
mailhost
- IP address of the mail host in dotted decimal notationpublic static boolean setDNSTimeout(int dnsTimeout)
dnsTimeout
- timeout value in milliseconds, zero for fallback and retrypublic static boolean setDHCPServerIP(String dhcpServer)
dhcpServer
- DHCP server IP address in dotted decimal notationpublic static boolean setIPAddress(byte[] localIP)
localIP
- IP address, MSB of address is index zeropublic static boolean setIPAddress(String localIP)
localIP
- IP address in dotted decimal notationpublic static boolean setIPAddress(String interfaceName, byte[] localIP)
interfaceName
- network interface namelocalIP
- IP address, MSB of address is index zeropublic static boolean setIPAddress(String interfaceName, String localIP)
interfaceName
- network interface namelocalIP
- IP address in dotted decimal notationpublic static boolean setGatewayIP(byte[] gateway)
gateway
- IP address of the gateway, MSB of address is index zeropublic static boolean setGatewayIP(String gateway)
gateway
- IP address of the gateway in dotted decimal notationpublic static boolean setGatewayIP(String interfaceName, byte[] gateway)
interfaceName
- network interface namegateway
- ip address of the gateway, MSB of address is index zeropublic static boolean setGatewayIP(String interfaceName, String gateway)
interfaceName
- network interface namegateway
- IP address of the gateway in dotted decimal notationpublic static boolean setSubnetMask(byte[] subnetMask)
subnetMask
- subnet mask, MSB of mask is at index zeropublic static boolean setSubnetMask(String subnetMask)
subnetMask
- subnet mask in dotted decimal notationpublic static boolean setSubnetMask(String interfaceName, byte[] subnetMask)
interfaceName
- network interface namesubnetMask
- subnet mask, MSB of mask is at index zeropublic static boolean setSubnetMask(String interfaceName, String subnetMask)
interfaceName
- network interface namesubnetMask
- subnet mask in dotted decimal notationpublic static boolean setProxyServer(String proxyServer)
proxyServer
- IP address of the proxy server, MSB of address is at index zeropublic static boolean setProxyPort(int proxyPort)
proxyPort
- the port number to be used for proxypublic static boolean setOptions(byte[] dhcp, byte[] ip, byte[] gateway, byte[] subnet, byte[] dns1, byte[] dns2, byte[] domain, byte[] mailhost)
dhcp
- IP address of the DHCP server, MSB of address is at index zeroip
- IP address of the local machine, MSB of address is at index zerogateway
- IP address of gateway address, MSB of address is at index zerosubnet
- subnet mask, MSB of address is at index zerodns1
- IP address of the primary DNS server, MSB of address is at index zerodns2
- IP address of the secondary DNS server, MSB of address is at index zerodomain
- domain name stored as a byte arraymailhost
- IP address of the outgoing mail server, MSB of address is at index zeropublic static byte[] getConnectionTable()
public static byte[] getARPCacheTable()
public static void commitNetworkState() throws CommitException
CommitNetworkState
method. Once they are committed you
can disable boot time restore using the
disableNetworkRestore
. Effectively this is the same as if
the network configuration was never committed. The configuration is
stored in RAM only and can be reconfigured at will.
The network configuration can only be recommitted after erasing
(zapping) bank 7 which will also erase the bank 7 application.
The easiest way to do this is to simply reload the bank 7
application using JavaKit.
This functionality is available in a login session using the
slush commands "ipconfig -C" and "ipconfig -D". getNetworkCommitState
,
disableNetworkRestore
,
com.dalsemi.system.TINIOS.getBootState
public static int getNetworkCommitState()
CommitNetworkState
,
disableNetworkRestore
,
com.dalsemi.system.TINIOS.getBootState
public static void disableNetworkRestore()
CommitNetworkState
,
getNetworkCommitState
,
com.dalsemi.system.TINIOS.getBootState
public static boolean setDefaultInterface(byte[] name)
name
- network interface, lo (loopback), eth (ethernet) or ppppublic static boolean getInterfaceInfo(int interfaceNum, byte[] data)
interfaceNum
- network interface numberdata
- buffer for interface infopublic static void addInterfaceEntry(byte[] name, byte[] ipAddr, byte[] subnet, byte[] gateway, byte flags, byte type, int transmitter)
name
- network interface lo(loopback), eth(ethernet) or pppipAddr
- IP address of the new interfacesubnet
- subnet mask of the new interfacegateway
- gateway IP address of the new interfaceflags
- network configuration flags mapped as follows:
type
- type of network interface ethernet = 1, ppp = 2, loopback = 3transmitter
- 24 bit transmitter routine address represented as a 32-bit intpublic static void removeInterfaceEntry(byte[] name)
name
- network interface name to removepublic static int getEthernetStatus()
name
- network interface name to remove
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |