com.eurotech.framework.net
Interface NetworkAdminService


public interface NetworkAdminService

Service API for getting and setting network interface configurations.

Author:
eurotech

Method Summary
 void disableInterface(String interfaceName)
          Disables the specified interface.
 void enableInterface(String interfaceName, boolean dhcp)
          Enables the specified interface.
 List<NetConfig> getFirewallConfiguration()
          Gets the firewall configuration of the system as currently specified
 List<? extends NetInterfaceConfig<? extends NetInterfaceAddressConfig>> getNetworkInterfaceConfigs()
          Returns a list of all of the configurations associated with all of the interfaces on the system.
 List<NetConfig> getNetworkInterfaceConfigs(String interfaceName)
          Returns the configuration information for the specified NetworkInterface name.
 Map<String,WifiHotspotInfo> getWifiHotspots(String ifaceName)
           
 void manageDhcpServer(String interfaceName, boolean enable, NetworkPair<IP4Address> allowedNetwork)
          Used to control DHCP servers on specified interfaces.
 void manageFirewall(String gatewayIface)
          Updates the Firewall configuration based on current environmental conditions.
 void renewDhcpLease(String interfaceName)
          Releases current IP address and acquires a new lease for the provided interface.
 void setFirewallOpenPortConfiguration(List<FirewallOpenPortConfigIP<? extends IPAddress>> firewallConfiguration)
          Sets the 'open port' portion of the firewall configuration
 void setFirewallPortForwardingConfiguration(List<FirewallPortForwardConfigIP<? extends IPAddress>> firewallConfiguration)
          Sets the 'port forwarding' portion of the firewall configuration
 void updateEthernetInterfaceConfig(String interfaceName, boolean autoConnect, int mtu, List<NetConfig> netConfigs)
          Updates the configuration of the specified EthernetInterface.
 void updateModemInterfaceConfig(String interfaceName, String serialNum, String modemId, int pppNumber, boolean autoConnect, int mtu, List<NetConfig> netConfigs)
          Updates the configuration of the specified ModemInterface.
 void updateWifiInterfaceConfig(String interfaceName, boolean autoConnect, WifiAccessPoint accessPoint, List<NetConfig> netConfigs)
          Updates the configuration of the specified WifiInterface.
 boolean verifyWifiCredentials(String ifaceName, WifiConfig wifiConfig, int tout)
           
 

Method Detail

getNetworkInterfaceConfigs

List<? extends NetInterfaceConfig<? extends NetInterfaceAddressConfig>> getNetworkInterfaceConfigs()
                                                                                                   throws EsfException
Returns a list of all of the configurations associated with all of the interfaces on the system.

Returns:
list of NetInterfaceConfigs on the system
Throws:
EsfException

getNetworkInterfaceConfigs

List<NetConfig> getNetworkInterfaceConfigs(String interfaceName)
                                           throws EsfException
Returns the configuration information for the specified NetworkInterface name. The returned NetConfig captured how the interface was configured; the returned list will have a NetConfig4 instance for IPv4 and an NetConfig6 instance for IPv6. This should not be confused with the currently active NetInterfaceAddress associated with the NetInterface.

Parameters:
interfaceName -
Returns:
list of NetConfig for this interface.
Throws:
EsfException

updateEthernetInterfaceConfig

void updateEthernetInterfaceConfig(String interfaceName,
                                   boolean autoConnect,
                                   int mtu,
                                   List<NetConfig> netConfigs)
                                   throws EsfException
Updates the configuration of the specified EthernetInterface.

Parameters:
interfaceName - - name of the Ethernet interface
autoConnect - - specifies the auto-connect value for the interface
mtu - - required MTU for the interface, -1 to keep the automatic default
netConfig4 - - the IPv4 configuration
netConfig6 - - the IPv6 configuration
Throws:
EsfException

updateWifiInterfaceConfig

void updateWifiInterfaceConfig(String interfaceName,
                               boolean autoConnect,
                               WifiAccessPoint accessPoint,
                               List<NetConfig> netConfigs)
                               throws EsfException
