serviceability

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserTypeIBRL = iota
	UserTypeIBRLWithAllocatedIP
	UserTypeEdgeFiltering
	UserTypeMulticast
)
View Source
const CurrentInterfaceVersion = 2

Variables

This section is empty.

Functions

func DeserializeConfig

func DeserializeConfig(reader *ByteReader, cfg *Config)

func DeserializeContributor added in v0.7.2

func DeserializeContributor(reader *ByteReader, contributor *Contributor)

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 DeserializeInterfaceV1 added in v0.7.2

func DeserializeInterfaceV1(reader *ByteReader, iface *Interface)

func DeserializeInterfaceV2 added in v0.7.2

func DeserializeInterfaceV2(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 DeserializeProgramConfig added in v0.6.3

func DeserializeProgramConfig(reader *ByteReader, programconfig *ProgramConfig)

func DeserializeProgramVersion added in v0.6.3

func DeserializeProgramVersion(reader *ByteReader, programversion *ProgramVersion)

func DeserializeUser

func DeserializeUser(reader *ByteReader, user *User)

func ToLineProtocol added in v0.7.2

func ToLineProtocol(measurement string, s any, ts time.Time, additionalTags map[string]string) (string, error)

ToLineProtocol converts a struct to InfluxDB line protocol format via struct tags. The tag format is `influx:"tag|field[,name][,option...]"` where `option` can be `pubkey`, `ip`, or `cidr`:

  • The `pubkey` option encodes a [32]byte field as a base58 string.
  • The `ip` option formats a [4]uint8 field as a dotted-decimal IP address.
  • The `cidr` option formats a slice of [5]uint8 (first 4 bytes are the IP, 5th byte is the mask) as comma-separated list of CIDR strings.

Types

type AccountType

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

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) ReadU128

func (br *ByteReader) ReadU128() Uint128

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) ReadU8

func (br *ByteReader) ReadU8() uint8

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 Contributor added in v0.7.2

type Contributor struct {
	AccountType    AccountType
	Owner          [32]uint8         `influx:"tag,owner,pubkey"`
	Index          Uint128           `influx:"-"`
	BumpSeed       uint8             `influx:"-"`
	Status         ContributorStatus `influx:"tag,status"`
	Code           string            `influx:"tag,code"`
	Name           string            `influx:"tag,name"`
	ReferenceCount uint32            `influx:"field,reference_count"`
	PubKey         [32]byte          `influx:"tag,pubkey,pubkey"`
}

func (Contributor) MarshalJSON added in v0.7.2

func (c Contributor) MarshalJSON() ([]byte, error)

type ContributorStatus added in v0.7.2

type ContributorStatus uint8
const (
	ContributorStatusPending ContributorStatus = iota
	ContributorStatusActivated
	ContributorStatusSuspended
	ContributorStatusDeleted
)

func (ContributorStatus) MarshalJSON added in v0.7.2

func (s ContributorStatus) MarshalJSON() ([]byte, error)

func (ContributorStatus) String added in v0.7.2

func (s ContributorStatus) String() string

type CyoaType

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

func (CyoaType) MarshalJSON added in v0.7.2

func (c CyoaType) MarshalJSON() ([]byte, error)

func (CyoaType) String added in v0.7.2

func (c CyoaType) String() string

type Device

type Device struct {
	AccountType            AccountType
	Owner                  [32]uint8        `influx:"tag,owner,pubkey"`
	Index                  Uint128          `influx:"-"`
	Bump_seed              uint8            `influx:"-"`
	LocationPubKey         [32]uint8        `influx:"tag,location_pubkey,pubkey"`
	ExchangePubKey         [32]uint8        `influx:"tag,exchange_pubkey,pubkey"`
	DeviceType             DeviceDeviceType `influx:"tag,device_type"`
	PublicIp               [4]uint8         `influx:"tag,public_ip,ip"`
	Status                 DeviceStatus     `influx:"tag,status"`
	Code                   string           `influx:"tag,code"`
	DzPrefixes             [][5]uint8       `influx:"field,dz_prefixes,cidr"`
	MetricsPublisherPubKey [32]uint8        `influx:"tag,metrics_publisher_pubkey,pubkey"`
	ContributorPubKey      [32]byte         `influx:"tag,contributor_pubkey,pubkey"`
	MgmtVrf                string           `influx:"field,mgmt_vrf"`
	Interfaces             []Interface      `influx:"-"`
	ReferenceCount         uint32           `influx:"field,reference_count"`
	UsersCount             uint16           `influx:"field,users_count"`
	MaxUsers               uint16           `influx:"field,max_users"`
	PubKey                 [32]byte         `influx:"tag,pubkey,pubkey"`
}

func (Device) MarshalJSON added in v0.7.2

func (d Device) MarshalJSON() ([]byte, error)

type DeviceDeviceType added in v0.7.2

type DeviceDeviceType uint8
const (
	DeviceDeviceTypeHybrid DeviceDeviceType = iota
	DeviceDeviceTypeTransit
	DeviceDeviceTypeEdge
)

func (DeviceDeviceType) String added in v0.7.2

func (d DeviceDeviceType) String() string

type DeviceStatus

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

func (DeviceStatus) MarshalJSON added in v0.7.2

func (d DeviceStatus) MarshalJSON() ([]byte, error)

func (DeviceStatus) String added in v0.7.2

func (d DeviceStatus) String() string

type Exchange

type Exchange struct {
	AccountType  AccountType
	Owner        [32]uint8      `influx:"tag,owner,pubkey"`
	Index        Uint128        `influx:"-"`
	Bump_seed    uint8          `influx:"-"`
	Lat          float64        `influx:"field,lat"`
	Lng          float64        `influx:"field,lng"`
	BgpCommunity uint16         `influx:"field,bgp_community"`
	Unused       uint16         `influx:"-"`
	Status       ExchangeStatus `influx:"tag,status"`
	Code         string         `influx:"tag,code"`
	Name         string         `influx:"tag,name"`
	PubKey       [32]byte       `influx:"tag,pubkey,pubkey"`
}

type ExchangeStatus

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

func (ExchangeStatus) String added in v0.7.2

func (e ExchangeStatus) String() string

type Interface

type Interface struct {
	Version            uint8
	Status             InterfaceStatus
	Name               string
	InterfaceType      InterfaceType
	InterfaceCYOA      InterfaceCYOA
	InterfaceDIA       InterfaceDIA
	LoopbackType       LoopbackType
	Bandwidth          uint64
	Cir                uint64
	Mtu                uint16
	RoutingMode        RoutingMode
	VlanId             uint16
	IpNet              [5]uint8
	NodeSegmentIdx     uint16
	UserTunnelEndpoint bool
}

func (Interface) MarshalJSON added in v0.7.2

func (i Interface) MarshalJSON() ([]byte, error)

type InterfaceCYOA added in v0.7.2

type InterfaceCYOA uint8
const (
	InterfaceCYOANone InterfaceCYOA = iota
	InterfaceCYOAGREOverDIA
	InterfaceCYOAGREOverFabric
	InterfaceCYOAGREOverPrivatePeering
	InterfaceCYOAGREOverPublicPeering
	InterfaceCYOAGREOverCable
)

func (InterfaceCYOA) MarshalJSON added in v0.7.2

func (l InterfaceCYOA) MarshalJSON() ([]byte, error)

func (InterfaceCYOA) String added in v0.7.2

func (l InterfaceCYOA) String() string

type InterfaceDIA added in v0.7.2

type InterfaceDIA uint8
const (
	InterfaceDIANone InterfaceDIA = iota
	InterfaceDIADIA
)

func (InterfaceDIA) MarshalJSON added in v0.7.2

func (l InterfaceDIA) MarshalJSON() ([]byte, error)

func (InterfaceDIA) String added in v0.7.2

func (l InterfaceDIA) String() string

type InterfaceStatus added in v0.5.3

type InterfaceStatus uint8
const (
	InterfaceStatusInvalid InterfaceStatus = iota
	InterfaceStatusUnmanaged
	InterfaceStatusPending
	InterfaceStatusActivated
	InterfaceStatusDeleting
	InterfaceStatusRejecting
	InterfaceStatusUnlinked
)

func (InterfaceStatus) MarshalJSON added in v0.7.2

func (i InterfaceStatus) MarshalJSON() ([]byte, error)

func (InterfaceStatus) String added in v0.7.2

func (i InterfaceStatus) String() string

type InterfaceType

type InterfaceType uint8
const (
	InterfaceTypeInvalid InterfaceType = iota
	InterfaceTypeLoopback
	InterfaceTypePhysical
)

func (InterfaceType) MarshalJSON added in v0.7.2

func (i InterfaceType) MarshalJSON() ([]byte, error)

func (InterfaceType) String added in v0.7.2

func (i InterfaceType) String() string
type Link struct {
	AccountType       AccountType
	Owner             [32]uint8    `influx:"tag,owner,pubkey"`
	Index             Uint128      `influx:"-"`
	Bump_seed         uint8        `influx:"-"`
	SideAPubKey       [32]uint8    `influx:"tag,side_a_pubkey,pubkey"`
	SideZPubKey       [32]uint8    `influx:"tag,side_z_pubkey,pubkey"`
	LinkType          LinkLinkType `influx:"tag,link_type"`
	Bandwidth         uint64       `influx:"field,bandwidth"`
	Mtu               uint32       `influx:"field,mtu"`
	DelayNs           uint64       `influx:"field,delay_ns"`
	JitterNs          uint64       `influx:"field,jitter_ns"`
	TunnelId          uint16       `influx:"tag,tunnel_id"`
	TunnelNet         [5]uint8     `influx:"tag,tunnel_net,cidr"`
	Status            LinkStatus   `influx:"tag,status"`
	Code              string       `influx:"tag,code"`
	ContributorPubKey [32]uint8    `influx:"tag,contributor_pubkey,pubkey"`
	SideAIfaceName    string       `influx:"tag,side_a_iface_name"`
	SideZIfaceName    string       `influx:"tag,side_z_iface_name"`
	DelayOverrideNs   uint64       `influx:"field,delay_override_ns"`
	PubKey            [32]byte     `influx:"tag,pubkey,pubkey"`
}

func (Link) MarshalJSON added in v0.7.2

func (l Link) MarshalJSON() ([]byte, error)

type LinkLinkType

type LinkLinkType uint8
const (
	LinkLinkTypeWAN LinkLinkType = 1
	LinkLinkTypeDZX LinkLinkType = 127
)

func (LinkLinkType) MarshalJSON added in v0.7.2

func (l LinkLinkType) MarshalJSON() ([]byte, error)

func (LinkLinkType) String added in v0.7.2

func (l LinkLinkType) String() string

type LinkStatus

type LinkStatus uint8
const (
	LinkStatusPending LinkStatus = iota
	LinkStatusActivated
	LinkStatusSuspended
	LinkStatusDeleted
	LinkStatusRejected
	LinkStatusRequested
	LinkStatusHardDrained
	LinkStatusSoftDrained
)

func (LinkStatus) MarshalJSON added in v0.7.2

func (l LinkStatus) MarshalJSON() ([]byte, error)

func (LinkStatus) String added in v0.7.2

func (l LinkStatus) String() string

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
)

func (LoopbackType) MarshalJSON added in v0.7.2

func (l LoopbackType) MarshalJSON() ([]byte, error)

func (LoopbackType) String added in v0.7.2

func (l LoopbackType) String() string

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
	PublisherCount  uint32
	SubscriberCount uint32
	PubKey          [32]byte
}

type MulticastGroupStatus

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

type ProgramConfig added in v0.6.3

type ProgramConfig struct {
	AccountType AccountType
	BumpSeed    uint8
	Version     ProgramVersion
}

type ProgramData

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

type ProgramDataProvider added in v0.7.2

type ProgramDataProvider interface {
	GetProgramData(ctx context.Context) (*ProgramData, error)
}

type ProgramVersion added in v0.6.3

type ProgramVersion struct {
	Major uint32
	Minor uint32
	Patch uint32
}

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 RoutingMode added in v0.7.2

type RoutingMode uint8
const (
	RoutingModeStatic RoutingMode = iota
	RoutingModeBGP
)

func (RoutingMode) MarshalJSON added in v0.7.2

func (l RoutingMode) MarshalJSON() ([]byte, error)

func (RoutingMode) String added in v0.7.2

func (l RoutingMode) String() string

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
}

func (User) MarshalJSON added in v0.7.2

func (u User) MarshalJSON() ([]byte, error)

type UserStatus

type UserStatus uint8
const (
	UserStatusPending UserStatus = iota
	UserStatusActivated
	UserStatusSuspended
	UserStatusDeleted
	UserStatusRejected
	UserStatusPendingBan
	UserStatusBanned
	UserStatusUpdating
)

func (UserStatus) MarshalJSON added in v0.7.2

func (u UserStatus) MarshalJSON() ([]byte, error)

func (UserStatus) String added in v0.7.2

func (u UserStatus) String() string

type UserUserType

type UserUserType uint8

func (UserUserType) MarshalJSON added in v0.7.2

func (u UserUserType) MarshalJSON() ([]byte, error)

func (UserUserType) String added in v0.7.2

func (u UserUserType) String() string

Jump to

Keyboard shortcuts

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