prefixfile

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BgpSecKeyJson added in v0.5.0

type BgpSecKeyJson struct {
	Asn     uint32 `json:"asn"`
	Expires *int64 `json:"expires,omitempty"`
	Ta      string `json:"ta,omitempty"`

	// Base32 encoded, but encoding/json handles this for us
	// Example: MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE4FxJr0n2bux1uX1Evl+QWwZYvIadPjLuFX2mxqKuAGUhKnr7VLLDgrE++l9p5eH2kWTNVAN22FUU3db/RKpE2w==
	Pubkey []byte `json:"pubkey"`
	// Base16 encoded, we need to decode this ourself
	// Example: 510F485D29A29DB7B515F9C478F8ED3CB7AA7D23
	Ski string `json:"ski"`
}

type Logger added in v0.5.0

type Logger interface {
	Debugf(string, ...interface{})
	Printf(string, ...interface{})
	Warnf(string, ...interface{})
	Errorf(string, ...interface{})
	Infof(string, ...interface{})
}

type MetaData

type MetaData struct {
	Counts          int    `json:"vrps"`
	CountBgpSecKeys int    `json:"bgpsec_pubkeys"`
	Buildtime       string `json:"buildtime,omitempty"`
	GeneratedUnix   *int64 `json:"generated,omitempty"`
}

func (MetaData) GetBuildTime added in v0.4.0

func (md MetaData) GetBuildTime() time.Time

type RPKIList added in v0.6.0

type RPKIList struct {
	Metadata   MetaData        `json:"metadata,omitempty"`
	ROA        []VRPJson       `json:"roas"` // for historical reasons this is called 'roas', but should've been called vrps
	BgpSecKeys []BgpSecKeyJson `json:"bgpsec_keys,omitempty"`
}

type SlurmBGPsecAssertion added in v0.5.0

type SlurmBGPsecAssertion struct {
	SKI             []byte `json:"SKI"`
	ASN             uint32 `json:"asn"`
	Comment         string `json:"comment"`
	RouterPublicKey []byte `json:"routerPublicKey"`
}

type SlurmBGPsecFilter added in v0.5.0

type SlurmBGPsecFilter struct {
	ASN     *uint32 `json:"asn,omitempty"`
	SKI     []byte  `json:"SKI,omitempty"`
	Comment string  `json:"comment"`
}

type SlurmConfig

type SlurmConfig struct {
	SlurmVersion            int
	ValidationOutputFilters SlurmValidationOutputFilters
	LocallyAddedAssertions  SlurmLocallyAddedAssertions
}

func DecodeJSONSlurm

func DecodeJSONSlurm(buf io.Reader) (*SlurmConfig, error)

func (*SlurmConfig) FilterAssert

func (s *SlurmConfig) FilterAssert(vrps []VRPJson, BRKs []BgpSecKeyJson, log Logger) (
	ovrps []VRPJson, oBRKs []BgpSecKeyJson)

func (*SlurmConfig) GetAssertions added in v0.5.0

func (s *SlurmConfig) GetAssertions() (vrps []VRPJson, BRKs []BgpSecKeyJson)

type SlurmLocallyAddedAssertions

type SlurmLocallyAddedAssertions struct {
	PrefixAssertions []SlurmPrefixAssertion
	BgpsecAssertions []SlurmBGPsecAssertion
}

func (*SlurmLocallyAddedAssertions) AssertBRKs added in v0.5.0

func (s *SlurmLocallyAddedAssertions) AssertBRKs() []BgpSecKeyJson

func (*SlurmLocallyAddedAssertions) AssertVRPs

func (s *SlurmLocallyAddedAssertions) AssertVRPs() []VRPJson

type SlurmPrefixAssertion

type SlurmPrefixAssertion struct {
	Prefix          string
	ASN             uint32
	MaxPrefixLength int
	Comment         string
}

func (*SlurmPrefixAssertion) GetASN

func (pa *SlurmPrefixAssertion) GetASN() uint32

func (*SlurmPrefixAssertion) GetMaxLen

func (pa *SlurmPrefixAssertion) GetMaxLen() int

func (*SlurmPrefixAssertion) GetPrefix

func (pa *SlurmPrefixAssertion) GetPrefix() *net.IPNet

type SlurmPrefixFilter

type SlurmPrefixFilter struct {
	Prefix  string
	ASN     *uint32 `json:"asn,omitempty"`
	Comment string
}

func (*SlurmPrefixFilter) GetASN

func (pf *SlurmPrefixFilter) GetASN() (uint32, bool)

func (*SlurmPrefixFilter) GetPrefix

func (pf *SlurmPrefixFilter) GetPrefix() netip.Prefix

type SlurmValidationOutputFilters

type SlurmValidationOutputFilters struct {
	PrefixFilters []SlurmPrefixFilter
	BgpsecFilters []SlurmBGPsecFilter
}

func (*SlurmValidationOutputFilters) FilterOnBRKs added in v0.5.0

func (s *SlurmValidationOutputFilters) FilterOnBRKs(brks []BgpSecKeyJson) (added, removed []BgpSecKeyJson)

func (*SlurmValidationOutputFilters) FilterOnVRPs

func (s *SlurmValidationOutputFilters) FilterOnVRPs(vrps []VRPJson) (added, removed []VRPJson)

type VRPJson

type VRPJson struct {
	Prefix  string      `json:"prefix"`
	Length  uint8       `json:"maxLength"`
	ASN     interface{} `json:"asn"`
	TA      string      `json:"ta,omitempty"`
	Expires *int64      `json:"expires,omitempty"`
}

func (*VRPJson) GetASN

func (vrp *VRPJson) GetASN() uint32

func (*VRPJson) GetASN2

func (vrp *VRPJson) GetASN2() (uint32, error)

func (*VRPJson) GetMaxLen

func (vrp *VRPJson) GetMaxLen() int

func (*VRPJson) GetPrefix

func (vrp *VRPJson) GetPrefix() netip.Prefix

func (*VRPJson) GetPrefix2

func (vrp *VRPJson) GetPrefix2() (netip.Prefix, error)

func (*VRPJson) String

func (vrp *VRPJson) String() string

Jump to

Keyboard shortcuts

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