Compare commits

..

1 Commits

Author SHA1 Message Date
Lynn Shi
95db7b2b06 WIFI-7336 OpenSync: assocClientRx should be busySelf (not busyRx) 2022-03-21 12:41:35 -04:00
4 changed files with 35 additions and 57 deletions

View File

@@ -98,6 +98,7 @@ 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;
@@ -142,8 +143,6 @@ 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
@@ -768,7 +767,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(ce.getCustomerId(), ce.getId(), StatusDataType.FIRMWARE);
Status statusRecord = statusServiceInterface.getOrNull(autoProvisionedCustomerId, autoProvisionedCustomerId, StatusDataType.FIRMWARE);
if (statusRecord == null) {
statusRecord = new Status();
statusRecord.setCreatedTimestamp(System.currentTimeMillis());
@@ -778,7 +777,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
statusRecord.setDetails(new EquipmentUpgradeStatusData());
((EquipmentUpgradeStatusData) statusRecord.getDetails()).setActiveSwVersion(activeFirmwareImageAp);
if (inactiveFirmwareImageAp != null) {
((EquipmentUpgradeStatusData) statusRecord.getDetails()).setAlternateSwVersion(inactiveFirmwareImageAp);
((EquipmentUpgradeStatusData) statusRecord.getDetails()).setActiveSwVersion(inactiveFirmwareImageAp);
}
}
EquipmentUpgradeStatusData fwUpgradeStatusData = (EquipmentUpgradeStatusData) statusRecord.getDetails();
@@ -796,8 +795,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; deprecated flag {} ; unknown flag {} ", ce.getInventoryId(),
trackSettings.getAutoUpgradeDeprecatedOnBind(), trackSettings.getAutoUpgradeUnknownOnBind());
LOG.debug("reconcileFwVersionToTrack for AP {} track flag for auto-upgrade {}", ce.getInventoryId(),
trackSettings.getAutoUpgradeDeprecatedOnBind());
// 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.
@@ -1124,6 +1123,11 @@ 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);
@@ -1154,10 +1158,19 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
vifState.getAssociatedClients(), channel);
RadioType radioType = null;
if (channel <= MAX_ALLOWED_2GHz_CHANNEL_NUMBER) {
radioType = RadioType.is2dot4GHz;
} else {
radioType = RadioType.is5GHz; // 8300 isn't supported
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;
}
}
updateActiveBssids(customerId, equipmentId, apId, ssid, radioType, bssid, numClients);
@@ -1448,10 +1461,8 @@ 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);
}
@@ -2237,13 +2248,10 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
Client client = clientServiceInterface.getOrNull(customerId, clientMacAddress);
if (client == null) {
LOG.info("Cannot find client instance for {}", 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());
}
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));
}
} else if (clientMacAddress.equals(equipmentServiceInterface.get(equipmentId).getBaseMacAddress())) {
LOG.info("Not a client device {} ", dhcpLeasedIps);

View File

@@ -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,13 +528,15 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
insert.add(rowMap);
} else {
// update
// insert
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);
}
}
}
@@ -558,7 +560,7 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
});
extIntegrationInterface.dhcpLeasedIpDbTableUpdate(ovsdbDao.getInitialOpensyncDhcpLeasedIp(awCf.join(), key, ovsdbClient), key, RowUpdateOperation.INIT);
awCf.join();
}
@@ -678,7 +680,7 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
}
});
extIntegrationInterface.wifiAssociatedClientsDbTableUpdate(ovsdbDao.getInitialOpensyncWifiAssociatedClients(acCf.join(), key, ovsdbClient), key);
}

View File

@@ -152,11 +152,6 @@ 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) {

View File

@@ -83,33 +83,6 @@ 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) {