attacknetwork

package
v0.27.6-retry-block-up... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2022 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttackNetwork

type AttackNetwork struct {
	component.Component
	// contains filtered or unexported fields
}

AttackNetwork implements a middleware for mounting an attack orchestrator and empowering it to communicate with the corrupted nodes.

func NewAttackNetwork

func NewAttackNetwork(
	logger zerolog.Logger,
	codec network.Codec,
	orchestrator insecure.AttackOrchestrator,
	connector insecure.CorruptedNodeConnector,
	corruptedNodeIds flow.IdentityList) (*AttackNetwork, error)

func (*AttackNetwork) Observe

func (a *AttackNetwork) Observe(message *insecure.Message)

Observe is the inbound message handler of the attack network. Instead of dispatching their messages to the networking layer of Flow, the conduits of corrupted nodes dispatch the outgoing messages to the attack network by calling the InboundHandler method of it remotely.

func (*AttackNetwork) Send

func (a *AttackNetwork) Send(event *insecure.Event) error

Send enforces dissemination of given event via its encapsulated corrupted node networking layer through the Flow network

type CorruptedConnector

type CorruptedConnector struct {
	// contains filtered or unexported fields
}

func NewCorruptedConnector

func NewCorruptedConnector(
	logger zerolog.Logger,
	corruptedNodeIds flow.IdentityList,
	corruptedPortMapping map[flow.Identifier]string) *CorruptedConnector

func (*CorruptedConnector) Connect

Connect creates a connection the corruptible conduit factory of the given corrupted identity.

func (*CorruptedConnector) WithIncomingMessageHandler added in v0.27.0

func (c *CorruptedConnector) WithIncomingMessageHandler(handler func(*insecure.Message))

WithIncomingMessageHandler sets the handler for the incoming messages from remote corrupted nodes.

type CorruptedNodeConnection

type CorruptedNodeConnection struct {
	component.Component
	// contains filtered or unexported fields
}

CorruptedNodeConnection abstracts connection between an attack orchestrator to a corruptible conduit factory (ccf) through the attack network.

func (*CorruptedNodeConnection) CloseConnection

func (c *CorruptedNodeConnection) CloseConnection() error

CloseConnection closes the connection to the corrupted conduit factory.

func (*CorruptedNodeConnection) SendMessage

func (c *CorruptedNodeConnection) SendMessage(message *insecure.Message) error

SendMessage sends the message from orchestrator to the corrupted conduit factory.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL