Documentation ¶
Index ¶
- Variables
- func CheckNoActivePorts()
- func GobEncode(d interface{}) []byte
- func HandleStreamAcknowledge(msg *Message)
- func HandleStreamClose(msg *Message)
- func HandleStreamCreate(msg *Message)
- func HandleStreamFlow(msg *Message)
- func NewActiveStream(tracker *StreamMeta)
- func NewFileServerConnection(address string, t ConnectorType, requester NodeID, FileConnID ConnectID)
- func NewFileServerListener(address string, t ConnectorType, requester NodeID, FileConnID ConnectID)
- func NewPortForwardConnection(address string, t ConnectorType, dstNode NodeID, dstAddress string, ...)
- func NewPortForwardListener(address string, t ConnectorType, dstNode NodeID, dstAddress string, ...)
- func NewShellConnection(address string, t ConnectorType, requester NodeID)
- func NewShellListener(address string, t ConnectorType, requester NodeID)
- func NewTCPConnection(address string)
- func NewTCPListener(address string)
- func NewUID(id []byte)
- func ParameterHandling()
- func ProcessMessagePortForward(msg *Message)
- func RandString(seed string, n int) string
- func RemoveActiveStream(id StreamID)
- func STARCoreSetup()
- func SetupConnectionCertificate(certPEMBlock []byte, keyPEMBlock []byte) (err error)
- func SqrtedString(b []byte, sep string) string
- func StringifySubarray(arr []string, starti int, endi int) (s string)
- func UnregisterConnection(connID ConnectID)
- func UnregisterListener(connID ConnectID)
- type ConnectID
- type Connection
- type Connector
- type ConnectorType
- type FileServer_Connection
- func (c FileServer_Connection) Close()
- func (c FileServer_Connection) DataSize() (s int)
- func (c FileServer_Connection) Handle()
- func (c FileServer_Connection) MessageDuration() (d time.Duration)
- func (c FileServer_Connection) Read(data []byte) (n int, err error)
- func (c FileServer_Connection) Send(msg Message) (err error)
- func (c FileServer_Connection) Write(data []byte) (n int, err error)
- type FileServer_Connector
- type Message
- func NewConnection(address string) (msg *Message)
- func NewMessage() (msg *Message)
- func NewMessageBindTCP(address string) (msg *Message)
- func NewMessageChatRequest(Nickname string, Content string) (msg *Message)
- func NewMessageConnectTCP(address string) (msg *Message)
- func NewMessageError(errorType MessageErrorResponseType, context string) (msg *Message)
- func NewMessageFileServerBindRequest(t ConnectorType, address string, fileconnid ConnectID) (msg *Message)
- func NewMessageFileServerConnectRequest(t ConnectorType, address string, fileconnid ConnectID) (msg *Message)
- func NewMessageFileServerInitiateTransferRequest(FileConnID ConnectID, AgentConnID ConnectID) (msg *Message)
- func NewMessageHello() (msg *Message)
- func NewMessageKillSwitch() (msg *Message)
- func NewMessageNewBind(address string) (msg *Message)
- func NewMessagePortForwardRequest(SrcAddress string, SrcType ConnectorType, DstNode NodeID, DstAddress string, ...) (msg *Message)
- func NewMessageRemoteCDRequest(Directory string) (msg *Message)
- func NewMessageRemoteCDResponse(NewDirectory string, OldDirectory string, Requester NodeID) (msg *Message)
- func NewMessageRemoteLSRequest(Directory string) (msg *Message)
- func NewMessageRemoteLSResponse(Directory string, FileInfos []os.FileInfo) (msg *Message)
- func NewMessageRemoteMkDirRequest(Directory string) (msg *Message)
- func NewMessageRemoteMkDirResponse(Directory string) (msg *Message)
- func NewMessageRemotePWDRequest() (msg *Message)
- func NewMessageRemotePWDResponse(Directory string) (msg *Message)
- func NewMessageRemoteTmpDirRequest() (msg *Message)
- func NewMessageRemoteTmpDirResponse(Directory string) (msg *Message)
- func NewMessageShellBindRequest(t ConnectorType, address string) (msg *Message)
- func NewMessageShellConnectionRequest(t ConnectorType, address string) (msg *Message)
- func NewMessageSyncRequest() (msg *Message)
- func NewMessageSyncResponse() (msg *Message)
- func NewMessageTerminate(t MessageTerminateType, index uint) (msg *Message)
- type MessageBindRequest
- type MessageChatRequest
- type MessageConnectRequest
- type MessageErrorResponse
- type MessageErrorResponseType
- type MessageFileServerBindRequest
- type MessageFileServerConnectRequest
- type MessageFileServerInitiateTransferRequest
- type MessageHelloResponse
- type MessageID
- type MessageKillSwitchRequest
- type MessageNewBindResponse
- type MessageNewConnectionResponse
- type MessagePortForwardRequest
- type MessageRemoteCDRequest
- type MessageRemoteCDResponse
- type MessageRemoteLSFileFormat
- type MessageRemoteLSRequest
- type MessageRemoteLSResponse
- type MessageRemoteMkDirRequest
- type MessageRemoteMkDirResponse
- type MessageRemotePWDRequest
- type MessageRemotePWDResponse
- type MessageRemoteTmpDirRequest
- type MessageRemoteTmpDirResponse
- type MessageShellBindRequest
- type MessageShellConnectionRequest
- type MessageSyncRequest
- type MessageSyncResponse
- type MessageTerminateRequest
- type MessageTerminateType
- type MessageType
- type Node
- type NodeID
- type NodeInfo
- func (ni *NodeInfo) AddConnector(id ConnectID, t ConnectorType, info string)
- func (ni *NodeInfo) AddListener(id ConnectID, t ConnectorType, info string)
- func (ni *NodeInfo) AddStream(id StreamID, t StreamType, info string, owner NodeID)
- func (ni *NodeInfo) RemoveConnector(id ConnectID)
- func (ni *NodeInfo) RemoveListener(id ConnectID)
- func (ni *NodeInfo) RemoveStream(id StreamID)
- func (ni *NodeInfo) Setup()
- func (ni *NodeInfo) Update()
- type NodeType
- type PortForward_Connection
- func (c PortForward_Connection) Close()
- func (c PortForward_Connection) DataSize() (s int)
- func (c PortForward_Connection) Handle()
- func (c PortForward_Connection) MessageDuration() (d time.Duration)
- func (c PortForward_Connection) Read(data []byte) (n int, err error)
- func (c PortForward_Connection) Send(msg Message) (err error)
- func (c PortForward_Connection) Write(data []byte) (n int, err error)
- type PortForward_Connector
- type Shell_Connection
- func (c Shell_Connection) Close()
- func (c Shell_Connection) DataSize() (s int)
- func (c Shell_Connection) Handle()
- func (c Shell_Connection) MessageDuration() (d time.Duration)
- func (c Shell_Connection) Read(data []byte) (n int, err error)
- func (c Shell_Connection) Send(msg Message) (err error)
- func (c Shell_Connection) Write(data []byte) (n int, err error)
- type Shell_Connector
- type Stream
- type StreamID
- type StreamMeta
- func GetActiveStream(id StreamID) (tracker *StreamMeta, ok bool)
- func NewStreamMeta(t StreamType, dstID NodeID, context string, writer func(data []byte), ...) (meta *StreamMeta)
- func NewStreamMetaCommand(dstID NodeID, context string, writer func(data []byte), ...) (meta *StreamMeta)
- func NewStreamMetaDownload(dstID NodeID, context string, writer func(data []byte), ...) (meta *StreamMeta)
- func NewStreamMetaFileServer(dstID NodeID, context string, writer func(data []byte), ...) (meta *StreamMeta)
- func NewStreamMetaMirror(metaOrig *StreamMeta, dstID NodeID) (metaNew *StreamMeta)
- func NewStreamMetaPortForwardingTCP(dstID NodeID, context string, writer func(data []byte), ...) (meta *StreamMeta)
- func NewStreamMetaPortForwardingUDP(dstID NodeID, context string, writer func(data []byte), ...) (meta *StreamMeta)
- func NewStreamMetaShell(dstID NodeID, context string, writer func(data []byte), ...) (meta *StreamMeta)
- func NewStreamMetaUpload(dstID NodeID, context string, writer func(data []byte), ...) (meta *StreamMeta)
- type StreamTakeover
- type StreamType
- type TCP_Connection
- func (c TCP_Connection) Close()
- func (c TCP_Connection) DataSize() (s int)
- func (c TCP_Connection) Handle()
- func (c TCP_Connection) MessageDuration() (d time.Duration)
- func (c TCP_Connection) Read(data []byte) (n int, err error)
- func (c TCP_Connection) Send(msg Message) (err error)
- func (c TCP_Connection) Write(data []byte) (n int, err error)
- type TCP_Connector
Constants ¶
This section is empty.
Variables ¶
var ConnectionCert tls.Certificate
var ConnectionConfig *tls.Config
Functions ¶
func CheckNoActivePorts ¶ added in v1.1.0
func CheckNoActivePorts()
func HandleStreamAcknowledge ¶
func HandleStreamAcknowledge(msg *Message)
func HandleStreamClose ¶
func HandleStreamClose(msg *Message)
func HandleStreamCreate ¶
func HandleStreamCreate(msg *Message)
func HandleStreamFlow ¶
func HandleStreamFlow(msg *Message)
func NewActiveStream ¶
func NewActiveStream(tracker *StreamMeta)
func NewFileServerConnection ¶
func NewFileServerConnection(address string, t ConnectorType, requester NodeID, FileConnID ConnectID)
func NewFileServerListener ¶
func NewFileServerListener(address string, t ConnectorType, requester NodeID, FileConnID ConnectID)
func NewPortForwardConnection ¶ added in v1.1.0
func NewPortForwardConnection(address string, t ConnectorType, dstNode NodeID, dstAddress string, dstType ConnectorType)
func NewPortForwardListener ¶ added in v1.1.0
func NewPortForwardListener(address string, t ConnectorType, dstNode NodeID, dstAddress string, dstType ConnectorType)
func NewShellConnection ¶
func NewShellConnection(address string, t ConnectorType, requester NodeID)
func NewShellListener ¶
func NewShellListener(address string, t ConnectorType, requester NodeID)
func NewTCPConnection ¶
func NewTCPConnection(address string)
func NewTCPListener ¶
func NewTCPListener(address string)
func ParameterHandling ¶
func ParameterHandling()
Allows for the creation of listeners (bind) and connections (connect) via command-line arguments.
func ProcessMessagePortForward ¶ added in v1.1.0
func ProcessMessagePortForward(msg *Message)
func RandString ¶
func RemoveActiveStream ¶
func RemoveActiveStream(id StreamID)
func STARCoreSetup ¶
func STARCoreSetup()
func SqrtedString ¶
SqrtedString turns a []byte into a hexadecimal string that is split into substrings demarcated by the specified separator string. The number of substrings is equal to the square root of the length of []byte. (Note: If "len([]byte)" is not a square number, not all data will be included).
func UnregisterConnection ¶
func UnregisterConnection(connID ConnectID)
UnregisterConnection removes a Connection from the tracker
func UnregisterListener ¶
func UnregisterListener(connID ConnectID)
Types ¶
type ConnectID ¶
type ConnectID [9]byte
The ConnectID type is a fixed-length byte array which should serve as a UUID for each Connection
func NewConnectID ¶
func NewConnectID() (id ConnectID)
func RegisterConnection ¶
func RegisterConnection(conn Connection) ConnectID
RegisterConnection adds a Connection to the tracker
func RegisterListener ¶
RegisterListener adds a Listener to the tracker
type Connection ¶
type Connection interface { Handle() MessageDuration() time.Duration Send(msg Message) (err error) Read(data []byte) (n int, err error) Write(data []byte) (n int, err error) Close() DataSize() (s int) }
The Connection interface provides the standard functions for using STAR node communications.
func GetConnectionById ¶
func GetConnectionById(connID ConnectID) (c Connection, ok bool)
func GetConnectionByString ¶
func GetConnectionByString(connID string) (c Connection, ok bool)
type Connector ¶
The Connector interface provides the standard functions for creating STAR node connections.
func GetListener ¶
type ConnectorType ¶
type ConnectorType byte
const ( // ConnectorType_TCPTLS is used by the terminal to tell an agent that a TCP // connector should be used when requesting a bind or a connect. This is the // required means of connections between S.T.A.R. nodes. ConnectorType_TCPTLS ConnectorType = iota + 1 ConnectorType_ShellTCP ConnectorType_ShellTCPTLS ConnectorType_ShellUDP ConnectorType_ShellUDPTLS ConnectorType_FileServerTCP ConnectorType_FileServerTCPTLS ConnectorType_FileServerUDP ConnectorType_FileServerUDPTLS ConnectorType_PortForwardTCP ConnectorType_PortForwardUDP )
type FileServer_Connection ¶
type FileServer_Connection struct { Type ConnectorType NetConn net.Conn TLSConn *tls.Conn ID ConnectID FileConnID ConnectID StreamID StreamID Destination NodeID }
func (FileServer_Connection) Close ¶
func (c FileServer_Connection) Close()
func (FileServer_Connection) DataSize ¶ added in v1.1.0
func (c FileServer_Connection) DataSize() (s int)
func (FileServer_Connection) Handle ¶
func (c FileServer_Connection) Handle()
func (FileServer_Connection) MessageDuration ¶
func (c FileServer_Connection) MessageDuration() (d time.Duration)
func (FileServer_Connection) Read ¶
func (c FileServer_Connection) Read(data []byte) (n int, err error)
func (FileServer_Connection) Send ¶
func (c FileServer_Connection) Send(msg Message) (err error)
type FileServer_Connector ¶
type FileServer_Connector struct { Type ConnectorType Address string Listener *net.Listener Requester NodeID FileConnID ConnectID }
func (*FileServer_Connector) Close ¶
func (connector *FileServer_Connector) Close()
func (*FileServer_Connector) Connect ¶
func (connector *FileServer_Connector) Connect() (err error)
func (*FileServer_Connector) Listen ¶
func (connector *FileServer_Connector) Listen() (err error)
type Message ¶
type Message struct { ID MessageID Source NodeID Destination NodeID Type MessageType Data []byte }
The Message type serves as the overarching data structure for STAR messages.
func NewConnection ¶
func NewMessage ¶
func NewMessage() (msg *Message)
NewMessage creates and sets up a bare-bones STAR Message
func NewMessageBindTCP ¶
func NewMessageChatRequest ¶
func NewMessageConnectTCP ¶
func NewMessageError ¶
func NewMessageError(errorType MessageErrorResponseType, context string) (msg *Message)
func NewMessageFileServerBindRequest ¶
func NewMessageFileServerBindRequest(t ConnectorType, address string, fileconnid ConnectID) (msg *Message)
func NewMessageFileServerConnectRequest ¶
func NewMessageFileServerConnectRequest(t ConnectorType, address string, fileconnid ConnectID) (msg *Message)
func NewMessageHello ¶
func NewMessageHello() (msg *Message)
func NewMessageKillSwitch ¶
func NewMessageKillSwitch() (msg *Message)
func NewMessageNewBind ¶
func NewMessagePortForwardRequest ¶ added in v1.1.0
func NewMessagePortForwardRequest(SrcAddress string, SrcType ConnectorType, DstNode NodeID, DstAddress string, DstType ConnectorType) (msg *Message)
func NewMessageRemotePWDRequest ¶
func NewMessageRemotePWDRequest() (msg *Message)
func NewMessageRemoteTmpDirRequest ¶
func NewMessageRemoteTmpDirRequest() (msg *Message)
func NewMessageShellBindRequest ¶
func NewMessageShellBindRequest(t ConnectorType, address string) (msg *Message)
func NewMessageShellConnectionRequest ¶
func NewMessageShellConnectionRequest(t ConnectorType, address string) (msg *Message)
func NewMessageSyncRequest ¶
func NewMessageSyncRequest() (msg *Message)
func NewMessageSyncResponse ¶
func NewMessageSyncResponse() (msg *Message)
func NewMessageTerminate ¶
func NewMessageTerminate(t MessageTerminateType, index uint) (msg *Message)
func (*Message) GobDecodeMessage ¶
GobDecode gob decodes the provided data(d) into a type(t) pointer
func (*Message) HandleStream ¶
func (msg *Message) HandleStream()
type MessageBindRequest ¶
type MessageBindRequest struct { Type ConnectorType Data []byte }
type MessageChatRequest ¶
type MessageConnectRequest ¶
type MessageConnectRequest struct { Type ConnectorType Data []byte }
type MessageErrorResponse ¶
type MessageErrorResponse struct { Type MessageErrorResponseType Context string }
MessageError holds values related to any error messages returned by an Agent Node. Termainal Nodes *should not* send error messages to Agent Nodes.
type MessageErrorResponseType ¶
type MessageErrorResponseType byte
const ( MessageErrorResponseTypeX509KeyPair MessageErrorResponseType = iota + 1 MessageErrorResponseTypeConnectionLost MessageErrorResponseTypeBindDropped MessageErrorResponseTypeGobDecodeError MessageErrorResponseTypeAgentExitSignal MessageErrorResponseTypeUnsupportedConnectorType MessageErrorResponseTypeUnsupportedTerminationType MessageErrorResponseTypeInvalidTerminationIndex MessageErrorResponseTypeCommandEnded MessageErrorResponseTypeShellConnectionLost MessageErrorResponseTypeFileDownloadOpenFileError MessageErrorResponseTypeFileUploadOpenFileError MessageErrorResponseTypeFileDownloadCompleted MessageErrorResponseTypeFileUploadCompleted MessageErrorResponseTypeDirectoryCreationError MessageErrorResponseTypeFileServerConnectionLost MessageErrorResponseTypeFileServerConnectionNotFound MessageErrorResponseTypePortForwardingConnectionNotFound MessageErrorResponseTypePortForwardingConnectionLost )
type MessageFileServerBindRequest ¶
type MessageFileServerBindRequest struct { Address string Type ConnectorType Requester NodeID FileConnID ConnectID }
type MessageFileServerConnectRequest ¶
type MessageFileServerConnectRequest struct { Address string Type ConnectorType Requester NodeID FileConnID ConnectID }
type MessageHelloResponse ¶
type MessageID ¶
type MessageID [16]byte
The MessageID type is a fixed-length byte array which should serve as a UUID for each Message
type MessageKillSwitchRequest ¶
type MessageKillSwitchRequest struct { }
type MessageNewBindResponse ¶
type MessageNewBindResponse struct {
Address string
}
type MessageNewConnectionResponse ¶
type MessageNewConnectionResponse struct {
Address string
}
type MessagePortForwardRequest ¶ added in v1.1.0
type MessagePortForwardRequest struct { DstNode NodeID SrcType ConnectorType DstType ConnectorType SrcAddress string DstAddress string }
type MessageRemoteCDRequest ¶
type MessageRemoteCDRequest struct {
Directory string
}
type MessageRemoteCDResponse ¶
type MessageRemoteLSRequest ¶
type MessageRemoteLSRequest struct {
Directory string
}
type MessageRemoteLSResponse ¶
type MessageRemoteLSResponse struct { Directory string Files []MessageRemoteLSFileFormat }
type MessageRemoteMkDirRequest ¶
type MessageRemoteMkDirRequest struct {
Directory string
}
type MessageRemoteMkDirResponse ¶
type MessageRemoteMkDirResponse struct {
Directory string
}
type MessageRemotePWDRequest ¶
type MessageRemotePWDRequest struct { }
type MessageRemotePWDResponse ¶
type MessageRemotePWDResponse struct {
Directory string
}
type MessageRemoteTmpDirRequest ¶
type MessageRemoteTmpDirRequest struct { }
type MessageRemoteTmpDirResponse ¶
type MessageRemoteTmpDirResponse struct {
Directory string
}
type MessageShellBindRequest ¶
type MessageShellBindRequest struct { Address string Type ConnectorType Requester NodeID }
type MessageShellConnectionRequest ¶
type MessageShellConnectionRequest struct { Address string Type ConnectorType Requester NodeID }
type MessageSyncRequest ¶
type MessageSyncRequest struct { }
type MessageSyncResponse ¶
type MessageTerminateRequest ¶
type MessageTerminateRequest struct { Type MessageTerminateType Index uint }
type MessageTerminateType ¶
type MessageTerminateType byte
const ( MessageTerminateTypeAgent MessageTerminateType = iota + 1 MessageTerminateTypeConnection MessageTerminateTypeListener MessageTerminateTypeShell MessageTerminateTypeStream )
type MessageType ¶
type MessageType byte
The MessageType type indicates the type of Message
const ( // MessageTypeError identifies the Message as being in relation to an // error that occurred on the Agent and is being relayed to the Terminal // user. MessageTypeError MessageType = iota + 1 // MessageTypeSyncRequest identifies the Message as being a synchronization // request from the Terminal to Agents. The Message will be forwarded to // all neighboring Agents. MessageTypeSyncRequest // MessageTypeSyncResponse identifies the Message as being a // synchronization response from Agents to the Terminal. The Message // will be forwarded to all neighboring Agents. MessageTypeSyncResponse // MessageTypeKillSwitch identifies the Message as being a self-destruct // request from the Terminal to Agents. The Message will *only* be // forwarded if the correct confirmation code is passed. MessageTypeKillSwitch // MessageTypeStream* identifies the Message as being related to // bi-directional interactive traffic (i.e., a command prompt) MessageTypeStream MessageTypeStreamCreate MessageTypeStreamAcknowledge MessageTypeStreamClose MessageTypeStreamTakeover // MessageTypeStreamTakenOver is not handled by the stream, but rather // the terminal who previously had access to the stream. MessageTypeStreamTakenOver // MessageTypeBind indentifies the Message as being related to // the creation of a Listener on an agent MessageTypeBind // MessageTypeConnect identifies the Message as being related to // the creation of a Connection on an agent MessageTypeConnect // MessageTypeHello identifies the Message as being related to a // new node joining the constellation MessageTypeHello // MessageTypeNewBind identifies the message as being related to // the successful creation of a new listener. This is separate // from the MessageTypeBind Response in that this is sent to the // broadcast NodeID, so all terminals will be aware. MessageTypeNewBind // MessageTypeNewConnection identifies the message as being related to // the successful creation of a new connection. This is separate from the // MessageTypeConnection Response in that this is sent to the broadcast // NodeID, so all terminals will be aware. MessageTypeNewConnection // MessageTypeTerminateAgent identifies the message as being related to // the termination request of an agent. MessageTypeTerminate // MessageTypeShellBind identifies the message as being related to the // creation of a new shell listener. MessageTypeShellBind // MessageTypeShellConnection identifies the message as being related to the // creation of a new shell connection. MessageTypeShellConnection // MessageTypeFileServerBind identifies the message as being related to the // creation of a new single-use file server. MessageTypeFileServerBind // MessageTypeFileServerConnection identifies the message as being related to the // creation of a new file server connection. MessageTypeFileServerConnect // MessageTypeFileServerInitiateTransfer identifies the message as being related to // the transfer initiation of a file server file. MessageTypeFileServerInitiateTransfer // MessageTypeRemoteCD identifies the message as being related to the changing // of the working directory for the remote node (agent). MessageTypeRemoteCDRequest MessageTypeRemoteCDResponse // MessageTypeRemoteLS identifies the message as being related to the listing // of files and directories for the remote node (agent). MessageTypeRemoteLSRequest MessageTypeRemoteLSResponse // MessageTypeRemoteMkDir identifies the message as being related to the creation // of a directory for the remote node (agent). MessageTypeRemoteMkDirRequest MessageTypeRemoteMkDirResponse // MessageTypeRemotePWD identifies the message as being related to the listing // of the present working directory MessageTypeRemotePWDRequest MessageTypeRemotePWDResponse // MessageTypeRemoteTmpDir identifies the message as being related to the creation // of a temporary directory for the remote node (agent.) MessageTypeRemoteTmpDirRequest MessageTypeRemoteTmpDirResponse // MessageTypeChat identifies the message as being related to chatting MessageTypeChat // MessageTypePortForwardRequest identifies the message as being related to the // setting up of port forwarding MessageTypePortForwardRequest )
type Node ¶
type Node struct { ID NodeID Type NodeType Neighbors []NodeID MessageProcessor func(*Message) Printer func(NodeID, StreamID, ...interface{}) }
The Node type serves as the overarching data structure for tracking STAR nodes.
var ThisNode Node
type NodeID ¶
type NodeID [9]byte
The NodeID type is a fixed-length byte array which should serve as a UUID for each Node
func (NodeID) IsBroadcastNodeID ¶
Is the NodeID the Broadcast NodeID?
type NodeInfo ¶
type NodeInfo struct { ConnectionIDs map[uint]ConnectID ConnectionInfos map[uint]string ConnectionTypes map[uint]ConnectorType ListenerIDs map[uint]ConnectID ListenerInfos map[uint]string ListenerTypes map[uint]ConnectorType StreamIDs map[uint]StreamID StreamInfos map[uint]string StreamOwners map[uint]NodeID StreamTypes map[uint]StreamType GOOS string GOARCH string OS_egid int OS_environ []string OS_euid int OS_gid int OS_groups []int OS_hostname string OS_pagesize int OS_pid int OS_ppid int OS_uid int OS_workingdir string Interfaces []net.Interface // contains filtered or unexported fields }
var ThisNodeInfo NodeInfo
func (*NodeInfo) AddConnector ¶
func (ni *NodeInfo) AddConnector(id ConnectID, t ConnectorType, info string)
func (*NodeInfo) AddListener ¶
func (ni *NodeInfo) AddListener(id ConnectID, t ConnectorType, info string)
func (*NodeInfo) AddStream ¶
func (ni *NodeInfo) AddStream(id StreamID, t StreamType, info string, owner NodeID)
func (*NodeInfo) RemoveConnector ¶
func (*NodeInfo) RemoveListener ¶
func (*NodeInfo) RemoveStream ¶
type NodeType ¶
type NodeType byte
NodeType determines what kind of STAR Node we are dealing with (e.g., a terminal or an agent).
type PortForward_Connection ¶ added in v1.1.0
type PortForward_Connection struct { Type ConnectorType NetConn net.Conn DstNode NodeID DstAddress string DstType ConnectorType ID ConnectID StreamID StreamID }
func (PortForward_Connection) Close ¶ added in v1.1.0
func (c PortForward_Connection) Close()
func (PortForward_Connection) DataSize ¶ added in v1.1.0
func (c PortForward_Connection) DataSize() (s int)
func (PortForward_Connection) Handle ¶ added in v1.1.0
func (c PortForward_Connection) Handle()
func (PortForward_Connection) MessageDuration ¶ added in v1.1.0
func (c PortForward_Connection) MessageDuration() (d time.Duration)
func (PortForward_Connection) Read ¶ added in v1.1.0
func (c PortForward_Connection) Read(data []byte) (n int, err error)
func (PortForward_Connection) Send ¶ added in v1.1.0
func (c PortForward_Connection) Send(msg Message) (err error)
type PortForward_Connector ¶ added in v1.1.0
type PortForward_Connector struct { Type ConnectorType Address string DstNode NodeID DstAddress string DstType ConnectorType Listener *net.Listener }
func (*PortForward_Connector) Close ¶ added in v1.1.0
func (connector *PortForward_Connector) Close()
func (*PortForward_Connector) Connect ¶ added in v1.1.0
func (connector *PortForward_Connector) Connect() (err error)
func (*PortForward_Connector) Listen ¶ added in v1.1.0
func (connector *PortForward_Connector) Listen() (err error)
type Shell_Connection ¶
type Shell_Connection struct { Type ConnectorType NetConn net.Conn TLSConn *tls.Conn ID ConnectID StreamID StreamID Destination NodeID }
func (Shell_Connection) Close ¶
func (c Shell_Connection) Close()
func (Shell_Connection) DataSize ¶ added in v1.1.0
func (c Shell_Connection) DataSize() (s int)
func (Shell_Connection) Handle ¶
func (c Shell_Connection) Handle()
func (Shell_Connection) MessageDuration ¶
func (c Shell_Connection) MessageDuration() (d time.Duration)
func (Shell_Connection) Send ¶
func (c Shell_Connection) Send(msg Message) (err error)
type Shell_Connector ¶
type Shell_Connector struct { Type ConnectorType Address string Listener *net.Listener Requester NodeID }
func (*Shell_Connector) Close ¶
func (connector *Shell_Connector) Close()
func (*Shell_Connector) Connect ¶
func (connector *Shell_Connector) Connect() (err error)
func (*Shell_Connector) Listen ¶
func (connector *Shell_Connector) Listen() (err error)
type StreamID ¶
type StreamID [9]byte
func (StreamID) IsEmptyStreamID ¶
Is the StreamID an empty StreamID?
type StreamMeta ¶
type StreamMeta struct { ID StreamID Type StreamType // Context is the command to run for command execution, and agent's file system file path/name for upload/download Context string // contains filtered or unexported fields }
func GetActiveStream ¶
func GetActiveStream(id StreamID) (tracker *StreamMeta, ok bool)
func NewStreamMeta ¶
func NewStreamMeta(t StreamType, dstID NodeID, context string, writer func(data []byte), closer func(s StreamID)) (meta *StreamMeta)
NewStreamMeta is called by the terminal to setup a stream meta
func NewStreamMetaCommand ¶
func NewStreamMetaCommand(dstID NodeID, context string, writer func(data []byte), closer func(s StreamID)) (meta *StreamMeta)
func NewStreamMetaDownload ¶
func NewStreamMetaDownload(dstID NodeID, context string, writer func(data []byte), closer func(s StreamID)) (meta *StreamMeta)
func NewStreamMetaFileServer ¶
func NewStreamMetaFileServer(dstID NodeID, context string, writer func(data []byte), closer func(s StreamID)) (meta *StreamMeta)
func NewStreamMetaMirror ¶
func NewStreamMetaMirror(metaOrig *StreamMeta, dstID NodeID) (metaNew *StreamMeta)
NewStreamMetaMirror is called by the agent to mirror/setup a stream meta
func NewStreamMetaPortForwardingTCP ¶ added in v1.1.0
func NewStreamMetaPortForwardingTCP(dstID NodeID, context string, writer func(data []byte), closer func(s StreamID)) (meta *StreamMeta)
func NewStreamMetaPortForwardingUDP ¶ added in v1.1.0
func NewStreamMetaPortForwardingUDP(dstID NodeID, context string, writer func(data []byte), closer func(s StreamID)) (meta *StreamMeta)
func NewStreamMetaShell ¶
func NewStreamMetaShell(dstID NodeID, context string, writer func(data []byte), closer func(s StreamID)) (meta *StreamMeta)
func NewStreamMetaUpload ¶
func NewStreamMetaUpload(dstID NodeID, context string, writer func(data []byte), closer func(s StreamID)) (meta *StreamMeta)
func (*StreamMeta) Close ¶
func (meta *StreamMeta) Close()
func (*StreamMeta) SendMessageAcknowledge ¶
func (meta *StreamMeta) SendMessageAcknowledge()
func (*StreamMeta) SendMessageClose ¶
func (meta *StreamMeta) SendMessageClose()
func (*StreamMeta) SendMessageCreate ¶
func (meta *StreamMeta) SendMessageCreate()
func (*StreamMeta) SendMessageWrite ¶
func (meta *StreamMeta) SendMessageWrite(data []byte)
type StreamTakeover ¶
type StreamTakeover struct {
ID StreamID
}
type StreamType ¶
type StreamType byte
const ( StreamTypeCommand StreamType = iota + 1 StreamTypeFileDownload StreamTypeFileServer StreamTypeFileUpload StreamTypeShell StreamTypePortForwardTCP StreamTypePortForwardUDP )
type TCP_Connection ¶
type TCP_Connection struct { TLSConn *tls.Conn NetConn net.Conn ID ConnectID Encoder *gob.Encoder Decoder *gob.Decoder }
func (TCP_Connection) Close ¶
func (c TCP_Connection) Close()
func (TCP_Connection) DataSize ¶ added in v1.1.0
func (c TCP_Connection) DataSize() (s int)
func (TCP_Connection) Handle ¶
func (c TCP_Connection) Handle()
func (TCP_Connection) MessageDuration ¶
func (c TCP_Connection) MessageDuration() (d time.Duration)
func (TCP_Connection) Send ¶
func (c TCP_Connection) Send(msg Message) (err error)
type TCP_Connector ¶
func (*TCP_Connector) Close ¶
func (connector *TCP_Connector) Close()
func (*TCP_Connector) Connect ¶
func (connector *TCP_Connector) Connect() (err error)
func (*TCP_Connector) Listen ¶
func (connector *TCP_Connector) Listen() error