/** * Set out_port * * @param port */ public OFFlowMod setOutPort(final OFPort port) { this.outPort = port.getValue(); return this; }
/** * Sets the outPort field of V6FlowMod message * @param outPort outPort of the message */ public V6FlowMod setOutPort(OFPort port) { this.outPort = port.getValue(); return this; }
/** * Sets the outPort field of V6FlowMod message * @param outPort outPort of the message */ public V6FlowMod setOutPort(OFPort port) { this.outPort = port.getValue(); return this; }
/** * Set out_port * @param port */ public /*OFFlowMod*/SNMPFlowMod setOutPort(OFPort port) { this.outPort = port.getValue(); return this; }
/** * Set in_port. Convenience method using OFPort enum. * * @param inPort */ public OFPacketOut setInPort(final OFPort inPort) { this.inPort = inPort.getValue(); return this; }
public OFFlowMod() { super(); this.outPort = OFPort.OFPP_NONE.getValue(); this.type = OFType.FLOW_MOD; this.length = U16.t(OFFlowMod.MINIMUM_LENGTH); }
/** * Converts the NodeConnector to the equivalent Openflow port number */ public static short toOFPort(NodeConnector salPort) { log.trace("SAL Port", salPort); if (salPort.getType().equals(NodeConnectorIDType.SWSTACK)) { return OFPort.OFPP_LOCAL.getValue(); } else if (salPort.getType().equals(NodeConnectorIDType.HWPATH)) { return OFPort.OFPP_NORMAL.getValue(); } else if (salPort.getType().equals(NodeConnectorIDType.CONTROLLER)) { return OFPort.OFPP_CONTROLLER.getValue(); } return (Short) salPort.getID(); } }
/** * Converts the NodeConnector to the equivalent Openflow port number */ public static short toOFPort(NodeConnector salPort) { log.trace("SAL Port", salPort); if (salPort.getType().equals(NodeConnectorIDType.SWSTACK)) { return OFPort.OFPP_LOCAL.getValue(); } else if (salPort.getType().equals(NodeConnectorIDType.HWPATH)) { return OFPort.OFPP_NORMAL.getValue(); } else if (salPort.getType().equals(NodeConnectorIDType.CONTROLLER)) { return OFPort.OFPP_CONTROLLER.getValue(); } return (Short) salPort.getID(); } }
/** * Converts the Openflow port number to the equivalent NodeConnector. */ public static NodeConnector toNodeConnector(short ofPort, Node node) { // Restore original OF unsigned 16 bits value for the comparison int unsignedOFPort = NetUtils.getUnsignedShort(ofPort); log.trace("Openflow port number signed: {} unsigned: {}", ofPort, unsignedOFPort); if (unsignedOFPort > maxOFPhysicalPort) { if (ofPort == OFPort.OFPP_LOCAL.getValue()) { return NodeConnectorCreator.createNodeConnector( NodeConnectorIDType.SWSTACK, NodeConnector.SPECIALNODECONNECTORID, node); } else if (ofPort == OFPort.OFPP_NORMAL.getValue()) { return NodeConnectorCreator.createNodeConnector( NodeConnectorIDType.HWPATH, NodeConnector.SPECIALNODECONNECTORID, node); } else if (ofPort == OFPort.OFPP_CONTROLLER.getValue()) { return NodeConnectorCreator.createNodeConnector( NodeConnectorIDType.CONTROLLER, NodeConnector.SPECIALNODECONNECTORID, node); } } return NodeConnectorCreator.createNodeConnector(ofPort, node); }
throws DroppedMessageException { final LinkedList<OVXPort> outPortList = new LinkedList<OVXPort>(); if (U16.f(outPort) < U16.f(OFPort.OFPP_MAX.getValue())) { if (sw.getPort(outPort) != null && sw.getPort(outPort).isActive()) { outPortList.add(sw.getPort(outPort)); } else if (U16.f(outPort) == U16.f(OFPort.OFPP_FLOOD.getValue())) { final Map<Short, OVXPort> ports = sw.getPorts(); for (final OVXPort port : ports.values()) { } else if (U16.f(outPort) == U16.f(OFPort.OFPP_ALL.getValue())) { final Map<Short, OVXPort> ports = sw.getPorts(); for (final OVXPort port : ports.values()) {
OFPort.OFPP_NONE.getValue());
if (inputPort == OFPort.OFPP_ALL.getValue()) { this.wildcards |= OFMatch.OFPFW_IN_PORT;
/** * Adds port for discovery. * * @param port the port */ public synchronized void addPort(final PhysicalPort port) { SwitchDiscoveryManager sdm = this.discoveryManager.get(port .getParentSwitch().getSwitchId()); if (sdm != null) { // Do not run discovery on local OpenFlow port if (port.getPortNumber() != OFPort.OFPP_LOCAL.getValue()) { sdm.addPort(port); } } DBManager.getInstance().addPort(port.toDPIDandPort()); }
public void removeFlowMods(OVXStatisticsReply msg) { int tid = msg.getXid() >> 16; short port = (short) (msg.getXid() & 0xFFFF); for (OFStatistics stat : msg.getStatistics()) { OVXFlowStatisticsReply reply = (OVXFlowStatisticsReply) stat; if (tid != this.getTidFromCookie(reply.getCookie())) { continue; } if (port != 0) { sendDeleteFlowMod(reply, port); if (reply.getMatch().getInputPort() == port) { sendDeleteFlowMod(reply, OFPort.OFPP_NONE.getValue()); } } else { sendDeleteFlowMod(reply, OFPort.OFPP_NONE.getValue()); } } }
private void sendPortStatistics() { OVXStatisticsRequest req = new OVXStatisticsRequest(); req.setStatisticType(OFStatisticsType.PORT); OVXPortStatisticsRequest preq = new OVXPortStatisticsRequest(); preq.setPortNumber(OFPort.OFPP_NONE.getValue()); req.setStatistics(Collections.singletonList(preq)); req.setLengthU(req.getLengthU() + preq.getLength()); sendMsg(req, this); }
specificReq.setOutPort(OFPort.OFPP_NONE.getValue()); specificReq.setTableId((byte) 0xff); req.setStatistics(Collections } else if (statsType == OFStatisticsType.VENDOR) { V6StatsRequest specificReq = new V6StatsRequest(); specificReq.setOutPort(OFPort.OFPP_NONE.getValue()); specificReq.setTableId((byte) 0xff); req.setStatistics(Collections match.setWildcards(0xffffffff); specificReq.setMatch(match); specificReq.setOutPort(OFPort.OFPP_NONE.getValue()); specificReq.setTableId((byte) 0xff); req.setStatistics(Collections if (target == null) { targetPort = OFPort.OFPP_NONE.getValue(); } else if (!(target instanceof Short)) { } else if (statsType == OFStatisticsType.QUEUE) { OFQueueStatisticsRequest specificReq = new OFQueueStatisticsRequest(); specificReq.setPortNumber(OFPort.OFPP_ALL.getValue()); specificReq.setQueueId(0xffffffff); req.setStatistics(Collections
/** * Adds a default OpenFlow port to the give list of physical ports. * * @param ports the list of ports */ protected void addDefaultPort(final LinkedList<OFPhysicalPort> ports) { final OFPhysicalPort port = new OFPhysicalPort(); port.setPortNumber(OFPort.OFPP_LOCAL.getValue()); port.setName("OpenFlow Local Port"); port.setConfig(1); final byte[] addr = {(byte) 0xA4, (byte) 0x23, (byte) 0x05, (byte) 0x00, (byte) 0x00, (byte) 0x00}; port.setHardwareAddress(addr); port.setState(1); port.setAdvertisedFeatures(0); port.setCurrentFeatures(0); port.setSupportedFeatures(0); ports.add(port); }
specificReq.setOutPort(OFPort.OFPP_NONE.getValue()); specificReq.setTableId((byte) 0xff); req.setStatistics(Collections } else if (statsType == OFStatisticsType.VENDOR) { V6StatsRequest specificReq = new V6StatsRequest(); specificReq.setOutPort(OFPort.OFPP_NONE.getValue()); specificReq.setTableId((byte) 0xff); req.setStatistics(Collections match.setWildcards(0xffffffff); specificReq.setMatch(match); specificReq.setOutPort(OFPort.OFPP_NONE.getValue()); specificReq.setTableId((byte) 0xff); req.setStatistics(Collections if (target == null) { targetPort = (short) OFPort.OFPP_NONE.getValue(); } else if (!(target instanceof Short)) { } else if (statsType == OFStatisticsType.QUEUE) { OFQueueStatisticsRequest specificReq = new OFQueueStatisticsRequest(); specificReq.setPortNumber((short) OFPort.OFPP_ALL.getValue()); specificReq.setQueueId(0xffffffff); req.setStatistics(Collections
List<OVXPortStatisticsReply> replies = new LinkedList<OVXPortStatisticsReply>(); int length = 0; if (this.portNumber == OFPort.OFPP_NONE.getValue()) { for (OVXPort p : sw.getPorts().values()) { OVXPortStatisticsReply reply = p.getPhysicalPort()
ofAction.setPort(OFPort.OFPP_IN_PORT.getValue()); actionsList.add(ofAction); actionsLength += OFActionOutput.MINIMUM_LENGTH; ofAction.setPort(OFPort.OFPP_FLOOD.getValue()); actionsList.add(ofAction); actionsLength += OFActionOutput.MINIMUM_LENGTH; ofAction.setPort(OFPort.OFPP_ALL.getValue()); actionsList.add(ofAction); actionsLength += OFActionOutput.MINIMUM_LENGTH; ofAction.setPort(OFPort.OFPP_CONTROLLER.getValue()); ofAction.setPort(OFPort.OFPP_LOCAL.getValue()); actionsList.add(ofAction); actionsLength += OFActionOutput.MINIMUM_LENGTH; ofAction.setPort(OFPort.OFPP_NORMAL.getValue()); actionsList.add(ofAction); actionsLength += OFActionOutput.MINIMUM_LENGTH;