mirror of
https://github.com/Telecominfraproject/wlan-cloud-opensync-controller.git
synced 2026-01-09 21:41:25 +00:00
Compare commits
6 Commits
WIFI-7323
...
NE-4690/po
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
de7d156429 | ||
|
|
4512096a49 | ||
|
|
1275043232 | ||
|
|
78f4169339 | ||
|
|
b7c6594937 | ||
|
|
d2c7eac05d |
@@ -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);
|
||||
|
||||
@@ -520,15 +520,18 @@ public class MqttStatsPublisher implements StatsPublisherInterface {
|
||||
if (apNodeMetrics.getSourceTimestampMs() < survey.getTimestampMs())
|
||||
apNodeMetrics.setSourceTimestampMs(survey.getTimestampMs());
|
||||
|
||||
int pctBusyTx = busyTx / totalDurationMs;
|
||||
float pctBusyTx = (float)busyTx / totalDurationMs;
|
||||
checkIfOutOfBound("pctBusyTx", pctBusyTx, survey, totalDurationMs, busyTx, busyRx, busy, busySelf);
|
||||
|
||||
radioUtil.setAssocClientTx(pctBusyTx);
|
||||
int pctBusyRx = busyRx / totalDurationMs;
|
||||
radioUtil.setAssocClientTx(Math.round(pctBusyTx));
|
||||
|
||||
float pctBusyRx = (float) busyRx / totalDurationMs;
|
||||
checkIfOutOfBound("pctBusyRx", pctBusyRx, survey, totalDurationMs, busyTx, busyRx, busy, busySelf);
|
||||
radioUtil.setAssocClientRx(pctBusyRx);
|
||||
|
||||
float pctBusySelf = (float) busySelf / totalDurationMs;
|
||||
checkIfOutOfBound("pctBusySelf", pctBusySelf, survey, totalDurationMs, busyTx, busyRx, busy, busySelf);
|
||||
radioUtil.setAssocClientRx(Math.round(pctBusySelf));
|
||||
|
||||
double pctIBSS = (busyTx + busySelf) / totalDurationMs;
|
||||
double pctIBSS = (double) (busyTx + busySelf) / totalDurationMs;
|
||||
if (pctIBSS > 100D || pctIBSS < 0D) {
|
||||
LOG.warn(
|
||||
"Calculated value for {} {} is out of bounds on totalDurationMs {} for survey.getBand {}. busyTx {} busyRx {} busy {} busySelf {} "
|
||||
@@ -538,13 +541,13 @@ public class MqttStatsPublisher implements StatsPublisherInterface {
|
||||
}
|
||||
radioUtil.setIbss(pctIBSS);
|
||||
|
||||
int nonWifi = (busy - (busyTx + busyRx)) / totalDurationMs;
|
||||
float nonWifi = (float) (busy - (busyTx + busyRx)) / totalDurationMs;
|
||||
checkIfOutOfBound("nonWifi", nonWifi, survey, totalDurationMs, busyTx, busyRx, busy, busySelf);
|
||||
radioUtil.setNonWifi(nonWifi);
|
||||
radioUtil.setNonWifi(Math.round(nonWifi));
|
||||
|
||||
int pctOBSSAndSelfErrors = (busyRx - busySelf) / totalDurationMs;
|
||||
float pctOBSSAndSelfErrors = (float) (busyRx - busySelf) / totalDurationMs;
|
||||
checkIfOutOfBound("OBSSAndSelfErrors", pctOBSSAndSelfErrors, survey, totalDurationMs, busyTx, busyRx, busy, busySelf);
|
||||
radioUtil.setUnassocClientRx(pctOBSSAndSelfErrors);
|
||||
radioUtil.setUnassocClientRx(Math.round(pctOBSSAndSelfErrors));
|
||||
|
||||
radioType = OvsdbToWlanCloudTypeMappingUtility.getRadioTypeFromOpensyncStatsRadioBandType(survey.getBand());
|
||||
if (radioType != RadioType.UNSUPPORTED) {
|
||||
@@ -559,7 +562,7 @@ public class MqttStatsPublisher implements StatsPublisherInterface {
|
||||
}
|
||||
|
||||
Long totalUtilization = Math.round((double) busy / totalDurationMs);
|
||||
Long totalNonWifi = totalUtilization - ((busyTx + busyRx) / totalDurationMs);
|
||||
Long totalNonWifi = Math.round((double) (busy - (busyTx + busyRx)) / totalDurationMs);
|
||||
|
||||
EquipmentCapacityDetails cap = new EquipmentCapacityDetails();
|
||||
cap.setUnavailableCapacity(totalNonWifi.intValue());
|
||||
@@ -623,8 +626,8 @@ public class MqttStatsPublisher implements StatsPublisherInterface {
|
||||
alarm = alarmServiceInterface.create(alarm);
|
||||
}
|
||||
|
||||
private void checkIfOutOfBound(String checkedType, int checkedValue, Survey survey, int totalDurationMs, int busyTx, int busyRx, int busy, int busySelf) {
|
||||
if (checkedValue > 100 || checkedValue < 0) {
|
||||
private void checkIfOutOfBound(String checkedType, float checkedValue, Survey survey, int totalDurationMs, int busyTx, int busyRx, int busy, int busySelf) {
|
||||
if (checkedValue > 100F || checkedValue < 0F) {
|
||||
LOG.warn(
|
||||
"Calculated value for {} {} is out of bounds on totalDurationMs {} for survey.getBand {}. busyTx {} busyRx {} busy {} busySelf {} "
|
||||
+ " survey.getTimestampMs {}, survey.getSurveyListList {}",
|
||||
|
||||
@@ -514,12 +514,12 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
||||
for (RowUpdate rowUpdate : tableUpdate.getRowUpdates().values()) {
|
||||
|
||||
if (rowUpdate.getNew() == null) {
|
||||
// delete
|
||||
Map<String, String> rowMap = new HashMap<>();
|
||||
|
||||
rowUpdate.getOld().getColumns().entrySet().forEach(c -> OvsdbDao.translateDhcpFpValueToString(c, rowMap));
|
||||
|
||||
delete.add(rowMap);
|
||||
// delete
|
||||
} else if (rowUpdate.getOld() == null) {
|
||||
// insert
|
||||
Map<String, String> rowMap = new HashMap<>();
|
||||
@@ -528,15 +528,13 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
||||
|
||||
insert.add(rowMap);
|
||||
} else {
|
||||
|
||||
// insert
|
||||
// update
|
||||
Map<String, String> rowMap = new HashMap<>();
|
||||
|
||||
rowUpdate.getOld().getColumns().putAll(rowUpdate.getNew().getColumns());
|
||||
rowUpdate.getOld().getColumns().entrySet().forEach(c -> OvsdbDao.translateDhcpFpValueToString(c, rowMap));
|
||||
|
||||
update.add(rowMap);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -560,7 +558,7 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
||||
|
||||
});
|
||||
|
||||
awCf.join();
|
||||
extIntegrationInterface.dhcpLeasedIpDbTableUpdate(ovsdbDao.getInitialOpensyncDhcpLeasedIp(awCf.join(), key, ovsdbClient), key, RowUpdateOperation.INIT);
|
||||
|
||||
}
|
||||
|
||||
@@ -680,7 +678,7 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
extIntegrationInterface.wifiAssociatedClientsDbTableUpdate(ovsdbDao.getInitialOpensyncWifiAssociatedClients(acCf.join(), key, ovsdbClient), key);
|
||||
|
||||
}
|
||||
|
||||
@@ -152,6 +152,11 @@ public class OvsdbDao extends OvsdbDaoBase {
|
||||
OvsdbClient ovsdbClient) {
|
||||
return ovsdbMonitor.getInitialOpensyncWifiAssociatedClients(join, key, ovsdbClient);
|
||||
}
|
||||
|
||||
public List<Map<String, String>> getInitialOpensyncDhcpLeasedIp(TableUpdates join, String key,
|
||||
OvsdbClient ovsdbClient) {
|
||||
return ovsdbMonitor.getInitialOpensyncDhcpLeasedIp(join, key, ovsdbClient);
|
||||
}
|
||||
|
||||
public Collection<? extends OpensyncAPInetState> getOpensyncApInetStateForRowUpdate(RowUpdate rowUpdate, String key,
|
||||
OvsdbClient ovsdbClient) {
|
||||
|
||||
@@ -83,6 +83,33 @@ public class OvsdbMonitor extends OvsdbDaoBase {
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
List<Map<String, String>> getInitialOpensyncDhcpLeasedIp(TableUpdates tableUpdates, String apId,
|
||||
OvsdbClient ovsdbClient) {
|
||||
LOG.debug("getInitialOpensyncDhcpLeasedIp:");
|
||||
List<Map<String, String>> ret = new ArrayList<>();
|
||||
try {
|
||||
LOG.debug(dhcpLeasedIpDbTable + "_" + apId + " initial monitor table state received {}",
|
||||
tableUpdates);
|
||||
|
||||
for (TableUpdate tableUpdate : tableUpdates.getTableUpdates().values()) {
|
||||
for (RowUpdate rowUpdate : tableUpdate.getRowUpdates().values()) {
|
||||
|
||||
if (rowUpdate.getNew() != null) {
|
||||
|
||||
Map<String, String> rowMap = new HashMap<>();
|
||||
|
||||
rowUpdate.getNew().getColumns().entrySet().forEach(c -> OvsdbDao.translateDhcpFpValueToString(c, rowMap));
|
||||
|
||||
ret.add(rowMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw (e);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
List<OpensyncAPInetState> getOpensyncApInetStateForRowUpdate(RowUpdate rowUpdate, String apId,
|
||||
OvsdbClient ovsdbClient) {
|
||||
|
||||
Reference in New Issue
Block a user