rpc

package
v0.2.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultDaemonAddress = &net.UnixAddr{
		Name: "/tmp/panapid.sock",
		Net:  "unix",
	}
	ErrDeref = errors.New("Can not dereference Nil value")
)

Functions

func NewConnectionTracerClient added in v0.2.0

func NewConnectionTracerClient(client *Client, id uint64, p logging.Perspective, odcid logging.ConnectionID) logging.ConnectionTracer

func NewServer added in v0.2.0

func NewServer(selector ServerSelector, tracer logging.Tracer, connectionTracer ServerConnectionTracer) (*rpc.Server, error)

func NewTracerClient added in v0.2.0

func NewTracerClient(client *Client) logging.Tracer

Types

type Client added in v0.2.0

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

func NewClient added in v0.2.0

func NewClient(conn io.ReadWriteCloser) (*Client, error)

func (*Client) Call added in v0.2.0

func (c *Client) Call(serviceMethod string, args interface{}, reply interface{}) error

func (*Client) Close added in v0.2.0

func (c *Client) Close() error

type ConnectionTracerClient added in v0.2.0

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

func (*ConnectionTracerClient) AcknowledgedPacket added in v0.2.0

func (c *ConnectionTracerClient) AcknowledgedPacket(level logging.EncryptionLevel, pnum logging.PacketNumber)

func (*ConnectionTracerClient) BufferedPacket added in v0.2.0

func (c *ConnectionTracerClient) BufferedPacket(ptype logging.PacketType)

func (*ConnectionTracerClient) Close added in v0.2.0

func (c *ConnectionTracerClient) Close()

func (*ConnectionTracerClient) ClosedConnection added in v0.2.0

func (c *ConnectionTracerClient) ClosedConnection(e error)

func (*ConnectionTracerClient) Debug added in v0.2.0

func (c *ConnectionTracerClient) Debug(name, msg string)

func (*ConnectionTracerClient) DroppedEncryptionLevel added in v0.2.0

func (c *ConnectionTracerClient) DroppedEncryptionLevel(level logging.EncryptionLevel)

func (*ConnectionTracerClient) DroppedKey added in v0.2.0

func (c *ConnectionTracerClient) DroppedKey(generation logging.KeyPhase)

func (*ConnectionTracerClient) DroppedPacket added in v0.2.0

func (c *ConnectionTracerClient) DroppedPacket(ptype logging.PacketType, size logging.ByteCount, reason logging.PacketDropReason)

func (*ConnectionTracerClient) LossTimerCanceled added in v0.2.0

func (c *ConnectionTracerClient) LossTimerCanceled()

func (*ConnectionTracerClient) LossTimerExpired added in v0.2.0

func (c *ConnectionTracerClient) LossTimerExpired(ttype logging.TimerType, level logging.EncryptionLevel)

func (*ConnectionTracerClient) LostPacket added in v0.2.0

func (*ConnectionTracerClient) NegotiatedVersion added in v0.2.0

func (c *ConnectionTracerClient) NegotiatedVersion(chosen logging.VersionNumber, clientVersions, serverVersions []logging.VersionNumber)

func (*ConnectionTracerClient) ReceivedPacket added in v0.2.0

func (c *ConnectionTracerClient) ReceivedPacket(hdr *logging.ExtendedHeader, size logging.ByteCount, frames []logging.Frame)

func (*ConnectionTracerClient) ReceivedRetry added in v0.2.0

func (c *ConnectionTracerClient) ReceivedRetry(hdr *logging.Header)

func (*ConnectionTracerClient) ReceivedTransportParameters added in v0.2.0

func (c *ConnectionTracerClient) ReceivedTransportParameters(parameters *logging.TransportParameters)

func (*ConnectionTracerClient) ReceivedVersionNegotiationPacket added in v0.2.0

func (c *ConnectionTracerClient) ReceivedVersionNegotiationPacket(hdr *logging.Header, versions []logging.VersionNumber)

func (*ConnectionTracerClient) RestoredTransportParameters added in v0.2.0

func (c *ConnectionTracerClient) RestoredTransportParameters(parameters *logging.TransportParameters)

func (*ConnectionTracerClient) SentPacket added in v0.2.0

