Examples of MACAddress


Examples of com.cloud.utils.net.MacAddress

    long address = 0;
   
    address = (_prefix & 0xff);
    address <<= 40;
    address |= (_instanceId | (1L << 31)) & 0xffffffff;
    return new MacAddress(address);
  }
View Full Code Here

Examples of com.cloud.utils.net.MacAddress

    long address = 0;
   
    address = (_prefix & 0xff);
    address <<= 40;
    address |= (_instanceId | (3L << 30)) & 0xffffffff;
    return new MacAddress(address);
  }
View Full Code Here

Examples of com.slytechs.utils.net.MacAddress

    } else if ( (c = word.split(":")).length == 16) {
      r = new IpAddress(parseIntoArray(new byte[16], c, 16));

    } else if ( (c = word.split("-")).length == 6 || (c = word.split(":")).length == 6) {
      r = new MacAddress(parseIntoArray(new byte[6], c, 16));

    } else if (c.length > 1) { // Catch all. Allow any type of address separated :
      r = new Address(parseIntoArray(new byte[c.length], c, 16));
    }
    else
View Full Code Here

Examples of net.floodlightcontroller.util.MACAddress

     * @return
     */
    private void checkPerSourceMacRate(OFPacketIn pin) {
        byte[] data = pin.getPacketData();
        byte[] mac = Arrays.copyOfRange(data, 6, 12);
        MACAddress srcMac = MACAddress.valueOf(mac);
        short ethType = (short) (((data[12] & 0xff) << 8) + (data[13] & 0xff));
        if (ethType != Ethernet.TYPE_LLDP && ethType != Ethernet.TYPE_BSN &&
                macCache.update(srcMac.toLong())) {
            // Check if we already pushed a flow in the last 5 seconds
            if (macBlockedCache.update(srcMac.toLong())) {
                return;
            }
            // write out drop flow per srcMac
            int port = pin.getInPort();
            SwitchPort swPort = new SwitchPort(getId(), port);
            ForwardingBase.blockHost(floodlightProvider,
                    swPort, srcMac.toLong(), (short) 5,
                    AppCookie.makeCookie(OFSWITCH_APP_ID, 0));
            floodlightProvider.addSwitchEvent(this.datapathId,
                    "SWITCH_PORT_BLOCKED_TEMPORARILY " +
                    "OFPort " + port + " mac " + srcMac, false);
            log.info("Excessive packet in from {} on {}, block host for 5 sec",
                    srcMac.toString(), swPort);
        }
    }
View Full Code Here

Examples of net.floodlightcontroller.util.MACAddress

            }
            // We ignore old mappings
            macToGuid.put(mac, guid);
            portToMac.put(port, mac);
            if(vNetsByGuid.get(guid)!=null)
                vNetsByGuid.get(guid).addHost(port,new MACAddress(mac.toBytes()));
        } else {
            log.warn("Could not add MAC {} to network ID {} on port {}, the network does not exist",
                     new Object[] {mac, guid, port});
        }
    }
View Full Code Here

Examples of net.floodlightcontroller.util.MACAddress

        if (log.isDebugEnabled()) {
            log.debug("Removing host {} from port {}", mac, port);
        }
        if (mac == null && port == null) return;
        if (port != null) {
            MACAddress host = portToMac.remove(port);
            if(host !=null && vNetsByGuid.get(macToGuid.get(host)) != null)
                vNetsByGuid.get(macToGuid.get(host)).removeHost(host);
      if(host !=null)
              macToGuid.remove(host);
        } else if (mac != null) {
View Full Code Here

Examples of net.floodlightcontroller.util.MACAddress

        if (macToGateway.containsKey(frame.getSourceMAC()))
            return true;

        Integer gwIp = macToGateway.get(frame.getDestinationMAC());
        if (gwIp != null) {
            MACAddress host = frame.getSourceMAC();
            String srcNet = macToGuid.get(host);
            if (srcNet != null) {
                Integer gwIpSrcNet = guidToGateway.get(srcNet);
                if ((gwIpSrcNet != null) && (gwIp.equals(gwIpSrcNet)))
                    return true;
View Full Code Here

Examples of net.floodlightcontroller.util.MACAddress

        @Override
        public void deviceAdded(IDevice device) {
            if (device.getIPv4Addresses() == null) return;
            for (Integer i : device.getIPv4Addresses()) {
                if (gatewayToGuid.containsKey(i)) {
                    MACAddress mac = MACAddress.valueOf(device.getMACAddress());
                    if (log.isDebugEnabled())
                        log.debug("Adding MAC {} with IP {} a a gateway",
                                    HexString.toHexString(mac.toBytes()),
                                    IPv4.fromIPv4Address(i));
                        macToGateway.put(mac, i);
                    }
                }
            }
View Full Code Here

Examples of net.floodlightcontroller.util.MACAddress

            }

            @Override
        public void deviceRemoved(IDevice device) {
            // if device is a gateway remove
            MACAddress mac = MACAddress.valueOf(device.getMACAddress());
            if (macToGateway.containsKey(mac)) {
                if (log.isDebugEnabled())
                    log.debug("Removing MAC {} as a gateway",
                                HexString.toHexString(mac.toBytes()));
                macToGateway.remove(mac);
             }
        }
View Full Code Here

Examples of org.iosgi.outpost.util.ipr.MacAddress

    IMachine m = session.getMachine();
    long count = 1;// vbox.getSystemProperties().getNetworkAdapterCount();
    for (long i = 0; i < count; i++) {
      INetworkAdapter a = m.getNetworkAdapter(i);
      String raw = a.getMACAddress();
      InetAddress addr = registry.get(new MacAddress(raw), 30,
          TimeUnit.SECONDS);
      addresses.add(addr);
    }
    return addresses;
  }
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.