Examples of OFPhysicalPort


Examples of org.openflow.protocol.OFPhysicalPort

            .getSwitchDevices().get(
                HexString.toLong(datapathIdString));

        IOFSwitch sw = switchDevice.getOpenFlowSwitch();
        List<OFPhysicalPort> switchPorts = switchDevice.getPortStates();
        OFPhysicalPort updatedPort = null;

        for (OFPhysicalPort ofPort : switchPorts) {

          if (ofPort.getPortNumber() == Short
              .parseShort(sensorIdString)) {
            updatedPort = ofPort;
            break;

          }

        }

        updatedPort.setConfig(0);

        OFPortMod portMod = new OFPortMod();

        if (updateStatus.equals("down")) {
          portMod.setConfig(OFPhysicalPort.OFPortConfig.OFPPC_PORT_DOWN
              .getValue());
        } else if (updateStatus.equals("up")) {
          portMod.setConfig(0);
        }

        portMod.setMask(1);
        portMod.setPortNumber(updatedPort.getPortNumber());
        portMod.setHardwareAddress(updatedPort.getHardwareAddress());
        portMod.setType(OFType.PORT_MOD);

        sw.getOutputStream().write(portMod);
        sw.getOutputStream().flush();
        obj = new JSONObject();
View Full Code Here

Examples of org.openflow.protocol.OFPhysicalPort

            .getSwitchDevices().get(
                HexString.toLong(datapathIdString));

        IOFSwitch sw = switchDevice.getOpenFlowSwitch();
        List<OFPhysicalPort> switchPorts = switchDevice.getPortStates();
        OFPhysicalPort updatedPort = null;

        for (OFPhysicalPort ofPort : switchPorts) {

          if (ofPort.getPortNumber() == Short
              .parseShort(sensorIdString)) {
            updatedPort = ofPort;
            break;

          }

        }

        updatedPort.setConfig(0);

        OFPortMod portMod = new OFPortMod();

        if (updateStatus.equals("down")) {
          portMod.setConfig(OFPhysicalPort.OFPortConfig.OFPPC_PORT_DOWN
              .getValue());
        } else if (updateStatus.equals("up")) {
          portMod.setConfig(0);
        }

        portMod.setMask(1);
        portMod.setPortNumber(updatedPort.getPortNumber());
        portMod.setHardwareAddress(updatedPort.getHardwareAddress());
        portMod.setType(OFType.PORT_MOD);

        sw.getOutputStream().write(portMod);
        sw.getOutputStream().flush();
        obj = new JSONObject();
View Full Code Here

Examples of org.openflow.protocol.OFPhysicalPort

          .getSwitchDevices().get(
              HexString.toLong(datapathIdString));

      IOFSwitch sw = switchDevice.getOpenFlowSwitch();
      List<OFPhysicalPort> switchPorts = switchDevice.getPortStates();
      OFPhysicalPort updatedPort = null;

      for (OFPhysicalPort ofPort : switchPorts) {

        if (ofPort.getPortNumber() == port) {
          updatedPort = ofPort;
          break;

        }

      }

      updatedPort.setConfig(0);

      OFPortMod portMod = new OFPortMod();

     
        portMod.setConfig(OFPhysicalPort.OFPortConfig.OFPPC_PORT_DOWN
            .getValue());
   

      portMod.setMask(1);
      portMod.setPortNumber(updatedPort.getPortNumber());
      portMod.setHardwareAddress(updatedPort.getHardwareAddress());
      portMod.setType(OFType.PORT_MOD);

      sw.getOutputStream().write(portMod);
      sw.getOutputStream().flush();
      ci.print("done");
View Full Code Here

Examples of org.openflow.protocol.OFPhysicalPort

      FlowscaleController flowscaleController, long datapathId,
      ArrayList<Short> loadedPorts) {

    for (int i = 0; i < flowscaleController.getSwitchDevices()
        .get(datapathId).getPortStates().size(); i++) {
      OFPhysicalPort checkedPorts = flowscaleController
          .getSwitchDevices().get(datapathId).getPortStates().get(i);

      if (loadedPorts.contains(checkedPorts.getPortNumber())) {

        if (checkedPorts.getState() % 2 != 0) {

          loadedPorts.remove(new Short(checkedPorts.getPortNumber()));

        }

      }
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.