def __init__(self, device_name, snap_length=65536, promiscuous=1, timeout=1000):
        """
        :param device_name: the name of the device to open on context enter
        :param snap_length: specifies the snapshot length to be set on the handle.
        :param promiscuous:  specifies if the interface is to be put into promiscuous mode(0 or 1).
        :param timeout: specifies the read timeout in milliseconds.
        """
        self._handle = None
        self._name = device_name.encode('utf-8')
        self._snap_length = snap_length
        self._promiscuous = promiscuous
        self._timeout = timeout
        self._err_buffer = ctypes.create_string_buffer(wtypes.PCAP_ERRBUF_SIZE)
        self._callback = None
        self._callback_wrapper = self.HANDLER_SIGNATURE(self.packet_handler)
def __init__ ( self , device_name , snap_length = 65536 , promiscuous = 1 , timeout = 1000 ) : self . _handle = None self . _name = device_name . encode ( 'utf-8' ) self . _snap_length = snap_length self . _promiscuous = promiscuous self . _timeout = timeout self . _err_buffer = ctypes . create_string_buffer ( wtypes . PCAP_ERRBUF_SIZE ) self . _callback = None self . _callback_wrapper = self . HANDLER_SIGNATURE ( self . packet_handler )
:param device_name: the name of the device to open on context enter
        :param snap_length: specifies the snapshot length to be set on the handle.
        :param promiscuous:  specifies if the interface is to be put into promiscuous mode(0 or 1).
        :param timeout: specifies the read timeout in milliseconds.