func (c *ConnectionTracerClient) SentPacket(hdr *logging.ExtendedHeader, size logging.ByteCount, ack *logging.AckFrame, frames []logging.Frame)

func (*ConnectionTracerClient) SentTransportParameters added in v0.2.0

func (c *ConnectionTracerClient) SentTransportParameters(parameters *logging.TransportParameters)

func (*ConnectionTracerClient) SetLossTimer added in v0.2.0

func (c *ConnectionTracerClient) SetLossTimer(ttype logging.TimerType, level logging.EncryptionLevel, t time.Time)

func (*ConnectionTracerClient) StartedConnection added in v0.2.0

func (c *ConnectionTracerClient) StartedConnection(local, remote net.Addr, srcConnID, destConnID logging.ConnectionID)

func (*ConnectionTracerClient) UpdatedCongestionState added in v0.2.0

func (c *ConnectionTracerClient) UpdatedCongestionState(state logging.CongestionState)

func (*ConnectionTracerClient) UpdatedKey added in v0.2.0

func (c *ConnectionTracerClient) UpdatedKey(generation logging.KeyPhase, remote bool)

func (*ConnectionTracerClient) UpdatedKeyFromTLS added in v0.2.0

func (c *ConnectionTracerClient) UpdatedKeyFromTLS(level logging.EncryptionLevel, p logging.Perspective)

func (*ConnectionTracerClient) UpdatedMetrics added in v0.2.0

func (c *ConnectionTracerClient) UpdatedMetrics(rttStats *logging.RTTStats, cwnd, bytesInFlight logging.ByteCount, packetsInFlight int)

func (*ConnectionTracerClient) UpdatedPTOCount added in v0.2.0

func (c *ConnectionTracerClient) UpdatedPTOCount(value uint32)

type ConnectionTracerMsg added in v0.2.0

type ConnectionTracerMsg struct {
	Local, Remote                            *pan.UDPAddr
	OdcID, SrcConnID, DestConnID             *logging.ConnectionID
	Chosen                                   logging.VersionNumber
	Versions, ClientVersions, ServerVersions []logging.VersionNumber
	ErrorMsg, Key, Value                     *string
	Parameters                               *logging.TransportParameters
	ByteCount, Cwnd                          logging.ByteCount
	Packets, ID                              int
	Header                                   *logging.Header
	ExtendedHeader                           *logging.ExtendedHeader
	Frames                                   []logging.Frame
	AckFrame                                 *logging.AckFrame
	PacketType                               logging.PacketType
	DropReason                               logging.PacketDropReason
	LossReason                               logging.PacketLossReason
	EncryptionLevel                          logging.EncryptionLevel
	PacketNumber                             logging.PacketNumber
	CongestionState                          logging.CongestionState
	PTOCount                                 uint32
	TracingID                                uint64
	Perspective                              logging.Perspective
	Bool                                     bool
	Generation                               logging.KeyPhase
	TimerType                                logging.TimerType
	Time                                     *time.Time
	RTTStats                                 *RTTStats
}

func (*ConnectionTracerMsg) String added in v0.2.0

func (m *ConnectionTracerMsg) String() string

type ConnectionTracerServer added in v0.2.0

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

func NewConnectionTracerServer added in v0.2.0

func NewConnectionTracerServer(ct ServerConnectionTracer) *ConnectionTracerServer

func (*ConnectionTracerServer) AcknowledgedPacket added in v0.2.0

func (c *ConnectionTracerServer) AcknowledgedPacket(args *ConnectionTracerMsg, resp *NilMsg) error

func (*ConnectionTracerServer) BufferedPacket added in v0.2.0

func (c *ConnectionTracerServer) BufferedPacket(args *ConnectionTracerMsg, resp *NilMsg) error

func (*ConnectionTracerServer) Close added in v0.2.0

func (c *ConnectionTracerServer) Close(args *ConnectionTracerMsg, resp *NilMsg) error

func (*ConnectionTracerServer) ClosedConnection added in v0.2.0

func (c *ConnectionTracerServer) ClosedConnection(args *ConnectionTracerMsg, resp *NilMsg) error

func (*ConnectionTracerServer) Debug added in v0.2.0

