snet

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: 28 Imported by: 0

Documentation

Overview

Package snet implements interfaces net.Conn and net.PacketConn for SCION connections.

The default (package-wide) SCION network must first be initialized by calling Init. All future package scoped DialSCION and ListenSCION calls will use this initial context to get the local ISD-AS, dispatcher or sciond.

A connection can be created by calling DialSCION or ListenSCION; both functions register an address-port pair with the local dispatcher. For Dial, the remote address is fixed, meaning only Read and Write can be used. Attempting to ReadFrom or WriteTo a connection created by Dial is an invalid operation. For Listen, the remote address cannot be fixed. ReadFrom, ReadFromSCION can be used to read from the connection and find out the sender's address; WriteTo and WriteToSCION can be used to send a message to a chosen destination.

For applications that need to run in multiple ASes, new networking contexts can be created using NewNetwork. Calling the DialSCION or ListenSCION methods on the networking context yields connections that run in that context.

Multiple networking contexts can share the same SCIOND and/or dispatcher.

Write calls never return SCMP errors directly. If a write call caused an SCMP message to be received by the Conn, it can be inspected by calling Read. In this case, the error value is non-nil and can be type asserted to *OpError. Method SCMP() can be called on the error to extract the SCMP header.

Important: not draining SCMP errors via Read calls can cause the dispatcher to shutdown the socket (see https://github.com/scionproto/scion/pull/1356). To prevent this on a Conn object with only Write calls, run a separate goroutine that continuously calls Read on the Conn.

Index

Constants

View Source
const (
	ErrNoAddr        common.ErrMsg = "remote address required, but none set"
	ErrDuplicateAddr common.ErrMsg = "remote address specified as argument, " +
		"but address set in conn"
	ErrAddressIsNil         common.ErrMsg = "address is nil"
	ErrNoApplicationAddress common.ErrMsg = "SCION host address is missing"
	ErrExtraPath            common.ErrMsg = "path set, but none required for local AS"
	ErrBadOverlay           common.ErrMsg = "overlay address not set, " +
		"and construction from SCION address failed"
	ErrMustHavePath common.ErrMsg = "overlay address set, but no path set"
	ErrPath         common.ErrMsg = "no path set, and error during path resolution"
)

Possible write errors

View Source
const (
	// BufSize is the receive and send buffer sizes
	BufSize = 1<<16 - 1
)
View Source
const (
	DefaultPathQueryTimeout = 5 * time.Second
)

Variables

This section is empty.

Functions

func IA

func IA() addr.IA

IA returns the default ISD-AS

func Init

func Init(ia addr.IA, sciondPath string, dispatcher reliable.DispatcherService) error

Init initializes the default SCION networking context.

func InitWithNetwork

func InitWithNetwork(network *SCIONNetwork) error

InitWithNetwork initializes snet with the provided SCION networking context.

func PathReplyEntryFromPath added in v0.4.0

func PathReplyEntryFromPath(p Path) *sciond.PathReplyEntry

PathReplyEntryFromPath extracts PathReplyEntry. If not possible, nil is returned.

func StableSortExtensions added in v0.4.0

func StableSortExtensions(data []common.Extension)

StableSortExtensions sorts the extensions in data in place. The sort is stable.

SCMP extensions are moved to the start of the slice, followed by HBH extensions and finally E2E extensions.

StableSortExtensions performs no validations on the number and/or types of extensions.

The function panics if data is nil.

Types

type Addr

type Addr struct {
	IA      addr.IA
	Host    *addr.AppAddr
	Path    *spath.Path
	NextHop *overlay.OverlayAddr
}

func AddrFromString

func AddrFromString(s string) (*Addr, error)

AddrFromString converts an address string of format isd-as,[ipaddr]:port (e.g., 1-ff00:0:300,[192.168.1.1]:80) to a SCION address.

func (*Addr) Copy

func (a *Addr) Copy() *Addr

func (*Addr) Desc

func (a *Addr) Desc() string

func (*Addr) EqualAddr added in v0.4.0

func (a *Addr) EqualAddr(o *Addr) bool

EqualAddr compares the IA/Host/L4port values with the supplied Addr

func (*Addr) GetPath added in v0.4.0

func (a *Addr) GetPath() (Path, error)

GetPath returns a path with attached metadata.

func (*Addr) IsZero

func (a *Addr) IsZero() bool

func (*Addr) Network

func (a *Addr) Network() string

func (*Addr) Set

func (a *Addr) Set(s string) error

This method implements flag.Value interface

func (*Addr) String

func (a *Addr) String() string

func (*Addr) UnmarshalText

func (a *Addr) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler

type BaseRouter added in v0.4.0

type BaseRouter struct {
	// IA is the source AS for paths, usually the local AS.
	IA addr.IA
	// PathResolver to solve path requests. If nil, all path requests yield
	// empty paths.
	PathResolver pathmgr.Resolver
	// PathPolicy is used to filter the paths. If set to nil, no filtering is done.
	PathPolicy *pathpol.Policy
}

BaseRouter is a path router implementation that uses a path resolver to query SCIOND for paths, or returns empty paths if a path resolver is not specified.

func (*BaseRouter) AllRoutes added in v0.4.0

func (r *BaseRouter) AllRoutes(ctx context.Context, dst addr.IA) ([]Path, error)

AllRoutes is the same as Route except that it returns multiple paths.

func (*BaseRouter) LocalIA added in v0.4.0

func (r *BaseRouter) LocalIA() addr.IA

func (*BaseRouter) Route added in v0.4.0

func (r *BaseRouter) Route(ctx context.Context, dst addr.IA) (Path, error)

Route uses the specified path resolver (if one exists) to obtain a path from the local AS to dst.

type Bytes added in v0.4.0

type Bytes common.RawBytes

Bytes contains the raw slices of data related to a packet. Most callers can safely ignore it. For performance-critical applications, callers should manually allocate/recycle the Bytes.

Prior to serialization/decoding, the internal slice is reset to its full capacity, so be careful about passing in slices that have runoff data after their length.

After a packet has been serialized/decoded, the length of Contents will be equal to the size of the entire packet data. The capacity remains unchanged.

If Bytes is not initialized, space will be allocated during serialization/decoding.

func (*Bytes) Prepare added in v0.4.0

func (b *Bytes) Prepare()

Prepare readies a layer's storage for use.

If the layer is not allocated, a backing buffer of maximum packet size is allocated.

If the layer is already allocated, its length is reset to its capacity.

type Conn

type Conn interface {
	Read(b []byte) (int, error)
	ReadFrom(b []byte) (int, net.Addr, error)
	ReadFromSCION(b []byte) (int, *Addr, error)
	Write(b []byte) (int, error)
	WriteTo(b []byte, address net.Addr) (int, error)
	WriteToSCION(b []byte, address *Addr) (int, error)
	Close() error
	LocalAddr() net.Addr
	BindAddr() net.Addr
	SVC() addr.HostSVC
	// RemoteAddr returns the remote network address.
	RemoteAddr() net.Addr
	// SetDeadline sets read and write deadlines. Implements the net.Conn
	// SetDeadline method.
	SetDeadline(deadline time.Time) error
	SetReadDeadline(deadline time.Time) error
	SetWriteDeadline(deadline time.Time) error
}

Conn represents a SCION connection.

func DialSCION

func DialSCION(network string, laddr, raddr *Addr) (Conn, error)

DialSCION calls DialSCION with infinite timeout on the default networking context.

func DialSCIONWithBindSVC

func DialSCIONWithBindSVC(network string, laddr, raddr, baddr *Addr,
	svc addr.HostSVC) (Conn, error)

DialSCIONWithBindSVC calls DialSCIONWithBindSVC with infinite timeout on the default networking context.

func ListenSCION

func ListenSCION(network string, laddr *Addr) (Conn, error)

ListenSCION calls ListenSCION with infinite timeout on the default networking context.

func ListenSCIONWithBindSVC

func ListenSCIONWithBindSVC(network string, laddr, baddr *Addr, svc addr.HostSVC) (Conn, error)

ListenSCIONWithBindSVC calls ListenSCIONWithBindSVC with infinite timeout on the default networking context.

type DefaultPacketDispatcherService added in v0.4.0

type DefaultPacketDispatcherService struct {
	// Dispatcher is used to get packets from the local SCION Dispatcher process.
	Dispatcher reliable.DispatcherService
	// SCMPHandler is invoked for packets that contain an SCMP L4. If the
	// handler is nil, errors are returned back to applications every time an
	// SCMP message is received.
	SCMPHandler SCMPHandler
}

DefaultPacketDispatcherService parses/serializes packets received from / sent to the dispatcher.

func (*DefaultPacketDispatcherService) RegisterTimeout added in v0.4.0

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

type Error

type Error interface {
	error
	SCMP() *scmp.Hdr
}

type LocalMachine added in v0.4.0

type LocalMachine struct {
	// InterfaceIP is the default L3 address for connections originating from
	// this machine. It should be an address configured on a host interface
	// that is reachable from the network.
	InterfaceIP net.IP
	// If this machine is behind a NAT, PublicIP should be set to the public IP
	// of the NAT. If the local IP is already public, PublicIP should be set to
	// nil.
	PublicIP net.IP
}

LocalMachine describes aspects of the host system and its network.

func (*LocalMachine) AppAddress added in v0.4.0

func (m *LocalMachine) AppAddress() *addr.AppAddr

AppAddress returns a public address for the local machine. The port is set to 0.

func (*LocalMachine) BindAddress added in v0.4.0

func (m *LocalMachine) BindAddress() *overlay.OverlayAddr

BindAddress returns a bind address for the local machine. The port is set to 0.

type Network

type Network interface {
	ListenSCIONWithBindSVC(network string,
		laddr, baddr *Addr, svc addr.HostSVC, timeout time.Duration) (Conn, error)
	DialSCIONWithBindSVC(network string,
		laddr, raddr, baddr *Addr, svc addr.HostSVC, timeout time.Duration) (Conn, error)
}

type OpError

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

func (*OpError) Error

func (e *OpError) Error() string

func (*OpError) RevInfo added in v0.4.0

func (e *OpError) RevInfo() *path_mgmt.RevInfo

func (*OpError) SCMP

func (e *OpError) SCMP() *scmp.Hdr

type PacketConn added in v0.4.0

type PacketConn interface {
	ReadFrom(pkt *SCIONPacket, ov *overlay.OverlayAddr) error
	WriteTo(pkt *SCIONPacket, ov *overlay.OverlayAddr) error
	SetReadDeadline(t time.Time) error
	SetWriteDeadline(t time.Time) error
	SetDeadline(t time.Time) error
	Close() error
}

PacketConn gives applications easy access to writing and reading custom SCION packets.

type PacketDispatcherService added in v0.4.0

type PacketDispatcherService interface {
	RegisterTimeout(ia addr.IA, public *addr.AppAddr, bind *overlay.OverlayAddr,
		svc addr.HostSVC, timeout time.Duration) (PacketConn, uint16, error)
}

PacketDispatcherService constructs SCION sockets where applications have fine-grained control over header fields.

type Path added in v0.4.0

type Path interface {
	// Fingerprint uniquely identifies the path based on the sequence of
	// ASes and BRs. Other metadata, such as MTU or NextHop have no effect
	// on the fingerprint. Empty string means unknown fingerprint.
	Fingerprint() string
	// OverlayNextHop returns the address:port pair of a local-AS overlay
	// speaker. Usually, this is a border router that will forward the traffic.
	OverlayNextHop() *overlay.OverlayAddr
	// Path returns a raw (data-plane compatible) representation of the path.
	// The returned path is initialized and ready for use in snet calls that
	// deal with raw paths.
	Path() *spath.Path
	// Interfaces returns a list of interfaces on the path. If the list is not
	// available the result is nil.
	Interfaces() []sciond.PathInterface
	// Destination is the AS the path points to. Empty paths return the local
	// AS of the router that created them.
	Destination() addr.IA
	// MTU returns the MTU of the path. If the result is zero, MTU is unknown.
	MTU() uint16
	// Expiry returns the expiration time of the path. If the result is a zero
	// value expiration time is unknown.
	Expiry() time.Time
	// Copy create a copy of the path.
	Copy() Path
}

Path is an abstract representation of a path. Most applications do not need access to the raw internals.

An empty path is a special kind of path that can be used for intra-AS traffic. Empty paths are valid return values for certain route calls (e.g., if the source and destination ASes match, or if a router was configured without a source of paths).

type RevocationHandler added in v0.4.0

type RevocationHandler interface {
	// RevokeRaw handles a revocation received as raw bytes.
	RevokeRaw(ctx context.Context, rawSRevInfo common.RawBytes)
}

RevocationHandler is called by the default SCMP Handler whenever revocations are encountered.

type Router added in v0.4.0

type Router interface {
	// Route returns a path from the local AS to dst. If dst matches the local
	// AS, an empty path is returned.
	Route(ctx context.Context, dst addr.IA) (Path, error)
	// AllRoutes is similar to Route except that it returns multiple paths.
	AllRoutes(ctx context.Context, dst addr.IA) ([]Path, error)
	// LocalIA returns the IA from which this router routes.
	LocalIA() addr.IA
}

Router performs path resolution for SCION-speaking applications.

Most applications backed by SCIOND can use the default router implementation in this package. Applications that run SCIOND-less (PS, SD, BS) might be interested in spinning their own implementations.

type SCIONAddress added in v0.4.0

type SCIONAddress struct {
	IA   addr.IA
	Host addr.HostAddr
}

SCIONAddress is the fully-specified address of a host.

type SCIONConn added in v0.3.0

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

func (*SCIONConn) BindAddr added in v0.3.0

func (c *SCIONConn) BindAddr() net.Addr

func (*SCIONConn) BindSnetAddr added in v0.3.0

func (c *SCIONConn) BindSnetAddr() *Addr

func (*SCIONConn) Close added in v0.3.0

func (c *SCIONConn) Close() error

func (*SCIONConn) LocalAddr added in v0.3.0

func (c *SCIONConn) LocalAddr() net.Addr

func (*SCIONConn) LocalSnetAddr added in v0.3.0

func (c *SCIONConn) LocalSnetAddr() *Addr

func (*SCIONConn) Read added in v0.3.0

func (c *SCIONConn) Read(b []byte) (int, error)

Read reads data into b from a connection with a fixed remote address. If the remote address for the connection is unknown, Read returns an error.

func (*SCIONConn) ReadFrom added in v0.3.0

func (c *SCIONConn) ReadFrom(b []byte) (int, net.Addr, error)

func (*SCIONConn) ReadFromSCION added in v0.3.0

func (c *SCIONConn) ReadFromSCION(b []byte) (int, *Addr, error)

ReadFromSCION reads data into b, returning the length of copied data and the address of the sender. If the remote address for the connection is already known, ReadFromSCION returns an error.

func (*SCIONConn) RemoteAddr added in v0.3.0

func (c *SCIONConn) RemoteAddr() net.Addr

func (*SCIONConn) RemoteSnetAddr added in v0.3.0

func (c *SCIONConn) RemoteSnetAddr() *Addr

func (*SCIONConn) SVC added in v0.3.0

func (c *SCIONConn) SVC() addr.HostSVC

func (*SCIONConn) SetDeadline added in v0.3.0

func (c *SCIONConn) SetDeadline(t time.Time) error

func (*SCIONConn) SetReadDeadline added in v0.3.0

func (c *SCIONConn) SetReadDeadline(t time.Time) error

func (*SCIONConn) SetWriteDeadline added in v0.3.0

func (c *SCIONConn) SetWriteDeadline(t time.Time) error

func (*SCIONConn) Write added in v0.3.0

func (c *SCIONConn) Write(b []byte) (int, error)

Write sends b through a connection with fixed remote address. If the remote address for the connection is unknown, Write returns an error.

func (*SCIONConn) WriteTo added in v0.3.0

func (c *SCIONConn) WriteTo(b []byte, raddr net.Addr) (int, error)

func (*SCIONConn) WriteToSCION added in v0.3.0

func (c *SCIONConn) WriteToSCION(b []byte, raddr *Addr) (int, error)

WriteToSCION sends b to raddr.

type SCIONNetwork added in v0.3.0

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

SCIONNetwork is the SCION networking context, containing local ISD-AS, SCIOND, Dispatcher and Path resolver.

var (
	// DefNetwork is the default SCION networking context for package-level Dial
	// and Listen
	DefNetwork *SCIONNetwork
)

func NewCustomNetwork added in v0.4.0

func NewCustomNetwork(ia addr.IA, sciondPath string,
	pktDispatcher PacketDispatcherService) (*SCIONNetwork, error)

NewCustomNetwork is similar to NewNetwork, except it gives control over the packet processing socket in the snet backend. It can be used to implement specialized sockets that implement firewall rules, custom SCMP handlers, or custom network access (e.g., dispatcher bypass).

func NewCustomNetworkWithPR added in v0.4.0

func NewCustomNetworkWithPR(ia addr.IA, pktDispatcher PacketDispatcherService,
	pr pathmgr.Resolver) *SCIONNetwork

NewCustomNetworkWithPR is similar to NewNetworkWithPR, while giving control over packet processing via pktDispatcher.

func NewNetwork

func NewNetwork(ia addr.IA, sciondPath string,
	dispatcher reliable.DispatcherService) (*SCIONNetwork, error)

NewNetwork creates a new networking context, on which future Dial or Listen calls can be made. The new connections use the SCIOND server at sciondPath, the dispatcher at dispatcherPath, and ia for the local ISD-AS.

If sciondPath is the empty string, the network will run without SCIOND. In this mode of operation, the app is fully responsible with supplying paths for sent traffic.

func NewNetworkWithPR

func NewNetworkWithPR(ia addr.IA, dispatcher reliable.DispatcherService,
	pr pathmgr.Resolver) *SCIONNetwork

NewNetworkWithPR creates a new networking context with path resolver pr. A nil path resolver means the Network will run without SCIOND.

func (*SCIONNetwork) DialSCION added in v0.3.0

func (n *SCIONNetwork) DialSCION(network string, laddr, raddr *Addr,
	timeout time.Duration) (Conn, error)

DialSCION returns a SCION connection to raddr. Nil values for laddr are not supported yet. Parameter network must be "udp4". The returned connection's Read and Write methods can be used to receive and send SCION packets.

The timeout is used for connection setup, it doesn't affect the returned connection. A timeout of 0 means infinite timeout.

func (*SCIONNetwork) DialSCIONWithBindSVC added in v0.3.0

func (n *SCIONNetwork) DialSCIONWithBindSVC(network string, laddr, raddr, baddr *Addr,
	svc addr.HostSVC, timeout time.Duration) (Conn, error)

DialSCIONWithBindSVC returns a SCION connection to raddr. Nil values for laddr are not supported yet. Parameter network must be "udp4". The returned connection's Read and Write methods can be used to receive and send SCION packets.

The timeout is used for connection setup, it doesn't affect the returned connection. A timeout of 0 means infinite timeout.

func (*SCIONNetwork) IA added in v0.3.0

func (n *SCIONNetwork) IA() addr.IA

IA returns the ISD-AS assigned to n

func (*SCIONNetwork) ListenSCION added in v0.3.0

func (n *SCIONNetwork) ListenSCION(network string, laddr *Addr,
	timeout time.Duration) (Conn, error)

ListenSCION registers laddr with the dispatcher. Nil values for laddr are not supported yet. The returned connection's ReadFrom and WriteTo methods can be used to receive and send SCION packets with per-packet addressing. Parameter network must be "udp4".

The timeout is used for connection setup, it doesn't affect the returned connection. A timeout of 0 means infinite timeout.

func (*SCIONNetwork) ListenSCIONWithBindSVC added in v0.3.0

func (n *SCIONNetwork) ListenSCIONWithBindSVC(network string, laddr, baddr *Addr,
	svc addr.HostSVC, timeout time.Duration) (Conn, error)

ListenSCIONWithBindSVC registers laddr with the dispatcher. Nil values for laddr are not supported yet. The returned connection's ReadFrom and WriteTo methods can be used to receive and send SCION packets with per-packet addressing. Parameter network must be "udp4".

The timeout is used for connection setup, it doesn't affect the returned connection. A timeout of 0 means infinite timeout.

func (*SCIONNetwork) PathResolver added in v0.3.0

func (n *SCIONNetwork) PathResolver() pathmgr.Resolver

PathResolver returns the pathmgr.PR that the network is using.

func (*SCIONNetwork) Sciond added in v0.3.0

func (n *SCIONNetwork) Sciond() sciond.Connector

Sciond returns the sciond API endpoint that the network is using.

type SCIONPacket added in v0.4.0

type SCIONPacket struct {
	Bytes
	SCIONPacketInfo
}

type SCIONPacketConn added in v0.4.0

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

SCIONPacketConn gives applications full control over the content of valid SCION packets.

func NewSCIONPacketConn added in v0.4.0

func NewSCIONPacketConn(conn net.PacketConn, scmpHandler SCMPHandler) *SCIONPacketConn

NewSCIONPacketConn creates a new conn with packet serialization/decoding support that transfers data over conn.

func (*SCIONPacketConn) Close added in v0.4.0

func (c *SCIONPacketConn) Close() error

func (*SCIONPacketConn) ReadFrom added in v0.4.0

func (c *SCIONPacketConn) ReadFrom(pkt *SCIONPacket, ov *overlay.OverlayAddr) error

func (*SCIONPacketConn) SetDeadline added in v0.4.0

func (c *SCIONPacketConn) SetDeadline(d time.Time) error

func (*SCIONPacketConn) SetReadDeadline added in v0.4.0

func (c *SCIONPacketConn) SetReadDeadline(d time.Time) error

func (*SCIONPacketConn) SetWriteDeadline added in v0.4.0

func (c *SCIONPacketConn) SetWriteDeadline(d time.Time) error

func (*SCIONPacketConn) WriteTo added in v0.4.0

func (c *SCIONPacketConn) WriteTo(pkt *SCIONPacket, ov *overlay.OverlayAddr) error

type SCIONPacketInfo added in v0.4.0

type SCIONPacketInfo struct {
	// Destination contains the destination address.
	Destination SCIONAddress
	// Source contains the source address. If it is an SVC address, packet
	// serialization will return an error.
	Source SCIONAddress
	// Path contains a SCION forwarding path. The field must be nil or an empty
	// path if the source and destination are inside the same AS.
	//
	// If the source and destination are in different ASes but the path is
	// nil or empty, an error is returned during serialization.
	Path *spath.Path
	// Extensions contains SCION HBH and E2E extensions. When received from a
	// RawSCIONConn, extensions are present in the order they were found in the packet.
	//
	// When writing to a RawSCIONConn, the serializer will attempt
	// to reorder the extensions, depending on their type, in the correct
	// order. If the number of extensions is over the limit allowed by SCION,
	// serialization will fail. Whenever multiple orders are valid, the stable
	// sorting is preferred. The extensions are sorted in place, so callers
	// should expect the order to change after a write.
	//
	// The SCMP HBH extension needs to be manually included by calling code,
	// even when the L4Header and Payload demand one (as is the case, for
	// example, for a SCMP::General::RecordPathRequest packet).
	Extensions []common.Extension
	// L4Header contains L4 header information.
	L4Header l4.L4Header
	Payload  common.Payload
}

SCIONPacketInfo contains the data needed to construct a SCION packet.

This is a high-level structure, and can only be used to create valid packets. The documentation for each field specifies cases where serialization might fail due to some violation of SCION protocol rules.

type SCMPHandler added in v0.4.0

type SCMPHandler interface {
	// Handle processes the packet as an SCMP packet. If packet is not SCMP, it
	// returns an error.
	//
	// If the handler returns an error value, snet will propagate the error
	// back to the caller. If the return value is nil, snet will reattempt to
	// read a data packet from the underlying dispatcher connection.
	//
	// Handlers that wish to ignore SCMP can just return nil.
	//
	// If the handler mutates the packet, the changes are seen by snet
	// connection method callers.
	Handle(pkt *SCIONPacket) error
}

SCMPHandler customizes the way snet connections deal with SCMP.

func NewSCMPHandler added in v0.4.0

func NewSCMPHandler(rh RevocationHandler) SCMPHandler

NewSCMPHandler creates a default SCMP handler that forwards revocations to the revocation handler. SCMP packets are also forwarded to snet callers via errors returned by Read calls.

If the revocation handler is nil, revocations are not forwarded. However, they are still sent back to the caller during read operations.

type SerializationOptions added in v0.4.0

type SerializationOptions struct {
	// If ComputeChecksums is true, the checksums in sent SCIONPackets are
	// recomputed. Otherwise, the checksum value is left intact.
	ComputeChecksums bool
	// If FixLengths is true, any lengths in sent SCIONPackets are recomputed
	// to match the data contained in payloads/inner layers. This currently
	// concerns extension headers and the L4 header.
	FixLengths bool
	// If InitializePaths is set to true, then forwarding paths are reset to
	// their starting InfoField/HopField during serialization, irrespective of
	// previous offsets. If it is set to false, then the fields are left
	// unchanged.
	InitializePaths bool
}

Directories

Path Synopsis
internal
ctxmonitor/mock_ctxmonitor
Package mock_ctxmonitor is a generated GoMock package.
Package mock_ctxmonitor is a generated GoMock package.
pathsource/mock_pathsource
Package mock_pathsource is a generated GoMock package.
Package mock_pathsource is a generated GoMock package.
Package mock_snet is a generated GoMock package.
Package mock_snet is a generated GoMock package.
QUIC/SCION implementation.
QUIC/SCION implementation.

Jump to

Keyboard shortcuts

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