/** * Builds the GroupDel OF message. * * @return GroupDel OF message */ public OFGroupDelete buildGroupDel() { OFGroupDelete groupMsg = factory.buildGroupDelete() .setGroup(OFGroup.of(groupId.id())) .setGroupType(OFGroupType.SELECT) .setXid(xid) .build(); return groupMsg; }
protected void pushOFDeleteGroup(IOFSwitch sw) { /* Delete the queues attached to all the member ports*/ long queueId = -1; OFPort ofp = null; ArrayList<OFBucket> ofBuckets = multicastGroup.getMemberOFBucketList(sw.getId()); OVSDBContext ovsdbContext = mcObject.ovsdbChannelMap.get(sw.getId()); for (OFBucket ofb : ofBuckets) { queueId = -1; ofp = null; for (OFAction ofa: ofb.getActions()){ if (ofa.getType() == OFActionType.SET_QUEUE){ OFActionSetQueue ofas = (OFActionSetQueue) ofa; queueId = ofas.getQueueId(); /* removes queue using OVSDBContext on the switch */ } if (ofa.getType() == OFActionType.OUTPUT){ OFActionOutput ofo = (OFActionOutput) ofa; ofp = ofo.getPort(); /* removes queue using OVSDBContext on the switch */ } } if (ofp != null && queueId != -1) ovsdbContext.deleteQueueOnPort(ofp, (int)queueId); else logger.error("pushOFDeleteGroup: unexpected actionset in group bucket"); } /* Creates group flow with set queue option */ OFFactory of13Factory = sw.getOFFactory(); OFGroupDelete delGroup = of13Factory.buildGroupDelete() .setGroup(OFGroup.of(multicastGroup.ofGroupId)) .setGroupType(OFGroupType.ALL) .build(); sw.write(delGroup); }