Search in sources :

Example 1 with OFCalientPortStatsRequest

use of org.projectfloodlight.openflow.protocol.OFCalientPortStatsRequest in project onos by opennetworkinglab.

the class OplinkSwitchHandshaker method sendMsg.

@Override
public final void sendMsg(OFMessage m) {
    List<OFMessage> messages = new ArrayList<>();
    messages.add(m);
    if (m.getType() == OFType.STATS_REQUEST) {
        OFStatsRequest sr = (OFStatsRequest) m;
        log.debug("OPLK Switch: Rebuilding stats request type {}", sr.getStatsType());
        switch(sr.getStatsType()) {
            case PORT:
                // Send experiment status request for Optical Fiber switch to device
                // Note: We just re-use calient message for a short term.
                OFCalientPortStatsRequest portRequest = this.factory().buildCalientPortStatsRequest().setXid(sr.getXid()).setFlags(sr.getFlags()).build();
                messages.add(portRequest);
                break;
            default:
                break;
        }
    } else {
        log.debug("OPLK Switch: sends msg:{}, as is", m.getType());
    }
    super.sendMsg(messages);
}
Also used : OFMessage(org.projectfloodlight.openflow.protocol.OFMessage) OFStatsRequest(org.projectfloodlight.openflow.protocol.OFStatsRequest) OFCalientPortStatsRequest(org.projectfloodlight.openflow.protocol.OFCalientPortStatsRequest) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 OFCalientPortStatsRequest (org.projectfloodlight.openflow.protocol.OFCalientPortStatsRequest)1 OFMessage (org.projectfloodlight.openflow.protocol.OFMessage)1 OFStatsRequest (org.projectfloodlight.openflow.protocol.OFStatsRequest)1