mirror of
https://github.com/Telecominfraproject/wlan-cloud-opensync-controller.git
synced 2025-11-28 08:13:56 +00:00
Update reported IpV4 address for wan interface based on the value in the
Wifi_Inet_Table when the table state changes. Handles situation where the AP connects before it's services are up and the table is not populated with the IPs of the wan/lan interfaces. Ensure dhcp_sniff is set on all interfaces.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package com.telecominfraproject.wlan.opensync.external.integration;
|
package com.telecominfraproject.wlan.opensync.external.integration;
|
||||||
|
|
||||||
|
import java.net.Inet4Address;
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -148,6 +149,14 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
private boolean isAutoconfigEnabled;
|
private boolean isAutoconfigEnabled;
|
||||||
@Value("${tip.wlan.ovsdb.defaultFwVersion:r10947-65030d81f3}")
|
@Value("${tip.wlan.ovsdb.defaultFwVersion:r10947-65030d81f3}")
|
||||||
private String defaultFwVersion;
|
private String defaultFwVersion;
|
||||||
|
@org.springframework.beans.factory.annotation.Value("${tip.wlan.ovsdb.wifi-iface.default_lan_type:bridge}")
|
||||||
|
public String defaultLanInterfaceType;
|
||||||
|
@org.springframework.beans.factory.annotation.Value("${tip.wlan.ovsdb.wifi-iface.default_lan_name:lan}")
|
||||||
|
public String defaultLanInterfaceName;
|
||||||
|
@org.springframework.beans.factory.annotation.Value("${tip.wlan.ovsdb.wifi-iface.default_wan_type:bridge}")
|
||||||
|
public String defaultWanInterfaceType;
|
||||||
|
@org.springframework.beans.factory.annotation.Value("${tip.wlan.ovsdb.wifi-iface.default_wan_name:wan}")
|
||||||
|
public String defaultWanInterfaceName;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private CacheManager cacheManagerShortLived;
|
private CacheManager cacheManagerShortLived;
|
||||||
@@ -500,9 +509,12 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
protocolStatusData.setReportedSwVersion("Unknown");
|
protocolStatusData.setReportedSwVersion("Unknown");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
if (connectNodeInfo.ipV4Address != null) {
|
||||||
protocolStatusData.setReportedIpV4Addr(InetAddress.getByName(connectNodeInfo.ipV4Address));
|
protocolStatusData.setReportedIpV4Addr(InetAddress.getByName(connectNodeInfo.ipV4Address));
|
||||||
|
}
|
||||||
} catch (UnknownHostException e) {
|
} catch (UnknownHostException e) {
|
||||||
// do nothing here
|
LOG.error("Could not set IpV4Addr {} on AP {} due to UnknownHostException ",
|
||||||
|
connectNodeInfo.ipV4Address, ce.getName(), e);
|
||||||
}
|
}
|
||||||
if ((connectNodeInfo.macAddress != null) && (MacAddress.valueOf(connectNodeInfo.macAddress) != null)) {
|
if ((connectNodeInfo.macAddress != null) && (MacAddress.valueOf(connectNodeInfo.macAddress) != null)) {
|
||||||
protocolStatusData.setReportedMacAddr(MacAddress.valueOf(connectNodeInfo.macAddress));
|
protocolStatusData.setReportedMacAddr(MacAddress.valueOf(connectNodeInfo.macAddress));
|
||||||
@@ -511,7 +523,8 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
protocolStatusData.setSerialNumber(connectNodeInfo.serialNumber);
|
protocolStatusData.setSerialNumber(connectNodeInfo.serialNumber);
|
||||||
protocolStatusData.setSystemName(connectNodeInfo.model);
|
protocolStatusData.setSystemName(connectNodeInfo.model);
|
||||||
statusRecord.setDetails(protocolStatusData);
|
statusRecord.setDetails(protocolStatusData);
|
||||||
statusServiceInterface.update(statusRecord);
|
Status protocolStatus = statusServiceInterface.update(statusRecord);
|
||||||
|
LOG.debug("ProtocolStatus for AP {} updated to {}", ce.getName(), protocolStatus);
|
||||||
|
|
||||||
statusRecord = statusServiceInterface.getOrNull(ce.getCustomerId(), ce.getId(), StatusDataType.FIRMWARE);
|
statusRecord = statusServiceInterface.getOrNull(ce.getCustomerId(), ce.getId(), StatusDataType.FIRMWARE);
|
||||||
if (statusRecord == null) {
|
if (statusRecord == null) {
|
||||||
@@ -1139,6 +1152,8 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
Status activeBssidsStatus = statusServiceInterface.getOrNull(customerId, equipmentId,
|
Status activeBssidsStatus = statusServiceInterface.getOrNull(customerId, equipmentId,
|
||||||
StatusDataType.ACTIVE_BSSIDS);
|
StatusDataType.ACTIVE_BSSIDS);
|
||||||
|
|
||||||
|
statusServiceInterface.getForCustomer(customerId, null, ImmutableSet.of(StatusDataType.ACTIVE_BSSIDS), null,
|
||||||
|
null);
|
||||||
if (activeBssidsStatus == null) {
|
if (activeBssidsStatus == null) {
|
||||||
activeBssidsStatus = new Status();
|
activeBssidsStatus = new Status();
|
||||||
activeBssidsStatus.setCustomerId(customerId);
|
activeBssidsStatus.setCustomerId(customerId);
|
||||||
@@ -1230,8 +1245,40 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
}
|
}
|
||||||
|
|
||||||
EquipmentLANStatusData lanStatusData = (EquipmentLANStatusData) lanStatus.getDetails();
|
EquipmentLANStatusData lanStatusData = (EquipmentLANStatusData) lanStatus.getDetails();
|
||||||
|
|
||||||
|
Status protocolStatus = statusServiceInterface.getOrNull(customerId, equipmentId, StatusDataType.PROTOCOL);
|
||||||
|
if (protocolStatus == null) {
|
||||||
|
protocolStatus = new Status();
|
||||||
|
protocolStatus.setCustomerId(customerId);
|
||||||
|
protocolStatus.setEquipmentId(equipmentId);
|
||||||
|
protocolStatus.setStatusDataType(StatusDataType.PROTOCOL);
|
||||||
|
protocolStatus.setDetails(new EquipmentProtocolStatusData());
|
||||||
|
protocolStatus = statusServiceInterface.update(protocolStatus);
|
||||||
|
}
|
||||||
|
|
||||||
|
EquipmentProtocolStatusData protocolStatusData = (EquipmentProtocolStatusData) protocolStatus.getDetails();
|
||||||
|
|
||||||
for (OpensyncAPInetState inetState : inetStateTables) {
|
for (OpensyncAPInetState inetState : inetStateTables) {
|
||||||
|
|
||||||
|
if (inetState.ifName != null && inetState.ifName.equals(defaultWanInterfaceName)) {
|
||||||
|
|
||||||
|
if (inetState.inetAddr != null) {
|
||||||
|
try {
|
||||||
|
protocolStatusData.setReportedIpV4Addr(Inet4Address.getByName(inetState.inetAddr));
|
||||||
|
protocolStatus.setDetails(protocolStatusData);
|
||||||
|
protocolStatus = statusServiceInterface.update(protocolStatus);
|
||||||
|
LOG.info("Updated IpV4Addr for AP {} to {} from Wifi_Inet_State change for if_name {}", apId,
|
||||||
|
((EquipmentProtocolStatusData) protocolStatus.getDetails()).getReportedIpV4Addr(), inetState.ifName);
|
||||||
|
LOG.debug("ProtocolStatus for AP {} updated to {}", apId, protocolStatus);
|
||||||
|
|
||||||
|
} catch (UnknownHostException e) {
|
||||||
|
LOG.error("Could not set IpV4Addr {} on AP {} due to UnknownHostException ", inetState.inetAddr,
|
||||||
|
apId, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if (inetState.getVlanId() > 1) {
|
if (inetState.getVlanId() > 1) {
|
||||||
|
|
||||||
if (!lanStatusData.getVlanStatusDataMap().containsKey(inetState.getVlanId())) {
|
if (!lanStatusData.getVlanStatusDataMap().containsKey(inetState.getVlanId())) {
|
||||||
@@ -1745,22 +1792,6 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
|
|
||||||
long locationId = ce.getLocationId();
|
long locationId = ce.getLocationId();
|
||||||
|
|
||||||
// "hwaddr":
|
|
||||||
// "inet_addr":
|
|
||||||
// "hostname":
|
|
||||||
// "fingerprint":
|
|
||||||
// "vendor_class":
|
|
||||||
// "lease_time":
|
|
||||||
// "subnet_mask":
|
|
||||||
// "gateway":
|
|
||||||
// "dhcp_server":
|
|
||||||
// "primary_dns":
|
|
||||||
// "secondary_dns":
|
|
||||||
// "db_status":
|
|
||||||
// "device_name":
|
|
||||||
// "device_type":
|
|
||||||
// "manuf_id":
|
|
||||||
|
|
||||||
if (rowUpdateOperation.equals(RowUpdateOperation.INSERT)) {
|
if (rowUpdateOperation.equals(RowUpdateOperation.INSERT)) {
|
||||||
|
|
||||||
List<ClientSession> clientSessionList = new ArrayList<>();
|
List<ClientSession> clientSessionList = new ArrayList<>();
|
||||||
@@ -1775,20 +1806,23 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
MacAddress clientMacAddress = new MacAddress(dhcpLeasedIps.get("hwaddr"));
|
MacAddress clientMacAddress = new MacAddress(dhcpLeasedIps.get("hwaddr"));
|
||||||
if (clientMacAddress.equals(equipmentServiceInterface.get(equipmentId).getBaseMacAddress())) {
|
if (clientMacAddress.equals(equipmentServiceInterface.get(equipmentId).getBaseMacAddress())) {
|
||||||
LOG.info("Not a client device {} ", dhcpLeasedIps);
|
LOG.info("Not a client device {} ", dhcpLeasedIps);
|
||||||
com.telecominfraproject.wlan.client.models.Client client = clientServiceInterface.getOrNull(customerId,
|
com.telecominfraproject.wlan.client.models.Client client = clientServiceInterface
|
||||||
clientMacAddress);
|
.getOrNull(customerId, clientMacAddress);
|
||||||
if (client != null) {
|
if (client != null) {
|
||||||
|
|
||||||
// In case somehow this equipment has accidentally been tagged as a client, remove
|
// In case somehow this equipment has accidentally been
|
||||||
|
// tagged as a client, remove
|
||||||
|
|
||||||
ClientSession clientSession = clientServiceInterface.getSessionOrNull(customerId, equipmentId, clientMacAddress);
|
ClientSession clientSession = clientServiceInterface.getSessionOrNull(customerId, equipmentId,
|
||||||
|
clientMacAddress);
|
||||||
|
|
||||||
if (clientSession != null) {
|
if (clientSession != null) {
|
||||||
LOG.info("Deleting invalid client session {}", clientServiceInterface.deleteSession(customerId, equipmentId, clientMacAddress));
|
LOG.info("Deleting invalid client session {}",
|
||||||
|
clientServiceInterface.deleteSession(customerId, equipmentId, clientMacAddress));
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG.info("Deleting invalid client {}", clientServiceInterface.delete(customerId, clientMacAddress));
|
LOG.info("Deleting invalid client {}",
|
||||||
|
clientServiceInterface.delete(customerId, clientMacAddress));
|
||||||
|
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
@@ -1878,6 +1912,13 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
LOG.info("Created Client {}.", client);
|
LOG.info("Created Client {}.", client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// we might have a session, update if required
|
||||||
|
ClientSession session = updateClientSession(customerId, equipmentId, locationId, dhcpLeasedIps,
|
||||||
|
clientMacAddress);
|
||||||
|
if (session != null) {
|
||||||
|
clientSessionList.add(session);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!clientSessionList.isEmpty()) {
|
if (!clientSessionList.isEmpty()) {
|
||||||
@@ -1905,20 +1946,23 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
if (clientMacAddress.equals(equipmentServiceInterface.get(equipmentId).getBaseMacAddress())) {
|
if (clientMacAddress.equals(equipmentServiceInterface.get(equipmentId).getBaseMacAddress())) {
|
||||||
|
|
||||||
LOG.info("Not a client device {} ", dhcpLeasedIps);
|
LOG.info("Not a client device {} ", dhcpLeasedIps);
|
||||||
com.telecominfraproject.wlan.client.models.Client client = clientServiceInterface.getOrNull(customerId,
|
com.telecominfraproject.wlan.client.models.Client client = clientServiceInterface
|
||||||
clientMacAddress);
|
.getOrNull(customerId, clientMacAddress);
|
||||||
if (client != null) {
|
if (client != null) {
|
||||||
|
|
||||||
// In case somehow this equipment has accidentally been tagged as a client, remove
|
// In case somehow this equipment has accidentally been
|
||||||
|
// tagged as a client, remove
|
||||||
|
|
||||||
ClientSession clientSession = clientServiceInterface.getSessionOrNull(customerId, equipmentId, clientMacAddress);
|
ClientSession clientSession = clientServiceInterface.getSessionOrNull(customerId, equipmentId,
|
||||||
|
clientMacAddress);
|
||||||
|
|
||||||
if (clientSession != null) {
|
if (clientSession != null) {
|
||||||
LOG.info("Deleting invalid client session {}", clientServiceInterface.deleteSession(customerId, equipmentId, clientMacAddress));
|
LOG.info("Deleting invalid client session {}",
|
||||||
|
clientServiceInterface.deleteSession(customerId, equipmentId, clientMacAddress));
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG.info("Deleting invalid client {}", clientServiceInterface.delete(customerId, clientMacAddress));
|
LOG.info("Deleting invalid client {}",
|
||||||
|
clientServiceInterface.delete(customerId, clientMacAddress));
|
||||||
|
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -132,7 +132,6 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void disconnected(OvsdbClient ovsdbClient) {
|
public void disconnected(OvsdbClient ovsdbClient) {
|
||||||
String remoteHost = ovsdbClient.getConnectionInfo().getRemoteAddress().getHostAddress();
|
String remoteHost = ovsdbClient.getConnectionInfo().getRemoteAddress().getHostAddress();
|
||||||
@@ -192,22 +191,16 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
|||||||
// connectedClients table
|
// connectedClients table
|
||||||
String apId = alterClientCnIfRequired(clientCn, connectNodeInfo);
|
String apId = alterClientCnIfRequired(clientCn, connectNodeInfo);
|
||||||
|
|
||||||
LOG.debug("Client connect for AP {}", apId);
|
LOG.debug("Client {} connect for AP {}", clientCn, apId);
|
||||||
|
|
||||||
OpensyncAPConfig opensyncAPConfig = extIntegrationInterface.getApConfig(apId);
|
|
||||||
|
|
||||||
// try {
|
|
||||||
// ovsdbDao.provisionBridgePortInterface(ovsdbClient);
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// LOG.warn("Could not provision Bridge->Port->Interface mapping.", e);
|
|
||||||
// }
|
|
||||||
ovsdbDao.removeAllStatsConfigs(ovsdbClient); // always
|
ovsdbDao.removeAllStatsConfigs(ovsdbClient); // always
|
||||||
ovsdbDao.removeAllSsids(ovsdbClient); // always
|
ovsdbDao.removeAllSsids(ovsdbClient); // always
|
||||||
ovsdbDao.removeWifiRrm(ovsdbClient);
|
ovsdbDao.removeWifiRrm(ovsdbClient);
|
||||||
|
|
||||||
|
OpensyncAPConfig opensyncAPConfig = extIntegrationInterface.getApConfig(apId);
|
||||||
|
|
||||||
if (opensyncAPConfig != null) {
|
if (opensyncAPConfig != null) {
|
||||||
ovsdbDao.configureWifiRadios(ovsdbClient, opensyncAPConfig);
|
ovsdbDao.configureWifiRadios(ovsdbClient, opensyncAPConfig);
|
||||||
ovsdbDao.configureInterfaces(ovsdbClient);
|
|
||||||
ovsdbDao.configureSsids(ovsdbClient, opensyncAPConfig);
|
ovsdbDao.configureSsids(ovsdbClient, opensyncAPConfig);
|
||||||
ovsdbDao.configureWifiRrm(ovsdbClient, opensyncAPConfig);
|
ovsdbDao.configureWifiRrm(ovsdbClient, opensyncAPConfig);
|
||||||
if (opensyncAPConfig.getHotspotConfig() != null) {
|
if (opensyncAPConfig.getHotspotConfig() != null) {
|
||||||
@@ -219,10 +212,13 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ovsdbDao.configureInterfaces(ovsdbClient);
|
||||||
|
|
||||||
if (ovsdbDao.getDeviceStatsReportingInterval(ovsdbClient) != collectionIntervalSecDeviceStats) {
|
if (ovsdbDao.getDeviceStatsReportingInterval(ovsdbClient) != collectionIntervalSecDeviceStats) {
|
||||||
ovsdbDao.updateDeviceStatsReportingInterval(ovsdbClient, collectionIntervalSecDeviceStats);
|
ovsdbDao.updateDeviceStatsReportingInterval(ovsdbClient, collectionIntervalSecDeviceStats);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LOG.debug("Client connect Done");
|
LOG.debug("Client connect Done");
|
||||||
return connectNodeInfo;
|
return connectNodeInfo;
|
||||||
}
|
}
|
||||||
@@ -271,12 +267,13 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
|||||||
ovsdbDao.removeAllStatsConfigs(ovsdbClient); // always
|
ovsdbDao.removeAllStatsConfigs(ovsdbClient); // always
|
||||||
|
|
||||||
ovsdbDao.configureWifiRadios(ovsdbClient, opensyncAPConfig);
|
ovsdbDao.configureWifiRadios(ovsdbClient, opensyncAPConfig);
|
||||||
ovsdbDao.configureInterfaces(ovsdbClient);
|
|
||||||
ovsdbDao.configureSsids(ovsdbClient, opensyncAPConfig);
|
ovsdbDao.configureSsids(ovsdbClient, opensyncAPConfig);
|
||||||
ovsdbDao.configureWifiRrm(ovsdbClient, opensyncAPConfig);
|
ovsdbDao.configureWifiRrm(ovsdbClient, opensyncAPConfig);
|
||||||
if (opensyncAPConfig.getHotspotConfig() != null) {
|
if (opensyncAPConfig.getHotspotConfig() != null) {
|
||||||
ovsdbDao.configureHotspots(ovsdbClient, opensyncAPConfig);
|
ovsdbDao.configureHotspots(ovsdbClient, opensyncAPConfig);
|
||||||
}
|
}
|
||||||
|
ovsdbDao.configureInterfaces(ovsdbClient);
|
||||||
|
|
||||||
ovsdbDao.configureStatsFromProfile(ovsdbClient, opensyncAPConfig);
|
ovsdbDao.configureStatsFromProfile(ovsdbClient, opensyncAPConfig);
|
||||||
if (ovsdbDao.getDeviceStatsReportingInterval(ovsdbClient) != collectionIntervalSecDeviceStats) {
|
if (ovsdbDao.getDeviceStatsReportingInterval(ovsdbClient) != collectionIntervalSecDeviceStats) {
|
||||||
ovsdbDao.updateDeviceStatsReportingInterval(ovsdbClient, collectionIntervalSecDeviceStats);
|
ovsdbDao.updateDeviceStatsReportingInterval(ovsdbClient, collectionIntervalSecDeviceStats);
|
||||||
@@ -360,7 +357,8 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
|||||||
|
|
||||||
CompletableFuture<TableUpdates> awCf = ovsdbClient.monitor(OvsdbDao.ovsdbName,
|
CompletableFuture<TableUpdates> awCf = ovsdbClient.monitor(OvsdbDao.ovsdbName,
|
||||||
OvsdbDao.dhcpLeasedIpDbTable + "_" + key,
|
OvsdbDao.dhcpLeasedIpDbTable + "_" + key,
|
||||||
new MonitorRequests(ImmutableMap.of(OvsdbDao.dhcpLeasedIpDbTable, new MonitorRequest(new MonitorSelect(true, true, true, true)))),
|
new MonitorRequests(ImmutableMap.of(OvsdbDao.dhcpLeasedIpDbTable,
|
||||||
|
new MonitorRequest(new MonitorSelect(true, true, true, true)))),
|
||||||
new MonitorCallback() {
|
new MonitorCallback() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -425,15 +423,12 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
awCf.join();
|
awCf.join();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void monitorCommandStateDbTable(OvsdbClient ovsdbClient, String key) throws OvsdbClientException {
|
private void monitorCommandStateDbTable(OvsdbClient ovsdbClient, String key) throws OvsdbClientException {
|
||||||
|
|
||||||
CompletableFuture<TableUpdates> csCf = ovsdbClient.monitor(OvsdbDao.ovsdbName,
|
CompletableFuture<TableUpdates> csCf = ovsdbClient.monitor(OvsdbDao.ovsdbName,
|
||||||
@@ -450,7 +445,6 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
|||||||
List<Map<String, String>> delete = new ArrayList<>();
|
List<Map<String, String>> delete = new ArrayList<>();
|
||||||
List<Map<String, String>> update = new ArrayList<>();
|
List<Map<String, String>> update = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
for (TableUpdate tableUpdate : tableUpdates.getTableUpdates().values()) {
|
for (TableUpdate tableUpdate : tableUpdates.getTableUpdates().values()) {
|
||||||
for (RowUpdate rowUpdate : tableUpdate.getRowUpdates().values()) {
|
for (RowUpdate rowUpdate : tableUpdate.getRowUpdates().values()) {
|
||||||
|
|
||||||
@@ -504,12 +498,10 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
csCf.join();
|
csCf.join();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void monitorAwlanNodeDbTable(OvsdbClient ovsdbClient, String key) throws OvsdbClientException {
|
private void monitorAwlanNodeDbTable(OvsdbClient ovsdbClient, String key) throws OvsdbClientException {
|
||||||
@@ -564,7 +556,6 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// now address the update/add
|
// now address the update/add
|
||||||
extIntegrationInterface.wifiAssociatedClientsDbTableUpdate(associatedClients, key);
|
extIntegrationInterface.wifiAssociatedClientsDbTableUpdate(associatedClients, key);
|
||||||
|
|
||||||
@@ -574,12 +565,11 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
|||||||
|
|
||||||
acCf.join();
|
acCf.join();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void monitorWifiInetStateDbTable(OvsdbClient ovsdbClient, String key) throws OvsdbClientException {
|
private void monitorWifiInetStateDbTable(OvsdbClient ovsdbClient, String key) throws OvsdbClientException {
|
||||||
CompletableFuture<TableUpdates> isCf = ovsdbClient
|
CompletableFuture<TableUpdates> isCf = ovsdbClient.monitor(OvsdbDao.ovsdbName,
|
||||||
.monitor(OvsdbDao.ovsdbName, OvsdbDao.wifiInetStateDbTable + "_" + key,
|
OvsdbDao.wifiInetStateDbTable + "_" + key,
|
||||||
new MonitorRequests(ImmutableMap.of(OvsdbDao.wifiInetStateDbTable,
|
new MonitorRequests(ImmutableMap.of(OvsdbDao.wifiInetStateDbTable,
|
||||||
new MonitorRequest(new MonitorSelect(true, true, true, true)))),
|
new MonitorRequest(new MonitorSelect(true, true, true, true)))),
|
||||||
new MonitorCallback() {
|
new MonitorCallback() {
|
||||||
@@ -598,17 +588,16 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
|||||||
for (RowUpdate rowUpdate : tableUpdate.getRowUpdates().values()) {
|
for (RowUpdate rowUpdate : tableUpdate.getRowUpdates().values()) {
|
||||||
|
|
||||||
if (rowUpdate.getNew() == null) {
|
if (rowUpdate.getNew() == null) {
|
||||||
inetStateDelete.addAll(ovsdbDao
|
inetStateDelete.addAll(
|
||||||
.getOpensyncApInetStateForRowUpdate(rowUpdate, key, ovsdbClient));
|
ovsdbDao.getOpensyncApInetStateForRowUpdate(rowUpdate, key, ovsdbClient));
|
||||||
} else {
|
} else {
|
||||||
inetStateInsertOrUpdate.addAll(ovsdbDao
|
inetStateInsertOrUpdate.addAll(
|
||||||
.getOpensyncApInetStateForRowUpdate(rowUpdate, key, ovsdbClient));
|
ovsdbDao.getOpensyncApInetStateForRowUpdate(rowUpdate, key, ovsdbClient));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// delete first
|
// delete first
|
||||||
extIntegrationInterface.wifiInetStateDbTableUpdate(inetStateDelete, key);
|
extIntegrationInterface.wifiInetStateDbTableUpdate(inetStateDelete, key);
|
||||||
|
|
||||||
@@ -686,7 +675,6 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -841,7 +829,6 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
|||||||
return "failed to trigger a factory reset of AP " + apId;
|
return "failed to trigger a factory reset of AP " + apId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String alterClientCnIfRequired(String clientCn, ConnectNodeInfo connectNodeInfo) {
|
public String alterClientCnIfRequired(String clientCn, ConnectNodeInfo connectNodeInfo) {
|
||||||
|
|||||||
@@ -2049,16 +2049,17 @@ public class OvsdbDao {
|
|||||||
|
|
||||||
public void configureInterfaces(OvsdbClient ovsdbClient) {
|
public void configureInterfaces(OvsdbClient ovsdbClient) {
|
||||||
|
|
||||||
configureWanInterfaces(ovsdbClient);
|
configureWanInterfacesForDhcpSniffing(ovsdbClient);
|
||||||
configureLanInterfaces(ovsdbClient);
|
configureLanInterfacesforDhcpSniffing(ovsdbClient);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void configureLanInterfaces(OvsdbClient ovsdbClient) {
|
private void configureLanInterfacesforDhcpSniffing(OvsdbClient ovsdbClient) {
|
||||||
List<Operation> operations = new ArrayList<>();
|
List<Operation> operations = new ArrayList<>();
|
||||||
Map<String, Value> updateColumns = new HashMap<>();
|
Map<String, Value> updateColumns = new HashMap<>();
|
||||||
List<Condition> conditions = new ArrayList<>();
|
List<Condition> conditions = new ArrayList<>();
|
||||||
conditions.add(new Condition("if_name", Function.EQUALS, new Atom<>(defaultLanInterfaceName)));
|
conditions.add(new Condition("if_name", Function.NOT_EQUALS, new Atom<>(defaultWanInterfaceName)));
|
||||||
|
conditions.add(new Condition("parent_ifname", Function.NOT_EQUALS, new Atom<>(defaultWanInterfaceName)));
|
||||||
updateColumns.put("dhcp_sniff", new Atom<>(true));
|
updateColumns.put("dhcp_sniff", new Atom<>(true));
|
||||||
|
|
||||||
Row row = new Row(updateColumns);
|
Row row = new Row(updateColumns);
|
||||||
@@ -2079,11 +2080,13 @@ public class OvsdbDao {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void configureWanInterfaces(OvsdbClient ovsdbClient) {
|
private void configureWanInterfacesForDhcpSniffing(OvsdbClient ovsdbClient) {
|
||||||
List<Operation> operations = new ArrayList<>();
|
List<Operation> operations = new ArrayList<>();
|
||||||
Map<String, Value> updateColumns = new HashMap<>();
|
Map<String, Value> updateColumns = new HashMap<>();
|
||||||
List<Condition> conditions = new ArrayList<>();
|
List<Condition> conditions = new ArrayList<>();
|
||||||
conditions.add(new Condition("if_name", Function.EQUALS, new Atom<>(defaultWanInterfaceName)));
|
conditions.add(new Condition("if_name", Function.NOT_EQUALS, new Atom<>(defaultLanInterfaceName)));
|
||||||
|
conditions.add(new Condition("parent_ifname", Function.NOT_EQUALS, new Atom<>(defaultLanInterfaceName)));
|
||||||
|
|
||||||
updateColumns.put("dhcp_sniff", new Atom<>(true));
|
updateColumns.put("dhcp_sniff", new Atom<>(true));
|
||||||
|
|
||||||
Row row = new Row(updateColumns);
|
Row row = new Row(updateColumns);
|
||||||
@@ -3359,6 +3362,7 @@ public class OvsdbDao {
|
|||||||
tableColumns.put("network", new Atom<>(true));
|
tableColumns.put("network", new Atom<>(true));
|
||||||
tableColumns.put("if_name", new Atom<>(ifName));
|
tableColumns.put("if_name", new Atom<>(ifName));
|
||||||
tableColumns.put("NAT", new Atom<>(isNat));
|
tableColumns.put("NAT", new Atom<>(isNat));
|
||||||
|
tableColumns.put("dhcp_sniff", new Atom<>(true));
|
||||||
|
|
||||||
Row row = new Row(tableColumns);
|
Row row = new Row(tableColumns);
|
||||||
if (isUpdate) {
|
if (isUpdate) {
|
||||||
|
|||||||
Reference in New Issue
Block a user