From patchwork Wed Feb 10 02:00:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ken-ichirou MATSUZAWA X-Patchwork-Id: 581280 X-Patchwork-Delegate: regit@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 4F81614031B for ; Wed, 10 Feb 2016 13:01:04 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=g1aSudrD; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756219AbcBJCBD (ORCPT ); Tue, 9 Feb 2016 21:01:03 -0500 Received: from mail-pa0-f68.google.com ([209.85.220.68]:35654 "EHLO mail-pa0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756203AbcBJCBB (ORCPT ); Tue, 9 Feb 2016 21:01:01 -0500 Received: by mail-pa0-f68.google.com with SMTP id fl4so240587pad.2 for ; Tue, 09 Feb 2016 18:01:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=8PlCaLF2d1CqphFncBk4fVq629+cMessQJ5YoL9XVzo=; b=g1aSudrDkgl21esCRVWp6ML3C0m43VNhU8UZ/VjH5J4js0TfLzyxFV10SpxvaqwI7F oERZXL9jdxUHYyE8p90WtA4KBEKqKc+iw3d6SjbWoLwYDWinO/xtZYVHhoG6WFfP1jE8 eIv/gn5YRnNUhwEvYN5+Oc6t0d5IRO3LBKWb4P9KTPCVAWwWxKjVVCgV3rI2NctNWbAU JhmtoM7CycpOZ5Rp8ZjGod8eJ2IDZVwC437Da8LDsLe+eOWP/8CFTnLmDOtO+6qIVdqS czUXHQY1SxmuYQZxk4qhCj+vYtZ7A7X7bBD1ATL4aXWhRzUGW3cmlmbMTljIJSgjsPkd uFOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=8PlCaLF2d1CqphFncBk4fVq629+cMessQJ5YoL9XVzo=; b=S3koYzI7OgzWcS1qmajDjwwEf7BG+JIFRsp8+bUgkEPYrZJCz76rY2HjbwzSTzxKmA yEImGeWPvviX1qoDQ0tSlCcaeeTqNDMyV/iUPE/f4CdL5a6Q30zz5J8CLo03scdPVigy btIo0V5Eis5afwsamC3BU5LJYjW4TR2L9rDLWYpWW7bd8FDNtnQ2mWSotaE9Crad+VwU iIbYqI7hGWdXGTFb8tKeBXgk9Llj4UCgqEaqDlwe16PXQbEdcnE+4jn1WG601Zobuzoz QcwhnhPQLM3niN2UTfep8hUSJ95j+2KA8A5FuPY4xTOwHgIoHc3cTmIuaFqvOd0yZ9wR zWBg== X-Gm-Message-State: AG10YOQvyQr5gpsyqDEg8itaavNMc2S3bXbOT6sWoJLNSbDJK2tALn/PpVSImXueGiEU1w== X-Received: by 10.66.250.165 with SMTP id zd5mr53844085pac.111.1455069661601; Tue, 09 Feb 2016 18:01:01 -0800 (PST) Received: from gmail.com (softbank220009032004.bbtec.net. [220.9.32.4]) by smtp.gmail.com with ESMTPSA id e1sm699611pas.1.2016.02.09.18.01.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Feb 2016 18:01:01 -0800 (PST) Date: Wed, 10 Feb 2016 11:00:57 +0900 From: Ken-ichirou MATSUZAWA To: Eric Leblond Cc: Netfilter Devel Subject: [PATCH ulogd 3/7] nfct/ipfix: introduce NAT entries Message-ID: <20160210020057.GD17470@gmail.com> References: <20160206104249.GA19349@gmail.com> <20160210015358.GA17470@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160210015358.GA17470@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Signed-off-by: Ken-ichirou MATSUZAWA --- include/ulogd/ipfix_protocol.h | 10 ++++++++++ input/flow/ulogd_inpflow_NFCT.c | 17 ++++++++--------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/include/ulogd/ipfix_protocol.h b/include/ulogd/ipfix_protocol.h index 330f0ea..23fa440 100644 --- a/include/ulogd/ipfix_protocol.h +++ b/include/ulogd/ipfix_protocol.h @@ -219,6 +219,16 @@ enum { /* reserved */ IPFIX_headerLengthIPv4 = 213, IPFIX_mplsPayloadLength = 214, + + /* select usefuls from: + * http://www.iana.org/assignments/ipfix/ipfix.txt */ + IPFIX_postNATSourceIPv4Address = 225, + IPFIX_postNATDestinationIPv4Address = 226, + IPFIX_postNAPTSourceTransportPort = 227, + IPFIX_postNAPTDestinationTransportPort = 228, + IPFIX_firewallEvent = 233, + IPFIX_postNATSourceIPv6Address = 281, + IPFIX_postNATDestinationIPv6Address = 282, }; /* Information elements of the netfilter vendor id */ diff --git a/input/flow/ulogd_inpflow_NFCT.c b/input/flow/ulogd_inpflow_NFCT.c index 0b3b339..8f9492a 100644 --- a/input/flow/ulogd_inpflow_NFCT.c +++ b/input/flow/ulogd_inpflow_NFCT.c @@ -265,7 +265,7 @@ static struct ulogd_key nfct_okeys[] = { .name = "reply.ip.saddr", .ipfix = { .vendor = IPFIX_VENDOR_IETF, - .field_id = IPFIX_sourceIPv4Address, + .field_id = IPFIX_postNATSourceIPv4Address, }, }, { @@ -274,7 +274,7 @@ static struct ulogd_key nfct_okeys[] = { .name = "reply.ip.daddr", .ipfix = { .vendor = IPFIX_VENDOR_IETF, - .field_id = IPFIX_destinationIPv4Address, + .field_id = IPFIX_postNATDestinationIPv4Address, }, }, { @@ -292,7 +292,7 @@ static struct ulogd_key nfct_okeys[] = { .name = "reply.l4.sport", .ipfix = { .vendor = IPFIX_VENDOR_IETF, - .field_id = IPFIX_sourceTransportPort, + .field_id = IPFIX_postNAPTSourceTransportPort, }, }, { @@ -301,7 +301,7 @@ static struct ulogd_key nfct_okeys[] = { .name = "reply.l4.dport", .ipfix = { .vendor = IPFIX_VENDOR_IETF, - .field_id = IPFIX_destinationTransportPort, + .field_id = IPFIX_postNAPTDestinationTransportPort, }, }, {