summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bpf-assembler.scm5
-rw-r--r--bpf.meta2
-rw-r--r--bpf.setup4
-rw-r--r--tests/run.scm4
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"