summaryrefslogtreecommitdiffstats
path: root/tools/regression/bpf/bpf_filter/tests/test0057.h
blob: 9df308807f4f4bef80ce2b54cc90e2806545ff85 (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
/*-
 * Test 0057:	Check boundary conditions (BPF_LD|BPF_H|BPF_IND)
 *
 * $FreeBSD$
 */

/* BPF program */
struct bpf_insn pc[] = {
	BPF_STMT(BPF_LD|BPF_IMM, 0xdeadc0de),
	BPF_STMT(BPF_LDX|BPF_IMM, 1),
	BPF_STMT(BPF_LD|BPF_H|BPF_IND, 0xffffffff),
	BPF_STMT(BPF_RET+BPF_A, 0),
};

/* Packet */
u_char	pkt[] = {
	0x01, 0x23, 0x45, 0x67,
};

/* Packet length seen on wire */
u_int	wirelen =	sizeof(pkt);

/* Packet length passed on buffer */
u_int	buflen =	sizeof(pkt);

/* Invalid instruction */
int	invalid =	0;

/* Expected return value */
u_int	expect =	0;

/* Expeced signal */
int	expect_signal =	0;
OpenPOWER on IntegriCloud