test0075.h revision 199604
138357Sjdp/*-
238357Sjdp * Test 0075:	Check boundary conditions (BPF_LD+BPF_MEM)
338357Sjdp *
438357Sjdp * $FreeBSD: head/tools/regression/bpf/bpf_filter/tests/test0075.h 199604 2009-11-20 18:53:38Z jkim $
538357Sjdp */
638357Sjdp
738357Sjdp/* BPF program */
838357Sjdpstruct bpf_insn pc[] = {
938357Sjdp	BPF_STMT(BPF_LD+BPF_IMM, 0xdeadc0de),
1038357Sjdp	BPF_STMT(BPF_LD+BPF_MEM, 0x8fffffff),
1138357Sjdp	BPF_STMT(BPF_RET+BPF_A, 0),
1238357Sjdp};
1338357Sjdp
1438357Sjdp/* Packet */
1538357Sjdpu_char	pkt[] = {
1638357Sjdp	0x00,
1738357Sjdp};
1838357Sjdp
1938357Sjdp/* Packet length seen on wire */
2038357Sjdpu_int	wirelen =	sizeof(pkt);
2138357Sjdp
2238357Sjdp/* Packet length passed on buffer */
2338357Sjdpu_int	buflen =	sizeof(pkt);
2438357Sjdp
2538357Sjdp/* Invalid instruction */
2638357Sjdpint	invalid =	1;
2738357Sjdp
2838357Sjdp/* Expected return value */
2938357Sjdpu_int	expect =	0xdeadc0de;
3038357Sjdp
3138357Sjdp/* Expected signal */
3238357Sjdp#ifdef __amd64__
3338357Sjdpint	expect_signal =	SIGBUS;
3438357Sjdp#else
3538357Sjdpint	expect_signal =	SIGSEGV;
3638357Sjdp#endif
3738357Sjdp