Documentation
¶
Index ¶
Constants ¶
View Source
const ( CERTS_TLS_LINK_X509 = 1 CERTS_RSA_ID_X509 = 2 CERTS_IDENTITY_V_SIGNING_CERT = 4 CERTS_SIGNING_V_TLS_CERT = 5 CERTS_RSA_ID_V_IDENTITY = 7 )
View Source
const ( DESTROY_REASON_NONE uint8 = iota // No reason given. DESTROY_REASON_PROTCOL // Tor protocol violation. (Note: if encounter with this reason consider creating an issue in the repo) DESTROY_REASON_INTERNAL // Internal error. DESTROY_REASON_REQUESTED // A client sent a TRUNCATE command. DESTROY_REASON_HIBERNATING // Not currently operating; trying to save bandwidth. DESTROY_REASON_RESOURCELIMIT // Out of memory, sockets, or circuit IDs. DESTROY_REASON_CONNECTFAILED // Unable to reach relay. DESTROY_REASON_OR_IDENTITY // Connected to relay, but its OR identity was not as expected. DESTROY_REASON_CHANNEL_CLOSED // The OR connection that was carrying this circuit died. DESTROY_REASON_FINISHED // The circuit has expired for being dirty or old. DESTROY_REASON_TIMEOUT // Circuit construction took too long DESTROY_REASON_DESTROYED // The circuit was destroyed w/o client TRUNCATE DESTROY_REASON_NOSUCHSERVICE // Request for unknown hidden service )
View Source
const ( DESTROY_REASON_NONE_MSG string = "No reason given." // No reason given. DESTROY_REASON_PROTCOL_MSG string = "Tor protocol violation." // Tor protocol violation. (Note: if encounter with this reason consider creating an issue in the repo) DESTROY_REASON_INTERNAL_MSG string = "Internal error." // Internal error. DESTROY_REASON_REQUESTED_MSG string = "A client sent a TRUNCATE command." // A client sent a TRUNCATE command. DESTROY_REASON_HIBERNATING_MSG string = "Not currently operating; trying to save bandwidth" // Not currently operating; trying to save bandwidth. DESTROY_REASON_RESOURCELIMIT_MSG string = "Out of memory, sockets, or circuit IDs." // Out of memory, sockets, or circuit IDs. DESTROY_REASON_CONNECTFAILED_MSG string = "Unable to reach relay." // Unable to reach relay. DESTROY_REASON_OR_IDENTITY_MSG string = "Connected to relay, but its OR identity was not as expected." // Connected to relay, but its OR identity was not as expected. DESTROY_REASON_CHANNEL_CLOSED_MSG string = "The OR connection that was carrying this circuit died." // The OR connection that was carrying this circuit died. DESTROY_REASON_FINISHED_MSG string = "The circuit has expired for being dirty or old." // The circuit has expired for being dirty or old. DESTROY_REASON_TIMEOUT_MSG string = "Circuit construction took too long" // Circuit construction took too long DESTROY_REASON_DESTROYED_MSG string = "The circuit was destroyed w/o client TRUNCATE" // The circuit was destroyed w/o client TRUNCATE DESTROY_REASON_NOSUCHSERVICE_MSG string = "Request for unknown hidden service" // Request for unknown hidden service )
View Source
const ( NETINFO_IPV4 byte = 0x04 NETINFO_IPV6 byte = 0x06 )
View Source
const CELL_BODY_LEN int = 509
View Source
const COMMAND_AUTH_CHALLANGE uint8 = 130
View Source
const COMMAND_CERTS uint8 = 129
View Source
const COMMAND_CREATE2 uint8 = 10
View Source
const COMMAND_CREATED2 uint8 = 11
View Source
const COMMAND_CREATED_FAST uint8 = 6
View Source
const COMMAND_CREATE_FAST uint8 = 5
View Source
const COMMAND_DESTROY uint8 = 4
View Source
const COMMAND_NETINFO uint8 = 8
View Source
const COMMAND_RELAY uint8 = 3
View Source
const COMMAND_RELAY_EARLY uint8 = 9
View Source
const COMMAND_VERSIONS uint8 = 7
Variables ¶
View Source
var ( ErrInvalidCircID = errors.New("invalid circuit id expected: %s found %s") ErrUnknownCommandID = errors.New("unknown command id") )
View Source
var AllKnownCells = map[uint8]func() Cell{ COMMAND_RELAY: func() Cell { return &RelayCell{} }, COMMAND_DESTROY: func() Cell { return &DestroyCell{} }, COMMAND_CREATE_FAST: func() Cell { return &CreateFastCell{} }, COMMAND_CREATED_FAST: func() Cell { return &CreatedFastCell{} }, COMMAND_NETINFO: func() Cell { return &NetInfoCell{} }, COMMAND_RELAY_EARLY: func() Cell { return &RelayEarlyCell{C: &RelayCell{}} }, COMMAND_CREATE2: func() Cell { return &Create2Cell{} }, COMMAND_CREATED2: func() Cell { return &Created2Cell{} }, COMMAND_CERTS: func() Cell { return &CertsCell{} }, }
Functions ¶
This section is empty.
Types ¶
type CellCoder ¶
type CellCoder struct {
// contains filtered or unexported fields
}
func NewCellCoder ¶
NewCellCoder can encode and decode link cells.
type CertsCell ¶
type CertsCell struct {
CircID uint32
Certificates []certificate
}
func (*CertsCell) GetCircuitID ¶
func (*CertsCell) SetCircuitID ¶
type Create2Cell ¶
type Create2Cell struct {
CircuitID uint32
HandshakeType uint16
Handshake handshakes.Handshake
}
func (*Create2Cell) GetCircuitID ¶
func (c *Create2Cell) GetCircuitID() uint32
func (*Create2Cell) ID ¶
func (*Create2Cell) ID() uint8
func (*Create2Cell) SetCircuitID ¶
func (c *Create2Cell) SetCircuitID(n uint32)
type CreateFastCell ¶
func (*CreateFastCell) GetCircuitID ¶
func (c *CreateFastCell) GetCircuitID() uint32
func (*CreateFastCell) ID ¶
func (*CreateFastCell) ID() uint8
func (*CreateFastCell) SetCircuitID ¶
func (c *CreateFastCell) SetCircuitID(n uint32)
type Created2Cell ¶
type Created2Cell struct {
CircuitID uint32
Handshake handshakes.Handshake // MAKE SURE YOU USED DecodeHandshake METHOD BEFORE TRYING TO USE THIS VAR
// contains filtered or unexported fields
}
func (*Created2Cell) DecodeHandshake ¶
func (c *Created2Cell) DecodeHandshake(htype uint16) error
func (*Created2Cell) GetCircuitID ¶
func (c *Created2Cell) GetCircuitID() uint32
func (*Created2Cell) ID ¶
func (*Created2Cell) ID() uint8
func (*Created2Cell) SetCircuitID ¶
func (c *Created2Cell) SetCircuitID(n uint32)
type CreatedFastCell ¶
func (*CreatedFastCell) GetCircuitID ¶
func (c *CreatedFastCell) GetCircuitID() uint32
func (*CreatedFastCell) ID ¶
func (*CreatedFastCell) ID() uint8
func (*CreatedFastCell) SetCircuitID ¶
func (c *CreatedFastCell) SetCircuitID(n uint32)
type DestroyCell ¶
func (*DestroyCell) GetCircuitID ¶
func (c *DestroyCell) GetCircuitID() uint32
func (*DestroyCell) ID ¶
func (*DestroyCell) ID() uint8
func (*DestroyCell) SetCircuitID ¶
func (c *DestroyCell) SetCircuitID(n uint32)
type NetInfoCell ¶
type NetInfoCell struct {
CircuitID uint32
Timestamp uint32 // UNIX Timestamp (should be empty if you aren't a relay)
OtherAddr netip.Addr // recipient's address
MyAdress []netip.Addr // sender's adress (should be empty if you aren't a relay)
}
func (*NetInfoCell) GetCircuitID ¶
func (c *NetInfoCell) GetCircuitID() uint32
func (*NetInfoCell) ID ¶
func (*NetInfoCell) ID() uint8
func (*NetInfoCell) SetCircuitID ¶
func (c *NetInfoCell) SetCircuitID(n uint32)
type RelayCell ¶
RelayCell carries an opaque 509-byte relay body. Onion encrypt/decrypt is owned by internal/hops.Chain, not this type.
func (*RelayCell) GetCircuitID ¶
func (*RelayCell) SetCircuitID ¶
type RelayEarlyCell ¶
type RelayEarlyCell struct {
C *RelayCell
}
func (*RelayEarlyCell) GetCircuitID ¶
func (c *RelayEarlyCell) GetCircuitID() uint32
func (*RelayEarlyCell) ID ¶
func (*RelayEarlyCell) ID() uint8
func (*RelayEarlyCell) SetCircuitID ¶
func (c *RelayEarlyCell) SetCircuitID(n uint32)
type VersionCell ¶
func UnserializeVersionCell ¶
func UnserializeVersionCell(b []byte) (*VersionCell, error)
func (*VersionCell) Serialize ¶
func (cell *VersionCell) Serialize() []byte
Click to show internal directories.
Click to hide internal directories.