diff options
author | Peter Bex <peter@more-magic.net> | 2013-08-27 22:32:50 +0200 |
---|---|---|
committer | Peter Bex <peter@more-magic.net> | 2016-03-04 21:38:49 +0100 |
commit | ad2bb6db82a463c52b34d6c9fdba95beb6625cc7 (patch) | |
tree | fbb53c343e0eb627b027a53342dfc41f856306e5 | |
parent | 8ed1e1d9da4ac8a6d5827d8a1938f1067055a6be (diff) | |
download | bpf-master.tar.gz |
-rw-r--r-- | bpf-assembler.scm | 5 | ||||
-rw-r--r-- | bpf.meta | 2 | ||||
-rw-r--r-- | bpf.setup | 4 | ||||
-rw-r--r-- | 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)) @@ -4,5 +4,5 @@ (author "Peter Bex") (category net) (license "BSD") - (depends (bitstring "0.6") matchable) + (depends (bitstring "1.11") matchable) (test-depends test)) @@ -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" |