lua

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Copyright 2021 Thorben Krüger (thorben.krueger@ovgu.de)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2021-2024 Thorben Krüger (thorben.krueger@ovgu.de)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2021-2024 Thorben Krüger (thorben.krueger@ovgu.de)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStats

func NewStats(state *State) extra.MultiConnectionTracer

Types

type LJValue added in v0.1.0

type LJValue struct {
	lua.LValue
}

LJValue is an (un)marshallable container for gopher-lua LValue, supports Lua-to-JSON, JSON-to-Lua.

func NewLJValue added in v0.1.0

func NewLJValue(lvalue lua.LValue) LJValue

NewLJValue wraps given lua lvalue

func (LJValue) MarshalJSON added in v0.1.0

func (lv LJValue) MarshalJSON() ([]byte, error)

MarshalJSON returns a recursive JSON encoding of the lua.LValue wrapped by lv

func (*LJValue) UnmarshalJSON added in v0.1.0

func (lv *LJValue) UnmarshalJSON(b []byte) error

UnmarshalJSON (re)sets *lv to a new lua Datastructure parsed from b. In case of complex types represented in b, it does so recursively. Implementation detail: In case of errors, *lv will remain unmodified.

type LuaSelector

type LuaSelector struct {
	*State
	// contains filtered or unexported fields
}

func NewMultiSelector

func NewMultiSelector(state *State) *LuaSelector

