wboxproto

package
v0.0.0-...-4e59c17 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MsgSolict MsgType = 1
	MsgCfg    MsgType = 2
	MsgNack   MsgType = 3

	Version byte = 1
)

Variables

View Source
var (
	ErrUnknownVersion = errors.New("proto: unknown protocol version")
)
View Source
var File_protocol_proto protoreflect.FileDescriptor

Functions

func IPv4

func IPv4(a uint32) net.IP

func Pack

func Pack(msg proto.Message) ([]byte, error)

func Unpack

func Unpack(b []byte) (proto.Message, error)

Types

type Cfg

type Cfg struct {

	// The UNIX timestamp the configuration is valid until.
	ValidUntil uint64 `protobuf:"varint,2,opt,name=valid_until,json=validUntil,proto3" json:"valid_until,omitempty"`
	// IPv6 network configuration.
	Server6 *IPv6     `protobuf:"bytes,7,opt,name=server6,proto3" json:"server6,omitempty"`
	Net6    []*Net6   `protobuf:"bytes,3,rep,name=net6,proto3" json:"net6,omitempty"`
	Routes6 []*Route6 `protobuf:"bytes,4,rep,name=routes6,proto3" json:"routes6,omitempty"`
	// IPv4 network configuration.
	Server4 uint32    `protobuf:"fixed32,8,opt,name=server4,proto3" json:"server4,omitempty"`
	Net4    []*Net4   `protobuf:"bytes,16,rep,name=net4,proto3" json:"net4,omitempty"`
	Routes4 []*Route4 `protobuf:"bytes,17,rep,name=routes4,proto3" json:"routes4,omitempty"`
	// The WireGuard tunnel endpoint client should switch to.
	// Can be empty if the client should reuse the configuration tunnel.
	// tun6_endpoint - Publicly routable IPv6 address of server.
	// tun_endpoint  - Publicly routable IPv4 address of server.
	// (at least one should be non-empty)
	//
	// tun_port      - UDP port to use.
	Tun6Endpoint *IPv6  `protobuf:"bytes,5,opt,name=tun6_endpoint,json=tun6Endpoint,proto3" json:"tun6_endpoint,omitempty"`
	Tun4Endpoint uint32 `protobuf:"fixed32,18,opt,name=tun4_endpoint,json=tun4Endpoint,proto3" json:"tun4_endpoint,omitempty"`
	TunPort      uint32 `protobuf:"varint,6,opt,name=tun_port,json=tunPort,proto3" json:"tun_port,omitempty"`
	// contains filtered or unexported fields
}

Message type byte: 2

func (*Cfg) Descriptor deprecated

func (*Cfg) Descriptor() ([]byte, []int)

Deprecated: Use Cfg.ProtoReflect.Descriptor instead.

func (*Cfg) GetNet4

func (x *Cfg) GetNet4() []*Net4

func (*Cfg) GetNet6

func (x *Cfg) GetNet6() []*Net6

func (*Cfg) GetRoutes4

func (x *Cfg) GetRoutes4() []*Route4

func (*Cfg) GetRoutes6

func (x *Cfg) GetRoutes6() []*Route6

func (*Cfg) GetServer4

func (x *Cfg) GetServer4() uint32

func (*Cfg) GetServer6

func (x *Cfg) GetServer6() *IPv6

func (*Cfg) GetTun4Endpoint

func (x *Cfg) GetTun4Endpoint() uint32

func (*Cfg) GetTun6Endpoint

func (x *Cfg) GetTun6Endpoint() *IPv6

func (*Cfg) GetTunPort

func (x *Cfg) GetTunPort() uint32

func (*Cfg) GetValidUntil

func (x *Cfg) GetValidUntil() uint64

func (*Cfg) ProtoMessage

func (*Cfg) ProtoMessage()

func (*Cfg) ProtoReflect

func (x *Cfg) ProtoReflect() protoreflect.Message

func (*Cfg) Reset

func (x *Cfg) Reset()

func (*Cfg) String

func (x *Cfg) String() string

type CfgSolict

type CfgSolict struct {

	// ed25519 public key of the client. MUST be 32 bytes.
	PeerPubkey []byte `protobuf:"bytes,1,opt,name=peer_pubkey,json=peerPubkey,proto3" json:"peer_pubkey,omitempty"`
	// contains filtered or unexported fields
}

Message type byte: 1

func (*CfgSolict) Descriptor deprecated

func (*CfgSolict) Descriptor() ([]byte, []int)

Deprecated: Use CfgSolict.ProtoReflect.Descriptor instead.

func (*CfgSolict) GetPeerPubkey

func (x *CfgSolict) GetPeerPubkey() []byte

func (*CfgSolict) ProtoMessage

func (*CfgSolict) ProtoMessage()

func (*CfgSolict) ProtoReflect

func (x *CfgSolict) ProtoReflect() protoreflect.Message

func (*CfgSolict) Reset

func (x *CfgSolict) Reset()

func (*CfgSolict) String

func (x *CfgSolict) String() string

type IPv6

type IPv6 struct {
	High uint64 `protobuf:"fixed64,1,opt,name=high,proto3" json:"high,omitempty"`
	Low  uint64 `protobuf:"varint,2,opt,name=low,proto3" json:"low,omitempty"`
	// contains filtered or unexported fields
}

func NewIPv6

func NewIPv6(addr net.IP) *IPv6

func (*IPv6) AsIP

func (ipv6 *IPv6) AsIP() net.IP

func (*IPv6) Descriptor deprecated

