Package org.jnode.net

Examples of org.jnode.net.ProtocolAddressInfo


     * @throws NetworkException
     */
    private void processARPRequest(SocketBuffer skbuf, ARPHeader hdr, NetDeviceAPI deviceAPI)
        throws SocketException {

        final ProtocolAddressInfo addrInfo = deviceAPI.getProtocolAddressInfo(hdr.getPType());
        if ((addrInfo != null) && (addrInfo.contains(hdr.getTargetPAddress()))) {
            // log.debug("Sending ARP reply");
            stat.arpreply.inc();
            stat.opackets.inc();
            hdr.swapAddresses();
            hdr.setSrcHWAddress(deviceAPI.getAddress());
View Full Code Here


        // network layer is left in a state that will require a reboot to unjam it (AFAIK). 
        //
        // So, check that loopback is correctly bound ...
        Device loopback = (InitialNaming.lookup(DeviceManager.NAME)).getDevice("loopback");
        NetDeviceAPI api = loopback.getAPI(NetDeviceAPI.class);
        ProtocolAddressInfo info = api.getProtocolAddressInfo(EthernetConstants.ETH_P_IP);
        if (info == null || !info.contains(InetAddress.getByAddress(new byte[]{127, 0, 0, 1}))) {
            PrintWriter err = getError().getPrintWriter();
            err.format(err_loopback);
            exit(1);
        }
View Full Code Here

        final ArrayList<InetAddress> list = new ArrayList<InetAddress>();
        final SecurityManager sm = System.getSecurityManager();
        try {
            final NetDeviceImpl netDeviceImpl = (NetDeviceImpl) netDevice;
            final NetDeviceAPI api = netDeviceImpl.getDevice().getAPI(NetDeviceAPI.class);
            final ProtocolAddressInfo info = api.getProtocolAddressInfo(EthernetConstants.ETH_P_IP);
            if (info != null) {
                for (ProtocolAddress ipaddr : info.addresses()) {
                    if (sm != null) {
                        try {
                            sm.checkConnect(ipaddr.toString(), 58000);
                            list.add(ipaddr.toInetAddress());
                        } catch (SecurityException ex) {
View Full Code Here

     */
    public VMNetDevice getByInetAddress(InetAddress addr) throws SocketException {
        for (Device dev : DeviceUtils.getDevicesByAPI(NetDeviceAPI.class)) {
            try {
                final NetDeviceAPI api = dev.getAPI(NetDeviceAPI.class);
                final ProtocolAddressInfo info = api.getProtocolAddressInfo(EthernetConstants.ETH_P_IP);
                if (info != null && info.contains(addr)) {
                    return new NetDeviceImpl(dev);
                }
            } catch (ApiNotFoundException ex) {
                // Ignore
            }
View Full Code Here

        final Collection<Device> devices = DeviceUtils
                .getDevicesByAPI(NetDeviceAPI.class);
        for (Device dev : devices) {
            try {
                final NetDeviceAPI api = dev.getAPI(NetDeviceAPI.class);
                final ProtocolAddressInfo addrInfo =
                    api.getProtocolAddressInfo(EthernetConstants.ETH_P_IP);
                if (addrInfo != null) {
                    final ProtocolAddress addr = addrInfo.getDefaultAddress();
                    if (addr != null) {
                        return addr.toInetAddress();
                    }
                }
            } catch (ApiNotFoundException ex) {
View Full Code Here

TOP

Related Classes of org.jnode.net.ProtocolAddressInfo

Copyright © 2018 www.massapicom. 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.