prifi_lib

package
v0.0.0-...-465a192 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package prifi contains the implementation of the PriFi protocol. It is network-agnostic and defines a MessageSender interface to interact with the network in prifi.go.

Index

Constants

View Source
const (
	PRIFI_ROLE_UNDEFINED int16 = iota
	PRIFI_ROLE_RELAY
	PRIFI_ROLE_CLIENT
	PRIFI_ROLE_TRUSTEE
)

Possible role of PriFi entities. The role restricts the kind of messages an entity can receive at a given point in time. The roles are mutually exclusive.

Variables

This section is empty.

Functions

This section is empty.

Types

type PriFiLibInstance

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

PriFiLibInstance contains the mutable state of a PriFi entity.

func NewPriFiClient

func NewPriFiClient(doLatencyTest bool, dataOutputEnabled bool, dataForDCNet chan []byte, dataFromDCNet chan []byte, doReplayPcap bool, pcapFolder string, msgSender net.MessageSender) *PriFiLibInstance

NewPriFiClient creates a new PriFi client

func NewPriFiRelay

func NewPriFiRelay(dataOutputEnabled bool, dataForClients chan []byte, dataFromDCNet chan []byte, experimentResultChan chan interface{}, timeoutHandler func([]int, []int), msgSender net.MessageSender) *PriFiLibInstance

NewPriFiRelay creates a new PriFi relay

func NewPriFiTrustee

func NewPriFiTrustee(neverSlowDown bool, alwaysSlowDown bool, baseSleepTime int, msgSender net.MessageSender) *PriFiLibInstance

NewPriFiTrustee creates a new PriFi trustee

func (*PriFiLibInstance) ReceivedMessage

func (p *PriFiLibInstance) ReceivedMessage(msg interface{}) error

ReceivedMessage must be called when a PriFi host receives a message. It takes care to call the correct message handler function.

type SpecializedLibInstance

type SpecializedLibInstance interface {
	ReceivedMessage(msg interface{}) error
}

Prifi's "Relay", "Client" and "Trustee" instance all can receive a message

Directories

Path Synopsis
Package config contains the cryptographic primitives that are used by the PriFi library.
Package config contains the cryptographic primitives that are used by the PriFi library.

Jump to

Keyboard shortcuts

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