func (c *ConnectionTracerServer) Debug(args *ConnectionTracerMsg, resp *NilMsg) error

func (*ConnectionTracerServer) DroppedEncryptionLevel added in v0.2.0

func (c *ConnectionTracerServer) DroppedEncryptionLevel(args *ConnectionTracerMsg, resp *NilMsg) error

func (*ConnectionTracerServer) DroppedKey added in v0.2.0

func (c *ConnectionTracerServer) DroppedKey(args *ConnectionTracerMsg, resp *NilMsg) error

func (*ConnectionTracerServer) DroppedPacket added in v0.2.0

func (c *ConnectionTracerServer) DroppedPacket(args *ConnectionTracerMsg, resp *NilMsg) error

func (*ConnectionTracerServer) LossTimerCanceled added in v0.2.0

func (c *ConnectionTracerServer) LossTimerCanceled(args *ConnectionTracerMsg, resp *NilMsg) error

func (*ConnectionTracerServer) LossTimerExpired added in v0.2.0

func (c *ConnectionTracerServer) LossTimerExpired(args *ConnectionTracerMsg, resp *NilMsg) error

func (*ConnectionTracerServer) LostPacket added in v0.2.0

func (c *ConnectionTracerServer) LostPacket(args *ConnectionTracerMsg, resp *NilMsg) error

func (*ConnectionTracerServer) NegotiatedVersion added in v0.2.0

func (c *ConnectionTracerServer) NegotiatedVersion(args *ConnectionTracerMsg, resp *NilMsg) error

func (*ConnectionTracerServer) NewTracerForConnection added in v0.2.0

func (c *ConnectionTracerServer) NewTracerForConnection(args *ConnectionTracerMsg, resp *NilMsg) error

func (*ConnectionTracerServer) ReceivedPacket added in v0.2.0

func (c *ConnectionTracerServer) ReceivedPacket(args *ConnectionTracerMsg, resp *NilMsg) error

func (*ConnectionTracerServer) ReceivedRetry added in v0.2.0

func (c *ConnectionTracerServer) ReceivedRetry(args *ConnectionTracerMsg, resp *NilMsg) error

func (*ConnectionTracerServer) ReceivedTransportParameters added in v0.2.0

func (c *ConnectionTracerServer) ReceivedTransportParameters(args *ConnectionTracerMsg, resp *NilMsg) error

func (*ConnectionTracerServer) ReceivedVersionNegotiationPacket added in v0.2.0

func (c *ConnectionTracerServer) ReceivedVersionNegotiationPacket(args *ConnectionTracerMsg, resp *NilMsg) error

func (*ConnectionTracerServer) RestoredTransportParameters added in v0.2.0

func (c *ConnectionTracerServer) RestoredTransportParameters(args *ConnectionTracerMsg, resp *NilMsg) error

func (*ConnectionTracerServer) SentPacket added in v0.2.0

func (c *ConnectionTracerServer) SentPacket(args *ConnectionTracerMsg, resp *NilMsg) error

func (*ConnectionTracerServer) SentTransportParameters added in v0.2.0

func (c *ConnectionTracerServer) SentTransportParameters(args *ConnectionTracerMsg, resp *NilMsg) error

func (*ConnectionTracerServer) SetLossTimer added in v0.2.0

func (c *ConnectionTracerServer) SetLossTimer(args *ConnectionTracerMsg, resp *NilMsg) error

func (*ConnectionTracerServer) StartedConnection added in v0.2.0

func (c *ConnectionTracerServer) StartedConnection(args *ConnectionTracerMsg, resp *NilMsg) error

func (*ConnectionTracerServer) UpdatedCongestionState added in v0.2.0

func (c *ConnectionTracerServer) UpdatedCongestionState(args *ConnectionTracerMsg, resp *NilMsg) error

func (*ConnectionTracerServer) UpdatedKey added in v0.2.0

func (c *ConnectionTracerServer) UpdatedKey(args *ConnectionTracerMsg, resp *NilMsg) error

func (*ConnectionTracerServer) UpdatedKeyFromTLS added in v0.2.0

func (c *ConnectionTracerServer) UpdatedKeyFromTLS(args *ConnectionTracerMsg, resp *NilMsg) error

