mirror of
https://github.com/Telecominfraproject/wlan-cloud-opensync-controller.git
synced 2025-11-01 19:17:52 +00:00
Compare commits
5 Commits
WIFI-7579-
...
WIFI-7708-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
19473c8b39 | ||
|
|
307bf0cd1c | ||
|
|
de7d156429 | ||
|
|
4512096a49 | ||
|
|
1275043232 |
@@ -98,7 +98,6 @@ import com.telecominfraproject.wlan.profile.models.ProfileType;
|
||||
import com.telecominfraproject.wlan.profile.network.models.ApNetworkConfiguration;
|
||||
import com.telecominfraproject.wlan.profile.network.models.RadioProfileConfiguration;
|
||||
import com.telecominfraproject.wlan.profile.rf.models.RfConfiguration;
|
||||
import com.telecominfraproject.wlan.profile.rf.models.RfElementConfiguration;
|
||||
import com.telecominfraproject.wlan.profile.ssid.models.SsidConfiguration;
|
||||
import com.telecominfraproject.wlan.profile.ssid.models.SsidConfiguration.SecureMode;
|
||||
import com.telecominfraproject.wlan.routing.RoutingServiceInterface;
|
||||
@@ -143,6 +142,8 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
||||
private static final String NATIVE_VLAN_ID = "pvid";
|
||||
private static final String SPACE_SEPERATOR = " ";
|
||||
|
||||
public final static int MAX_ALLOWED_2GHz_CHANNEL_NUMBER = 14;
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(OpensyncExternalIntegrationCloud.class);
|
||||
|
||||
@Autowired
|
||||
@@ -767,7 +768,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
||||
String firmwareVersion) {
|
||||
|
||||
LOG.debug("reconcileFwVersionToTrack for AP {} with active firmware version {} model {}", ce.getInventoryId(), activeFirmwareImageAp, model);
|
||||
Status statusRecord = statusServiceInterface.getOrNull(autoProvisionedCustomerId, autoProvisionedCustomerId, StatusDataType.FIRMWARE);
|
||||
Status statusRecord = statusServiceInterface.getOrNull(ce.getCustomerId(), ce.getId(), StatusDataType.FIRMWARE);
|
||||
if (statusRecord == null) {
|
||||
statusRecord = new Status();
|
||||
statusRecord.setCreatedTimestamp(System.currentTimeMillis());
|
||||
@@ -777,7 +778,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
||||
statusRecord.setDetails(new EquipmentUpgradeStatusData());
|
||||
((EquipmentUpgradeStatusData) statusRecord.getDetails()).setActiveSwVersion(activeFirmwareImageAp);
|
||||
if (inactiveFirmwareImageAp != null) {
|
||||
((EquipmentUpgradeStatusData) statusRecord.getDetails()).setActiveSwVersion(inactiveFirmwareImageAp);
|
||||
((EquipmentUpgradeStatusData) statusRecord.getDetails()).setAlternateSwVersion(inactiveFirmwareImageAp);
|
||||
}
|
||||
}
|
||||
EquipmentUpgradeStatusData fwUpgradeStatusData = (EquipmentUpgradeStatusData) statusRecord.getDetails();
|
||||
@@ -795,8 +796,8 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
||||
// determine if AP requires FW upgrade before cloud
|
||||
// connection/provision
|
||||
if (trackSettings.getAutoUpgradeDeprecatedOnBind().equals(TrackFlag.ALWAYS) || trackSettings.getAutoUpgradeUnknownOnBind().equals(TrackFlag.ALWAYS)) {
|
||||
LOG.debug("reconcileFwVersionToTrack for AP {} track flag for auto-upgrade {}", ce.getInventoryId(),
|
||||
trackSettings.getAutoUpgradeDeprecatedOnBind());
|
||||
LOG.debug("reconcileFwVersionToTrack for AP {} track flag for auto-upgrade; deprecated flag {} ; unknown flag {} ", ce.getInventoryId(),
|
||||
trackSettings.getAutoUpgradeDeprecatedOnBind(), trackSettings.getAutoUpgradeUnknownOnBind());
|
||||
// check the reported fw version for the AP, if it is < than
|
||||
// the default version for the cloud, then download and
|
||||
// flash the firmware before proceeding.
|
||||
@@ -1123,11 +1124,6 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
||||
return;
|
||||
}
|
||||
|
||||
ApElementConfiguration apElementConfig = (ApElementConfiguration) apNode.getDetails();
|
||||
|
||||
ProfileContainer profileContainer = new ProfileContainer(profileServiceInterface.getProfileWithChildren(apNode.getProfileId()));
|
||||
RfConfiguration rfConfig = (RfConfiguration) profileContainer.getChildOfTypeOrNull(apNode.getProfileId(), ProfileType.rf).getDetails();
|
||||
|
||||
for (OpensyncAPVIFState vifState : vifStateTables) {
|
||||
|
||||
LOG.debug("Processing vifState for interface {} on AP {}", vifState.getIfName(), apId);
|
||||
@@ -1158,19 +1154,10 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
||||
vifState.getAssociatedClients(), channel);
|
||||
|
||||
RadioType radioType = null;
|
||||
Map<RadioType, RfElementConfiguration> rfElementMap = rfConfig.getRfConfigMap();
|
||||
Map<RadioType, ElementRadioConfiguration> elementRadioMap = apElementConfig.getRadioMap();
|
||||
|
||||
if (apElementConfig.getAdvancedRadioMap().isEmpty()) {
|
||||
LOG.warn("No AdvancedRadioMap for ap {} {}", apId, apElementConfig);
|
||||
continue;
|
||||
}
|
||||
for (RadioType rType : elementRadioMap.keySet()) {
|
||||
boolean autoChannelSelection = rfElementMap.get(rType).getAutoChannelSelection();
|
||||
if (elementRadioMap.get(rType).getActiveChannel(autoChannelSelection) == channel) {
|
||||
radioType = rType;
|
||||
break;
|
||||
}
|
||||
if (channel <= MAX_ALLOWED_2GHz_CHANNEL_NUMBER) {
|
||||
radioType = RadioType.is2dot4GHz;
|
||||
} else {
|
||||
radioType = RadioType.is5GHz; // 8300 isn't supported
|
||||
}
|
||||
|
||||
updateActiveBssids(customerId, equipmentId, apId, ssid, radioType, bssid, numClients);
|
||||
@@ -1461,8 +1448,10 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
||||
if (currentActiveBSSIDs == null) {
|
||||
currentActiveBSSIDs = new ArrayList<>();
|
||||
} else {
|
||||
currentActiveBSSIDs = currentActiveBSSIDs.stream().filter(p -> (p.getRadioType() != null && p.getSsid() != null))
|
||||
.filter(p -> !p.getRadioType().equals(freqBand) || !p.getSsid().equals(ssid)).collect(Collectors.toList());
|
||||
currentActiveBSSIDs = currentActiveBSSIDs.stream()
|
||||
.filter(p -> (p.getRadioType() != null && p.getSsid() != null))
|
||||
.filter(p -> !(p.getRadioType().equals(freqBand) && p.getSsid().equals(ssid)) )
|
||||
.collect(Collectors.toList());
|
||||
LOG.debug("Processing Wifi_VIF_State table update for AP {}, activeBSSIDs bssidList without current radio freq {} and ssid {}", apId,
|
||||
currentActiveBSSIDs, ssid);
|
||||
}
|
||||
@@ -2248,10 +2237,13 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
||||
Client client = clientServiceInterface.getOrNull(customerId, clientMacAddress);
|
||||
if (client == null) {
|
||||
LOG.info("Cannot find client instance for {}", clientMacAddress);
|
||||
ClientSession session = clientServiceInterface.getSessionOrNull(customerId, equipmentId, clientMacAddress);
|
||||
if (session != null) {
|
||||
LOG.info("Delete clientSession for client that was removed from the Dhcp_Leased_IP table {}",
|
||||
clientServiceInterface.deleteSession(customerId, equipmentId, clientMacAddress));
|
||||
ClientSession clientSession = clientServiceInterface.getSessionOrNull(customerId, equipmentId, clientMacAddress);
|
||||
if (clientSession != null && clientSession.getDetails() != null && clientSession.getDetails().getAssociationState() != null) {
|
||||
if (!clientSession.getDetails().getAssociationState().equals(AssociationState.Disconnected)) {
|
||||
clientSession.getDetails().setAssociationState(AssociationState.Disconnected);
|
||||
clientSession = clientServiceInterface.updateSession(clientSession);
|
||||
LOG.info("Session {} for client {} is now disconnected.", clientSession, clientSession.getMacAddress());
|
||||
}
|
||||
}
|
||||
} else if (clientMacAddress.equals(equipmentServiceInterface.get(equipmentId).getBaseMacAddress())) {
|
||||
LOG.info("Not a client device {} ", dhcpLeasedIps);
|
||||
|
||||
@@ -152,6 +152,9 @@ public class AsyncPublishService {
|
||||
clientSession.getDetails().setSessionId(Long.toUnsignedString(apEventClientSession.getSessionId()));
|
||||
clientSession.getDetails().setRadioType(OvsdbToWlanCloudTypeMappingUtility.getRadioTypeFromOpensyncStatsRadioBandType(apClientEvent.getBand()));
|
||||
clientSession.getDetails().setSsid(apClientEvent.getSsid());
|
||||
if (apClientEvent.hasBssid()) {
|
||||
clientSession.getDetails().setBssid(MacAddress.valueOf(apClientEvent.getBssid()));
|
||||
}
|
||||
if (apClientEvent.hasAuthStatus()) {
|
||||
clientSession.getDetails().setAssociationStatus(apClientEvent.getAuthStatus());
|
||||
}
|
||||
@@ -202,6 +205,9 @@ public class AsyncPublishService {
|
||||
clientSession.getDetails().setSessionId(Long.toUnsignedString(apEventClientSession.getSessionId()));
|
||||
clientSession.getDetails().setRadioType(OvsdbToWlanCloudTypeMappingUtility.getRadioTypeFromOpensyncStatsRadioBandType(apClientEvent.getBand()));
|
||||
clientSession.getDetails().setSsid(apClientEvent.getSsid());
|
||||
if (apClientEvent.hasBssid()) {
|
||||
clientSession.getDetails().setBssid(MacAddress.valueOf(apClientEvent.getBssid()));
|
||||
}
|
||||
if (apClientEvent.hasStatus()) {
|
||||
clientSession.getDetails().setAssociationStatus(apClientEvent.getStatus());
|
||||
}
|
||||
@@ -320,6 +326,9 @@ public class AsyncPublishService {
|
||||
clientSession.getDetails().setSessionId(Long.toUnsignedString(apEventClientSession.getSessionId()));
|
||||
clientSession.getDetails().setRadioType(OvsdbToWlanCloudTypeMappingUtility.getRadioTypeFromOpensyncStatsRadioBandType(apClientEvent.getBand()));
|
||||
clientSession.getDetails().setSsid(apClientEvent.getSsid());
|
||||
if (apClientEvent.hasBssid()) {
|
||||
clientSession.getDetails().setBssid(MacAddress.valueOf(apClientEvent.getBssid()));
|
||||
}
|
||||
if (apClientEvent.hasDevType()) {
|
||||
if (apClientEvent.getDevType().equals(DeviceType.DEV_AP)) {
|
||||
clientSession.getDetails().setDisconnectByApTimestamp(apClientEvent.getTimestampMs());
|
||||
|
||||
Reference in New Issue
Block a user