forked from seladb/PcapPlusPlus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
161 lines (145 loc) · 5.92 KB
/
Makefile
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
ifeq ($(wildcard mk/platform.mk),)
$(error platform.mk not found! Please run configure script first)
endif
include mk/platform.mk
COMMONPP_HOME := Common++
PACKETPP_HOME := Packet++
PCAPPP_HOME := Pcap++
PACKETPP_TEST := Tests/Packet++Test
PCAPPP_TEST := Tests/Pcap++Test
FUZZERS_HOME := Tests/Fuzzers
EXAMPLE_ARPSPOOF := Examples/ArpSpoofing
EXAMPLE_ARPING := Examples/Arping
EXAMPLE_DPDK1 := Examples/DpdkExample-FilterTraffic
EXAMPLE_DNSSPOOF := Examples/DnsSpoofing
EXAMPLE_DNSRESOLVER := Examples/DNSResolver
EXAMPLE_HTTPANALYZE := Examples/HttpAnalyzer
EXAMPLE_PF_RING1 := Examples/PfRingExample-FilterTraffic
EXAMPLE_PCAP_PRINT := Examples/PcapPrinter
EXAMPLE_SSLANALYZER := Examples/SSLAnalyzer
EXAMPLE_PCAPSPLITTER := Examples/PcapSplitter
EXAMPLE_PCAPSEARCH := Examples/PcapSearch
EXAMPLE_ICMP_FT := Examples/IcmpFileTransfer
EXAMPLE_TCP_REASM := Examples/TcpReassembly
EXAMPLE_IP_FRAG := Examples/IPFragUtil
EXAMPLE_IP_DEFRAG := Examples/IPDefragUtil
EXAMPLE_TLS_FP := Examples/TLSFingerprinting
EXAMPLE_DPDK2 := Examples/DpdkBridge
EXAMPLE_KNI_PONG := Examples/KniPong
UNAME := $(shell uname)
.SILENT:
all: libs
@cd $(PACKETPP_TEST) && $(MAKE) Packet++Test
@cd $(PCAPPP_TEST) && $(MAKE) Pcap++Test
@cd $(EXAMPLE_ARPSPOOF) && $(MAKE) ArpSpoofing
@cd $(EXAMPLE_ARPING) && $(MAKE) Arping
@cd $(EXAMPLE_DNSSPOOF) && $(MAKE) DnsSpoofing
@cd $(EXAMPLE_DNSRESOLVER) && $(MAKE) DNSResolver
@cd $(EXAMPLE_HTTPANALYZE) && $(MAKE) HttpAnalyzer
@cd $(EXAMPLE_PCAP_PRINT) && $(MAKE) PcapPrinter
@cd $(EXAMPLE_SSLANALYZER) && $(MAKE) SSLAnalyzer
@cd $(EXAMPLE_PCAPSPLITTER) && $(MAKE) PcapSplitter
@cd $(EXAMPLE_PCAPSEARCH) && $(MAKE) PcapSearch
@cd $(EXAMPLE_ICMP_FT) && $(MAKE) IcmpFileTransfer-pitcher && $(MAKE) IcmpFileTransfer-catcher
@cd $(EXAMPLE_TCP_REASM) && $(MAKE) TcpReassembly
@cd $(EXAMPLE_IP_FRAG) && $(MAKE) IPFragUtil
@cd $(EXAMPLE_IP_DEFRAG) && $(MAKE) IPDefragUtil
@cd $(EXAMPLE_TLS_FP) && $(MAKE) TLSFingerprinting
ifdef USE_DPDK
@cd $(EXAMPLE_DPDK1) && $(MAKE) DpdkTrafficFilter
@cd $(EXAMPLE_DPDK2) && $(MAKE) DpdkBridge
@cd $(EXAMPLE_KNI_PONG) && $(MAKE) KniPong
endif
ifdef PF_RING_HOME
@cd $(EXAMPLE_PF_RING1) && $(MAKE) PfRingTrafficFilter
endif
@$(MKDIR) -p Dist/examples
$(CP) $(EXAMPLE_ARPSPOOF)/Bin/* ./Dist/examples
$(CP) $(EXAMPLE_ARPING)/Bin/* ./Dist/examples
$(CP) $(EXAMPLE_DNSSPOOF)/Bin/* ./Dist/examples
$(CP) $(EXAMPLE_DNSRESOLVER)/Bin/* ./Dist/examples
$(CP) $(EXAMPLE_HTTPANALYZE)/Bin/* ./Dist/examples
$(CP) $(EXAMPLE_PCAP_PRINT)/Bin/* ./Dist/examples
$(CP) $(EXAMPLE_SSLANALYZER)/Bin/* ./Dist/examples
$(CP) $(EXAMPLE_PCAPSPLITTER)/Bin/* ./Dist/examples
$(CP) $(EXAMPLE_PCAPSEARCH)/Bin/* ./Dist/examples
$(CP) $(EXAMPLE_ICMP_FT)/Bin/* ./Dist/examples
$(CP) $(EXAMPLE_TCP_REASM)/Bin/* ./Dist/examples
$(CP) $(EXAMPLE_IP_FRAG)/Bin/* ./Dist/examples
$(CP) $(EXAMPLE_IP_DEFRAG)/Bin/* ./Dist/examples
$(CP) $(EXAMPLE_TLS_FP)/Bin/* ./Dist/examples
ifdef USE_DPDK
$(CP) $(EXAMPLE_DPDK1)/Bin/* ./Dist/examples
$(CP) $(EXAMPLE_DPDK2)/Bin/* ./Dist/examples
$(CP) $(EXAMPLE_KNI_PONG)/Bin/* ./Dist/examples
endif
ifdef PF_RING_HOME
$(CP) $(EXAMPLE_PF_RING1)/Bin/* ./Dist/examples
endif
@echo Finished successfully building PcapPlusPlus
# PcapPlusPlus libs only
libs:
@$(RM) -rf Dist
@cd $(COMMONPP_HOME) && $(MAKE) all
@cd $(PACKETPP_HOME) && $(MAKE) all
@cd $(PCAPPP_HOME) && $(MAKE) all
@$(MKDIR) -p Dist
@$(MKDIR) -p Dist/header
@$(CP) $(COMMONPP_HOME)/Lib/Release/* ./Dist
@$(CP) $(PACKETPP_HOME)/Lib/* ./Dist
@$(CP) $(PCAPPP_HOME)/Lib/* ./Dist
@$(CP) $(COMMONPP_HOME)/header/* ./Dist/header
@$(CP) $(PACKETPP_HOME)/header/* ./Dist/header
@$(CP) $(PCAPPP_HOME)/header/* ./Dist/header
@$(MKDIR) -p Dist/mk
$(CP) mk/PcapPlusPlus.mk ./Dist/mk
@echo Finished successfully building PcapPlusPlus libs
@echo ' '
# PcapPlusPlus with fuzzers
fuzzers: libs
@cd $(FUZZERS_HOME) && $(MAKE)
# Clean
clean:
@cd $(COMMONPP_HOME) && $(MAKE) clean
@cd $(PACKETPP_HOME) && $(MAKE) clean
@cd $(PCAPPP_HOME) && $(MAKE) clean
@cd $(PACKETPP_TEST) && $(MAKE) clean
@cd $(PCAPPP_TEST) && $(MAKE) clean
@cd $(EXAMPLE_ARPSPOOF) && $(MAKE) clean
@cd $(EXAMPLE_ARPING) && $(MAKE) clean
@cd $(EXAMPLE_DNSSPOOF) && $(MAKE) clean
@cd $(EXAMPLE_DNSRESOLVER) && $(MAKE) clean
@cd $(EXAMPLE_HTTPANALYZE) && $(MAKE) clean
@cd $(EXAMPLE_PCAP_PRINT) && $(MAKE) clean
@cd $(EXAMPLE_SSLANALYZER) && $(MAKE) clean
@cd $(EXAMPLE_PCAPSPLITTER) && $(MAKE) clean
@cd $(EXAMPLE_PCAPSEARCH) && $(MAKE) clean
@cd $(EXAMPLE_ICMP_FT) && $(MAKE) clean
@cd $(EXAMPLE_TCP_REASM) && $(MAKE) clean
@cd $(EXAMPLE_IP_FRAG) && $(MAKE) clean
@cd $(EXAMPLE_IP_DEFRAG) && $(MAKE) clean
@cd $(EXAMPLE_TLS_FP) && $(MAKE) clean
@cd $(FUZZERS_HOME) && $(MAKE) clean
ifdef USE_DPDK
@cd $(EXAMPLE_DPDK1) && $(MAKE) clean
@cd $(EXAMPLE_DPDK2) && $(MAKE) clean
@cd $(EXAMPLE_KNI_PONG) && $(MAKE) clean
endif
ifdef PF_RING_HOME
@cd $(EXAMPLE_PF_RING1) && $(MAKE) clean
endif
@$(RM) -rf Dist
@echo Finished successfully cleaning PcapPlusPlus
ifndef WIN32
INSTALL_DIR=Dist
# Install
install: | $(INSTALL_DIR)
@cd Dist && ../mk/$(INSTALL_SCRIPT)
@echo 'Installation complete!'
# Uninstall
uninstall: | $(INSTALL_DIR)
@cd Dist && ../mk/$(UNINSTALL_SCRIPT)
@echo 'Uninstallation complete!'
$(INSTALL_DIR):
@echo 'Please run make all first' && exit 1
endif