func NewLuaSelector(script string) (*LuaSelector, error) { func NewMultiSelector(state *State) extra.MultiSelector {

func (*LuaSelector) Close

func (s *LuaSelector) Close(local, remote pan.UDPAddr) error

func (*LuaSelector) Initialize

func (s *LuaSelector) Initialize(prefs map[string]string, local, remote pan.UDPAddr, paths []*pan.Path) error

func (*LuaSelector) JSON

func (s *LuaSelector) JSON(indata []byte) (outdata []byte, err error)

Call JSON() function in the underlying Lua module with indata automatically unmarshalled from JSON to Lua table. Marshal returned Lua data automatically to JSON, return result as outdata

func (*LuaSelector) Path

func (s *LuaSelector) Path(local, remote pan.UDPAddr) (*pan.Path, error)

func (*LuaSelector) PathDown

func (s *LuaSelector) PathDown(local, remote pan.UDPAddr, fp pan.PathFingerprint, pi pan.PathInterface) error

func (*LuaSelector) Refresh

func (s *LuaSelector) Refresh(local, remote pan.UDPAddr, paths []*pan.Path) error

func (*LuaSelector) SetPreferences

func (s *LuaSelector) SetPreferences(prefs map[string]string, local, remote pan.UDPAddr) error

type State

type State struct {
	*lua.LState
	sync.Mutex
	*log.Logger
	// contains filtered or unexported fields
}

func NewState

func NewState(opts ...lua.Options) *State

func (*State) DoFile

func (s *State) DoFile(fname string) error

Open file under fname and run it

func (*State) DoReader

func (s *State) DoReader(r io.Reader, name string) error

func (*State) GetString

func (s *State) GetString() string

func (*State) LoadScript deprecated

func (s *State) LoadScript(fname string) error

Open file under fname and run it

Deprecated: Should be called DoFile, kept for backward compatibility

type Stats

type Stats struct {
	*State
	// contains filtered or unexported fields
}

func (*Stats) AcknowledgedPacket

func (s *Stats) AcknowledgedPacket(local, remote *pan.UDPAddr, level logging.EncryptionLevel, num logging.PacketNumber) error

func (*Stats) BufferedPacket

func (s *Stats) BufferedPacket(local, remote *pan.UDPAddr, ptype logging.PacketType) error

func (*Stats) Close

func (s *Stats) Close(local, remote *pan.UDPAddr) error

func (*Stats) ClosedConnection

func (s *Stats) ClosedConnection(local, remote *pan.UDPAddr, err error) error

func (*Stats) Debug

func (s *Stats) Debug(local, remote *pan.UDPAddr, name, msg string) error

func (*Stats) DroppedEncryptionLevel

func (s *Stats) DroppedEncryptionLevel(local, remote *pan.UDPAddr, level logging.EncryptionLevel) error

func (*Stats) DroppedKey

func (s *Stats) DroppedKey(local, remote *pan.UDPAddr, generation logging.KeyPhase) error

func (*Stats) DroppedPacket

func (s *Stats) DroppedPacket(local, remote *pan.UDPAddr, ptype logging.PacketType, size logging.ByteCount, reason logging.PacketDropReason) error

func (*Stats) LossTimerCanceled

func (s *Stats) LossTimerCanceled(local, remote *pan.UDPAddr) error

func (*Stats) LossTimerExpired

func (s *Stats) LossTimerExpired(local, remote *pan.UDPAddr, ttype logging.TimerType, level logging.EncryptionLevel) error

func (*Stats) LostPacket

func (s *Stats) LostPacket(local, remote *pan.UDPAddr, level logging.EncryptionLevel, num logging.PacketNumber, reason logging.PacketLossReason) error

func (*Stats) NegotiatedVersion

func (s *Stats) NegotiatedVersion(local, remote *pan.UDPAddr, chosen logging.VersionNumber, clientVersions, serverVersions []logging.VersionNumber) error

func (*Stats) ReceivedPacket

func (s *Stats) ReceivedPacket(local, remote *pan.UDPAddr, hdr *logging.ExtendedHeader, size logging.ByteCount, frames []logging.Frame) error

func (*Stats) ReceivedRetry

func (s *Stats) ReceivedRetry(local, remote *pan.UDPAddr, hdr *logging.Header) error

func (*Stats) ReceivedTransportParameters

func (s *Stats) ReceivedTransportParameters(local, remote *pan.UDPAddr, parameters *logging.TransportParameters) error

func (*Stats) ReceivedVersionNegotiationPacket

func (s *Stats) ReceivedVersionNegotiationPacket(local, remote *pan.UDPAddr, hdr *logging.Header, versions []logging.VersionNumber) error

func (*Stats) RestoredTransportParameters

func (s *Stats) RestoredTransportParameters(local, remote *pan.UDPAddr, parameters *logging.TransportParameters) error

func (*Stats) SentPacket

func (s *Stats) SentPacket(local, remote *pan.UDPAddr, hdr *logging.ExtendedHeader, size logging.ByteCount, ack *logging.AckFrame, frames []logging.Frame) error

func (*Stats) SentTransportParameters

func (s *Stats) SentTransportParameters(local, remote *pan.UDPAddr, parameters *logging.TransportParameters) error

func (*Stats) SetLossTimer

func (s *Stats) SetLossTimer(local, remote *pan.UDPAddr, ttype logging.TimerType, level logging.EncryptionLevel, t time.Time) error

func (*Stats) StartedConnection

func (s *Stats) StartedConnection(local, remote *pan.UDPAddr, srcConnID, destConnID logging.ConnectionID) error

func (*Stats) TracerForConnection

func (s *Stats) TracerForConnection(tracer_id uint64, p logging.Perspective, odcid logging.ConnectionID) error

func (*Stats) UpdatedCongestionState

func (s *Stats) UpdatedCongestionState(local, remote *pan.UDPAddr, state logging.CongestionState) error

func (*Stats) UpdatedKey

func (s *Stats) UpdatedKey(local, remote *pan.UDPAddr, generation logging.KeyPhase, rmte bool) error

func (*Stats) UpdatedKeyFromTLS

func (s *Stats) UpdatedKeyFromTLS(local, remote *pan.UDPAddr, level logging.EncryptionLevel, p logging.Perspective) error

func (*Stats) UpdatedMetrics

func (s *Stats) UpdatedMetrics(local, remote *pan.UDPAddr, rttStats *extra.RTTStats, cwnd, bytesInFlight logging.ByteCount, packetsInFlight int) error

func (*Stats) UpdatedPTOCount

func (s *Stats) UpdatedPTOCount(local, remote *pan.UDPAddr, value uint32) error

Jump to

Keyboard shortcuts

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