summaryrefslogtreecommitdiff
path: root/regress/sys/netinet6/frag6/Makefile
blob: 55434b249d15ae3b614bcabc07268b5537fcdfc9 (plain)
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
#	$OpenBSD: Makefile,v 1.7 2013/07/23 22:15:04 bluhm Exp $

# The following ports must be installed:
#
# python-2.7          interpreted object-oriented programming language
# py-libdnet          python interface to libdnet
# scapy               powerful interactive packet manipulation in python

# This test needs a manual setup of two machines
# Set up machines: SRC DST
# SRC is the machine where this makefile is running.
# DST is running OpenBSD with pf disabled to test the IPv6 stack.
# Enable echo udp6 in inetd.conf of DST to test UDP fragments.
#
# +---+   1   +---+
# |SRC| ----> |DST|
# +---+       +---+
#     out    in

# Configure Addresses on the machines.
# Adapt interface and addresse variables to your local setup.
#
SRC_IF =	tun0
SRC_MAC =	fe:e1:ba:d1:56:1f
DST_MAC =	52:54:00:12:34:50

SRC_OUT6 =	fdd7:e83e:66bc:211:fce1:baff:fed1:561f
DST_IN6 =	fdd7:e83e:66bc:211:5054:ff:fe12:3450

depend: addr.py

# Create python include file containing the addresses.
addr.py: Makefile
	rm -f $@ $@.tmp
	echo 'SRC_IF = "${SRC_IF}"' >>$@.tmp
	echo 'SRC_MAC = "${SRC_MAC}"' >>$@.tmp
	echo 'DST_MAC = "${DST_MAC}"' >>$@.tmp
.for var in SRC_OUT DST_IN
	echo '${var} = "${${var}}"' >>$@.tmp
	echo '${var}6 = "${${var}6}"' >>$@.tmp
.endfor
	mv $@.tmp $@

# Ping all addresses.  This ensures that the ip addresses are configured
# and all routing table are set up to allow bidirectional packet flow.
TARGETS +=	ping6
run-regress-ping6:
	@echo '\n======== $@ ========'
.for ip in SRC_OUT DST_IN
	@echo Check ping6 ${ip}6:
	ping6 -n -c 1 ${${ip}6}
.endfor

# Ping all addresses again but with 5000 bytes payload.  These large
# packets get fragmented by SRC and must be handled by DST.
TARGETS +=	fragping6
run-regress-fragping6:
	@echo '\n======== $@ ========'
.for ip in SRC_OUT DST_IN
	@echo Check ping6 ${ip}6:
	ping6 -n -c 1 -s 5000 -m ${${ip}6}
.endfor

# Send hand-crafted fragmented packet
TARGETS +=	frag6
run-regress-frag6: addr.py
	@echo '\n======== $@ ========'
	@echo Check ping6 reassembly
	${SUDO} python2.7 frag6.py

# An hop by hop options extension header before the fragment header
TARGETS +=	frag6-ext
run-regress-frag6-ext: addr.py
	@echo '\n======== $@ ========'
	@echo Check ping6 extension header reassembly
	${SUDO} python2.7 frag6_ext.py

# An destination options extension header after the fragment header
TARGETS +=	frag6-opt
run-regress-frag6-opt: addr.py
	@echo '\n======== $@ ========'
	@echo Check ping6 destination option reassembly
	${SUDO} python2.7 frag6_opt.py

# fragmented packet with head overlapping first fragment
TARGETS +=	frag6-overhead0
run-regress-frag6-overhead0: addr.py
	@echo '\n======== $@ ========'
	@echo Check ping6 head overlapping first fragment
	${SUDO} python2.7 frag6_overhead0.py

# fragmented packet with head overlapping second fragment
TARGETS +=	frag6-overhead
run-regress-frag6-overhead: addr.py
	@echo '\n======== $@ ========'
	@echo Check ping6 head overlapping second fragment
	${SUDO} python2.7 frag6_overhead.py

# fragmented packet with tail overlapping last fragment
TARGETS +=	frag6-overtail
run-regress-frag6-overtail: addr.py
	@echo '\n======== $@ ========'
	@echo Check ping6 tail overlapping last fragment
	${SUDO} python2.7 frag6_overtail.py

# fragmented packet with overlap, drop future fragments
TARGETS +=	frag6-overdrop
run-regress-frag6-overdrop: addr.py
	@echo '\n======== $@ ========'
	@echo Check ping6 overlap drop future fragments
	${SUDO} python2.7 frag6_overdrop.py

# fragmented packet with overlap, atomic fragment must be processed
TARGETS +=	frag6-overatomic
run-regress-frag6-overatomic: addr.py
	@echo '\n======== $@ ========'
	@echo Check ping6 overlapping and atomic fragments
	${SUDO} python2.7 frag6_overatomic.py

# atomic fragment with short fragmented payload
TARGETS +=	frag6-shortatomic
run-regress-frag6-shortatomic: addr.py
	@echo '\n======== $@ ========'
	@echo Check ping6 short atomic fragments
	${SUDO} python2.7 frag6_shortatomic.py

# fragmented packet permuted fragments
TARGETS +=	frag6-permute
run-regress-frag6-permute: addr.py
	@echo '\n======== $@ ========'
	@echo Check ping6 permuted fragments
	${SUDO} python2.7 frag6_permute.py

# fragmented packet with zero length first fragment
TARGETS +=	frag6-zerofirst
run-regress-frag6-zerofirst: addr.py
	@echo '\n======== $@ ========'
	@echo Check ping6 zero length first fragment
	${SUDO} python2.7 frag6_zerofirst.py

# fragmented packet with zero length second fragment
TARGETS +=	frag6-zerosecond
run-regress-frag6-zerosecond: addr.py
	@echo '\n======== $@ ========'
	@echo Check ping6 zero length second fragment
	${SUDO} python2.7 frag6_zerosecond.py

# atomic fragmented udp packet
TARGETS +=	frag6-udpatomic
run-regress-frag6-udpatomic: addr.py
	@echo '\n======== $@ ========'
	@echo Check ping6 atomic udp fragment
	${SUDO} python2.7 frag6_udpatomic.py

# fragmented udp packet after header
TARGETS +=	frag6-udpheader
run-regress-frag6-udpheader: addr.py
	@echo '\n======== $@ ========'
	@echo Check ping6 udp header fragment
	${SUDO} python2.7 frag6_udpheader.py

# fragmented udp packet within payload
TARGETS +=	frag6-udppayload
run-regress-frag6-udppayload: addr.py
	@echo '\n======== $@ ========'
	@echo Check ping6 udp payload fragment
	${SUDO} python2.7 frag6_udppayload.py

# fragmented icmp packet not within 60 second timeout
TARGETS +=	frag6-timeout
run-regress-frag6-timeout: addr.py
	@echo '\n======== $@ ========'
	@echo Check ping6 fragment timeout
	${SUDO} python2.7 frag6_timeout.py

REGRESS_TARGETS =	${TARGETS:S/^/run-regress-/}
REGRESS_SLOW_TARGETS =	run-regress-frag6-timeout

CLEANFILES +=		addr.py *.pyc *.log

.include <bsd.regress.mk>