|
|||||||||
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 |
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 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 java.lang.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 java.lang.String |
getDomainname()
Gets the domain name of TINI. |
static java.lang.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 java.lang.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 java.lang.String |
getGatewayIP(java.lang.String interfaceName)
Gets the IP address of the gateway for the specified interface as a string in dotted decimal notation. |
static void |
getGatewayIP(java.lang.String interfaceName,
byte[] address)
Gets the IP address of the gateway for the specified interface. |
static java.lang.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 java.lang.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 java.lang.String |
getIPAddress(java.lang.String interfaceName)
Gets the IP address of the specified interface as a String. |
static void |
getIPAddress(java.lang.String interfaceName,
byte[] address)
Gets the IP address of the specified interface. |
static java.lang.String |
getMailhost()
Gets the IP address of the default mailhost. |
static int |
getNetworkCommitState()
Returns the commit state as UNCOMMITED, COMMITTED or RESTORE_DISABLED |
static java.lang.String |
getPrimaryDNS()
Gets the primary DNS server address. |
static int |
getProxyPort()
Gets the proxy server port number. |
static java.lang.String |
getProxyServer()
Gets the IP address of the proxy server. |
static java.lang.String |
getSecondaryDNS()
Gets the secondary DNS server address. |
static java.lang.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 java.lang.String |
getSubnetMask(java.lang.String interfaceName)
Gets the subnet mask of the specified interface as a String. |
static void |
getSubnetMask(java.lang.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(java.lang.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(java.lang.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(java.lang.String gateway)
Sets the gateway IP for the default interface. |
static boolean |
setGatewayIP(java.lang.String interfaceName,
byte[] gateway)
Sets the gateway IP address for the specified interface. |
static boolean |
setGatewayIP(java.lang.String interfaceName,
java.lang.String gateway)
Sets the gateway IP for the specified interface. |
static boolean |
setHostname(java.lang.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(java.lang.String localIP)
Sets the IP address of the default interface. |
static boolean |
setIPAddress(java.lang.String interfaceName,
byte[] localIP)
Sets the IP address of the specified interface. |
static boolean |
setIPAddress(java.lang.String interfaceName,
java.lang.String localIP)
Sets the IP address of the specified interface. |
static boolean |
setMailhost(java.lang.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(java.lang.String primaryDNS)
Sets the primary DNS IP address to the given string. |
static boolean |
setProxyPort(int proxyPort)
Sets the proxy port. |
static boolean |
setProxyServer(java.lang.String proxyServer)
Sets the proxy server IP address |
static boolean |
setSecondaryDNS(java.lang.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(java.lang.String subnetMask)
Sets the subnet mask of the default interface. |
static boolean |
setSubnetMask(java.lang.String interfaceName,
byte[] subnetMask)
Sets the subnet mask of the specified interface. |
static boolean |
setSubnetMask(java.lang.String interfaceName,
java.lang.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
Constructor Detail |
public TININet()
Method Detail |
public static void update()
public static java.lang.String getHostname()
public static java.lang.String getDomainname()
public static java.lang.String getPrimaryDNS()
public static java.lang.String getSecondaryDNS()
public static java.lang.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 java.lang.String getDHCPServerIP()
public static void getIPAddress(java.lang.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 java.lang.String getIPAddress(java.lang.String interfaceName)
interfaceName
- network interface (lo, eth or ppp)public static java.lang.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 java.lang.String getGatewayIP()
public static void getGatewayIP(java.lang.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 java.lang.String getGatewayIP(java.lang.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 java.lang.String getSubnetMask()
public static void getSubnetMask(java.lang.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 java.lang.String getSubnetMask(java.lang.String interfaceName)
public static void getEthernetAddress(byte[] address)
address
- byte array of length six to be filled with the ethernet addresspublic static java.lang.String getEthernetAddress()
public static java.lang.String getProxyServer()
public static int getProxyPort()
public static boolean setHostname(java.lang.String host)
host
- hostnamepublic static boolean setDomainname(java.lang.String domain)
domain
- domain name to be setpublic static boolean setPrimaryDNS(java.lang.String primaryDNS)
primaryDNS
- primary DNS IP address in dotted decimal notationpublic static boolean setSecondaryDNS(java.lang.String secondDNS)
secondDNS
- secondary DNS IP address in dotted decimal notationpublic static boolean setMailhost(java.lang.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(java.lang.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(java.lang.String localIP)
localIP
- IP address in dotted decimal notationpublic static boolean setIPAddress(java.lang.String interfaceName, byte[] localIP)
interfaceName
- network interface namelocalIP
- IP address, MSB of address is index zeropublic static boolean setIPAddress(java.lang.String interfaceName, java.lang.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(java.lang.String gateway)
gateway
- IP address of the gateway in dotted decimal notationpublic static boolean setGatewayIP(java.lang.String interfaceName, byte[] gateway)
interfaceName
- network interface namegateway
- ip address of the gateway, MSB of address is index zeropublic static boolean setGatewayIP(java.lang.String interfaceName, java.lang.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(java.lang.String subnetMask)
subnetMask
- subnet mask in dotted decimal notationpublic static boolean setSubnetMask(java.lang.String interfaceName, byte[] subnetMask)
interfaceName
- network interface namesubnetMask
- subnet mask, MSB of mask is at index zeropublic static boolean setSubnetMask(java.lang.String interfaceName, java.lang.String subnetMask)
interfaceName
- network interface namesubnetMask
- subnet mask in dotted decimal notationpublic static boolean setProxyServer(java.lang.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
public static int getNetworkCommitState()
public static void disableNetworkRestore()
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 remove
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |