]> xenbits.xensource.com Git - xen-guest-agent.git/commitdiff
pnet: reword NetworkView as AddressesState
authorYann Dirson <yann.dirson@vates.fr>
Thu, 23 Nov 2023 10:36:20 +0000 (11:36 +0100)
committerYann Dirson <yann.dirson@vates.fr>
Fri, 8 Dec 2023 09:59:46 +0000 (10:59 +0100)
Prepares renaming of "cache" member.

Signed-off-by: Yann Dirson <yann.dirson@vates.fr>
src/collector_net_pnet.rs

index cf8dc3b430cd8c921fae310bfea176464530721f..476a80142743edb02226cd4d1fbc2f9ef69acdc1 100644 (file)
@@ -26,14 +26,14 @@ impl InterfaceInfo {
     }
 }
 
-type NetworkView = HashMap<u32, InterfaceInfo>;
+type AddressesState = HashMap<u32, InterfaceInfo>;
 pub struct NetworkSource {
-    cache: NetworkView,
+    cache: AddressesState,
 }
 
 impl NetworkSource {
     pub fn new() -> io::Result<NetworkSource> {
-        Ok(NetworkSource {cache: NetworkView::new()})
+        Ok(NetworkSource {cache: AddressesState::new()})
     }
 
     pub async fn collect_current(&mut self) -> Result<Vec<NetEvent>, Box<dyn Error>> {
@@ -57,7 +57,7 @@ impl NetworkSource {
         let network_interfaces = pnet_datalink::interfaces();
 
         // get a full view of interfaces, diffable with the cache
-        let mut network_view: NetworkView = NetworkView::new();
+        let mut network_view = AddressesState::new();
         for iface in network_interfaces.iter() {
             // KLUDGE: drop ":alias" suffix for Linux interface aliases
             let name = iface.name.split(":").next().unwrap_or(&iface.name);