func (*ConnectionTracerServer) UpdatedMetrics added in v0.2.0

func (c *ConnectionTracerServer) UpdatedMetrics(args *ConnectionTracerMsg, resp *NilMsg) error

func (*ConnectionTracerServer) UpdatedPTOCount added in v0.2.0

func (c *ConnectionTracerServer) UpdatedPTOCount(args *ConnectionTracerMsg, resp *NilMsg) error

type IDMsg added in v0.2.0

type IDMsg struct {
	Value *int
}

type IDServer added in v0.2.0

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

func (*IDServer) GetID added in v0.2.0

func (s *IDServer) GetID(arg, resp *IDMsg) error

type NilMsg added in v0.2.0

type NilMsg struct{}

type Path

type Path struct {
	Source      pan.IA
	Destination pan.IA
	Metadata    *pan.PathMetadata
	Fingerprint pan.PathFingerprint
	//ForwardingPath pan.ForwardingPath
	Expiry time.Time
}

func NewPathFrom

func NewPathFrom(p *pan.Path) *Path

func (*Path) PanPath

func (p *Path) PanPath() *pan.Path

type RTTStats added in v0.2.0

type RTTStats struct {
	LatestRTT, MaxAckDelay, MeanDeviation, MinRTT, PTO, SmoothedRTT time.Duration
}

func NewRTTStats added in v0.2.0

func NewRTTStats(stats *logging.RTTStats) *RTTStats

type SelectorClient

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

func NewSelectorClient

func NewSelectorClient(client *Client) *SelectorClient

func (*SelectorClient) Close

func (s *SelectorClient) Close() error

func (*SelectorClient) Initialize

func (s *SelectorClient) Initialize(local, remote pan.UDPAddr, paths []*pan.Path)

func (*SelectorClient) Path

func (s *SelectorClient) Path() *pan.Path

func (*SelectorClient) PathDown

func (s *SelectorClient) PathDown(fp pan.PathFingerprint, pi pan.PathInterface)

func (*SelectorClient) Refresh

func (s *SelectorClient) Refresh(paths []*pan.Path)

type SelectorMsg added in v0.2.0

type SelectorMsg struct {
	Local         *pan.UDPAddr
	Remote        *pan.UDPAddr
	Fingerprint   *pan.PathFingerprint
	PathInterface *pan.PathInterface
	Paths         []*Path
}

type SelectorServer

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

func NewSelectorServer

func NewSelectorServer(selector ServerSelector) *SelectorServer

func (*SelectorServer) Close

func (s *SelectorServer) Close(args, resp *SelectorMsg) error

func (*SelectorServer) Initialize

func (s *SelectorServer) Initialize(args, resp *SelectorMsg) error

func (*SelectorServer) Path

func (s *SelectorServer) Path(args, resp *SelectorMsg) error

func (*SelectorServer) PathDown

func (s *SelectorServer) PathDown(args, resp *SelectorMsg) error

func (*SelectorServer) Refresh

func (s *SelectorServer) Refresh(args, resp *SelectorMsg) error

type ServerConnectionTracer added in v0.2.0

