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

Method handleShellPanelCommand

admin/cli/interactive.go:1039–1065  ·  view source on GitHub ↗
(route string, uuid string)

Source from the content-addressed store, hash-verified

1037}
1038
1039func (console *Console) handleShellPanelCommand(route string, uuid string) {
1040 sMessage := protocol.PrepareAndDecideWhichSProtoToLower(global.G_Component.Conn, global.G_Component.Secret, global.G_Component.UUID)
1041
1042 header := &protocol.Header{
1043 Sender: protocol.ADMIN_UUID,
1044 Accepter: uuid,
1045 MessageType: protocol.SHELLCOMMAND,
1046 RouteLen: uint32(len([]byte(route))),
1047 Route: route,
1048 }
1049
1050 console.ready <- true
1051
1052 for {
1053 select {
1054 case tCommand := <-console.getCommand:
1055 shellCommandMess := &protocol.ShellCommand{
1056 CommandLen: uint64(len(tCommand)),
1057 Command: tCommand,
1058 }
1059 protocol.ConstructMessage(sMessage, header, shellCommandMess, false)
1060 sMessage.SendMessage()
1061 case <-console.mgr.ConsoleManager.Exit:
1062 return
1063 }
1064 }
1065}
1066
1067func (console *Console) handleSSHPanelCommand(route string, uuid string) {
1068 sMessage := protocol.PrepareAndDecideWhichSProtoToLower(global.G_Component.Conn, global.G_Component.Secret, global.G_Component.UUID)

Callers 1

Calls 3

ConstructMessageFunction · 0.92
SendMessageMethod · 0.65

Tested by

no test coverage detected