]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - tools/regression/bpf/bpf_filter/tests/test0043.h
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / tools / regression / bpf / bpf_filter / tests / test0043.h
1 /*-
2  * Test 0043:   Check boundary conditions (BPF_LD+BPF_H+BPF_ABS)
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_LD+BPF_H+BPF_ABS, 2),
11         BPF_STMT(BPF_RET+BPF_A, 0),
12 };
13
14 /* Packet */
15 u_char  pkt[] = {
16         0x01, 0x23, 0x45,
17 };
18
19 /* Packet length seen on wire */
20 u_int   wirelen =       sizeof(pkt);
21
22 /* Packet length passed on buffer */
23 u_int   buflen =        sizeof(pkt);
24
25 /* Invalid instruction */
26 int     invalid =       0;
27
28 /* Expected return value */
29 u_int   expect =        0;
30
31 /* Expected signal */
32 int     expect_signal = 0;