Updates the configuration of the specified WifiInterface.

Parameters:
interfaceName - - name of the wifi interface
autoConnect - - specifies the auto-connect value for the interface
mtu - - required MTU for the interface, -1 to keep the automatic default
netConfig4 - - the IPv4 configuration
netConfig6 - - the IPv6 configuration
Throws:
EsfException

updateModemInterfaceConfig

void updateModemInterfaceConfig(String interfaceName,
                                String serialNum,
                                String modemId,
                                int pppNumber,
                                boolean autoConnect,
                                int mtu,
                                List<NetConfig> netConfigs)
                                throws EsfException
Updates the configuration of the specified ModemInterface.

Parameters:
interfaceName - - name of the Modem interface
serialNum - - the modem's serial number
modemId - - user string to identify the modem
pppNumber - - ppp number to use for this interface
autoConnect - - specifies the auto-connect value for the interface
mtu - - required MTU for the interface, -1 to keep the automatic default
netConfigs - - list of NetConfigs for this interface
Throws:
EsfException

enableInterface

void enableInterface(String interfaceName,
                     boolean dhcp)
                     throws EsfException
Enables the specified interface.

Parameters:
interfaceName - - name of the interface to be enabled.
Throws:
EsfException

disableInterface

void disableInterface(String interfaceName)
                      throws EsfException
Disables the specified interface.

Parameters:
interfaceName - - name of the interface to be disabled.
Throws:
EsfException

manageDhcpServer

void manageDhcpServer(String interfaceName,
                      boolean enable,
                      NetworkPair<IP4Address> allowedNetwork)
                      throws EsfException
Used to control DHCP servers on specified interfaces.

Parameters:
interfaceName - The interface of the DHCP server to modify the state
enable - Whether to enable or disable the DHCP server
allowedNetwork - The allowed network for the DHCP server if enabled
Throws:
EsfException

renewDhcpLease

void renewDhcpLease(String interfaceName)
                    throws EsfException
Releases current IP address and acquires a new lease for the provided interface.

Parameters:
interfaceName - The interface on which to renew the lease
Throws:
EsfException

getFirewallConfiguration

List<NetConfig> getFirewallConfiguration()
                                         throws EsfException
Gets the firewall configuration of the system as currently specified

Returns:
A list of NetConfigs representing the firewall configuration
Throws:
EsfException

setFirewallOpenPortConfiguration

void setFirewallOpenPortConfiguration(List<FirewallOpenPortConfigIP<? extends IPAddress>> firewallConfiguration)
                                      throws EsfException
Sets the 'open port' portion of the firewall configuration

Parameters:
firewallConfiguration - A list of FirewallOpenPortConfigIP Objects representing the configuration to set
Throws:
EsfException

setFirewallPortForwardingConfiguration

void setFirewallPortForwardingConfiguration(List<FirewallPortForwardConfigIP<? extends IPAddress>> firewallConfiguration)
                                            throws EsfException
Sets the 'port forwarding' portion of the firewall configuration

Parameters:
firewallConfiguration - A list of FirewallPortForwardConfigIP Objects representing the configuration to set
Throws:
EsfException

manageFirewall

void manageFirewall(String gatewayIface)
                    throws EsfException
Updates the Firewall configuration based on current environmental conditions. This is used to update the firewall in events where NAT rules need to change based on a new WAN interface coming up or going down. This ensures all downstream clients utilizing NAT on the gateway can and will maintain active Internet connections through the gateway.

Parameters:
gatewayIface - The new gateway interface that is now active as the WAN interface
Throws:
EsfException

getWifiHotspots

Map<String,WifiHotspotInfo> getWifiHotspots(String ifaceName)
                                            throws EsfException
Throws:
EsfException

verifyWifiCredentials

boolean verifyWifiCredentials(String ifaceName,
                              WifiConfig wifiConfig,
                              int tout)


Copyright © 2013. All Rights Reserved.