use of org.projectfloodlight.openflow.protocol.errormsg.OFBadRequestErrorMsg in project onos by opennetworkinglab.
the class DefaultOFSwitch method processControllerCommand.
@Override
public void processControllerCommand(Channel channel, OFMessage msg) {
OFControllerRole myRole = role(channel);
if (OFControllerRole.ROLE_SLAVE.equals(myRole)) {
OFBadRequestErrorMsg errorMsg = FACTORY.errorMsgs().buildBadRequestErrorMsg().setXid(msg.getXid()).setCode(OFBadRequestCode.IS_SLAVE).build();
channel.writeAndFlush(Collections.singletonList(errorMsg));
return;
}
switch(msg.getType()) {
case PORT_MOD:
OFPortMod portMod = (OFPortMod) msg;
processPortMod(portMod);
break;
case FLOW_MOD:
OFFlowMod flowMod = (OFFlowMod) msg;
processFlowMod(flowMod);
break;
case GROUP_MOD:
OFGroupMod groupMod = (OFGroupMod) msg;
processGroupMod(groupMod);
break;
case METER_MOD:
OFMeterMod meterMod = (OFMeterMod) msg;
processMeterMod(meterMod, channel);
break;
case TABLE_MOD:
log.debug("processControllerCommand: {} not yet supported for {}", msg.getType(), msg);
break;
default:
log.warn("Unexpected message {} received for switch {}", msg.getType(), this);
}
}
Aggregations