response

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

Documentation

Overview

Package response provides a message type in response to an Exit message.

Index

Constants

View Source
const (
	Magic = "resp"
	Len   = magic.Len +
		slice.Uint32Len +
		slice.Uint16Len +
		nonce.IDLen + 1
)

Variables

This section is empty.

Functions

func Gen

func Gen() codec.Codec

Gen is a factory function for an IntroQuery.

func New

func New(id nonce.ID, port uint16, res slice.Bytes, load byte) ont.Onion

Types

type Response

type Response struct {

	// ID of the Exit message.
	ID nonce.ID

	// Port of the Exit service.
	Port uint16

	// Load of the Exit relay.
	Load byte

	// Bytes of the Response to the Exit request message.
	slice.Bytes
}

Response is a reply to an Exit message.

func (*Response) Account

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

Account for an Response.

TODO: this is supposed to affect half the exit fee and the two hops following.

func (*Response) Decode

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

Decode what should be an Response message from a splice.Splice.

func (*Response) Encode

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

Encode this Response into a splice.Splice's next bytes.

func (*Response) Handle

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

Handle provides the relay switching logic for an engine handling an Response message.

func (*Response) Len

func (x *Response) Len() int

Len returns the length of the onion starting from this one (used to size a Splice).

func (*Response) Magic

func (x *Response) Magic() string

Magic bytes identifying a HiddenService message is up next.

func (*Response) Unwrap

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

Unwrap is a no-op because there is no onion inside a Response (that we concern ourselves with).

func (*Response) Wrap

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

Wrap places another onion inside this one in its slot. Which isn't going to happen.

Jump to

Keyboard shortcuts

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