From owner-freebsd-net@freebsd.org Fri Jan 8 18:46:07 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 7491EA67980 for ; Fri, 8 Jan 2016 18:46:07 +0000 (UTC) (envelope-from rizzo.unipi@gmail.com) Received: from mail-lf0-x22f.google.com (mail-lf0-x22f.google.com [IPv6:2a00:1450:4010:c07::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 027461EAF for ; Fri, 8 Jan 2016 18:46:07 +0000 (UTC) (envelope-from rizzo.unipi@gmail.com) Received: by mail-lf0-x22f.google.com with SMTP id c192so180691127lfe.2 for ; Fri, 08 Jan 2016 10:46:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=GDP7tbl3uYz5n9yhOht2A6qMvwXxErauT4jiUYh1FKc=; b=fs+V5FFoDXgVCMl9sptCf2zMyYEJkZQxdXiQ1fW5PpCQsjetfDZ9xh3ehcz+1yPlSX LLPYKfKYQzxmPR4W1oImbWTq+EL+I1S4VtCcLwzZVWWmPY/Ql9F0Hxm8KtzY6ENVt8gm rlxbyzXT81XxKjAnnieH1/u0ZfP1Fbhx7rxWiUeU8DnRGOB9cEmFygpHU+3T8oF1P1dw tw/ansG6K5xyHFCNrIvjYCtFHmMO8B3vqaEbjZ7Eatk68OvafxIyYFoNn7gPv9LtPAjx NOga/ZzpKPq3WLKPWRGtQTPba07OC6FTchKTB8L0J93GjyQZPMzIThKJiXjtbIaPpneX TnHg== MIME-Version: 1.0 X-Received: by 10.25.158.136 with SMTP id h130mr29859237lfe.136.1452278763900; Fri, 08 Jan 2016 10:46:03 -0800 (PST) Sender: rizzo.unipi@gmail.com Received: by 10.114.13.33 with HTTP; Fri, 8 Jan 2016 10:46:03 -0800 (PST) In-Reply-To: References: Date: Fri, 8 Jan 2016 10:46:03 -0800 X-Google-Sender-Auth: 75mlTHSCPxZC8wn-BXhIff91KEg Message-ID: Subject: Re: Netmap software interface mirror / netmap monitor From: Luigi Rizzo To: Pavel Odintsov Cc: "freebsd-net@freebsd.org" , Giuseppe Lettieri Content-Type: text/plain; charset=UTF-8 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, 08 Jan 2016 18:46:07 -0000 On Fri, Jan 8, 2016 at 10:35 AM, Pavel Odintsov wrote: > Hello, Dear Community! > > I'm working with netmap and my application uses netmap for traffic > capture. It's works really well. > > But I need some way to feed same data from physical interface to two > or more applications. > > I have found this code > https://github.com/luigirizzo/netmap/blob/master/sys/dev/netmap/netmap_monitor.c > but could not find any docs about it. > > Could you help me with examples and use cases? look at netmap_user.h, where it explains how to open a port in monitor mode. Essentially, once you have an active netmap port say netmap:ix0, you can sniff the traffic opening additional netmap ports named netmap:ix0/r (for rx traffic) or netmap:ix0/t (for tx) or even netmap:ix0/rt (for both tx and rx) Giuseppe (in Cc) can give more details cheers luigi