Make note re: checksums
This commit is contained in:
parent
97009ad9a7
commit
b5e73b8462
6
ip.rkt
6
ip.rkt
|
@ -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 ? ?)))))
|
||||
|
|
Loading…
Reference in New Issue