json

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package json encodes AS topology information via JSON. All types exposed by this package are designed to be directly marshaled to / unmarshaled from JSON.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attribute added in v0.6.0

type Attribute string

Attribute indicates the capability of a primary AS.

const (
	// Authoritative indicates an authoritative AS.
	Authoritative Attribute = "authoritative"
	// AttrCore indicates a core AS.
	AttrCore Attribute = "core"
	// Issuing indicates an issuing AS.
	Issuing Attribute = "issuing"
	// Voting indicates a voting AS. A voting AS must also be a core AS.
	Voting Attribute = "voting"
)

func (*Attribute) UnmarshalText added in v0.6.0

func (t *Attribute) UnmarshalText(b []byte) error

UnmarshalText checks that the attribute is valid. It can either be "authoritative", "core", "issuing", or "voting".

type BFD added in v0.6.0

type BFD struct {
	Disable               bool         `json:"disable,omitempty"`
	DetectMult            uint8        `json:"detect_mult,omitempty"`
	DesiredMinTxInterval  util.DurWrap `json:"desired_min_tx_interval,omitempty"`
	RequiredMinRxInterval util.DurWrap `json:"required_min_rx_interval,omitempty"`
}

BFD configuration.

type BRInfo

type BRInfo struct {
	InternalAddr string                           `json:"internal_addr"`
	Interfaces   map[common.IFIDType]*BRInterface `json:"interfaces"`
}

BRInfo contains Border Router specific information.

func (BRInfo) String

func (i BRInfo) String() string

type BRInterface

type BRInterface struct {
	Underlay Underlay `json:"underlay,omitempty"`
	IA       string   `json:"isd_as"`
	LinkTo   string   `json:"link_to"`
	MTU      int      `json:"mtu"`
	BFD      *BFD     `json:"bfd,omitempty"`
}

BRInterface contains the information for an data-plane BR socket that is external (i.e., facing the neighboring AS).

type GatewayInfo added in v0.6.0

type GatewayInfo struct {
	CtrlAddr   string   `json:"ctrl_addr"`
	DataAddr   string   `json:"data_addr"`
	ProbeAddr  string   `json:"probe_addr,omitempty"`
	Interfaces []uint64 `json:"allow_interfaces,omitempty"`
}

GatewayInfo contains SCION gateway information.

type ServerInfo

type ServerInfo struct {
	Addr string `json:"addr"`
}

ServerInfo contains the information for a SCION application running in the local AS.

func (ServerInfo) String

func (i ServerInfo) String() string

type Topology

type Topology struct {
	Timestamp      int64  `json:"timestamp,omitempty"`
	TimestampHuman string `json:"timestamp_human,omitempty"`
	IA             string `json:"isd_as"`
	MTU            int    `json:"mtu"`
	// Attributes are the primary AS attributes as described in
	// https://github.com/scionproto/scion/blob/master/doc/ControlPlanePKI.md#primary-ases
	Attributes          []Attribute             `json:"attributes"`
	BorderRouters       map[string]*BRInfo      `json:"border_routers,omitempty"`
	ControlService      map[string]*ServerInfo  `json:"control_service,omitempty"`
	DiscoveryService    map[string]*ServerInfo  `json:"discovery_service,omitempty"`
	HiddenSegmentLookup map[string]*ServerInfo  `json:"hidden_segment_lookup_service,omitempty"`
	HiddenSegmentReg    map[string]*ServerInfo  `json:"hidden_segment_registration_service,omitempty"`
	SIG                 map[string]*GatewayInfo `json:"sigs,omitempty"`
}

Topology is the JSON type for the entire AS topology file.

func Load

func Load(b []byte) (*Topology, error)

Load parses a topology from its raw byte representation.

func LoadFromFile

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

LoadFromFile parses a topology from a file.

type Underlay added in v0.6.0

type Underlay struct {
	Public string `json:"public,omitempty"`
	Remote string `json:"remote,omitempty"`
	Bind   string `json:"bind,omitempty"`
}

Underlay is the underlay information for a BR interface.

Jump to

Keyboard shortcuts

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