Make note re: checksums

This commit is contained in:
Tony Garnock-Jones 2014-06-16 10:15:53 -04:00
parent 97009ad9a7
commit b5e73b8462
1 changed files with 3 additions and 3 deletions

6
ip.rkt
View File

@ -46,7 +46,7 @@
(fragment-offset :: bits 13)
ttl
protocol
(header-checksum :: bits 16)
(header-checksum :: bits 16) ;; TODO: check checksum
(source-ip0 :: binary bits 32)
(destination-ip0 :: binary bits 32)
(rest :: binary) ]
@ -124,7 +124,7 @@
(match e
[(message (ip-packet peer-address _ _ _ _ body) _ _)
(bit-string-case body
([ type code (checksum :: integer bytes 2) (rest :: binary) ]
([ type code (checksum :: integer bytes 2) (rest :: binary) ] ;; TODO: check cksum
(case type
[(8) ;; ECHO (0 is ECHO-REPLY)
(log-info "Ping of ~a from ~a"
@ -153,4 +153,4 @@
[_ #f]))
(void)
(gestalt-union (pub (ip-packet my-address ? ? PROTOCOL-ICMP ? ?))
(sub (ip-packet ? my-address ? PROTOCOL-ICMP ? ?)))))
(sub (ip-packet ? my-address ? PROTOCOL-ICMP ? ?)))))