onehop

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package onehop provides a sender for messages sent on a one-hop path.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BeaconSender

type BeaconSender struct {
	Sender
	// AddressRewriter resolves SVC addresses, if possible. If it is nil,
	// resolution is not attempted.
	AddressRewriter *messenger.AddressRewriter
	// QUICBeaconSender is used to send beacons over QUIC whenever the sender
	// detects that the server supports QUIC.
	QUICBeaconSender QUICBeaconSender
}

BeaconSender is used to send beacons on a one-hop path.

func (*BeaconSender) Send

func (s *BeaconSender) Send(ctx context.Context, bseg *seg.Beacon, ia addr.IA,
	egIfid common.IFIDType, signer infra.Signer, ov *overlay.OverlayAddr) error

Send packs and sends out the beacon. QUIC is first attempted, and if that fails the method falls back on UDP.

type Msg

type Msg struct {
	// Dst is the destination of the message.
	Dst snet.SCIONAddress
	// Ifid is the IFID the message is sent on.
	Ifid common.IFIDType
	// InfoTime is the timestamp set in the info field.
	InfoTime time.Time
	// Pld is the message payload.
	Pld common.Payload
}

Msg defines the message payload and the path it is sent on.

type OHPPacketDispatcherService

type OHPPacketDispatcherService struct {
	snet.PacketDispatcherService
}

OHPPacketDispatcherService creates sockets where all packets have the OHP extension enabled.

func (*OHPPacketDispatcherService) RegisterTimeout

func (s *OHPPacketDispatcherService) RegisterTimeout(ia addr.IA, public *addr.AppAddr,
	bind *overlay.OverlayAddr, svc addr.HostSVC,
	timeout time.Duration) (snet.PacketConn, uint16, error)

type Path

type Path spath.Path

Path is a one-hop path.

type QUICBeaconSender

type QUICBeaconSender interface {
	// SendBeacon sends the beacon to the address using the specified ID.
	SendBeacon(ctx context.Context, msg *seg.Beacon, a net.Addr, id uint64) error
}

QUICBeaconSender is used to send beacons over QUIC.

type Sender

type Sender struct {
	// IA is the ISD-AS of the local AS.
	IA addr.IA
	// Addr is the address that is set as the source.
	Addr *addr.AppAddr
	// Conn is used to send the packets.
	Conn snet.PacketConn

	// MAC is the mac to issue hop fields.
	MAC hash.Hash
	// contains filtered or unexported fields
}

Sender is used to send payloads on a one-hop path.

func (*Sender) CreatePath

func (s *Sender) CreatePath(ifid common.IFIDType, now time.Time) (*Path, error)

CreatePath creates the one-hop path and initializes it.

func (*Sender) CreatePkt

func (s *Sender) CreatePkt(msg *Msg) (*snet.SCIONPacket, error)

CreatePkt creates a scion packet with a one-hop path and the payload.

func (*Sender) Send

func (s *Sender) Send(msg *Msg, nextHop *overlay.OverlayAddr) error

Send sends the payload on a one-hop path.

Jump to

Keyboard shortcuts

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