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;
}
Aggregations