reverse

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: Unlicense Imports: 15 Imported by: 0

Documentation

Overview

Package reverse provides a message type for the forwarding directions in a 3 layer routing header.

Index

Constants

View Source
const (
	Magic = "rvrs"
)

Variables

This section is empty.

Functions

func Gen

func Gen() codec.Codec

Gen is a factory function for a Reverse.

func New

func New(ip *netip.AddrPort) ont.Onion

New creates a new Reverse onion.

Types

type Reverse

type Reverse struct {

	// AddrPort of the relay to forward this message.
	AddrPort *netip.AddrPort

	// Onion contained inside this message.
	ont.Onion
}

Reverse is a part of the 3 layer relay RoutingHeader which provides the next address to forward to.

func (*Reverse) Account

func (x *Reverse) Account(res *sess.Data, sm *sess.Manager,
	s *sessions.Data, last bool) (skip bool, sd *sessions.Data)

Account for the reverse message - note that the actual size being carried is computed at the end of the circuit with the returned Response/Confirmation/Message.

func (*Reverse) Decode

func (x *Reverse) Decode(s *splice.Splice) (e error)

Decode a Reverse from a provided splice.Splice.

func (*Reverse) Encode

func (x *Reverse) Encode(s *splice.Splice) (e error)

Encode a Reverse into the next bytes of a splice.Splice.

func (*Reverse) Handle

func (x *Reverse) Handle(s *splice.Splice, p ont.Onion, ng ont.Ngin) (e error)

Handle is the relay logic for an engine handling a Reverse message.

This is where the 3 layer RoutingHeader is processed.

func (*Reverse) Len

func (x *Reverse) Len() int

Len returns the length of this Reverse message.

func (*Reverse) Magic

func (x *Reverse) Magic() string

Magic is the identifying 4 byte string indicating a Reverse message follows.

func (*Reverse) Unwrap

func (x *Reverse) Unwrap() interface{}

Unwrap returns the onion inside this Reverse.

func (*Reverse) Wrap

func (x *Reverse) Wrap(inner ont.Onion)

Wrap puts another onion inside this Reverse onion.

Jump to

Keyboard shortcuts

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