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
- type PriFiLibInstance
- func NewPriFiClient(doLatencyTest bool, dataOutputEnabled bool, dataForDCNet chan []byte, ...) *PriFiLibInstance
- func NewPriFiRelay(dataOutputEnabled bool, dataForClients chan []byte, dataFromDCNet chan []byte, ...) *PriFiLibInstance
- func NewPriFiTrustee(neverSlowDown bool, alwaysSlowDown bool, baseSleepTime int, ...) *PriFiLibInstance
- type SpecializedLibInstance
Constants ¶
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