config

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package config is responsible for parsing the SIG json config file into a set of simple intermediate data-structures.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ASEntry

type ASEntry struct {
	Name string
	Nets []*IPNet
	Sigs SIGSet
}

type Cfg

type Cfg struct {
	ASes          map[addr.IA]*ASEntry
	ConfigVersion uint64
}

Cfg is a direct Go representation of the JSON file format.

func LoadFromFile

func LoadFromFile(path string) (*Cfg, error)

Load a JSON config file from path and parse it into a Cfg struct.

type IPNet

type IPNet net.IPNet

IPNet is custom type of net.IPNet, to allow custom unmarshalling.

func (*IPNet) IPNet

func (in *IPNet) IPNet() *net.IPNet

func (*IPNet) MarshalJSON

func (in *IPNet) MarshalJSON() ([]byte, error)

func (*IPNet) String

func (in *IPNet) String() string

func (*IPNet) UnmarshalJSON

func (in *IPNet) UnmarshalJSON(b []byte) error

type SIG

type SIG struct {
	Id        siginfo.SigIdType `json:"-"`
	Addr      net.IP
	CtrlPort  uint16
	EncapPort uint16
}

SIG represents a SIG in a remote IA.

type SIGSet

type SIGSet map[siginfo.SigIdType]*SIG

Jump to

Keyboard shortcuts

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