def __init__()

in zktraffic/base/sniffer.py [0:0]


  def __init__(self,
      iface="eth0",
      writes_only=False,
      debug=False):
    """
      if client_port is 0 we sniff all clients
      if zookeeper_port is changed later on you must call update_filter()
    """
    self.iface = iface
    self.writes_only = writes_only
    self.debug = debug
    self.client_port = 0
    self.track_replies = False
    self.max_queued_requests = 10000
    self.zookeeper_port = DEFAULT_PORT
    self.excluded_opcodes = set()
    self.is_loopback = iface in ["lo", "lo0"]
    self.read_timeout_ms = 0
    self.dump_bad_packet = False
    self.sampling = 1.0  # percentage of packets to inspect [0, 1]

    # These are set after initialization, and require `update_filter` to be called
    self.included_ips = []
    self.excluded_ips = []

    self.update_filter()
    self.exclude_pings()