com.esf.net.linux.route.service
Interface ILinuxRouteService
- public interface ILinuxRouteService
The ILinuxRouteService is used to set routing preferences in Linux
environment
- Author:
- pravin.dhake
Field Summary |
static java.lang.String |
SERVICE_NAME
service name of this interface for the bundle activator
(com.esf.networking.firewall.service) |
Method Summary |
void |
addNewRoute(java.lang.String routerIPAddress,
java.lang.String adapter)
|
void |
addPersistentRoute(java.lang.String gatewayIPAddress,
java.lang.String deviceIPAddress,
java.lang.String adapter,
java.lang.String netmask,
int routeNumber)
|
java.lang.String |
getDefaultRoute(java.lang.String adapter)
|
SERVICE_NAME
public static final java.lang.String SERVICE_NAME
- service name of this interface for the bundle activator
(com.esf.networking.firewall.service)
addNewRoute
public void addNewRoute(java.lang.String routerIPAddress,
java.lang.String adapter)
throws java.io.IOException
- Parameters:
routerIPAddress
- ip address of the routeradapter
- name as String
- Throws:
java.io.IOException
getDefaultRoute
public java.lang.String getDefaultRoute(java.lang.String adapter)
throws java.lang.Exception
- Parameters:
adapter
- name as String
- Returns:
- null if wrong input given, else returns the route information in
form of string similar to Linux command output on console
- Throws:
java.lang.Exception
addPersistentRoute
public void addPersistentRoute(java.lang.String gatewayIPAddress,
java.lang.String deviceIPAddress,
java.lang.String adapter,
java.lang.String netmask,
int routeNumber)
throws java.lang.Exception
- Parameters:
gatewayIPAddress
- address of default gateway in dotted notation, as StringdeviceIPAddress
- address of this interface in dotted notation, as Stringadapter
- name as Stringnetmask
- subnet mask of interface in dotted notation, as StringrouteNumber
- = 0 for 1st route ,1 for 2nd route and so on.
Depending upon this number the GATEWAY ,ADDRESS and NETMASK
are classified in /etc/sysconfig/network-scripts/route-adapter
file as GATEWAY0,GATEWAY1 ....etc.
- Throws:
java.lang.Exception
- when wrong routenumber or already pre-defined route
number is used
Copyright © 2009 Eurotech Inc. All rights reserved.