Package org.jnode.net.ethernet

Examples of org.jnode.net.ethernet.EthernetAddress


        final byte[] hwAddrArr = new byte[ETH_ALEN];
        for (int i = 0; i < ETH_ALEN; i++)
            hwAddrArr[i] = (byte) getReg8(byPAR0 + i);

        this.hwAddress = new EthernetAddress(hwAddrArr, 0);

        log.debug("Found " + flags.getName() + " IRQ = " + irq.getIRQ()
            + ", IO Base = 0x" + NumberUtils.hex(ioBase)
            + ", IO Length = " + io_length
            + ", MAC Address = " + hwAddress);
View Full Code Here


        io.setReg(EVACK, 0xFFFF);

        // Read MAC address
        final byte[] macAddr = new byte[CNFOWNMACADDR.getRecordLength()];
        getConfig(CNFOWNMACADDR, macAddr, 0, CNFOWNMACADDR.getRecordLength());
        this.hwAddress = new EthernetAddress(macAddr, 0);
        log.info("MAC-address for " + flags.getName() + ' ' + hwAddress);

        // Set maximum data length
        setConfig16(CNFMAXDATALEN, WLAN_DATA_MAXLEN);
        // Set transmit rate control
View Full Code Here

        final byte[] saprom = new byte[32];
        getNicData(0, saprom, 0, 32);

        if (flags.is16bit()) {
            this.hwAddress =
                    new EthernetAddress(saprom[0], saprom[2], saprom[4], saprom[6], saprom[8],
                            saprom[10]);
        } else {
            this.hwAddress = new EthernetAddress(saprom, 0);
        }

        log.debug("Found " + flags.getName() + " IRQ=" + irq + ", IOBase=0x" +
                NumberUtils.hex(iobase) + ", MAC Address=" + hwAddress);
    }
View Full Code Here

            case LINKSTATUS:
                final LinkStatus lstat = Prism2InfoFrame.getLinkStatus(frame, 0);
                switch (lstat) {
                    case CONNECTED:
                        getConfig(CURRENTBSSID, frame, 0, WLAN_BSSID_LEN);
                        bssid = new EthernetAddress(frame, 0);
                        log.info("Connected to " + bssid);
                        break;
                    case DISCONNECTED:
                        log.info("Disconnected");
                        bssid = null;
View Full Code Here

                hwAddrArr[y++] = (byte) value;
                hwAddrArr[y++] = (byte) (value >> 8);
            }
        }

        this.hwAddress = new EthernetAddress(hwAddrArr, 0);

        if (sum != 0xBABA) {
            log.debug(this.flags.getName() + ": Invalid EEPROM checksum " + NumberUtils.hex(sum) +
                    ", check settings before activating this device!");
        }
View Full Code Here

        try {
            final DeviceManager dm = InitialNaming.lookup(DeviceManager.NAME);
            final Device dev = dm.getDevice(devId);
            final NetDeviceAPI api = dev.getAPI(NetDeviceAPI.class);
            final EthernetAddress mac = (EthernetAddress) api.getAddress();

            SocketBuffer skbuf = new SocketBuffer();
            skbuf.insert(28);
            skbuf.set16(0, 0x0001); // Hardware type
            skbuf.set16(2, 0x0800); // Protocol type
            skbuf.set(4, 6); // Hardware address size
            skbuf.set(5, 4); // Protocol address size
            skbuf.set16(6, 0x01); // Operation APR request
            mac.writeTo(skbuf, 8); // Source mac
            skbuf.set32(14, 0xc0a8c853); // Source IP
            skbuf.set32(14, 0xc0a8c801); // Target IP

            // Prefix ethernet header
            skbuf.insert(14);
            // Set dest address
            EthernetAddress dst = new EthernetAddress("ff-ff-ff-ff-ff-ff");
            dst.writeTo(skbuf, 0);

            // Set packet type
            skbuf.set16(12, 0x0806);

            //api.transmit(skbuf);
View Full Code Here

        hwAddrArr[1] = (byte) (eeprom[0x0a] & 0xFF);
        hwAddrArr[2] = (byte) (eeprom[0x0b] >> 8);
        hwAddrArr[3] = (byte) (eeprom[0x0b] & 0xFF);
        hwAddrArr[4] = (byte) (eeprom[0x0c] >> 8);
        hwAddrArr[5] = (byte) (eeprom[0x0c] & 0xFF);
        this.hwAddress = new EthernetAddress(hwAddrArr, 0);

        log.debug("Found " + flags.getName() + " IRQ=" + irq + ", IOBase=0x" +
                NumberUtils.hex(iobase) + ", MAC Address=" + hwAddress);
    }
View Full Code Here

        hwAddrArr[2] = adr1[2];
        hwAddrArr[3] = adr1[3];
        hwAddrArr[4] = adr2[0];
        hwAddrArr[5] = adr2[1];

        this.hwAddress = new EthernetAddress(hwAddrArr, 0);

        // disable multicast
        setReg32(REG_MAR0, 0);
        setReg32(REG_MAR0 + 4, 0);
View Full Code Here

     * @param skbuf
     */
    public p80211Header(SocketBuffer skbuf) {
        this.frameControl = skbuf.get16(0);
        this.durationId = skbuf.get16(2);
        this.address1 = new EthernetAddress(skbuf, 4);
        this.address2 = new EthernetAddress(skbuf, 10);
        this.address3 = new EthernetAddress(skbuf, 16);
        this.sequenceControl = skbuf.get16(22);
        this.address4 = new EthernetAddress(skbuf, 24);
    }
View Full Code Here

        protocolType = skbuf.get16(2);
        hardwareAddressSize = skbuf.get(4);
        protocolAddressSize = skbuf.get(5);
        operation = ARPOperation.getType(skbuf.get16(6));
        if ((hardwareType == 1) && (protocolType == EthernetConstants.ETH_P_IP)) {
            sourceHardwareAddress = new EthernetAddress(skbuf, 8);
            sourceProtocolAddress = new IPv4Address(skbuf, 14);
            destinationHardwareAddress = new EthernetAddress(skbuf, 18);
            destinationProtocolAddress = new IPv4Address(skbuf, 24);
        } else {
            throw new SocketException("Unknown hw,ptype: " + hardwareType + ',' + protocolType);
        }
    }
View Full Code Here

TOP

Related Classes of org.jnode.net.ethernet.EthernetAddress

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.