Search in sources :

Example 1 with AllowedAddressPairsBuilder

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();
}
Also used : IpPrefixOrAddress(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.IpPrefixOrAddress) AllowedAddressPairsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.interfaces._interface.AllowedAddressPairsBuilder) MacAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)

Example 2 with AllowedAddressPairsBuilder

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();
}
Also used : IpPrefixOrAddress(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.IpPrefixOrAddress) AllowedAddressPairsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.interfaces._interface.AllowedAddressPairsBuilder)

Aggregations

IpPrefixOrAddress (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.IpPrefixOrAddress)2 AllowedAddressPairsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.interfaces._interface.AllowedAddressPairsBuilder)2 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)1