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.
This commit is contained in:
Timothy Messier committed 2023-05-31 12:18:23 +00:00
1 parent 78ea1a9f3a
commit b88b4cce75
1 file changed
+15 -4
+15 -4
View File
@@ -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
}