Make all ssh-msg structs inherit from a supertype.

This commit is contained in:
Tony Garnock-Jones 2011-10-23 16:38:23 -04:00
parent 69ee05d88c
commit 18fcb4cebd
1 changed files with 5 additions and 2 deletions

View File

@ -20,7 +20,8 @@
mpint-width
t:name-list)
(provide (struct-out ssh-msg-kexinit)
(provide (struct-out ssh-msg)
(struct-out ssh-msg-kexinit)
(struct-out ssh-msg-kexdh-init)
(struct-out ssh-msg-kexdh-reply)
(struct-out ssh-msg-disconnect)
@ -29,6 +30,8 @@
(struct-out ssh-msg-debug)
(struct-out ssh-msg-ignore))
(struct ssh-msg () #:transparent)
(define decoder-map (make-hasheqv))
(define-values (prop:ssh-message-encoder ssh-message-encoder? ssh-message-encoder)
@ -48,7 +51,7 @@
(syntax-rules ()
((_ name type-byte-value (field-type field-name) ...)
(begin
(struct name (field-name ...)
(struct name ssh-msg (field-name ...)
#:transparent
#:property prop:ssh-message-encoder
(compute-ssh-message-encoder type-byte-value field-type ...))