Examples of IPv4RoutingTable


Examples of org.jnode.net.ipv4.IPv4RoutingTable

        try {
            ipNL = (IPv4NetworkLayer) NetUtils.getNLM().getNetworkLayer(EthernetConstants.ETH_P_IP);
        } catch (NoSuchProtocolException ex) {
            throw new NetworkException("Cannot find IPv4 network layer", ex);
        }
        final IPv4RoutingTable rt = ipNL.getRoutingTable();
        rt.add(new IPv4Route(target, null, gateway, device));
    }
View Full Code Here

Examples of org.jnode.net.ipv4.IPv4RoutingTable

        try {
            ipNL = (IPv4NetworkLayer) NetUtils.getNLM().getNetworkLayer(EthernetConstants.ETH_P_IP);
        } catch (NoSuchProtocolException ex) {
            throw new NetworkException("Cannot find IPv4 network layer", ex);
        }
        final IPv4RoutingTable rt = ipNL.getRoutingTable();

        for (IPv4Route route : rt.entries()) {
            if (!route.getDestination().equals(target)) {
                continue;
            }
            if (gateway != null) {
                if (!gateway.equals(route.getGateway())) {
                    continue;
                }
            }
            if (device != null) {
                if (device != route.getDevice()) {
                    continue;
                }
            }

            rt.remove(route);
            return;
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.