-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
158 lines (116 loc) · 4.07 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
PREFIX=${HOME}
OBJS=\
pcap-tools.o
PROGS= \
pcap-extract-interval \
pcap-subtract-timestamp \
pcap-join \
pcap-remove-dupe \
pcap-remove-bogus \
pcap-split \
pcap-sample \
pcap-change-dst \
pcap-change-ip \
pcap-change-port \
pcap-decapsulate-gre \
pcap-find-misordered \
pcap-reorder \
pcap-fix-linux-af-inet6 \
pcap-strip-vlans \
pcap-print-sip \
pcap-print-tcp-options \
pcap-print-sip-protocol \
pcap-print-time-qname-qtype-rcode \
pcap-separate-by-sip \
pcap-separate-by-connection \
pcap-sort-by-sip \
pcap-merge-sorted-sip \
pcap-separate \
pcap-to-dlt-loop \
pcap-to-dlt-raw \
pcap-to-dlt-en10mb \
pcap-bad-udp-checksum \
pcap-dns-find-edns-opt \
#pcap-print-time-sip-len \
LIBPCAP=-lpcap
LIBPCAPLAYERS=-L${PREFIX}/lib -lpcap_layers
# BSD
#LIBMD5=-lmd
#INCDIRS=
# LINUX
LIBMD5=-lcrypto
INCDIRS=-I${PREFIX}/include
CFLAGS = -Wall -g ${INCDIRS}
all: ${PROGS}
pcap-tools.o: pcap-tools.c pcap-tools.h
${CC} -c -o $@ pcap-tools.c
pcap-extract-interval: pcap-extract-interval.o ${OBJS}
${CC} -o $@ ${@}.o ${OBJS} ${LIBPCAP}
pcap-subtract-timestamp: pcap-subtract-timestamp.o ${OBJS}
${CC} -o $@ ${@}.o ${OBJS} ${LIBPCAP}
pcap-join: pcap-join.o ${OBJS}
${CC} -o $@ ${@}.o ${OBJS} ${LIBPCAP}
pcap-remove-dupe: pcap-remove-dupe.o ${OBJS}
${CC} -o $@ ${@}.o ${OBJS} ${LIBPCAP} ${LIBMD5}
pcap-remove-bogus: pcap-remove-bogus.o ${OBJS}
${CC} -o $@ ${@}.o ${OBJS} ${LIBPCAP}
pcap-split: pcap-split.o ${OBJS}
${CC} -o $@ ${@}.o ${OBJS} ${LIBPCAP}
pcap-change-dst: pcap-change-dst.o ${OBJS}
${CC} -o $@ ${@}.o ${OBJS} ${LIBPCAP} ${LIBPCAPLAYERS}
pcap-change-ip: pcap-change-ip.o ${OBJS}
${CC} -o $@ ${@}.o ${OBJS} ${LIBPCAP} ${LIBPCAPLAYERS}
pcap-change-port: pcap-change-port.o ${OBJS}
${CC} -o $@ ${@}.o ${OBJS} ${LIBPCAP} ${LIBPCAPLAYERS}
pcap-decapsulate-gre: pcap-decapsulate-gre.o ${OBJS}
${CC} -o $@ ${@}.o ${OBJS} ${LIBPCAP} ${LIBPCAPLAYERS}
pcap-find-misordered: pcap-find-misordered.o ${OBJS}
${CC} -o $@ ${@}.o ${OBJS} ${LIBPCAP}
pcap-reorder: pcap-reorder.o ${OBJS}
${CC} -o $@ ${@}.o ${OBJS} ${LIBPCAP} ${LIBPCAPLAYERS}
pcap-fix-linux-af-inet6: pcap-fix-linux-af-inet6.o ${OBJS}
${CC} -o $@ ${@}.o ${OBJS} ${LIBPCAP}
pcap-strip-vlans: pcap-strip-vlans.o ${OBJS}
${CC} -o $@ ${@}.o ${OBJS} ${LIBPCAP}
pcap-print-sip: pcap-print-sip.o ${OBJS}
${CC} -o $@ ${@}.o ${OBJS} ${LIBPCAP} ${LIBPCAPLAYERS}
pcap-print-tcp-options: pcap-print-tcp-options.o ${OBJS}
${CC} -o $@ ${@}.o ${OBJS} ${LIBPCAP} ${LIBPCAPLAYERS}
pcap-print-sip-protocol: pcap-print-sip-protocol.o ${OBJS}
${CC} -o $@ ${@}.o ${OBJS} ${LIBPCAP} ${LIBPCAPLAYERS}
pcap-separate-by-sip: pcap-separate-by-sip.o ${OBJS}
${CC} -o $@ ${@}.o ${OBJS} ${LIBPCAP} ${LIBPCAPLAYERS}
pcap-separate-by-connection: pcap-separate-by-connection.o ${OBJS}
${CC} -o $@ ${@}.o ${OBJS} ${LIBPCAP} ${LIBPCAPLAYERS}
pcap-sort-by-sip: pcap-sort-by-sip.o ${OBJS}
${CC} -o $@ ${@}.o ${OBJS} ${LIBPCAP} ${LIBPCAPLAYERS}
pcap-separate: pcap-separate.o ${OBJS}
${CC} -o $@ ${@}.o ${OBJS} ${LIBPCAP} ${LIBPCAPLAYERS}
pcap-to-dlt-loop: pcap-to-dlt-loop.o ${OBJS}
${CC} -o $@ ${@}.o ${OBJS} ${LIBPCAP} ${LIBPCAPLAYERS}
pcap-to-dlt-raw: pcap-to-dlt-raw.o ${OBJS}
${CC} -o $@ ${@}.o ${OBJS} ${LIBPCAP} ${LIBPCAPLAYERS}
pcap-to-dlt-en10mb: pcap-to-dlt-en10mb.o ${OBJS}
${CC} -o $@ ${@}.o ${OBJS} ${LIBPCAP} ${LIBPCAPLAYERS}
pcap-merge-sorted-sip: pcap-merge-sorted-sip.o ${OBJS}
${CC} -o $@ ${@}.o ${OBJS} ${LIBPCAP} ${LIBPCAPLAYERS}
#pcap-print-time-sip-len: pcap-print-time-sip-len.o
#${CC} -o $@ ${@}.o ${LIBPCAP} ${LIBPCAPLAYERS}
pcap-print-time-qname-qtype-rcode: pcap-print-time-qname-qtype-rcode.o
${CC} -o $@ ${@}.o ${LIBPCAP} ${LIBPCAPLAYERS} -lldns
pcap-bad-udp-checksum: pcap-bad-udp-checksum.o
${CC} -o $@ ${@}.o ${LIBPCAP} ${LIBPCAPLAYERS} -linx_addr_c
pcap-dns-find-edns-opt: pcap-dns-find-edns-opt.o
${CC} -o $@ ${@}.o ${LIBPCAP} ${OBJS} ${LIBPCAPLAYERS} -lldns
pcap-sample: pcap-sample.o ${OBJS}
${CC} -o $@ ${@}.o ${LIBPCAP} ${OBJS}
clean:
@for f in ${PROGS}; do \
rm -fv $$f.o $$f ; \
done
rm -fv ${OBJS}
install:
@for f in ${PROGS}; do \
echo "install -C -m 755 $$f ${PREFIX}/bin"; \
install -C -m 755 $$f ${PREFIX}/bin ; \
done