aboutsummaryrefslogtreecommitdiff
path: root/tools/regression/bpf/bpf_filter/tests/test0035.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/regression/bpf/bpf_filter/tests/test0035.h')
-rw-r--r--tools/regression/bpf/bpf_filter/tests/test0035.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/tools/regression/bpf/bpf_filter/tests/test0035.h b/tools/regression/bpf/bpf_filter/tests/test0035.h
new file mode 100644
index 000000000000..d7f157fffdcb
--- /dev/null
+++ b/tools/regression/bpf/bpf_filter/tests/test0035.h
@@ -0,0 +1,32 @@
+/*-
+ * Test 0035: BPF_ALU+BPF_DIV+BPF_K
+ *
+ * $FreeBSD$
+ */
+
+/* BPF program */
+struct bpf_insn pc[] = {
+ BPF_STMT(BPF_LD+BPF_IMM, 0xa7c2da06),
+ BPF_STMT(BPF_ALU+BPF_DIV+BPF_K, 0xdead),
+ BPF_STMT(BPF_RET+BPF_A, 0),
+};
+
+/* Packet */
+u_char pkt[] = {
+ 0x00,
+};
+
+/* 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 = 0xc0de;
+
+/* Expected signal */
+int expect_signal = 0;