View | Details | Raw Unified | Return to bug 29813
Collapse All | Expand All

(-)a/extensions/libip6t_NETFLOW.c (+1 lines)
Line 0 Link Here
1
libipt_NETFLOW.c
(-)a/extensions/libipt_NETFLOW.c (-5 / +109 lines)
Lines 1-13 Link Here
1
/* Shared library add-on to iptables to add NETFLOW target support. */
1
/*
2
 * iptables helper for NETFLOW target
3
 * <abc@telekom.ru>
4
 *
5
 *
6
 *   This file is part of NetFlow exporting module.
7
 *
8
 *   This program is free software: you can redistribute it and/or modify
9
 *   it under the terms of the GNU General Public License as published by
10
 *   the Free Software Foundation, either version 2 of the License, or
11
 *   (at your option) any later version.
12
 *
13
 *   This program is distributed in the hope that it will be useful,
14
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 *   GNU General Public License for more details.
17
 *
18
 *   You should have received a copy of the GNU General Public License
19
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
 *
21
 */
22
23
#include <stdio.h>
24
#include <string.h>
25
#include <stdlib.h>
26
#include <getopt.h>
27
#include <net/if.h>
28
#include <sys/socket.h>
29
#include <netinet/in.h>
30
#include <arpa/inet.h>
31
32
#define __EXPORTED_HEADERS__
33
#ifdef XTABLES
2
#include <xtables.h>
34
#include <xtables.h>
35
#else
36
#include <iptables.h>
37
#endif
38
39
#ifdef XTABLES_VERSION_CODE	// since 1.4.1
40
#define MOD140
41
#define iptables_target         xtables_target
42
#endif
43
44
#ifdef iptables_target		// only in 1.4.0
45
#define MOD140
46
#endif
47
48
#ifdef MOD140
49
#define ipt_entry_target	xt_entry_target
50
#define register_target		xtables_register_target
51
#define _IPT_ENTRY		void
52
#define _IPT_IP			void
53
#ifndef IPT_ALIGN
54
#define IPT_ALIGN		XT_ALIGN
55
#endif
56
#else // before 1.3.x
57
#define _IPT_ENTRY struct ipt_entry
58
#define _IPT_IP struct ipt_ip
59
#endif
60
61
#ifndef IPTABLES_VERSION
62
#define IPTABLES_VERSION XTABLES_VERSION
63
#endif
64
65
static struct option opts[] = {
66
  { 0 }
67
};
68
69
static void help(void)
70
{
71
	printf("NETFLOW target\n");
72
}
73
74
static int parse(int c, char **argv, int invert, unsigned int *flags,
75
	     const _IPT_ENTRY  *entry,
76
	     struct ipt_entry_target **targetinfo)
77
78
{
79
	return 1;
80
}
81
82
static void final_check(unsigned int flags)
83
{
84
}
85
86
static void save(const _IPT_IP *ip, const struct ipt_entry_target *match)
87
{
88
}
89
90
static void print(const _IPT_IP *ip,
91
      const struct ipt_entry_target *target,
92
      int numeric)
93
{
94
	printf("NETFLOW ");
95
}
3
96
4
static struct xtables_target netflow = {
97
static struct iptables_target netflow = { 
98
	.next		= NULL,
5
	.name		= "NETFLOW",
99
	.name		= "NETFLOW",
6
	.version	= XTABLES_VERSION,
100
	.version	= IPTABLES_VERSION,
7
	.family		= NFPROTO_IPV4,
101
	.size           = IPT_ALIGN(0),
102
	.userspacesize  = IPT_ALIGN(0),
103
	.help		= &help,
104
	.parse		= &parse,
105
	.final_check    = &final_check,
106
	.print		= &print,
107
	.save		= &save,
108
	.extra_opts     = opts
8
};
109
};
9
110
111
#ifndef _init
112
#define _init __attribute__((constructor)) _INIT
113
#endif
10
void _init(void)
114
void _init(void)
11
{
115
{
12
	xtables_register_target(&netflow);
116
	register_target(&netflow);
13
}
117
}
(-)a/iptables.spec (-2 / +6 lines)
Lines 1-6 Link Here
1
Name: iptables
1
Name: iptables
2
Version: 1.4.21
2
Version: 1.4.21
3
Release: alt2
3
Release: alt3
4
4
5
Summary: Tools for managing Linux kernel packet filtering capabilities
5
Summary: Tools for managing Linux kernel packet filtering capabilities
6
License: GPLv2+
6
License: GPLv2+
Lines 94-100 operates with netfilter. Link Here
94
%setup -n %name-%version-%release
94
%setup -n %name-%version-%release
95
95
96
%build
96
%build
97
%add_optflags -fno-strict-aliasing
97
%add_optflags -fno-strict-aliasing -DXTABLES
98
%autoreconf
98
%autoreconf
99
%configure \
99
%configure \
100
	%{subst_enable static} \
100
	%{subst_enable static} \
Lines 223-228 fi Link Here
223
%endif
223
%endif
224
224
225
%changelog
225
%changelog
226
* Sun Jun 21 2015 Sergey Y. Afonin <asy@altlinux.ru> 1.4.21-alt3
227
- Updated libipt_NETFLOW.c from ipt_netflow 2.1,
228
  built libip6t_NETFLOW.so (closes: #29813)
229
226
* Sat Feb 14 2015 Anton Farygin <rider@altlinux.ru> 1.4.21-alt2
230
* Sat Feb 14 2015 Anton Farygin <rider@altlinux.ru> 1.4.21-alt2
227
- xtables: SET target: Add mapping of meta informations 
231
- xtables: SET target: Add mapping of meta informations 
228
  (skbinfo ipset extension) (closes: #30729)
232
  (skbinfo ipset extension) (closes: #30729)

Return to bug 29813