Commits

Peter Bex  committed 0144ae1

Update for latest bitstring version

  • Participants
  • Parent commits afe0a79

Comments (0)

Files changed (4)

File bpf-assembler.scm

 ;; 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   '())
 
 (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))
  (author "Peter Bex")
  (category net)
  (license "BSD")
- (depends (bitstring "0.6") matchable)
+ (depends (bitstring "1.11") matchable)
  (test-depends test))
 ;; -*- Scheme -*-
 
+(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)
-(compile -s -O3 bpf-assembler.scm -j bpf-assembler)
-(compile -s -O3 bpf-assembler.import.scm)
 
 (install-extension
   'bpf

File tests/run.scm

                 "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)
                 "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"