summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Bex <peter@more-magic.net>2013-08-27 22:32:50 +0200
committerPeter Bex <peter@more-magic.net>2016-03-04 21:38:49 +0100
commitad2bb6db82a463c52b34d6c9fdba95beb6625cc7 (patch)
treefbb53c343e0eb627b027a53342dfc41f856306e5
parent8ed1e1d9da4ac8a6d5827d8a1938f1067055a6be (diff)
downloadbpf-ad2bb6db82a463c52b34d6c9fdba95beb6625cc7.tar.gz
Update for latest bitstring versionHEADmaster
-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"