type ServerConnectionTracer interface {
	TracerForConnection(id uint64, p logging.Perspective, odcid logging.ConnectionID) error
	StartedConnection(local, remote *pan.UDPAddr, srcConnID, destConnID logging.ConnectionID) error
	NegotiatedVersion(local, remote *pan.UDPAddr, chosen logging.VersionNumber, clientVersions, serverVersions []logging.VersionNumber) error
	ClosedConnection(local, remote *pan.UDPAddr, err error) error
	SentTransportParameters(*pan.UDPAddr, *pan.UDPAddr, *logging.TransportParameters) error
	ReceivedTransportParameters(*pan.UDPAddr, *pan.UDPAddr, *logging.TransportParameters) error
	RestoredTransportParameters(local, remote *pan.UDPAddr, parameters *logging.TransportParameters) error
	SentPacket(local, remote *pan.UDPAddr, hdr *logging.ExtendedHeader, size logging.ByteCount, ack *logging.AckFrame, frames []logging.Frame) error
	ReceivedVersionNegotiationPacket(*pan.UDPAddr, *pan.UDPAddr, *logging.Header, []logging.VersionNumber) error
	ReceivedRetry(*pan.UDPAddr, *pan.UDPAddr, *logging.Header) error
	ReceivedPacket(local, remote *pan.UDPAddr, hdr *logging.ExtendedHeader, size logging.ByteCount, frames []logging.Frame) error
	BufferedPacket(*pan.UDPAddr, *pan.UDPAddr, logging.PacketType) error
	DroppedPacket(*pan.UDPAddr, *pan.UDPAddr, logging.PacketType, logging.ByteCount, logging.PacketDropReason) error
	UpdatedMetrics(local, remote *pan.UDPAddr, rttStats *RTTStats, cwnd, bytesInFlight logging.ByteCount, packetsInFlight int) error
	AcknowledgedPacket(*pan.UDPAddr, *pan.UDPAddr, logging.EncryptionLevel, logging.PacketNumber) error
	LostPacket(*pan.UDPAddr, *pan.UDPAddr, logging.EncryptionLevel, logging.PacketNumber, logging.PacketLossReason) error
	UpdatedCongestionState(*pan.UDPAddr, *pan.UDPAddr, logging.CongestionState) error
	UpdatedPTOCount(local, remote *pan.UDPAddr, value uint32) error
	UpdatedKeyFromTLS(*pan.UDPAddr, *pan.UDPAddr, logging.EncryptionLevel, logging.Perspective) error
	UpdatedKey(local, remote *pan.UDPAddr, generation logging.KeyPhase, rem bool) error
	DroppedEncryptionLevel(*pan.UDPAddr, *pan.UDPAddr, logging.EncryptionLevel) error
	DroppedKey(local, remote *pan.UDPAddr, generation logging.KeyPhase) error
	SetLossTimer(*pan.UDPAddr, *pan.UDPAddr, logging.TimerType, logging.EncryptionLevel, time.Time) error
	LossTimerExpired(*pan.UDPAddr, *pan.UDPAddr, logging.TimerType, logging.EncryptionLevel) error
	LossTimerCanceled(local, remote *pan.UDPAddr) error
	Close(local, remote *pan.UDPAddr) error
	Debug(local, remote *pan.UDPAddr, name, msg string) error
}

type ServerSelector

type ServerSelector interface {
	Initialize(pan.UDPAddr, pan.UDPAddr, []*pan.Path) error
	Path(pan.UDPAddr, pan.UDPAddr) (*pan.Path, error)
	PathDown(pan.UDPAddr, pan.UDPAddr, pan.PathFingerprint, pan.PathInterface) error
	Refresh(pan.UDPAddr, pan.UDPAddr, []*pan.Path) error
	Close(pan.UDPAddr, pan.UDPAddr) error
}

func NewServerSelectorFunc

func NewServerSelectorFunc(fn func(pan.UDPAddr, pan.UDPAddr) pan.Selector) ServerSelector

type TracerClient added in v0.2.0

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

func (TracerClient) DroppedPacket added in v0.2.0

func (TracerClient) SentPacket added in v0.2.0

func (c TracerClient) SentPacket(addr net.Addr, hdr *logging.Header, n logging.ByteCount, fs []logging.Frame)

func (TracerClient) TracerForConnection added in v0.2.0

type TracerMsg added in v0.2.0

type TracerMsg struct {
	//Context      context.Context
	ID           *int
	TracingID    *uint64
	Perspective  *logging.Perspective
	ConnectionID *logging.ConnectionID
	Addr         net.Addr
	Header       *logging.Header
	ByteCount    *logging.ByteCount
	Frames       []logging.Frame
	PacketType   *logging.PacketType
	DropReason   *logging.PacketDropReason
}

type TracerServer added in v0.2.0

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

func NewTracerServer added in v0.2.0

func NewTracerServer(tracer logging.Tracer) *TracerServer

func (*TracerServer) DroppedPacket added in v0.2.0

func (s *TracerServer) DroppedPacket(args, resp *TracerMsg) error

func (*TracerServer) SentPacket added in v0.2.0

func (s *TracerServer) SentPacket(args, resp *TracerMsg) error

Jump to

Keyboard shortcuts

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