use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.interfaces._interface.AllowedAddressPairsBuilder in project netvirt by opendaylight.
the class AclServiceUtilsTest method buildAAp.
private AllowedAddressPairs buildAAp(String addr) {
AllowedAddressPairsBuilder aapb = new AllowedAddressPairsBuilder();
aapb.setIpAddress(new IpPrefixOrAddress(addr.toCharArray()));
aapb.setMacAddress(new MacAddress("AA:BB:CC:DD:EE:FF"));
return aapb.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.interfaces._interface.AllowedAddressPairsBuilder in project netvirt by opendaylight.
the class NeutronvpnUtils method getAclAllowedAddressPairs.
/**
* Gets the acl allowed address pairs.
*
* @param macAddress the mac address
* @param ipAddress the ip address
* @return the acl allowed address pairs
*/
protected static AllowedAddressPairs getAclAllowedAddressPairs(MacAddress macAddress, org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.types.rev160517.IpPrefixOrAddress ipAddress) {
AllowedAddressPairsBuilder aclAllowedAdressPairBuilder = new AllowedAddressPairsBuilder();
aclAllowedAdressPairBuilder.setMacAddress(macAddress);
if (ipAddress != null && ipAddress.getValue() != null) {
if (ipAddress.getIpPrefix() != null) {
aclAllowedAdressPairBuilder.setIpAddress(new IpPrefixOrAddress(ipAddress.getIpPrefix()));
} else {
aclAllowedAdressPairBuilder.setIpAddress(new IpPrefixOrAddress(ipAddress.getIpAddress()));
}
}
return aclAllowedAdressPairBuilder.build();
}
Aggregations