Documentation ¶
Overview ¶
Package svc implements support for SVC Resolution.
Index ¶
Constants ¶
const ErrHandler common.ErrMsg = "Unable to handle SVC request"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseHandler ¶
type BaseHandler struct { // Message is the payload data to send in the reply. Nil and zero-length // payloads are supported. Message []byte }
BaseHandler reverses a SCION packet, replaces the source address with the one in the struct and then sends the message on the connection.
type Reply ¶
type Reply struct { // Transports maps transport keys (e.g., "QUIC") to network address strings // (e.g., "192.168.1.1:80"). Applications should check if the transport keys // are acceptable and must parse the address strings accordingly. Transports map[Transport]string // ReturnPath contains the reversed and initialized path the SVC resolution // message arrived on. This can be used to communicate across paths // bootstrapped via One-Hop Path communication. ReturnPath snet.Path }
Reply is an SVC resolution reply.
type Request ¶
type Request struct { // Source is the override value for the source address of the reply packet. Source snet.SCIONAddress // Conn is the connection to send the reply on. Conn must not be nil. Conn snet.PacketConn Packet *snet.Packet Underlay *net.UDPAddr }
type RequestHandler ¶
type RequestHandler interface { // Handle replies to SCION packets with SVC destinations coming from the // specified underlay address. // // Handle implementantions might panic if the destination is not an SVC // address, so callers should perform the check beforehand. Handle(*Request) (Result, error) }
RequestHandler handles SCION packets with SVC destination addresses.
type Resolver ¶
type Resolver struct { Network snet.Network // LocalIA is the local AS. LocalIA addr.IA // LocalIP is the default L3 address for connections originating from this process. LocalIP net.IP // RoundTripper performs the request/reply exchange for SVC resolutions. If // nil, the default round tripper is used. RoundTripper RoundTripper }
Resolver performs SVC address resolution.
type ResolverPacketConn ¶ added in v0.12.0
type ResolverPacketConn struct { // PacketConn is the conn to receive and send packets. snet.PacketConn // Source contains the address from which packets should be sent. Source snet.SCIONAddress // Handler handles packets for SVC destinations. Handler RequestHandler }
ResolverPacketConn redirects SVC destination packets to SVC resolution handler logic.
type Result ¶
type Result int
Result is used to inform Handler users on the outcome of handler execution.
type RoundTripper ¶
type RoundTripper interface { // RoundTrip performs the round trip interaction. RoundTrip(ctx context.Context, c snet.PacketConn, request *snet.Packet, u *net.UDPAddr) (*Reply, error) }
RoundTripper does a single SVC resolution request/reply interaction over a connection, using the specified request packet and underlay address.
func DefaultRoundTripper ¶
func DefaultRoundTripper() RoundTripper
DefaultRoundTripper returns a basic implementation of the RoundTripper interface.
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
ctxconn
Package ctxconn provides a helper function to track context cancellation when working with connections.
|
Package ctxconn provides a helper function to track context cancellation when working with connections. |
ctxconn/mock_ctxconn
Package mock_ctxconn is a generated GoMock package.
|
Package mock_ctxconn is a generated GoMock package. |
Package mock_svc is a generated GoMock package.
|
Package mock_svc is a generated GoMock package. |