|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.eurotech.framework.linux.net.route.RouteServiceImpl
public class RouteServiceImpl
| Field Summary |
|---|
| Fields inherited from interface com.eurotech.framework.linux.net.route.IRouteService |
|---|
SERVICE_NAME |
| Method Summary | |
|---|---|
void |
addStaticRoute(IPAddress destination,
IPAddress gateway,
IPAddress netmask,
String iface,
int metric)
Adds a static route to the system's route table. |
String |
getDefaultInterface(IPAddress destination)
Returns the default route's interface for the specified destination address, or null if no route exists. |
RouteConfig |
getDefaultRoute(String iface)
Returns the default route for a specified interface. |
static IRouteService |
getInstance()
|
RouteConfig[] |
getRoutes()
Returns the routes contained in the system's route table. |
void |
removeStaticRoute(IPAddress destination,
IPAddress gateway,
IPAddress netmask,
String iface)
Removes a static route in the system's route table. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static IRouteService getInstance()
public void addStaticRoute(IPAddress destination,
IPAddress gateway,
IPAddress netmask,
String iface,
int metric)
throws Exception
IRouteService
addStaticRoute in interface IRouteServicedestination - An IPAddress object representing the destination IP address.gateway - An IPAddress object representing the gateway IP address.netmask - An IPAddress object representing the netmask.iface - A String object specifying the interface name.metric - An int representing the metric (priority) of the route.
Exception - for invalid supplied parameters, or failure to add.public RouteConfig getDefaultRoute(String iface)
IRouteService
getDefaultRoute in interface IRouteServiceiface - A String object specifying the interface name.
public RouteConfig[] getRoutes()
IRouteService
getRoutes in interface IRouteService
public void removeStaticRoute(IPAddress destination,
IPAddress gateway,
IPAddress netmask,
String iface)
throws Exception
IRouteService
removeStaticRoute in interface IRouteServicedestination - An InetAddress object representing the destination IP address.gateway - An InetAddress object representing the gateway IP address.netmask - An InetAddress object representing the netmask.iface - A String object specifying the interface name.
Exception - for invalid supplied parameters, or failure to remove.public String getDefaultInterface(IPAddress destination)
IRouteService
getDefaultInterface in interface IRouteServicedestination - An IPAddress object representing the destination IP address.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||