pub fn add_port(&mut self, mac: MacAddr, ip: IpAddr, port: u16) {
        let key = (mac, ip);
        
        if !self.hosts.contains_key(&key) {
            self.hosts.insert(key, HostInfo::new(mac, ip, 0));
        }
        
        if let Some(host) = self.hosts.get_mut(&key) {
            host.add_port(port);
        }
    }
/// Add a given port into the corresponding host info. The host info is 
/// created if it is not already in the table.
Add a given port into the corresponding host info. The host info is
created if it is not already in the table.
Add a given port into the corresponding host info . The host info is created if it is not already in the table .
pub fn add_port(&mut self, mac: MacAddr, ip: IpAddr, port: u16) {
        let key = (mac, ip);
        if !self.hosts.contains_key(&key) {
            self.hosts.insert(key, HostInfo::new(mac, ip, 0));
        }
        if let Some(host) = self.hosts.get_mut(&key) {
            host.add_port(port);
        }
    }
pub fn add_port ( & mut self , mac : MacAddr , ip : IpAddr , port : u16 ) { let key = ( mac , ip ) ; if ! self . hosts . contains_key ( & key ) { self . hosts . insert ( key , HostInfo :: new ( mac , ip , 0 ) ) ; } if let Some ( host ) = self . hosts . get_mut ( & key ) { host . add_port ( port ) ; } }
Add a given port into the corresponding host info.
Add a given port into the corresponding host info .
&mut self
mac
MacAddr
ip
IpAddr
port
u16
&mut self
mac
MacAddr
ip
IpAddr
port
u16