diff --git a/opensync-gateway-cloud-process/src/main/resources/application.properties b/opensync-gateway-cloud-process/src/main/resources/application.properties index 041d50c..e7ebe5d 100644 --- a/opensync-gateway-cloud-process/src/main/resources/application.properties +++ b/opensync-gateway-cloud-process/src/main/resources/application.properties @@ -96,6 +96,8 @@ tip.wlan.listOfPathsToProtect=/api,/filestore #this server only supports REST requests, CSRF would get in the way tip.wlan.csrf-enabled=false +# do not allow clientCn alteration +tip.wlan.preventClientCnAlteration=false #properties that configure remote interfaces to communicate with cloud # when separate portal - prov - ssc processes are in use: ##SSC-related services diff --git a/opensync-gateway/src/main/java/com/telecominfraproject/wlan/opensync/ovsdb/TipWlanOvsdbClient.java b/opensync-gateway/src/main/java/com/telecominfraproject/wlan/opensync/ovsdb/TipWlanOvsdbClient.java index 44052d8..46937ed 100644 --- a/opensync-gateway/src/main/java/com/telecominfraproject/wlan/opensync/ovsdb/TipWlanOvsdbClient.java +++ b/opensync-gateway/src/main/java/com/telecominfraproject/wlan/opensync/ovsdb/TipWlanOvsdbClient.java @@ -59,6 +59,9 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface { @org.springframework.beans.factory.annotation.Value("${tip.wlan.manager.collectionIntervalSec.deviceStats:120}") private long collectionIntervalSecDeviceStats; + @org.springframework.beans.factory.annotation.Value("${tip.wlan.preventClientCnAlteration:false}") + private boolean preventClientCnAlteration; + @Autowired private SslContext sslContext; @@ -196,6 +199,7 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface { } catch (Exception e) { LOG.warn("Could not provision Bridge->Port->Interface mapping.", e); } + ovsdbDao.removeAllStatsConfigs(ovsdbClient); // always ovsdbDao.removeAllSsids(ovsdbClient); // always ovsdbDao.removeWifiRrm(ovsdbClient); @@ -204,10 +208,12 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface { ovsdbDao.configureInterfaces(ovsdbClient); ovsdbDao.configureSsids(ovsdbClient, opensyncAPConfig); ovsdbDao.configureWifiRrm(ovsdbClient, opensyncAPConfig); + ovsdbDao.configureStatsFromProfile(ovsdbClient, opensyncAPConfig); + if (((ApNetworkConfiguration) opensyncAPConfig.getApProfile().getDetails()).getSyntheticClientEnabled()) { + ovsdbDao.enableNetworkProbeForSyntheticClient(ovsdbClient); + } } - ovsdbDao.removeAllStatsConfigs(ovsdbClient); // always - ovsdbDao.configureStatsFromProfile(ovsdbClient, opensyncAPConfig); // Check if device stats is configured in Wifi_Stats_Config table, // provision it @@ -274,7 +280,7 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface { ovsdbDao.configureInterfaces(ovsdbClient); ovsdbDao.configureSsids(ovsdbClient, opensyncAPConfig); ovsdbDao.configureWifiRrm(ovsdbClient, opensyncAPConfig); - + ovsdbDao.configureStatsFromProfile(ovsdbClient, opensyncAPConfig); // Check if device stats is configured in Wifi_Stats_Config table, diff --git a/opensync-gateway/src/main/java/com/telecominfraproject/wlan/opensync/ovsdb/dao/OvsdbDao.java b/opensync-gateway/src/main/java/com/telecominfraproject/wlan/opensync/ovsdb/dao/OvsdbDao.java index 7c7c44c..848da61 100644 --- a/opensync-gateway/src/main/java/com/telecominfraproject/wlan/opensync/ovsdb/dao/OvsdbDao.java +++ b/opensync-gateway/src/main/java/com/telecominfraproject/wlan/opensync/ovsdb/dao/OvsdbDao.java @@ -550,7 +550,7 @@ public class OvsdbDao { // mqtt_settings:ins:'["map",[["broker","testportal.123wlan.com"],["topics","/ap/dev-ap-0300/opensync"],["qos","0"],["port","1883"],["remote_log","1"]]]' Map newMqttSettings = new HashMap<>(); newMqttSettings.put("broker", mqttBrokerAddress); - newMqttSettings.put("topics", "/ap/" + clientCn + "_" + ret.serialNumber + "/opensync"); + newMqttSettings.put("topics", "/ap/" + clientCn + "/opensync"); newMqttSettings.put("port", "" + mqttBrokerListenPort); newMqttSettings.put("compress", "zlib"); newMqttSettings.put("qos", "0"); @@ -3423,7 +3423,7 @@ public class OvsdbDao { Set> operatorFriendlyName = new HashSet<>(); operatorProfile.getOperatorFriendlyName().stream() - .forEach(c -> operatorFriendlyName.add(new Atom<>(c.getFormattedFriendlyName()))); + .forEach(c -> operatorFriendlyName.add(new Atom<>(c.getAsDuple()))); com.vmware.ovsdb.protocol.operation.notation.Set operatorFriendlyNameSet = com.vmware.ovsdb.protocol.operation.notation.Set .of(operatorFriendlyName); rowColumns.put("operator_friendly_name", operatorFriendlyNameSet); @@ -3449,7 +3449,7 @@ public class OvsdbDao { Set> venueUrls = new HashSet<>(); int index = 1; for (VenueName venueName : venueProfile.getVenueNameSet()) { - venueNames.add(new Atom(venueName.getFormattedVenueName())); + venueNames.add(new Atom(venueName.getAsDuple())); String url = String.valueOf(index) + ":" + venueName.getVenueUrl(); venueUrls.add(new Atom(url)); index++; @@ -3644,9 +3644,7 @@ public class OvsdbDao { public void configureStatsFromProfile(OvsdbClient ovsdbClient, OpensyncAPConfig opensyncApConfig) { - LOG.debug("Metrics config from profile {}", opensyncApConfig.getMetricsProfiles()); - - if (opensyncApConfig.getMetricsProfiles().isEmpty()) { + if (opensyncApConfig.getMetricsProfiles() == null || opensyncApConfig.getMetricsProfiles().isEmpty()) { configureStats(ovsdbClient); } else {