(self, dnetdict)
Update info about network interface according to given dnet dictionary
Update info about network interface according to given dnet dictionary
Update info about network interface according to given dnet dictionary
def update(self, dnetdict):
        """Update info about network interface according to given dnet dictionary"""
        self.name = dnetdict["name"]
        # Other attributes are optional
        try:
            self.ip = socket.inet_ntoa(dnetdict["addr"].ip)
        except (KeyError, AttributeError, NameError):
            pass
        try:
            self.mac = dnetdict["link_addr"]
        except KeyError:
            pass
        self._update_pcapdata()
def update ( self , dnetdict ) : self . name = dnetdict [ "name" ] # Other attributes are optional try : self . ip = socket . inet_ntoa ( dnetdict [ "addr" ] . ip ) except ( KeyError , AttributeError , NameError ) : pass try : self . mac = dnetdict [ "link_addr" ] except KeyError : pass self . _update_pcapdata ( )