-
Notifications
You must be signed in to change notification settings - Fork 18
/
Makefile.am
342 lines (299 loc) · 8.48 KB
/
Makefile.am
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
SUBDIRS=
if WITH_NDP
SUBDIRS+=input/nfbCInterface
endif
SUBDIRS+=. tests init
bin_PROGRAMS=ipfixprobe ipfixprobe_stats
DISTCHECK_CONFIGURE_FLAGS="--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)"
ipfixprobe_LDFLAGS=-lpthread -ldl -latomic -ltelemetry -lappFs
ipfixprobe_CFLAGS=-I$(srcdir)/include/ -fPIC -DFUSE_USE_VERSION=30
ipfixprobe_CXXFLAGS=-std=gnu++17 -Wno-write-strings -I$(srcdir)/include/ -fPIC -DFUSE_USE_VERSION=30
if OS_CYGWIN
ipfixprobe_CXXFLAGS+=-Wl,--export-all-symbols
else
ipfixprobe_CXXFLAGS+=-Wl,--export-dynamic
endif
ipfixprobe_input_src=\
input/input.cpp \
input/benchmark.cpp \
input/benchmark.hpp \
input/parser.cpp \
input/parser.hpp \
input/headers.hpp
# How to create loadable example.so plugin:
#pkglib_LTLIBRARIES=example.la
#example_la_CXXFLAGS=-I$(srcdir)/include/
#example_la_SOURCES=example.cpp example.hpp
#example_la_LDFLAGS=-module -shared -avoid-version
if WITH_NDP
ipfixprobe_LDFLAGS+=-lnuma -lndpRI -L$(srcdir)/input/nfbCInterface/
ipfixprobe_CXXFLAGS+=-I$(srcdir)/input/nfbCInterface/include/
ipfixprobe_input_src+=\
input/ndp.cpp \
input/ndp.hpp
endif
if WITH_RAW
ipfixprobe_input_src+=\
input/raw.cpp \
input/raw.hpp
endif
if WITH_PCAP
ipfixprobe_input_src+=\
input/pcap.cpp \
input/pcap.hpp
endif
if WITH_STEM
ipfixprobe_input_src+=\
input/stem.cpp \
input/stem.hpp
endif
ipfixprobe_storage_src=\
storage/fragmentationCache/ringBuffer.hpp \
storage/fragmentationCache/timevalUtils.hpp \
storage/fragmentationCache/fragmentationKeyData.hpp \
storage/fragmentationCache/fragmentationTable.hpp \
storage/fragmentationCache/fragmentationTable.cpp \
storage/fragmentationCache/fragmentationCache.hpp \
storage/fragmentationCache/fragmentationCache.cpp \
storage/cache.cpp \
storage/cache.hpp \
storage/xxhash.c \
storage/xxhash.h
ipfixprobe_output_src=\
output/ipfix.cpp \
output/ipfix.hpp \
output/text.cpp \
output/text.hpp \
output/ipfix-basiclist.cpp
if WITH_NEMEA
ipfixprobe_output_src+=\
output/unirec.hpp \
output/unirec.cpp \
fields.c \
fields.h
endif
ipfixprobe_process_src=\
process/http.cpp \
process/http.hpp \
process/rtsp.cpp \
process/rtsp.hpp \
process/sip.cpp \
process/sip.hpp \
process/tls.cpp \
process/tls.hpp \
process/tls_parser.cpp \
process/tls_parser.hpp \
process/smtp.cpp \
process/smtp.hpp \
process/dns-utils.hpp \
process/dns.cpp \
process/dns.hpp \
process/passivedns.cpp \
process/passivedns.hpp \
process/ntp.cpp \
process/ntp.hpp \
process/idpcontent.hpp \
process/idpcontent.cpp \
process/netbios.hpp \
process/netbios.cpp \
process/bstats.hpp \
process/bstats.cpp \
process/phists.cpp \
process/phists.hpp \
process/pstats.hpp \
process/pstats.cpp \
process/ovpn.hpp \
process/ovpn.cpp \
process/ssdp.hpp \
process/ssdp.cpp \
process/dnssd.hpp \
process/dnssd.cpp \
process/basicplus.hpp \
process/basicplus.cpp \
process/wg.hpp \
process/wg.cpp \
process/stats.cpp \
process/stats.hpp \
process/md5.hpp \
process/md5.cpp \
process/common.hpp \
process/ssadetector.hpp \
process/ssadetector.cpp \
process/icmp.hpp \
process/icmp.cpp \
process/vlan.hpp \
process/vlan.cpp \
process/nettisa.hpp \
process/nettisa.cpp \
process/flow_hash.hpp \
process/flow_hash.cpp \
process/mpls.hpp \
process/mpls.cpp \
process/mqtt.hpp \
process/mqtt.cpp
if WITH_QUIC
ipfixprobe_process_src+=\
process/quic.hpp \
process/quic.cpp \
process/quic_parser.cpp \
process/quic_parser.hpp
endif
if WITH_FLEXPROBE
ipfixprobe_process_src+=\
process/flexprobe-data.h \
process/flexprobe-data-processing.cpp \
process/flexprobe-data-processing.h \
process/flexprobe-tcp-tracking.cpp \
process/flexprobe-tcp-tracking.h \
process/flexprobe-encryption-processing.cpp \
process/flexprobe-encryption-processing.h
endif
if WITH_OSQUERY
ipfixprobe_input_src+=\
process/osquery.cpp\
process/osquery.hpp
endif
if WITH_DPDK
ipfixprobe_input_src+=\
input/dpdk/dpdkMbuf.hpp \
input/dpdk/dpdkMbuf.cpp \
input/dpdk/dpdkDevice.hpp \
input/dpdk/dpdkDevice.cpp \
input/dpdk.cpp \
input/dpdk.h \
input/dpdk-ring.cpp \
input/dpdk-ring.h
endif
ipfixprobe_headers_src=\
include/ipfixprobe/plugin.hpp \
include/ipfixprobe/input.hpp \
include/ipfixprobe/storage.hpp \
include/ipfixprobe/output.hpp \
include/ipfixprobe/process.hpp \
include/ipfixprobe/options.hpp \
include/ipfixprobe/utils.hpp \
include/ipfixprobe/ipfix-basiclist.hpp \
include/ipfixprobe/flowifc.hpp \
include/ipfixprobe/ipaddr.hpp \
include/ipfixprobe/packet.hpp \
include/ipfixprobe/ring.h \
include/ipfixprobe/byte-utils.hpp \
include/ipfixprobe/ipfix-elements.hpp \
include/ipfixprobe/rtp.hpp \
include/ipfixprobe/telemetry-utils.hpp \
include/ipfixprobe/parser-stats.hpp
ipfixprobe_src=\
$(ipfixprobe_input_src) \
$(ipfixprobe_storage_src) \
$(ipfixprobe_output_src) \
$(ipfixprobe_process_src) \
$(ipfixprobe_headers_src) \
pluginmgr.cpp \
pluginmgr.hpp \
options.cpp \
utils.cpp \
ring.c \
workers.cpp \
workers.hpp \
stats.cpp \
stats.hpp \
ipfixprobe.hpp \
ipfixprobe.cpp
if WITH_LIBUNWIND
ipfixprobe_src+=\
stacktrace.cpp \
stacktrace.hpp
endif
ipfixprobe_SOURCES=$(ipfixprobe_src) main.cpp
ipfixprobe_stats_CXXFLAGS=-std=gnu++17 -Wno-write-strings -I$(srcdir)/include/
ipfixprobe_stats_SOURCES=ipfixprobe_stats.cpp \
include/ipfixprobe/options.hpp \
include/ipfixprobe/utils.hpp \
stats.cpp \
stats.hpp \
options.cpp \
utils.cpp
pkgdocdir=${docdir}/ipfixprobe
pkgdoc_DATA=README.md
EXTRA_DIST=README.md \
pcaps/README.md \
pcaps/mixed.pcap \
pcaps/dns.pcap \
pcaps/dnssd.pcap \
pcaps/http.pcap \
pcaps/rtsp.pcap \
pcaps/tls.pcap \
pcaps/ntp.pcap \
pcaps/sip.pcap \
pcaps/ssdp.pcap \
pcaps/netbios.pcap \
pcaps/smtp.pcap \
pcaps/ovpn.pcap \
pcaps/idpcontent.pcap \
pcaps/bstats.pcap \
pcaps/wg.pcap \
pcaps/quic_initial-sample.pcap \
debian/control debian/changelog debian/watch debian/copyright debian/patches debian/patches/series \
debian/source debian/source/format debian/source/local-options debian/source/include-binaries \
debian/rules debian/README.Debian debian/compat \
docker/Dockerfile docker/ipfixprobe_wrapper.sh docker/process_script.sh docker/README.md
bashcompl_DATA=ipfixprobe.bash
if HAVE_GOOGLETEST
check_LTLIBRARIES=libipfixprobe.la
libipfixprobe_la_SOURCES=$(ipfixprobe_src)
libipfixprobe_la_LDFLAGS=$(ipfixprobe_LDFLAGS)
libipfixprobe_la_CFLAGS=$(ipfixprobe_CFLAGS)
libipfixprobe_la_CXXFLAGS=$(ipfixprobe_CXXFLAGS)
check-local:
@if test -e googletest/googletest/Makefile; then \
( cd googletest/googletest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la ); \
( cd googletest/googlemock && $(MAKE) $(AM_MAKEFLAGS) lib/libgmock.la lib/libgmock_main.la ); \
else \
echo "missing googletest submodule, run `git submodule init && git submodule update` and reconfigure"; \
fi;
clean-local:
@if test -e googletest/googletest/Makefile; then \
( cd googletest/googletest && $(MAKE) $(AM_MAKEFLAGS) clean; ) \
fi
endif
RPMDIR = RPMBUILD
if MAKE_RPMS
RPMFILENAME=$(PACKAGE_NAME)-$(VERSION)
.PHONY: srpm
srpm:
rm -rf "$(RPMDIR)/SOURCES/$(RPMFILENAME)"
mkdir -p $(RPMDIR)/BUILD/ $(RPMDIR)/SRPMS/ $(RPMDIR)/RPMS/ $(RPMDIR)/SOURCES
make ${AM_MAKEFLAGS} distdir='$(RPMDIR)/SOURCES/$(RPMFILENAME)' distdir
( cd "$(RPMDIR)/SOURCES/"; tar -z -c -f $(RPMFILENAME)-$(RELEASE).tar.gz $(RPMFILENAME); rm -rf $(RPMFILENAME); )
$(RPMBUILD) -bs $(PACKAGE_NAME).spec --define "_topdir `pwd`/$(RPMDIR)";
.PHONY: rpm
rpm: srpm
$(RPMBUILD) --define "_topdir `pwd`/$(RPMDIR)" --rebuild $(RPMDIR)/SRPMS/$(RPMFILENAME)-$(RELEASE).src.rpm --with pcap --with unwind;
.PHONY: rpm-nemea
rpm-nemea: srpm
$(RPMBUILD) --define "_topdir `pwd`/$(RPMDIR)" --rebuild $(RPMDIR)/SRPMS/$(RPMFILENAME)-$(RELEASE).src.rpm --with nemea --with pcap --with unwind;
.PHONY: rpm-ndp
rpm-ndp: srpm
$(RPMBUILD) --define "_topdir `pwd`/$(RPMDIR)" --rebuild $(RPMDIR)/SRPMS/$(RPMFILENAME)-$(RELEASE).src.rpm --with ndp --with unwind;
else
endif
rpm-clean:
rm -rf $(RPMDIR)
if WITH_NEMEA
include ./aminclude.am
else
fields.h fields.c:
touch $@
endif
if MAKE_DEB
.PHONY: deb-source
deb-source:
make dist && make distdir && ln -fs ipfixprobe-@[email protected] ipfixprobe_@VERSION@ubuntu@[email protected] && cd ipfixprobe-@VERSION@ && debuild -S
.PHONY: deb
deb:
make dist && make distdir && ln -fs ipfixprobe-@[email protected] ipfixprobe_@VERSION@ubuntu@[email protected] && cd ipfixprobe-@VERSION@ && debuild
else
endif
.PHONY: doc
doc:
doxygen