]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - tools/regression/bpf/bpf_filter/tests/test0078.h
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / tools / regression / bpf / bpf_filter / tests / test0078.h
1 /*-
2  * Test 0078:   Check boundary conditions (BPF_STX)
3  *
4  * $FreeBSD$
5  */
6
7 /* BPF program */
8 struct bpf_insn pc[] = {
9         BPF_STMT(BPF_LD+BPF_IMM, 0xdeadc0de),
10         BPF_STMT(BPF_STX, 0x8fffffff),
11         BPF_STMT(BPF_MISC+BPF_TXA, 0),
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 =        0xdeadc0de;
31
32 /* Expected signal */
33 #ifdef __amd64__
34 int     expect_signal = SIGBUS;
35 #else
36 int     expect_signal = SIGSEGV;
37 #endif