Documentation ¶
Index ¶
- type PCAPLog
- type PCAPReceivedPacket
- type Packet
- type StateMachine
- func (s *StateMachine) AssertState(state string) bool
- func (s *StateMachine) AssertStateOrState(state1 string, state2 string) bool
- func (s *StateMachine) ChangeState(newState string)
- func (s *StateMachine) Init(states []string, logInfo, logErr func(interface{}))
- func (s *StateMachine) SetEntity(e string)
- func (s *StateMachine) State() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PCAPLog ¶
type PCAPLog struct {
// contains filtered or unexported fields
}
PCAPLog is a collection of PCAPReceivedPackets
type PCAPReceivedPacket ¶
type PCAPReceivedPacket struct { ID uint32 ReceivedAt uint64 SentAt uint64 Delay uint64 DataLen uint32 IsFinalFragment bool // contains filtered or unexported fields }
PCAPReceivedPacket represents a PCAP that was transmitted through Prifi and received at the relay
type Packet ¶
type Packet struct { ID uint32 MsSinceBeginningOfCapture uint64 //milliseconds since beginning of capture Header []byte RealLength int }
Packet is an ID(Packet number), TimeSent in microsecond, and some Data
type StateMachine ¶
is used to asset that an entity is in a given state
func (*StateMachine) AssertState ¶
func (s *StateMachine) AssertState(state string) bool
asserts (and returns true/false) that the state is the one given. Fails if the given state is invalid
func (*StateMachine) AssertStateOrState ¶
func (s *StateMachine) AssertStateOrState(state1 string, state2 string) bool
asserts (and returns true/false) that the state is the one given. Fails if the given state is invalid
func (*StateMachine) ChangeState ¶
func (s *StateMachine) ChangeState(newState string)
changes state if it is valid
func (*StateMachine) Init ¶
func (s *StateMachine) Init(states []string, logInfo, logErr func(interface{}))
creates a StateMachine with two logging functions. The initial state will be states[0]
func (*StateMachine) SetEntity ¶
func (s *StateMachine) SetEntity(e string)
sets the entity used in printing the log messages