config

package
v0.0.0-...-c8fc2fc Latest Latest
Warning

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

Go to latest
Published: Mar 2, 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 {
	Nets []*IPNet
	Sigs SIGSet
}

type Cfg

type Cfg struct {
	ASes          map[addr.ISD_AS]*ASEntry
	ConfigVersion float64
}

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.

func Parse

func Parse(b common.RawBytes) (*Cfg, error)

Parse a JSON config from b 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) UnmarshalJSON

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

type SIG

type SIG struct {
	Id        siginfo.SigIdType
	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