]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - tools/regression/bpf/bpf_filter/tests/test0076.h
THIS BRANCH IS OBSOLETE, PLEASE READ:
[FreeBSD/FreeBSD.git] / tools / regression / bpf / bpf_filter / tests / test0076.h
1 /*-
2  * Test 0076:   Check boundary conditions (BPF_LDX+BPF_MEM)
3  *
4  * $FreeBSD$
5  */
6
7 /* BPF program */
8 static struct bpf_insn  pc[] = {
9         BPF_STMT(BPF_LD+BPF_IMM, 0xdeadc0de),
10         BPF_STMT(BPF_LDX+BPF_MEM, 0x8fffffff),
11         BPF_STMT(BPF_MISC+BPF_TXA, 0),
12         BPF_STMT(BPF_RET+BPF_A, 0),
13 };
14
15 /* Packet */
16 static u_char   pkt[] = {
17         0x00,
18 };
19
20 /* Packet length seen on wire */
21 static u_int    wirelen =       sizeof(pkt);
22
23 /* Packet length passed on buffer */
24 static u_int    buflen =        sizeof(pkt);
25
26 /* Invalid instruction */
27 static int      invalid =       1;
28
29 /* Expected return value */
30 static u_int    expect =        0xdeadc0de;
31
32 /* Expected signal */
33 #ifdef __amd64__
34 static int      expect_signal = SIGBUS;
35 #else
36 static int      expect_signal = SIGSEGV;
37 #endif