diff options
Diffstat (limited to 'tools/regression/bpf/bpf_filter/tests/test0046.h')
-rw-r--r-- | tools/regression/bpf/bpf_filter/tests/test0046.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tools/regression/bpf/bpf_filter/tests/test0046.h b/tools/regression/bpf/bpf_filter/tests/test0046.h new file mode 100644 index 0000000..0c9d72e --- /dev/null +++ b/tools/regression/bpf/bpf_filter/tests/test0046.h @@ -0,0 +1,33 @@ +/*- + * Test 0046: Check boundary conditions (BPF_LD|BPF_H|BPF_IND) + * + * $FreeBSD$ + */ + +/* BPF program */ +struct bpf_insn pc[] = { + BPF_STMT(BPF_LD|BPF_IMM, 0xdeadc0de), + BPF_STMT(BPF_LDX|BPF_IMM, 1), + BPF_STMT(BPF_LD|BPF_H|BPF_IND, 2), + BPF_STMT(BPF_RET+BPF_A, 0), +}; + +/* Packet */ +u_char pkt[] = { + 0x01, 0x23, 0x45, 0x67, +}; + +/* Packet length seen on wire */ +u_int wirelen = sizeof(pkt); + +/* Packet length passed on buffer */ +u_int buflen = sizeof(pkt); + +/* Invalid instruction */ +int invalid = 0; + +/* Expected return value */ +u_int expect = 0; + +/* Expeced signal */ +int expect_signal = 0; |