@@ -, +, @@ 1.4.21-alt3 - Updated libipt_NETFLOW.c from ipt_netflow 2.1, built libip6t_NETFLOW.so (closes: #29813) --- a/extensions/libip6t_NETFLOW.c +++ a/extensions/libip6t_NETFLOW.c @@ -0,0 +1, @@ +libipt_NETFLOW.c --- a/extensions/libipt_NETFLOW.c +++ a/extensions/libipt_NETFLOW.c @@ -1,13 +1,117 @@ -/* Shared library add-on to iptables to add NETFLOW target support. */ +/* + * iptables helper for NETFLOW target + * + * + * + * This file is part of NetFlow exporting module. + * + * This program 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 2 of the License, or + * (at your option) any later version. + * + * This program 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 this program. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#define __EXPORTED_HEADERS__ +#ifdef XTABLES #include +#else +#include +#endif + +#ifdef XTABLES_VERSION_CODE // since 1.4.1 +#define MOD140 +#define iptables_target xtables_target +#endif + +#ifdef iptables_target // only in 1.4.0 +#define MOD140 +#endif + +#ifdef MOD140 +#define ipt_entry_target xt_entry_target +#define register_target xtables_register_target +#define _IPT_ENTRY void +#define _IPT_IP void +#ifndef IPT_ALIGN +#define IPT_ALIGN XT_ALIGN +#endif +#else // before 1.3.x +#define _IPT_ENTRY struct ipt_entry +#define _IPT_IP struct ipt_ip +#endif + +#ifndef IPTABLES_VERSION +#define IPTABLES_VERSION XTABLES_VERSION +#endif + +static struct option opts[] = { + { 0 } +}; + +static void help(void) +{ + printf("NETFLOW target\n"); +} + +static int parse(int c, char **argv, int invert, unsigned int *flags, + const _IPT_ENTRY *entry, + struct ipt_entry_target **targetinfo) + +{ + return 1; +} + +static void final_check(unsigned int flags) +{ +} + +static void save(const _IPT_IP *ip, const struct ipt_entry_target *match) +{ +} + +static void print(const _IPT_IP *ip, + const struct ipt_entry_target *target, + int numeric) +{ + printf("NETFLOW "); +} -static struct xtables_target netflow = { +static struct iptables_target netflow = { + .next = NULL, .name = "NETFLOW", - .version = XTABLES_VERSION, - .family = NFPROTO_IPV4, + .version = IPTABLES_VERSION, + .size = IPT_ALIGN(0), + .userspacesize = IPT_ALIGN(0), + .help = &help, + .parse = &parse, + .final_check = &final_check, + .print = &print, + .save = &save, + .extra_opts = opts }; +#ifndef _init +#define _init __attribute__((constructor)) _INIT +#endif void _init(void) { - xtables_register_target(&netflow); + register_target(&netflow); } --- a/iptables.spec +++ a/iptables.spec @@ -1,6 +1,6 @@ Name: iptables Version: 1.4.21 -Release: alt2 +Release: alt3 Summary: Tools for managing Linux kernel packet filtering capabilities License: GPLv2+ @@ -94,7 +94,7 @@ operates with netfilter. %setup -n %name-%version-%release %build -%add_optflags -fno-strict-aliasing +%add_optflags -fno-strict-aliasing -DXTABLES %autoreconf %configure \ %{subst_enable static} \ @@ -223,6 +223,10 @@ fi %endif %changelog +* Sun Jun 21 2015 Sergey Y. Afonin 1.4.21-alt3 +- Updated libipt_NETFLOW.c from ipt_netflow 2.1, + built libip6t_NETFLOW.so (closes: #29813) + * Sat Feb 14 2015 Anton Farygin 1.4.21-alt2 - xtables: SET target: Add mapping of meta informations (skbinfo ipset extension) (closes: #30729)