core: github.com/katzenpost/core/wire/commands Index | Files

package commands

import "github.com/katzenpost/core/wire/commands"

Index

Package Files

commands.go

Constants

const (

    // ConsensusOk signifies that the GetConsensus request has completed
    // successfully.
    ConsensusOk = 0

    // ConsensusNotFound signifies that the document document corresponding
    // to the epoch in the GetConsensus was not found, but retrying later
    // may be successful.
    ConsensusNotFound = 1

    // ConsensusGone signifies that the document corresponding to the epoch
    // in the GetConsensus was not found, and that retrying later will
    // not be successful.
    ConsensusGone = 2

    // DescriptorOk signifies that the PostDescriptor request has completed
    // succcessfully.
    DescriptorOk = 0

    // DescriptorInvalid signifies that the PostDescriptor request has failed
    // due to an unspecified error.
    DescriptorInvalid = 1

    // DescriptorConflict signifies that the PostDescriptor request has
    // failed due to the uploaded descriptor conflicting with a previously
    // uploaded descriptor.
    DescriptorConflict = 2

    // DescriptorForbidden signifies that the PostDescriptor request has
    // failed due to an authentication error.
    DescriptorForbidden = 3

    // VoteOk signifies that the vote was accepted by the peer.
    VoteOk = 0

    // VoteTooLate signifies that the vote was too late.
    VoteTooLate = 1

    // VoteTooEarly signifies that the vote was too late.
    VoteTooEarly = 2

    // VoteNotAuthorized signifies that the voting entity's key is not white-listed.
    VoteNotAuthorized = 3

    // VoteNotSigned signifies that the vote payload failed signature verification.
    VoteNotSigned = 4

    // VoteMalformed signifies that the vote payload was invalid.
    VoteMalformed = 5

    // VoteAlreadyReceived signifies that the vote from that peer was already received.
    VoteAlreadyReceived = 6

    // VoteNotFound signifies that the vote was not found.
    VoteNotFound = 7

    // RevealOk signifies that the reveal was accepted by the peer.
    RevealOk = 8

    // RevealTooEarly signifies that the peer breaking protocol. XXX: should drop?
    RevealTooEarly = 9

    // RevealNotAuthorized signifies that the revealing entity's key is not white-listed.
    RevealNotAuthorized = 10

    // RevealAlreadyReceived signifies that the reveal from that peer was already received.
    RevealAlreadyReceived = 11

    // RevealTooLate signifies that the reveal from that peer arrived too late.
    RevealTooLate = 12
)

type Command Uses

type Command interface {
    // ToBytes serializes the command and returns the resulting slice.
    ToBytes() []byte
}

Command is the common interface exposed by all message command structures.

func FromBytes Uses

func FromBytes(b []byte) (Command, error)

FromBytes de-serializes the command in the buffer b, returning a Command or an error.

type Consensus Uses

type Consensus struct {
    ErrorCode uint8
    Payload   []byte
}

Consensus is a de-serialized consensus command.

func (*Consensus) ToBytes Uses

func (c *Consensus) ToBytes() []byte

ToBytes serializes the Consensus and returns the resulting byte slice.

type Disconnect Uses

type Disconnect struct{}

Disconnect is a de-serialized disconnect command.

func (*Disconnect) ToBytes Uses

func (c *Disconnect) ToBytes() []byte

ToBytes serializes the Disconnect and returns the resulting slice.

type GetConsensus Uses

type GetConsensus struct {
    Epoch uint64
}

GetConsensus is a de-serialized get_consensus command.

func (*GetConsensus) ToBytes Uses

func (c *GetConsensus) ToBytes() []byte

ToBytes serializes the GetConsensus and returns the resulting byte slice.

type GetVote Uses

type GetVote struct {
    Epoch     uint64
    PublicKey *eddsa.PublicKey
}

GetVote is a de-serialized get_vote command.

func (*GetVote) ToBytes Uses

func (v *GetVote) ToBytes() []byte

ToBytes serializes the GetVote and returns the resulting slice.

type Message Uses

