Search in sources :

Example 1 with DVSMacLearningPolicy

use of com.vmware.vim25.DVSMacLearningPolicy in project cloudstack by apache.

the class HypervisorHostHelper method createDVSMacManagementPolicy.

public static DVSMacManagementPolicy createDVSMacManagementPolicy(Map<NetworkOffering.Detail, String> nicDetails) {
    if (nicDetails == null) {
        nicDetails = getDefaultSecurityDetails();
    }
    DVSMacManagementPolicy macManagementPolicy = new DVSMacManagementPolicy();
    macManagementPolicy.setAllowPromiscuous(Boolean.valueOf(nicDetails.getOrDefault(NetworkOffering.Detail.PromiscuousMode, "false")));
    macManagementPolicy.setForgedTransmits(Boolean.valueOf(nicDetails.getOrDefault(NetworkOffering.Detail.ForgedTransmits, "false")));
    macManagementPolicy.setMacChanges(Boolean.valueOf(nicDetails.getOrDefault(NetworkOffering.Detail.MacAddressChanges, "false")));
    DVSMacLearningPolicy macLearningPolicy = new DVSMacLearningPolicy();
    macLearningPolicy.setEnabled(Boolean.parseBoolean(nicDetails.getOrDefault(NetworkOffering.Detail.MacLearning, "false")));
    macManagementPolicy.setMacLearningPolicy(macLearningPolicy);
    return macManagementPolicy;
}
Also used : DVSMacLearningPolicy(com.vmware.vim25.DVSMacLearningPolicy) DVSMacManagementPolicy(com.vmware.vim25.DVSMacManagementPolicy)

Aggregations

DVSMacLearningPolicy (com.vmware.vim25.DVSMacLearningPolicy)1 DVSMacManagementPolicy (com.vmware.vim25.DVSMacManagementPolicy)1