src/main/java/net/floodlightcontroller/routing/ForwardingBase.java
/**
     * Write packetout message to sw with output actions to one or more
     * output ports with inPort/outPorts passed in.
     * @param packetData
     * @param sw
     * @param inPort
     * @param ports
     * @param cntx
     */
Write packetout message to sw with output actions to one or more
output ports with inPort/outPorts passed in.
Write packetout message to sw with output actions to one or more output ports with inPort / outPorts passed in .
public void packetOutMultiPort(byte[] packetData,
                                   IOFSwitch sw,
                                   short inPort,
                                   Set<Integer> outPorts,
                                   FloodlightContext cntx) {
        List<OFAction> actions = new ArrayList<OFAction>();
        Iterator<Integer> j = outPorts.iterator();
        while (j.hasNext())
        {
            actions.add(new OFActionOutput(j.next().shortValue(),
                                           (short) 0));
        }
        OFPacketOut po =
                (OFPacketOut) floodlightProvider.getOFMessageFactory().
                getMessage(OFType.PACKET_OUT);
        po.setActions(actions);
        po.setActionsLength((short) (OFActionOutput.MINIMUM_LENGTH *
                outPorts.size()));
        po.setBufferId(OFPacketOut.BUFFER_ID_NONE);
        po.setInPort(inPort);
        short poLength = (short)(po.getActionsLength() +
                OFPacketOut.MINIMUM_LENGTH);
        poLength += packetData.length;
        po.setPacketData(packetData);
        po.setLength(poLength);
        try {
            counterStore.updatePktOutFMCounterStoreLocal(sw, po);
            if (log.isTraceEnabled()) {
                log.trace("write broadcast packet on switch-id={} " +
                        "interfaces={} packet-out={}",
                        new Object[] {sw.getId(), outPorts, po});
            }
            messageDamper.write(sw, po, cntx);
        } catch (IOException e) {
            log.error("Failure writing packet out", e);
        }
    }
public void packetOutMultiPort ( byte [ ] packetData , IOFSwitch sw , short inPort , Set < Integer > outPorts , FloodlightContext cntx ) { List < OFAction > actions = new ArrayList < OFAction > ( ) ; Iterator < Integer > j = outPorts . iterator ( ) ; while ( j . hasNext ( ) ) { actions . add ( new OFActionOutput ( j . next ( ) . shortValue ( ) , ( short ) 0 ) ) ; } OFPacketOut po = ( OFPacketOut ) floodlightProvider . getOFMessageFactory ( ) . getMessage ( OFType . PACKET_OUT ) ; po . setActions ( actions ) ; po . setActionsLength ( ( short ) ( OFActionOutput . MINIMUM_LENGTH * outPorts . size ( ) ) ) ; po . setBufferId ( OFPacketOut . BUFFER_ID_NONE ) ; po . setInPort ( inPort ) ; short poLength = ( short ) ( po . getActionsLength ( ) + OFPacketOut . MINIMUM_LENGTH ) ; poLength += packetData . length ; po . setPacketData ( packetData ) ; po . setLength ( poLength ) ; try { counterStore . updatePktOutFMCounterStoreLocal ( sw , po ) ; if ( log . isTraceEnabled ( ) ) { log . trace ( "write broadcast packet on switch-id={} " + "interfaces={} packet-out={}" , new Object [ ] { sw . getId ( ) , outPorts , po } ) ; } messageDamper . write ( sw , po , cntx ) ; } catch ( IOException e ) { log . error ( "Failure writing packet out" , e ) ; } }
Write packetout message to sw with output actions to one or more
 output ports with inPort/outPorts passed in.
Write packetout message to sw with output actions to one or more output ports with inPort / outPorts passed in .
//setting actions // set buffer-id to BUFFER_ID_NONE, and set in-port to OFPP_NONE // data (note buffer_id is always BUFFER_ID_NONE) and length