Documentation ¶
Overview ¶
Package tcp contains the structures and interface for peer-to-peer communications through a TCP bind listener used for Agent communications TCP listener's do not have a server because the Merlin Server does not send/receive messages. They are sent through peer-to-peer communications
Index ¶
- func DefaultOptions() map[string]string
- type Listener
- func (l *Listener) Addr() string
- func (l *Listener) Authenticate(id uuid.UUID, data interface{}) (messages.Base, error)
- func (l *Listener) Authenticator() authenticators.Authenticator
- func (l *Listener) ConfiguredOptions() (options map[string]string)
- func (l *Listener) Construct(msg messages.Base, key []byte) (data []byte, err error)
- func (l *Listener) Deconstruct(data, key []byte) (messages.Base, error)
- func (l *Listener) Description() string
- func (l *Listener) ID() uuid.UUID
- func (l *Listener) Name() string
- func (l *Listener) Options() map[string]string
- func (l *Listener) PSK() string
- func (l *Listener) Protocol() int
- func (l *Listener) Server() *servers.ServerInterface
- func (l *Listener) SetOption(option string, value string) error
- func (l *Listener) Status() string
- func (l *Listener) String() string
- func (l *Listener) Transformers() []transformer.Transformer
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultOptions ¶
DefaultOptions returns a map of configurable listener options that will subsequently be passed to the NewTCPListener function
Types ¶
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
Listener is an aggregate structure that implements the Listener interface
func NewTCPListener ¶
NewTCPListener is a factory that creates and returns a Listener aggregate that implements the Listener interface
func (*Listener) Authenticate ¶
Authenticate takes data coming into the listener from an agent and passes it to the listener's configured authenticator to authenticate the agent. Once an agent is authenticated, this function will no longer be used.
func (*Listener) Authenticator ¶
func (l *Listener) Authenticator() authenticators.Authenticator
Authenticator returns the authenticator the listener is configured to use
func (*Listener) ConfiguredOptions ¶
ConfiguredOptions returns the server's current configuration for options that can be set by the user
func (*Listener) Construct ¶
Construct takes in a messages.Base structure that is ready to be sent to an agent and runs all the data transforms on it to encode and encrypt it. If an empty key is passed in, then the listener's interface encryption key will be used.
func (*Listener) Deconstruct ¶
Deconstruct takes in data that an agent sent to the listener and runs all the listener's transforms on it until a messages.Base structure is returned. The key is used for decryption transforms. If an empty key is passed in, then the listener's interface encryption key will be used.
func (*Listener) Description ¶
Description returns the listener's description
func (*Listener) Options ¶
Options returns the original map of options passed into the NewTCPListener function
func (*Listener) PSK ¶
PSK returns the listener's pre-shared key used for encrypting & decrypting agent messages
func (*Listener) Protocol ¶
Protocol returns a constant from the listeners package that represents the protocol type of this listener
func (*Listener) Server ¶
func (l *Listener) Server() *servers.ServerInterface
Server is not used by TCP listeners because the Merlin Server itself does not listen for or send Agent messages. TCP listeners are used for peer-to-peer communications that come in from other listeners like the HTTP listener. This functions returns nil because it is not used but required to implement the interface.
func (*Listener) Status ¶
Status returns the status of the embedded server's state, required to implement the Listener interface. TCP Listeners do not have an embedded server and therefore returns a static "Created"
func (*Listener) Transformers ¶
func (l *Listener) Transformers() []transformer.Transformer
Transformers returns a list of transforms the lister is configured to use
type Repository ¶
type Repository interface { Add(listener Listener) error Exists(name string) bool List() func(string) []string Listeners() []Listener ListenerByID(id uuid.UUID) (Listener, error) ListenerByName(name string) (Listener, error) RemoveByID(id uuid.UUID) error SetOption(id uuid.UUID, options, value string) error }
Repository is an interface to store and manage TCP listeners