wboxproto

package
v0.0.0-...-d60fec0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: MIT Imports: 6 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")
)

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Message type byte: 2

func (*Cfg) Descriptor

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

func (*Cfg) GetNet4

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

func (*Cfg) GetNet6

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

func (*Cfg) GetRoutes4

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

func (*Cfg) GetRoutes6

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

func (*Cfg) GetServer4

func (m *Cfg) GetServer4() uint32

func (*Cfg) GetServer6

func (m *Cfg) GetServer6() *IPv6

func (*Cfg) GetTun4Endpoint

func (m *Cfg) GetTun4Endpoint() uint32

func (*Cfg) GetTun6Endpoint

func (m *Cfg) GetTun6Endpoint() *IPv6

func (*Cfg) GetTunPort

func (m *Cfg) GetTunPort() uint32

func (*Cfg) GetValidUntil

func (m *Cfg) GetValidUntil() uint64

func (*Cfg) ProtoMessage

func (*Cfg) ProtoMessage()

func (*Cfg) Reset

func (m *Cfg) Reset()

func (*Cfg) String

func (m *Cfg) String() string

func (*Cfg) XXX_DiscardUnknown

func (m *Cfg) XXX_DiscardUnknown()

func (*Cfg) XXX_Marshal

func (m *Cfg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Cfg) XXX_Merge

func (m *Cfg) XXX_Merge(src proto.Message)

func (*Cfg) XXX_Size

func (m *Cfg) XXX_Size() int

func (*Cfg) XXX_Unmarshal

func (m *Cfg) XXX_Unmarshal(b []byte) error

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Message type byte: 1

func (*CfgSolict) Descriptor

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

func (*CfgSolict) GetPeerPubkey

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

func (*CfgSolict) ProtoMessage

func (*CfgSolict) ProtoMessage()

func (*CfgSolict) Reset

func (m *CfgSolict) Reset()

func (*CfgSolict) String

func (m *CfgSolict) String() string

func (*CfgSolict) XXX_DiscardUnknown

func (m *CfgSolict) XXX_DiscardUnknown()

func (*CfgSolict) XXX_Marshal

func (m *CfgSolict) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CfgSolict) XXX_Merge

func (m *CfgSolict) XXX_Merge(src proto.Message)

func (*CfgSolict) XXX_Size

func (m *CfgSolict) XXX_Size() int

func (*CfgSolict) XXX_Unmarshal

func (m *CfgSolict) XXX_Unmarshal(b []byte) error

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func NewIPv6

func NewIPv6(addr net.IP) *IPv6

func (*IPv6) AsIP

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

func (*IPv6) Descriptor

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

func (*IPv6) GetHigh

func (m *IPv6) GetHigh() uint64

func (*IPv6) GetLow

func (m *IPv6) GetLow() uint64

func (*IPv6) ProtoMessage

func (*IPv6) ProtoMessage()

func (*IPv6) Reset

func (m *IPv6) Reset()

func (*IPv6) String

func (m *IPv6) String() string

func (*IPv6) XXX_DiscardUnknown

func (m *IPv6) XXX_DiscardUnknown()

func (*IPv6) XXX_Marshal

func (m *IPv6) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*IPv6) XXX_Merge

func (m *IPv6) XXX_Merge(src proto.Message)

func (*IPv6) XXX_Size

func (m *IPv6) XXX_Size() int

func (*IPv6) XXX_Unmarshal

func (m *IPv6) XXX_Unmarshal(b []byte) error

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Message type byte: 3

func (*Nack) Descriptor

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

func (*Nack) GetDescription

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

func (*Nack) ProtoMessage

func (*Nack) ProtoMessage()

func (*Nack) Reset

func (m *Nack) Reset()

func (*Nack) String

func (m *Nack) String() string

func (*Nack) XXX_DiscardUnknown

func (m *Nack) XXX_DiscardUnknown()

func (*Nack) XXX_Marshal

func (m *Nack) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Nack) XXX_Merge

func (m *Nack) XXX_Merge(src proto.Message)

func (*Nack) XXX_Size

func (m *Nack) XXX_Size() int

func (*Nack) XXX_Unmarshal

func (m *Nack) XXX_Unmarshal(b []byte) error

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Net4) AsIPNet

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

func (*Net4) Descriptor

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

func (*Net4) GetAddr

func (m *Net4) GetAddr() uint32

func (*Net4) GetPrefixLen

func (m *Net4) GetPrefixLen() int32

func (*Net4) ProtoMessage

func (*Net4) ProtoMessage()

func (*Net4) Reset

func (m *Net4) Reset()

func (*Net4) String

func (m *Net4) String() string

func (*Net4) XXX_DiscardUnknown

func (m *Net4) XXX_DiscardUnknown()

func (*Net4) XXX_Marshal

func (m *Net4) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Net4) XXX_Merge

func (m *Net4) XXX_Merge(src proto.Message)

func (*Net4) XXX_Size

func (m *Net4) XXX_Size() int

func (*Net4) XXX_Unmarshal

func (m *Net4) XXX_Unmarshal(b []byte) error

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Net6) AsIPNet

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

func (*Net6) Descriptor

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

func (*Net6) GetAddr

func (m *Net6) GetAddr() *IPv6

func (*Net6) GetPrefixLen

func (m *Net6) GetPrefixLen() int32

func (*Net6) ProtoMessage

func (*Net6) ProtoMessage()

func (*Net6) Reset

func (m *Net6) Reset()

func (*Net6) String

func (m *Net6) String() string

func (*Net6) XXX_DiscardUnknown

func (m *Net6) XXX_DiscardUnknown()

func (*Net6) XXX_Marshal

func (m *Net6) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Net6) XXX_Merge

func (m *Net6) XXX_Merge(src proto.Message)

func (*Net6) XXX_Size

func (m *Net6) XXX_Size() int

func (*Net6) XXX_Unmarshal

func (m *Net6) XXX_Unmarshal(b []byte) error

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Route4) Descriptor

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

func (*Route4) GetDest

func (m *Route4) GetDest() *Net4

func (*Route4) GetGateway

func (m *Route4) GetGateway() uint32

func (*Route4) GetSrc

func (m *Route4) GetSrc() uint32

func (*Route4) ProtoMessage

func (*Route4) ProtoMessage()

func (*Route4) Reset

func (m *Route4) Reset()

func (*Route4) String

func (m *Route4) String() string

func (*Route4) XXX_DiscardUnknown

func (m *Route4) XXX_DiscardUnknown()

func (*Route4) XXX_Marshal

func (m *Route4) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Route4) XXX_Merge

func (m *Route4) XXX_Merge(src proto.Message)

func (*Route4) XXX_Size

func (m *Route4) XXX_Size() int

func (*Route4) XXX_Unmarshal

func (m *Route4) XXX_Unmarshal(b []byte) error

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Route6) Descriptor

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

func (*Route6) GetDest

func (m *Route6) GetDest() *Net6

func (*Route6) GetSrc

func (m *Route6) GetSrc() *IPv6

func (*Route6) ProtoMessage

func (*Route6) ProtoMessage()

func (*Route6) Reset

func (m *Route6) Reset()

func (*Route6) String

func (m *Route6) String() string

func (*Route6) XXX_DiscardUnknown

func (m *Route6) XXX_DiscardUnknown()

func (*Route6) XXX_Marshal

func (m *Route6) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Route6) XXX_Merge

func (m *Route6) XXX_Merge(src proto.Message)

func (*Route6) XXX_Size

func (m *Route6) XXX_Size() int

func (*Route6) XXX_Unmarshal

func (m *Route6) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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