From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Fedin Subject: Re: [PATCH v2 4/5] lib/librte_eal: add tcpdump support in primary process Date: Wed, 17 Feb 2016 12:57:39 +0300 Message-ID: <012101d16969$a38c2b90$eaa482b0$@samsung.com> References: <1455289045-25915-1-git-send-email-reshma.pattan@intel.com> <1455289045-25915-5-git-send-email-reshma.pattan@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: 'Reshma Pattan' , dev@dpdk.org Return-path: Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 97C4FC31C for ; Wed, 17 Feb 2016 10:57:42 +0100 (CET) Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O2O004JCRO5F360@mailout1.w1.samsung.com> for dev@dpdk.org; Wed, 17 Feb 2016 09:57:41 +0000 (GMT) In-reply-to: <1455289045-25915-5-git-send-email-reshma.pattan@intel.com> Content-language: ru List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hello! > +static int > +compare_filter(struct rte_mbuf *pkt) > +{ > + struct ipv4_hdr *pkt_hdr = rte_pktmbuf_mtod_offset(pkt, struct ipv4_hdr *, > + sizeof(struct ether_hdr)); > + if (pkt_hdr->src_addr != src_ip_filter) > + return -1; > + > + return 0; > +} Some critics to this... What if i want to capture packets coming from more than one host? What if i want to capture all packets? What if it's not IPv4 at all? May be this function should always return 0 if src_ip_filter == 0? This would at least be a quick way to disable filtering. Kind regards, Pavel Fedin Senior Engineer Samsung Electronics Research center Russia