Compare commits

...

5 Commits

Author SHA1 Message Date
ralphlee
19473c8b39 [WIFI-7708] Add BSSID handling for client session 2022-04-21 00:42:22 -04:00
christieunitt-cu
307bf0cd1c Merge pull request #80 from Telecominfraproject/NE-4690/portMismatch
NETEXP-4690 Port to 1.4: OpenSync gateway change to derive radioType …
2022-04-12 16:04:41 -04:00
Christie Unitt
de7d156429 NETEXP-4690 Port to 1.4: OpenSync gateway change to dervie radioType from AP chan number 2022-04-12 15:56:47 -04:00
ralphlee3
4512096a49 [WIFI-7588] Disconnect client sessions on DHCP lease IP table delete (#79) 2022-04-11 16:27:25 -04:00
ralphlee3
1275043232 [WIFI-7579] Bugfixes on updating status API for auto-upgrade (#78) 2022-04-11 11:48:22 -04:00
2 changed files with 30 additions and 29 deletions

View File

@@ -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);

View File

@@ -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());