serviceability

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SERVICEABILITY_PROGRAM_ID_TESTNET = "DZtnuQ839pSaDMFG5q1ad2V95G82S5EC4RrB3Ndw2Heb"
	SERVICEABILITY_PROGRAM_ID_DEVNET  = "GYhQDKuESrasNZGyhMJhGYFtbzNijYhcrN9poSqCQVah"
)
View Source
const (
	UserTypeIBRL = iota
	UserTypeIBRLWithAllocatedIP
	UserTypeEdgeFiltering
	UserTypeMulticast
)
View Source
const CurrentInterfaceVersion = 1

Variables

This section is empty.

Functions

func DeserializeConfig

func DeserializeConfig(reader *ByteReader, cfg *Config)

func DeserializeDevice

func DeserializeDevice(reader *ByteReader, dev *Device)

func DeserializeExchange

func DeserializeExchange(reader *ByteReader, exchange *Exchange)

func DeserializeInterface

func DeserializeInterface(reader *ByteReader, iface *Interface)
func DeserializeLink(reader *ByteReader, link *Link)

func DeserializeLocation

func DeserializeLocation(reader *ByteReader, loc *Location)

func DeserializeMulticastGroup

func DeserializeMulticastGroup(reader *ByteReader, multicastgroup *MulticastGroup)

func DeserializeUser

func DeserializeUser(reader *ByteReader, user *User)

Types

type AccountType

type AccountType uint8
const (
	GlobalState AccountType = iota + 1
	ConfigType
	LocationType
	ExchangeType
	DeviceType
	LinkType
	UserType
	MulticastGroupType
)

type ByteReader

type ByteReader struct {
	// contains filtered or unexported fields
}

func NewByteReader

func NewByteReader(data []byte) *ByteReader

func (*ByteReader) ReadF64

func (br *ByteReader) ReadF64() float64

func (*ByteReader) ReadIPv4

func (br *ByteReader) ReadIPv4() [4]byte

func (*ByteReader) ReadIPv4Slice

func (br *ByteReader) ReadIPv4Slice() [][4]byte

func (*ByteReader) ReadNetworkV4

func (br *ByteReader) ReadNetworkV4() [5]byte

func (*ByteReader) ReadNetworkV4Slice

func (br *ByteReader) ReadNetworkV4Slice() [][5]byte

func (*ByteReader) ReadPubkey

func (br *ByteReader) ReadPubkey() [32]byte

func (*ByteReader) ReadPubkeySlice

func (br *ByteReader) ReadPubkeySlice() [][32]byte

func (*ByteReader) ReadString

func (br *ByteReader) ReadString() string

func (*ByteReader) ReadU8

func (br *ByteReader) ReadU8() uint8

func (*ByteReader) ReadU16

func (br *ByteReader) ReadU16() uint16

func (*ByteReader) ReadU32

func (br *ByteReader) ReadU32() uint32

func (*ByteReader) ReadU64

func (br *ByteReader) ReadU64() uint64

func (*ByteReader) ReadU128

func (br *ByteReader) ReadU128() Uint128

func (*ByteReader) Remaining

func (br *ByteReader) Remaining() uint32

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(rpc RPCClient, programID solana.PublicKey) *Client

func (*Client) GetProgramData

func (c *Client) GetProgramData(ctx context.Context) (*ProgramData, error)

func (*Client) ProgramID

func (c *Client) ProgramID() solana.PublicKey

type Config

type Config struct {
	AccountType         AccountType
	Owner               [32]byte
	Bump_seed           uint8
	Local_asn           uint32
	Remote_asn          uint32
	TunnelTunnelBlock   [5]uint8
	UserTunnelBlock     [5]uint8
	MulticastGroupBlock [5]uint8
	PubKey              [32]byte
}

type CyoaType

type CyoaType uint8
const (
	CyoaTypeGREOverDIA CyoaType = iota + 1
	CyoaTypeGREOverFabric
	CyoaTypeGREOverPrivatePeering
	CyoaTypeGREOverPublicPeering
	CyoaTypeGREOverCable
)

type Device

type Device struct {
	AccountType            AccountType
	Owner                  [32]uint8
	Index                  Uint128
	Bump_seed              uint8
	LocationPubKey         [32]uint8
	ExchangePubKey         [32]uint8
	DeviceType             uint8
	PublicIp               [4]uint8
	Status                 DeviceStatus
	Code                   string
	DzPrefixes             [][5]uint8
	MetricsPublisherPubKey [32]uint8
	ContributorPubKey      [32]byte
	BgpAsn                 uint32
	DiaBgpAsn              uint32
	MgmtVrf                string
	DnsServers             [][4]uint8
	NtpServers             [][4]uint8
	Interfaces             []Interface
	PubKey                 [32]byte
}

type DeviceStatus

type DeviceStatus uint8
const (
	DeviceStatusPending DeviceStatus = iota
	DeviceStatusActivated
	DeviceStatusSuspended
	DeviceStatusDeleted
)

