dhcpcanon/dhcpcapfsm.py
def reset(self, iface=None, client_mac=None, xid=None, scriptfile=None):
        """Reset object attributes when state is INIT."""
        logger.debug('Reseting attributes.')
        if iface is None:
            iface = conf.iface
        if client_mac is None:
            # scapy for python 3 returns byte, not tuple
            tempmac = get_if_raw_hwaddr(iface)
            if isinstance(tempmac, tuple) and len(tempmac) == 2:
                mac = tempmac[1]
            else:
                mac = tempmac
            client_mac = str2mac(mac)
        self.client = DHCPCAP(iface=iface, client_mac=client_mac, xid=xid)
        if scriptfile is not None:
            self.script = ClientScript(scriptfile)
        else:
            self.script = None
        self.time_sent_request = None
        self.discover_attempts = 0
        self.request_attempts = 0
        self.current_state = STATE_PREINIT
        self.offers = list()
def reset(self, iface=None, client_mac=None, xid=None, scriptfile=None):
        logger.debug('Reseting attributes.')
        if iface is None:
            iface = conf.iface
        if client_mac is None:
            # scapy for python 3 returns byte, not tuple
            tempmac = get_if_raw_hwaddr(iface)
            if isinstance(tempmac, tuple) and len(tempmac) == 2:
                mac = tempmac[1]
            else:
                mac = tempmac
            client_mac = str2mac(mac)
        self.client = DHCPCAP(iface=iface, client_mac=client_mac, xid=xid)
        if scriptfile is not None:
            self.script = ClientScript(scriptfile)
        else:
            self.script = None
        self.time_sent_request = None
        self.discover_attempts = 0
        self.request_attempts = 0
        self.current_state = STATE_PREINIT
        self.offers = list()
def reset ( self , iface = None , client_mac = None , xid = None , scriptfile = None ) : logger . debug ( 'Reseting attributes.' ) if iface is None : iface = conf . iface if client_mac is None : # scapy for python 3 returns byte, not tuple tempmac = get_if_raw_hwaddr ( iface ) if isinstance ( tempmac , tuple ) and len ( tempmac ) == 2 : mac = tempmac [ 1 ] else : mac = tempmac client_mac = str2mac ( mac ) self . client = DHCPCAP ( iface = iface , client_mac = client_mac , xid = xid ) if scriptfile is not None : self . script = ClientScript ( scriptfile ) else : self . script = None self . time_sent_request = None self . discover_attempts = 0 self . request_attempts = 0 self . current_state = STATE_PREINIT self . offers = list ( )
Reset object attributes when state is INIT.
Reset object attributes when state is INIT .