func (*IPv6) Descriptor() ([]byte, []int)

Deprecated: Use IPv6.ProtoReflect.Descriptor instead.

func (*IPv6) GetHigh

func (x *IPv6) GetHigh() uint64

func (*IPv6) GetLow

func (x *IPv6) GetLow() uint64

func (*IPv6) ProtoMessage

func (*IPv6) ProtoMessage()

func (*IPv6) ProtoReflect

func (x *IPv6) ProtoReflect() protoreflect.Message

func (*IPv6) Reset

func (x *IPv6) Reset()

func (*IPv6) String

func (x *IPv6) String() string

type Message

type Message = proto.Message

type MsgType

type MsgType byte

type Nack

type Nack struct {

	// Human-readable error description.
	Description []byte `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"`
	// contains filtered or unexported fields
}

Message type byte: 3

func (*Nack) Descriptor deprecated

func (*Nack) Descriptor() ([]byte, []int)

Deprecated: Use Nack.ProtoReflect.Descriptor instead.

func (*Nack) GetDescription

func (x *Nack) GetDescription() []byte

func (*Nack) ProtoMessage

func (*Nack) ProtoMessage()

func (*Nack) ProtoReflect

func (x *Nack) ProtoReflect() protoreflect.Message

func (*Nack) Reset

func (x *Nack) Reset()

func (*Nack) String

func (x *Nack) String() string

type Net4

type Net4 struct {
	Addr      uint32 `protobuf:"fixed32,1,opt,name=addr,proto3" json:"addr,omitempty"`
	PrefixLen int32  `protobuf:"varint,2,opt,name=prefix_len,json=prefixLen,proto3" json:"prefix_len,omitempty"`
	// contains filtered or unexported fields
}

func (*Net4) AsIPNet

func (n *Net4) AsIPNet() net.IPNet

func (*Net4) Descriptor deprecated

func (*Net4) Descriptor() ([]byte, []int)

Deprecated: Use Net4.ProtoReflect.Descriptor instead.

func (*Net4) GetAddr

func (x *Net4) GetAddr() uint32

func (*Net4) GetPrefixLen

func (x *Net4) GetPrefixLen() int32

func (*Net4) ProtoMessage

func (*Net4) ProtoMessage()

func (*Net4) ProtoReflect

func (x *Net4) ProtoReflect() protoreflect.Message

func (*Net4) Reset

func (x *Net4) Reset()

func (*Net4) String

func (x *Net4) String() string

type Net6

type Net6 struct {
	Addr      *IPv6 `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"`
	PrefixLen int32 `protobuf:"varint,2,opt,name=prefix_len,json=prefixLen,proto3" json:"prefix_len,omitempty"`
	// contains filtered or unexported fields
}

func (*Net6) AsIPNet

func (n *Net6) AsIPNet() net.IPNet

func (*Net6) Descriptor deprecated

func (*Net6) Descriptor() ([]byte, []int)

Deprecated: Use Net6.ProtoReflect.Descriptor instead.

func (*Net6) GetAddr

func (x *Net6) GetAddr() *IPv6

func (*Net6) GetPrefixLen

func (x *Net6) GetPrefixLen() int32

func (*Net6) ProtoMessage

func (*Net6) ProtoMessage()

func (*Net6) ProtoReflect

func (x *Net6) ProtoReflect() protoreflect.Message

func (*Net6) Reset

func (x *Net6) Reset()

func (*Net6) String

func (x *Net6) String() string

type Route4

type Route4 struct {
	Dest    *Net4  `protobuf:"bytes,1,opt,name=dest,proto3" json:"dest,omitempty"`
	Src     uint32 `protobuf:"fixed32,2,opt,name=src,proto3" json:"src,omitempty"`
	Gateway uint32 `protobuf:"fixed32,3,opt,name=gateway,proto3" json:"gateway,omitempty"`
	// contains filtered or unexported fields
}

func (*Route4) Descriptor deprecated

func (*Route4) Descriptor() ([]byte, []int)

Deprecated: Use Route4.ProtoReflect.Descriptor instead.

func (*Route4) GetDest

func (x *Route4) GetDest() *Net4

func (*Route4) GetGateway

func (x *Route4) GetGateway() uint32

func (*Route4) GetSrc

func (x *Route4) GetSrc() uint32

func (*Route4) ProtoMessage

func (*Route4) ProtoMessage()

func (*Route4) ProtoReflect

func (x *Route4) ProtoReflect() protoreflect.Message

func (*Route4) Reset

func (x *Route4) Reset()

func (*Route4) String

func (x *Route4) String() string

type Route6

type Route6 struct {
	Dest *Net6 `protobuf:"bytes,1,opt,name=dest,proto3" json:"dest,omitempty"`
	Src  *IPv6 `protobuf:"bytes,2,opt,name=src,proto3" json:"src,omitempty"`
	// contains filtered or unexported fields
}

func (*Route6) Descriptor deprecated

func (*Route6) Descriptor() ([]byte, []int)

Deprecated: Use Route6.ProtoReflect.Descriptor instead.

func (*Route6) GetDest

func (x *Route6) GetDest() *Net6

func (*Route6) GetSrc

func (x *Route6) GetSrc() *IPv6

func (*Route6) ProtoMessage

func (*Route6) ProtoMessage()

func (*Route6) ProtoReflect

func (x *Route6) ProtoReflect() protoreflect.Message

func (*Route6) Reset

func (x *Route6) Reset()

func (*Route6) String

func (x *Route6) String() string

Jump to

Keyboard shortcuts

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