1/*- 2 * Test 0070: Check boundary conditions (BPF_LD+BPF_B+BPF_IND) 3 * 4 * $FreeBSD$ 5 */ 6 7/* BPF program */ 8static struct bpf_insn pc[] = { 9 BPF_STMT(BPF_LD+BPF_IMM, 0xdeadc0de), 10 BPF_STMT(BPF_LDX+BPF_IMM, 1), 11 BPF_STMT(BPF_LD+BPF_B+BPF_IND, 0), 12 BPF_STMT(BPF_RET+BPF_A, 0), 13}; 14 15/* Packet */ 16static u_char pkt[] = { 17 0x01, 0x23, 0x45, 18}; 19 20/* Packet length seen on wire */ 21static u_int wirelen = sizeof(pkt); 22 23/* Packet length passed on buffer */ 24static u_int buflen = 0; 25 26/* Invalid instruction */ 27static int invalid = 0; 28 29/* Expected return value */ 30static u_int expect = 0; 31 32/* Expected signal */ 33static int expect_signal = 0; 34