type Exchange

type Exchange struct {
	AccountType AccountType
	Owner       [32]uint8
	Index       Uint128
	Bump_seed   uint8
	Lat         float64
	Lng         float64
	LocId       uint32
	Status      ExchangeStatus
	Code        string
	Name        string
	PubKey      [32]byte
}

type ExchangeStatus

type ExchangeStatus uint8
const (
	ExchangeStatusPending ExchangeStatus = iota
	ExchangeStatusActivated
	ExchangeStatusSuspended
	ExchangeStatusDeleted
)

type Interface

type Interface struct {
	Version            uint8
	Name               string
	InterfaceType      InterfaceType
	LoopbackType       LoopbackType
	VlanId             uint16
	IpNet              [5]uint8
	NodeSegmentIdx     uint16
	UserTunnelEndpoint bool
}

type InterfaceType

type InterfaceType uint8
const (
	InterfaceTypeInvalid InterfaceType = iota
	InterfaceTypeLoopback
	InterfaceTypePhysical
)
type Link struct {
	AccountType       AccountType
	Owner             [32]uint8
	Index             Uint128
	Bump_seed         uint8
	SideAPubKey       [32]uint8
	SideZPubKey       [32]uint8
	LinkType          LinkLinkType
	Bandwidth         uint64
	Mtu               uint32
	DelayNs           uint64
	JitterNs          uint64
	TunnelId          uint16
	TunnelNet         [5]uint8
	Status            LinkStatus
	Code              string
	ContributorPubKey [32]uint8
	SideAIfaceName    string
	SideZIfaceName    string
	PubKey            [32]byte
}

type LinkLinkType

type LinkLinkType uint8
const (
	LinkLinkTypeMPLSoverGRE LinkLinkType = iota + 1
)

type LinkStatus

type LinkStatus uint8
const (
	LinkStatusPending LinkStatus = iota
	LinkStatusActivated
	LinkStatusSuspended
	LinkStatusDeleted
)

type Location

type Location struct {
	AccountType AccountType
	Owner       [32]uint8
	Index       Uint128
	Bump_seed   uint8
	Lat         float64
	Lng         float64
	LocId       uint32
	Status      LocationStatus
	Code        string
	Name        string
	Country     string
	PubKey      [32]byte
}

type LocationStatus

type LocationStatus uint8
const (
	LocationStatusPending LocationStatus = iota
	LocationStatusActivated
	LocationStatusSuspended
	LocationStatusDeleted
)

type LoopbackType

type LoopbackType uint8
const (
	LoopbackTypeNone LoopbackType = iota
	LoopbackTypeVpnv4
	LoopbackTypeIpv4
	LoopbackTypePimRpAddr
	LoopbackTypeReserved
)

type MulticastGroup

type MulticastGroup struct {
	AccountType  AccountType
	Owner        [32]uint8
	Index        Uint128
	Bump_seed    uint8
	TenantPubKey [32]uint8
	MulticastIp  [4]uint8
	MaxBandwidth uint64
	Status       MulticastGroupStatus
	Code         string
	PubAllowList [][32]uint8
	SubAllowList [][32]uint8
	Publishers   [][32]uint8
	Subscribers  [][32]uint8
	PubKey       [32]byte
}

type MulticastGroupStatus

type MulticastGroupStatus uint8
const (
	MulticastGroupStatusPending MulticastGroupStatus = iota
	MulticastGroupStatusActivated
	MulticastGroupStatusSuspended
	MulticastGroupStatusDeleted
)

type ProgramData

type ProgramData struct {
	Config          Config
	Locations       []Location
	Exchanges       []Exchange
	Devices         []Device
	Links           []Link
	Users           []User
	MulticastGroups []MulticastGroup
}

type RPCClient

type RPCClient interface {
	GetProgramAccounts(context.Context, solana.PublicKey) (rpc.GetProgramAccountsResult, error)
}

RPCClient is an interface for interacting with the Solana RPC server.

type Uint128

type Uint128 struct {
	High uint64
	Low  uint64
}

type User

type User struct {
	AccountType  AccountType
	Owner        [32]uint8
	Index        Uint128
	Bump_seed    uint8
	UserType     UserUserType
	TenantPubKey [32]uint8
	DevicePubKey [32]uint8
	CyoaType     CyoaType
	ClientIp     [4]uint8
	DzIp         [4]uint8
	TunnelId     uint16
	TunnelNet    [5]uint8
	Status       UserStatus
	Publishers   [][32]uint8
	Subscribers  [][32]uint8
	PubKey       [32]byte
}

type UserStatus

type UserStatus uint8
const (
	UserStatusPending UserStatus = iota
	UserStatusActivated
	UserStatusSuspended
	UserStatusDeleted
)

type UserUserType

type UserUserType uint8

Jump to

Keyboard shortcuts

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