MCPcopy
hub / github.com/ph4ntonn/Stowaway / handleSSHPanelCommand

Method handleSSHPanelCommand

admin/cli/interactive_win.go:1068–1094  ·  view source on GitHub ↗
(route string, uuid string)

Source from the content-addressed store, hash-verified

1066}
1067
1068func (console *Console) handleSSHPanelCommand(route string, uuid string) {
1069 sMessage := protocol.PrepareAndDecideWhichSProtoToLower(global.G_Component.Conn, global.G_Component.Secret, global.G_Component.UUID)
1070
1071 header := &protocol.Header{
1072 Sender: protocol.ADMIN_UUID,
1073 Accepter: uuid,
1074 MessageType: protocol.SSHCOMMAND,
1075 RouteLen: uint32(len([]byte(route))),
1076 Route: route,
1077 }
1078
1079 console.ready <- true
1080
1081 for {
1082 select {
1083 case tCommand := <-console.getCommand:
1084 sshCommandMess := &protocol.SSHCommand{
1085 CommandLen: uint64(len(tCommand)),
1086 Command: tCommand,
1087 }
1088 protocol.ConstructMessage(sMessage, header, sshCommandMess, false)
1089 sMessage.SendMessage()
1090 case <-console.mgr.ConsoleManager.Exit:
1091 return
1092 }
1093 }
1094}
1095
1096func (console *Console) expectParams(params []string, numbers interface{}, mode int, needToBeInt interface{}) bool {
1097 switch nums := numbers.(type) {

Callers 1

Calls 3

ConstructMessageFunction · 0.92
SendMessageMethod · 0.65

Tested by

no test coverage detected