Package org.jnode.net

Examples of org.jnode.net.HardwareAddress


    public void process(Object[] object) {
        try {
            //log.debug("<transmit dev=" + getDevice().getId() + ">");
            final Object[] data = (Object[]) object;
            final SocketBuffer skbuf = (SocketBuffer) data[0];
            final HardwareAddress destination = (HardwareAddress) data[1];
            tx_count += skbuf.getSize();
            doTransmit(skbuf, destination);
            //log.debug("</transmit dev=" + getDevice().getId() + ">");
        } catch (NetworkException ex) {
            log.error("Cannot transmit packet", ex);
View Full Code Here


        final IPv4Address addr = new IPv4Address(args[0]);
        final IPv4Address myAddr = new IPv4Address(args[1]);
        final Device dev = dm.getDevice(args[2]);
        final long timeout = 5000;

        final HardwareAddress hwAddr;
        hwAddr = arp.getHardwareAddress(addr, myAddr, dev, timeout);

        System.out.println("Found hwaddress:" + hwAddr);
    }
View Full Code Here

    public void testEqualsHardwareAddress() {
        EthernetAddress mac =
                new EthernetAddress(TEST_MAC_ADDRESS_BYTE_0, TEST_MAC_ADDRESS_BYTE_1,
                        TEST_MAC_ADDRESS_BYTE_2, TEST_MAC_ADDRESS_BYTE_3, TEST_MAC_ADDRESS_BYTE_4,
                        TEST_MAC_ADDRESS_BYTE_5);
        HardwareAddress mac2 = new EthernetAddress(TEST_MAC_ADDRESS_STRING);
        Assert.assertTrue(mac.equals(mac2));
    }
View Full Code Here

    /**
     * Swap the two src and target addresses
     */
    public void swapAddresses() {
        final HardwareAddress hwTmp = destinationHardwareAddress;
        final ProtocolAddress pTmp = destinationProtocolAddress;
        destinationHardwareAddress = sourceHardwareAddress;
        destinationProtocolAddress = sourceProtocolAddress;
        sourceHardwareAddress = hwTmp;
        sourceProtocolAddress = pTmp;
View Full Code Here

            // This is simple, just return my address
            return getAPI(device).getAddress();
        }

        while (true) {
            final HardwareAddress hwAddress = cache.get(address);
            if (hwAddress != null) {
                return hwAddress;
            }
            final long now = System.currentTimeMillis();
            if ((now - start) >= timeout) {
View Full Code Here

     */
    private void request(ProtocolAddress address, ProtocolAddress myAddress, Device device)
        throws NetworkException {
        // Not found in the cache, make a request
        final NetDeviceAPI api = getAPI(device);
        final HardwareAddress srcHwAddr = api.getAddress();
        final HardwareAddress trgHwAddr = srcHwAddr.getDefaultBroadcastAddress();
        final ARPOperation op = ARPOperation.ARP_REQUEST;
        final int hwtype = srcHwAddr.getType();
        final int ptype = address.getType();

        final ARPHeader hdr =
View Full Code Here

        // The device we will use to transmit the packet
        final Device dev;
        final NetDeviceAPI api;
        // The hardware address we will be sending to
        final HardwareAddress hwDstAddr;

        // Has the destination device been given?
        if (skbuf.getDevice() == null) {
            // The device has not been send, figure out the route ourselves.
View Full Code Here

TOP

Related Classes of org.jnode.net.HardwareAddress

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.