feat(bsr/ssh): Add file transfer direction to channel summary

When an SSH channel is used for a file transfer, the summary will report
the detected direction of the file transfer as either an upload or
download, relative to the end client.
pull/3251/head
Timothy Messier 3 years ago
parent 78ea1a9f3a
commit b88b4cce75
No known key found for this signature in database
GPG Key ID: EFD2F184F7600572

@ -59,6 +59,16 @@ func ValidExecApplicationProgram(d ExecApplicationProgram) bool {
return false
}
// FileTransferDirection indicates the direction of a file transfer.
type FileTransferDirection string
// Valid file transfer directions.
const (
FileTransferNotApplicable FileTransferDirection = "not applicable"
FileTransferUpload FileTransferDirection = "upload"
FileTransferDownload FileTransferDirection = "download"
)
// ChannelSummary encapsulates data for a channel
// SessionProgram can only be one of the following: exec, shell, or subsystem
// SubsystemName is only populated if SessionProgram is subsystem
@ -66,8 +76,9 @@ func ValidExecApplicationProgram(d ExecApplicationProgram) bool {
//
// scp, rsync, or unknown
type ChannelSummary struct {
ChannelSummary *bsr.ChannelSummary
SessionProgram SessionProgram
SubsystemName string
ExecProgram ExecApplicationProgram
ChannelSummary *bsr.ChannelSummary
SessionProgram SessionProgram
SubsystemName string
ExecProgram ExecApplicationProgram
FileTransferDirection FileTransferDirection
}

Loading…
Cancel
Save