onehop

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2020 License: Apache-2.0 Imports: 13 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
	RPC             RPC
}

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

func (*BeaconSender) Send

func (s *BeaconSender) Send(ctx context.Context, bseg *seg.PathSegment, ia addr.IA,
	egIfid common.IFIDType, ov *net.UDPAddr) error

Send packs and sends out the beacon.

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 []byte
}

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) Register

func (s *OHPPacketDispatcherService) Register(ctx context.Context, ia addr.IA,
	registration *net.UDPAddr, svc addr.HostSVC) (snet.PacketConn, uint16, error)

type Path

type Path spath.Path

Path is a one-hop path.

type RPC added in v0.6.0

type RPC interface {
	SendBeacon(ctx context.Context, b *seg.PathSegment, remote net.Addr) error
}

RPC is used to send beacons.

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 *net.UDPAddr
	// 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.Packet, error)

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

func (*Sender) Send

func (s *Sender) Send(msg *Msg, nextHop *net.UDPAddr) 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