]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - tools/regression/bpf/bpf_filter/tests/test0081.h
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / tools / regression / bpf / bpf_filter / tests / test0081.h
1 /*-
2  * Test 0081:   Check unconditional jump range.
3  *
4  * $FreeBSD$
5  */
6
7 /* BPF program */
8 struct bpf_insn pc[] = {
9         BPF_STMT(BPF_LD+BPF_IMM, 0),
10         BPF_JUMP(BPF_JMP+BPF_JA, 2, 0, 0),
11         BPF_STMT(BPF_LD+BPF_IMM, 0xdeadc0de),
12         BPF_STMT(BPF_RET+BPF_A, 0),
13 };
14
15 /* Packet */
16 u_char  pkt[] = {
17         0x00,
18 };
19
20 /* Packet length seen on wire */
21 u_int   wirelen =       sizeof(pkt);
22
23 /* Packet length passed on buffer */
24 u_int   buflen =        sizeof(pkt);
25
26 /* Invalid instruction */
27 int     invalid =       1;
28
29 /* Expected return value */
30 u_int   expect =        0;
31
32 /* Expected signal */
33 #ifdef BPF_JIT_COMPILER
34 int     expect_signal = SIGSEGV;
35 #else
36 int     expect_signal = SIGABRT;
37 #endif