mirror of
https://github.com/nfstream/nfstream.git
synced 2026-05-14 16:12:17 +00:00
Minor fixes.
This commit is contained in:
parent
800bd01cd5
commit
acaa3ad8e2
10 changed files with 8 additions and 43 deletions
|
|
@ -22,7 +22,7 @@ import sys
|
|||
|
||||
|
||||
path = sys.argv[1]
|
||||
flow_streamer = NFStreamer(source=path)
|
||||
flow_streamer = NFStreamer(source=path, idle_timeout=5)
|
||||
try:
|
||||
for flow in flow_streamer:
|
||||
print(flow)
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ If not, see <http://www.gnu.org/licenses/>.
|
|||
"""
|
||||
|
||||
|
||||
from nfstream.streamer import NFStreamer
|
||||
from nfstream.plugin import NFPlugin
|
||||
from .streamer import NFStreamer
|
||||
from .plugin import NFPlugin
|
||||
|
||||
"""
|
||||
streamer module is the core module of nfstream package.
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ class NFCache(object):
|
|||
self.active_timeout = 0
|
||||
for root_idx in range(nroots): # init root
|
||||
self._roots.append(LRU(idle_timeout=self.idle_timeout))
|
||||
self.idle_scan_period = 0.01
|
||||
self.idle_scan_period = 0.001
|
||||
self.idle_scanning = True
|
||||
self.current_tick = 0
|
||||
self.current_root_idx = 0 # current updating to avoid collision
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
cc repository
|
||||
-------------
|
||||
This repository contains headers C definitions for ABI cffi bindings.
|
||||
|
||||
Currently:
|
||||
|
||||
* libpcap_cc.py: a portable C/C++ library for network traffic capture.
|
||||
* libndpi_cc.py: Open and Extensible LGPLv3 Deep Packet Inspection Library.
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
file: __init__.py
|
||||
This file is part of nfstream.
|
||||
|
||||
Copyright (C) 2019 - Zied Aouini <aouinizied@gmail.com>
|
||||
|
||||
nfstream is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
nfstream is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with nfstream.
|
||||
If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
||||
"""
|
||||
cc module is c code definitions module for external libraries.
|
||||
"""
|
||||
|
||||
__author__ = """Zied Aouini"""
|
||||
__email__ = 'aouinizied@gmail.com'
|
||||
__version__ = '1.2.1'
|
||||
|
|
@ -14,9 +14,9 @@ You should have received a copy of the GNU General Public License along with nfs
|
|||
If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
||||
from .cc.libndpi_cc import cc, cc_ndpi_network_headers, cc_ndpi_id_struct, cc_ndpi_flow_tcp_struct
|
||||
from .cc.libndpi_cc import cc_ndpi_flow_udp_struct, cc_ndpi_int_one_line_struct, cc_ndpi_packet_struct
|
||||
from .cc.libndpi_cc import cc_ndpi_packet_struct_stack, cc_ndpi_apis
|
||||
from .libndpi_cc import cc, cc_ndpi_network_headers, cc_ndpi_id_struct, cc_ndpi_flow_tcp_struct
|
||||
from .libndpi_cc import cc_ndpi_flow_udp_struct, cc_ndpi_int_one_line_struct, cc_ndpi_packet_struct
|
||||
from .libndpi_cc import cc_ndpi_packet_struct_stack, cc_ndpi_apis
|
||||
from os.path import abspath, dirname
|
||||
import cffi
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ from enum import Enum, IntEnum
|
|||
from threading import Lock
|
||||
from select import select
|
||||
from cffi import FFI
|
||||
from .cc.libpcap_cc import cc, cc_packed
|
||||
from .libpcap_cc import cc, cc_packed
|
||||
import os.path
|
||||
import sys
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,6 @@ class NFStreamer(object):
|
|||
def __iter__(self):
|
||||
try:
|
||||
self._producer.start()
|
||||
tm.sleep(0.1)
|
||||
self._consumer.connect('ipc:///tmp/nfstream.pipe')
|
||||
while True:
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue