diff --git a/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/config/NetworkConfig.java b/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/config/NetworkConfig.java index d1eea845..e237083e 100644 --- a/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/config/NetworkConfig.java +++ b/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/config/NetworkConfig.java @@ -15,7 +15,7 @@ @Component public class NetworkConfig { // Getters and setters - private final Map interfaceInfo; //k: name, v: ssid + private final Map ssidInfo; //k: name, v: ssid private final Monitor monitor; private final List mdnsList; private final List arpList; @@ -29,9 +29,8 @@ public NetworkConfig(@Value("${spring.profiles.active:default}") String profile, Map map = mapper.readValue(resource.getFile(), Map.class); //interface_info - List> interfaceInfoList = (List>) map.get( - "interface_info"); - this.interfaceInfo = interfaceInfoList.stream() + List> interfaceInfoList = (List>) map.get("ssid_info"); + this.ssidInfo = interfaceInfoList.stream() .collect(Collectors.toMap(info-> info.get("name"), info->info.get("ssid"))); //monitor @@ -48,14 +47,14 @@ public NetworkConfig(@Value("${spring.profiles.active:default}") String profile, Map mdnsMap = (Map) managedMap.get("mdns"); String mdnsCommand = (String) mdnsMap.get("command"); this.mdnsList = ((List) mdnsMap.get("interfaces")).stream() - .map(interfaceName->new Managed(interfaceName, interfaceInfo.get(interfaceName), generateCommand(mdnsCommand, interfaceName))) + .map(interfaceName->new Managed(interfaceName, ssidInfo.get(interfaceName), generateCommand(mdnsCommand, interfaceName))) .toList(); // arp Map arpMap = (Map) managedMap.get("arp"); String arpCommand = (String) arpMap.get("command"); this.arpList = ((List) arpMap.get("interfaces")).stream() - .map(interfaceName->new Managed(interfaceName, interfaceInfo.get(interfaceName), generateCommand(arpCommand, interfaceName))) + .map(interfaceName->new Managed(interfaceName, ssidInfo.get(interfaceName), generateCommand(arpCommand, interfaceName))) .toList(); } catch (IOException e) { diff --git a/modules/infrastructure/log-writer/src/main/resources/network-local.json b/modules/infrastructure/log-writer/src/main/resources/network-local.json index d4eaf62f..fe08c386 100644 --- a/modules/infrastructure/log-writer/src/main/resources/network-local.json +++ b/modules/infrastructure/log-writer/src/main/resources/network-local.json @@ -1,5 +1,5 @@ { - "interface_info": [ + "ssid_info": [ { "name": "en0", "ssid": "*" diff --git a/modules/infrastructure/log-writer/src/main/resources/network-prod.json b/modules/infrastructure/log-writer/src/main/resources/network-prod.json index d4eaf62f..01d606d3 100644 --- a/modules/infrastructure/log-writer/src/main/resources/network-prod.json +++ b/modules/infrastructure/log-writer/src/main/resources/network-prod.json @@ -1,24 +1,32 @@ { - "interface_info": [ + "ssid_info": [ { - "name": "en0", - "ssid": "*" + "name": "default_wlan", + "ssid": "JNU" + }, + { + "name": "usb_wlan0", + "ssid": "eduroam" + }, + { + "name": "usb_wlan1", + "ssid": "ECONO_5G" } ], "monitor": { "command": "tshark -l -i {{interface}} -T fields -e wlan.sa -e eth.src", - "interface": "en0" + "interface": "monitor_wlan" }, "managed": { "mdns": { "command": "sudo -S tshark -l -i {{interface}} -Y mdns -T fields -e eth.src -e ip.src -e dns.ptr.domain_name", - "interfaces": ["en0"] + "interfaces": ["default_wlan", "usb_wlan0"] }, "arp": { "command": "sudo -S arp-scan --interface={{interface}} --localnet", - "interfaces": ["en0"] + "interfaces": ["usb_wlan1"] } } } \ No newline at end of file