diff --git a/ssh-channel.rkt b/ssh-channel.rkt new file mode 100644 index 0000000..f38d536 --- /dev/null +++ b/ssh-channel.rkt @@ -0,0 +1,43 @@ +#lang racket/base + +(require racket/set) +(require racket/match) + +(require "ssh-numbers.rkt") +(require "ssh-message-types.rkt") +(require "ssh-exceptions.rkt") + +(require "os2-support.rkt") + +(provide (struct-out ssh-channel)) + +;; A CloseState is one of +;; - 'neither, indicating that neither side has signalled closure +;; - 'local, only the local end has signalled closure +;; - 'remote, only the remote end has signalled closure +;; - 'both, both ends have signalled closure. +;; Represents local knowledge of the state of a shared shutdown state +;; machine. +;; +;; 'neither +;; / \ +;; \/ \/ +;; 'local 'remote +;; \ / +;; \/ \/ +;; 'both + +;; A ChannelState is a (ssh-channel ...) TODO +;; Named ssh-channel to avoid conflicts with Racket's built-in +;; synchronous channels. +(struct ssh-channel (my-ref ;; Uint32 + your-ref ;; Maybe + type ;; String + continuations ;; TransactionManager (see ordered-rpc.rkt) + outbound-window ;; Maybe + outbound-packet-size ;; Maybe + inbound-window ;; Natural + eof-state ;; CloseState covering EOF signals + close-state ;; CloseState covering CLOSE signals + ) + #:transparent) diff --git a/ssh-session.rkt b/ssh-session.rkt index 774124f..f884e15 100644 --- a/ssh-session.rkt +++ b/ssh-session.rkt @@ -68,37 +68,6 @@ session-id) ;; starts off #f until initial keying #:transparent) -;; A CloseState is one of -;; - 'neither, indicating that neither side has signalled closure -;; - 'local, only the local end has signalled closure -;; - 'remote, only the remote end has signalled closure -;; - 'both, both ends have signalled closure. -;; Represents local knowledge of the state of a shared shutdown state -;; machine. -;; -;; 'neither -;; / \ -;; \/ \/ -;; 'local 'remote -;; \ / -;; \/ \/ -;; 'both - -;; A ChannelState is a (ssh-channel ...) TODO -;; Named ssh-channel to avoid conflicts with Racket's built-in -;; synchronous channels. -(struct ssh-channel (my-ref ;; Uint32 - your-ref ;; Maybe - type ;; String - continuations ;; TransactionManager (see ordered-rpc.rkt) - outbound-window ;; Maybe - outbound-packet-size ;; Maybe - inbound-window ;; Natural - eof-state ;; CloseState covering EOF signals - close-state ;; CloseState covering CLOSE signals - ) - #:transparent) - ;; Generic inputs into the exchange-hash part of key ;; exchange. Diffie-Hellman uses these fields along with the host key, ;; the exchange values, and the shared secret to get the final hash.