frr

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package frr implements the "Fake Rapid Response" service. It contains Fleetspeak modules that can be used to simulate GRR traffic through the Fleetspeak system for integration and load testing.

Index

Constants

This section is empty.

Variables

View Source
var DefaultFRRMaster fgrpc.MasterClient

DefaultFRRMaster sets a default connection to the FRR master server. This default will be used by the FRR ServerService if a configuration is not provided. It exists to allow special connection types.

Functions

func ClientServiceFactory

func ClientServiceFactory(conf *fspb.ClientServiceConfig) (cservice.Service, error)

ClientServiceFactory is a client.ServiceFactory which produces a frr client component.

func ServerServiceFactory

func ServerServiceFactory(sc *srpb.ServiceConfig) (service.Service, error)

ServerServiceFactory is a server.ServiceFactory which produces a FRR server component. This component receives messages from clients and forwards them (via grpc calls) to a MasterServer.

Types

type MasterServer

type MasterServer struct {
	fgrpc.UnimplementedMasterServer
	// contains filtered or unexported fields
}

A MasterServer implements fgrpc.MasterServer which records (in ram) metadata about received messages. It also provides methods to examine this metadata, check it for consistency and trigger FRR operations.

func NewMasterServer

func NewMasterServer(admin sgrpc.AdminClient) *MasterServer

NewMasterServer returns MasterServer object.

func (*MasterServer) AllRequests

func (s *MasterServer) AllRequests(id common.ClientID) []int64

AllRequests returns a list of all requests for the client which we've received any data for.

func (*MasterServer) CompletedRequests

CompletedRequests implements fgrpc.MasterServer and returns a list of requests made to a client which have been completed.

func (*MasterServer) CreateBroadcastRequest

func (s *MasterServer) CreateBroadcastRequest(ctx context.Context, rd *fpb.TrafficRequestData, limit uint64) error

CreateBroadcastRequest initiates a hunt which sends the provided TrafficRequestData to every client, up to limit.

func (*MasterServer) CreateFileDownloadHunt

func (s *MasterServer) CreateFileDownloadHunt(ctx context.Context, name string, limit uint64) error

CreateFileDownloadHunt initiates a hunt which requests that up to limit clients download the file identified by name.

func (*MasterServer) CreateHunt

CreateHunt implements fgrpc.MasterServer and initiates a hunt which sends the provided TrafficRequestData to provided clients, or to every client, up to limit, if ClientIds is empty

func (*MasterServer) GetCompletedRequests

func (s *MasterServer) GetCompletedRequests(id common.ClientID) []int64

GetCompletedRequests returns a list of requests made to a client which have been completed.

func (*MasterServer) RecordFileResponse

func (s *MasterServer) RecordFileResponse(ctx context.Context, i *fpb.FileResponseInfo) (*fspb.EmptyMessage, error)

RecordFileResponse implements fgrpc.MasterServer and records that the message was received.

func (*MasterServer) RecordTrafficResponse

func (s *MasterServer) RecordTrafficResponse(ctx context.Context, i *fpb.MessageInfo) (*fspb.EmptyMessage, error)

RecordTrafficResponse implements fgrpc.MasterServer and records that the message was received.

func (*MasterServer) SetAdminClient

func (s *MasterServer) SetAdminClient(admin sgrpc.AdminClient)

SetAdminClient changes the stub that is used to contact the FS server.

func (*MasterServer) WatchCompleted

func (s *MasterServer) WatchCompleted() <-chan common.ClientID

WatchCompleted creates, and returns a channel which notifies when a request to a client is completed. Repeated calls return the same channel. Should only be called before the server is exported. (i.e. when it is idle)

Directories

Path Synopsis
proto

Jump to

Keyboard shortcuts

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