From ad2bb6db82a463c52b34d6c9fdba95beb6625cc7 Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Tue, 27 Aug 2013 22:32:50 +0200 Subject: Update for latest bitstring version --- bpf-assembler.scm | 5 +++-- bpf.meta | 2 +- bpf.setup | 4 ++-- tests/run.scm | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/bpf-assembler.scm b/bpf-assembler.scm index c626bee..207b271 100644 --- a/bpf-assembler.scm +++ b/bpf-assembler.scm @@ -14,10 +14,11 @@ ;; Labels are jump offset from *next* instruction (a little surprising perhaps) (define (label? x) (and (integer? x) (<= 0 x 256))) +(use-for-syntax srfi-1 matchable) + ;; Basic idea stolen from sixtyfive-oh-two. Thanks, Felix! ;) (begin-for-syntax (import chicken) - (use srfi-1 matchable) (define addrmodes '()) (define opcodes '()) @@ -207,7 +208,7 @@ (define (write-decimal-bpf-bytecode code #!optional (port (current-output-port)) raw-code?) - (let ((code (bitstring-of-any code))) + (let ((code (->bitstring code))) (unless raw-code? (fprintf port "~A\n" (quotient (bitstring-length code) 64))) (let lp ((code code)) diff --git a/bpf.meta b/bpf.meta index 9be37e7..f5347ef 100644 --- a/bpf.meta +++ b/bpf.meta @@ -4,5 +4,5 @@ (author "Peter Bex") (category net) (license "BSD") - (depends (bitstring "0.6") matchable) + (depends (bitstring "1.11") matchable) (test-depends test)) diff --git a/bpf.setup b/bpf.setup index ba55d90..37007b4 100644 --- a/bpf.setup +++ b/bpf.setup @@ -1,9 +1,9 @@ ;; -*- Scheme -*- -(compile -s -O3 bpf-interface.scm -j bpf-interface) -(compile -s -O3 bpf-interface.import.scm) (compile -s -O3 bpf-assembler.scm -j bpf-assembler) (compile -s -O3 bpf-assembler.import.scm) +(compile -s -O3 bpf-interface.scm -j bpf-interface) +(compile -s -O3 bpf-interface.import.scm) (install-extension 'bpf diff --git a/tests/run.scm b/tests/run.scm index fd4c692..36db071 100644 --- a/tests/run.scm +++ b/tests/run.scm @@ -140,7 +140,7 @@ "6 0 0 65535" "6 0 0 0") "\n" 'suffix) - (lambda () (read-decimal-bpf-bytecode))))) + read-decimal-bpf-bytecode))) (test "unoptimised connection creation/teardown dump" `((ldh (pkt 12)) (jeq #x0800 0 37) @@ -228,7 +228,7 @@ "6 0 0 65535" "6 0 0 0") "\n" 'suffix) - (lambda () (read-decimal-bpf-bytecode)))))) + read-decimal-bpf-bytecode)))) (test-group "decimal bytecode writer" (test "src localhost" -- cgit v1.2.3