type Message struct {
    QueueSizeHint uint8
    Sequence      uint32
    Payload       []byte
}

Message is a de-serialized message command containing a message.

func (*Message) ToBytes Uses

func (c *Message) ToBytes() []byte

ToBytes serializes the Message and returns the resulting slice.

type MessageACK Uses

type MessageACK struct {
    QueueSizeHint uint8
    Sequence      uint32
    ID            [sphinxConstants.SURBIDLength]byte
    Payload       []byte
}

MessageACK is a de-serialized message command containing an ACK.

func (*MessageACK) ToBytes Uses

func (c *MessageACK) ToBytes() []byte

ToBytes serializes the MessageACK and returns the resulting slice.

type MessageEmpty Uses

type MessageEmpty struct {
    Sequence uint32
}

MessageEmpty is a de-serialized message command signifying a empty queue.

func (*MessageEmpty) ToBytes Uses

func (c *MessageEmpty) ToBytes() []byte

ToBytes serializes the MessageEmpty and returns the resulting slice.

type NoOp Uses

type NoOp struct{}

NoOp is a de-serialized noop command.

func (*NoOp) ToBytes Uses

func (c *NoOp) ToBytes() []byte

ToBytes serializes the NoOp and returns the resulting slice.

type PostDescriptor Uses

type PostDescriptor struct {
    Epoch   uint64
    Payload []byte
}

PostDescriptor is a de-serialized post_descriptor command.

func (*PostDescriptor) ToBytes Uses

func (c *PostDescriptor) ToBytes() []byte

ToBytes serializes the PostDescriptor and returns the resulting byte slice.

type PostDescriptorStatus Uses

type PostDescriptorStatus struct {
    ErrorCode uint8
}

PostDescriptorStatus is a de-serialized post_descriptor_status command.

func (*PostDescriptorStatus) ToBytes Uses

func (c *PostDescriptorStatus) ToBytes() []byte

ToBytes serializes the PostDescriptorStatus and returns the resulting byte slice.

type RetrieveMessage Uses

type RetrieveMessage struct {
    Sequence uint32
}

RetrieveMessage is a de-serialized retrieve_message command.

func (*RetrieveMessage) ToBytes Uses

func (c *RetrieveMessage) ToBytes() []byte

ToBytes serializes the RetrieveMessage and returns the resulting slice.

type Reveal Uses

type Reveal struct {
    Epoch     uint64
    PublicKey *eddsa.PublicKey
    Payload   []byte
}

Reveal is a de-serialized reveal command exchanged by authorities.

func (*Reveal) ToBytes Uses

func (r *Reveal) ToBytes() []byte

ToBytes serializes the Reveal and returns the resulting byte slice.

type RevealStatus Uses

type RevealStatus struct {
    ErrorCode uint8
}

RevealStatus is a de-serialized revealStatus command.

func (*RevealStatus) ToBytes Uses

func (r *RevealStatus) ToBytes() []byte

ToBytes serializes the RevealStatus and returns the resulting byte slice.

type SendPacket Uses

type SendPacket struct {
    SphinxPacket []byte
}

SendPacket is a de-serialized send_packet command.

func (*SendPacket) ToBytes Uses

func (c *SendPacket) ToBytes() []byte

ToBytes serializes the SendPacket and returns the resulting slice.

type Vote Uses

type Vote struct {
    Epoch     uint64
    PublicKey *eddsa.PublicKey
    Payload   []byte
}

Vote is a vote which is exchanged by Directory Authorities.

func (*Vote) ToBytes Uses

func (c *Vote) ToBytes() []byte

ToBytes serializes the Vote and returns the resulting slice.

type VoteStatus Uses

type VoteStatus struct {
    ErrorCode uint8
}

VoteStatus is a resonse status for a Vote command.

func (*VoteStatus) ToBytes Uses

func (c *VoteStatus) ToBytes() []byte

ToBytes serializes the VoteStatus and returns the resulting slice.

Package commands imports 7 packages (graph) and is imported by 8 packages. Updated 2019-11-19. Refresh now. Tools for package owners.