public static List<AllowedAddressPairs> getPortAllowedAddresses(Interface port) { if (port == null) { LOG.error("Port is Null"); return null; } InterfaceAcl aclInPort = port.getAugmentation(InterfaceAcl.class); if (aclInPort == null) { LOG.error("getSecurityGroupInPortList: no security group associated to Interface port: {}", port.getName()); return null; } return aclInPort.getAllowedAddressPairs(); }
@Override public boolean equals(java.lang.Object obj) { if (this == obj) { return true; } if (!(obj instanceof DataObject)) { return false; } if (!org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.InterfaceAcl.class.equals(((DataObject)obj).getImplementedInterface())) { return false; } org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.InterfaceAcl other = (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.InterfaceAcl)obj; if (!Objects.equals(_allowedAddressPairs, other.getAllowedAddressPairs())) { return false; } if (!Objects.equals(_securityGroups, other.getSecurityGroups())) { return false; } if (!Objects.equals(_portSecurityEnabled, other.isPortSecurityEnabled())) { return false; } return true; }
public InterfaceAclBuilder(InterfaceAcl base) { this._allowedAddressPairs = base.getAllowedAddressPairs(); this._securityGroups = base.getSecurityGroups(); this._portSecurityEnabled = base.isPortSecurityEnabled(); }
private AclInterface updateAclInterfaceInCache(String interfaceId, InterfaceAcl aclInPortAfter) { AclInterface aclInterface = AclInterfaceCacheUtil.getAclInterfaceFromCache(interfaceId); if (aclInterface != null) { boolean portSecurityEnabled = aclInPortAfter.isPortSecurityEnabled(); aclInterface.setPortSecurityEnabled(portSecurityEnabled); if (portSecurityEnabled) { aclInterface.setSecurityGroups(aclInPortAfter.getSecurityGroups()); aclInterface.setAllowedAddressPairs(aclInPortAfter.getAllowedAddressPairs()); } } else { // Control should not come here LOG.error("Unable to find Acl Interface details for {}", interfaceId); } return aclInterface; }
private AclInterface addAclInterfaceToCache(String interfaceId, InterfaceAcl aclInPort) { AclInterface aclInterface = new AclInterface(); aclInterface.setInterfaceId(interfaceId); aclInterface.setPortSecurityEnabled(aclInPort.isPortSecurityEnabled()); aclInterface.setSecurityGroups(aclInPort.getSecurityGroups()); aclInterface.setAllowedAddressPairs(aclInPort.getAllowedAddressPairs()); AclInterfaceCacheUtil.addAclInterfaceToCache(interfaceId, aclInterface); return aclInterface; }
private AclInterface getOldAclInterfaceObject(AclInterface aclInterface, InterfaceAcl aclInPortBefore) { AclInterface oldAclInterface = new AclInterface(); if (aclInPortBefore == null) { oldAclInterface.setPortSecurityEnabled(false); } else { oldAclInterface.setInterfaceId(aclInterface.getInterfaceId()); oldAclInterface.setDpId(aclInterface.getDpId()); oldAclInterface.setLPortTag(aclInterface.getLPortTag()); oldAclInterface.setPortSecurityEnabled(aclInPortBefore.isPortSecurityEnabled()); oldAclInterface.setAllowedAddressPairs(aclInPortBefore.getAllowedAddressPairs()); oldAclInterface.setSecurityGroups(aclInPortBefore.getSecurityGroups()); } return oldAclInterface; }
portOriginal.getSecurityGroups(), portUpdated.getSecurityGroups())); List<AllowedAddressPairs> updatedAddressPairs = NeutronvpnUtils.getUpdatedAllowedAddressPairs( interfaceAcl.getAllowedAddressPairs(), portOriginal.getAllowedAddressPairs(), portUpdated.getAllowedAddressPairs()); interfaceAclBuilder.setAllowedAddressPairs(NeutronvpnUtils.getAllowedAddressPairsForFixedIps(