From owner-freebsd-net@freebsd.org Fri Jan 1 11:42:56 2016 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5126A54177 for ; Fri, 1 Jan 2016 11:42:56 +0000 (UTC) (envelope-from h.rezaee@ideatech.io) Received: from mail.ideatech.io (mail.ideatech.io [104.131.120.36]) by mx1.freebsd.org (Postfix) with ESMTP id C19551118 for ; Fri, 1 Jan 2016 11:42:56 +0000 (UTC) (envelope-from h.rezaee@ideatech.io) Received: from hadi-pc.my.domain (unknown [83.121.0.83]) by mail.ideatech.io (Postfix) with ESMTPSA id 2AD21112815 for ; Fri, 1 Jan 2016 06:33:47 -0500 (EST) To: freebsd-net@freebsd.org From: Hadi Rezaee Subject: pcap and processing packets X-Enigmail-Draft-Status: N1110 Message-ID: <56866415.6080303@ideatech.io> Date: Fri, 1 Jan 2016 15:03:41 +0330 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jan 2016 11:42:57 -0000 Hello everybody, I'm about writing a packet filter using libpcap .. I just have two theoretical question that I hope to get them answered here. 1) Let say, I've initialed pcap on my ethernet nic using "pcap_open_live" (in non-blocking-mode) and "pcap_dispatch". lets assume that the user callback function (for dispatch) is implemented in not optimal manner that takes for example 5 seconds to finish processing each packet. I want to know what will happen to ongoing incoming packets ?! are they getting buffered or queued somewhere in OS ? or they just get simply dropped ? 2) When i initial pcap with pcap_open_live, and I set "to_ms" (read-timeout) parameter to zero .. I cannot catch a thing ! it has to be more than zero to work .. Is it normal behavior ? Thanks, -- Hadi Rezaee +98 912 1403571 IdeaTech.io