Documentation ¶
Overview ¶
Package ir describes the input-format-agnostic specification of the required connectivity
Index ¶
- Constants
- func ValidateICMP(t, c int) error
- type ACL
- type ACLCollection
- type ACLRule
- type ACLWriter
- type Action
- type AnyProtocol
- type CIDR
- type Collection
- type ConfigDefs
- type Connection
- type Definitions
- type Direction
- type Endpoint
- type EndpointType
- type ICMP
- type ICMPCodeType
- type IP
- type Packet
- type PortRange
- type PortRangePair
- type Protocol
- type Reader
- type RemoteType
- type SG
- type SGCollection
- type SGName
- type SGResource
- type SGRule
- type SGWriter
- type Spec
- type TCPUDP
- type TrackedProtocol
- type TransportLayerProtocolName
- type Writer
Constants ¶
View Source
const AnyCIDR = "0.0.0.0/0"
View Source
const AnyIP = "0.0.0.0"
View Source
const DefaultMaxPort = 65535
View Source
const DefaultMinPort = 1
Variables ¶
This section is empty.
Functions ¶
func ValidateICMP ¶
Types ¶
type ACLCollection ¶
func MergeACLCollections ¶
func MergeACLCollections(collections ...*ACLCollection) *ACLCollection
func NewACLCollection ¶
func NewACLCollection() *ACLCollection
func (*ACLCollection) LookupOrCreate ¶
func (c *ACLCollection) LookupOrCreate(name string) *ACL
func (*ACLCollection) SortedACLSubnets ¶
func (c *ACLCollection) SortedACLSubnets() []string
func (*ACLCollection) Write ¶
func (c *ACLCollection) Write(w Writer) error
type ACLRule ¶
type ACLRule struct { Action Action Direction Direction Source IP Destination IP Protocol Protocol Explanation string }
func AllowReceive ¶
type ACLWriter ¶
type ACLWriter interface {
WriteACL(*ACLCollection) error
}
type AnyProtocol ¶
type AnyProtocol struct{}
func (AnyProtocol) InverseDirection ¶
func (t AnyProtocol) InverseDirection() Protocol
type Collection ¶
type ConfigDefs ¶
type ConfigDefs struct { Subnets map[string]IP // Network interface name to IP address NIFToIP map[string]IP // Instance is a collection of NIFs InstanceToNIFs map[string][]string // VPEs have a single IP VPEToIP map[string]IP }
ConfigDefs holds definitions that are part of the network architecture
func (*ConfigDefs) InstanceFromNIF ¶
func (s *ConfigDefs) InstanceFromNIF(nifName string) (string, bool)
func (*ConfigDefs) RemoteFromIP ¶
func (s *ConfigDefs) RemoteFromIP(ip IP) RemoteType
func (*ConfigDefs) SubnetNameFromIP ¶
func (s *ConfigDefs) SubnetNameFromIP(ip IP) (string, bool)
type Connection ¶
type Connection struct { // Egress endpoint Src Endpoint // Ingress endpoint Dst Endpoint // Allowed protocols TrackedProtocols []TrackedProtocol // Provenance information Origin fmt.Stringer }
type Definitions ¶
type Definitions struct { ConfigDefs // Segments are a way for users to create aggregations. SubnetSegments map[string][]string // Externals are a way for users to name IP addresses or ranges external to the VPC. Externals map[string]IP }
Definitions adds to ConfigDefs the spec-specific definitions
func (*Definitions) Lookup ¶
func (s *Definitions) Lookup(t EndpointType, name string) (Endpoint, error)
type Endpoint ¶
type Endpoint struct { // Symbolic name of endpoint, if available Name string // list of CIDR / Ip addresses. Values []IP // Type of endpoint Type EndpointType }
type EndpointType ¶
type EndpointType string
const ( EndpointTypeExternal EndpointType = "external" EndpointTypeSegment EndpointType = "segment" EndpointTypeSubnet EndpointType = "subnet" EndpointTypeNIF EndpointType = "nif" EndpointTypeVPE EndpointType = "vpe" EndpointTypeInstance EndpointType = "instance" EndpointTypeAny EndpointType = "any" )
type ICMPCodeType ¶
type PortRangePair ¶
type Protocol ¶
type Protocol interface { // InverseDirection returns the response expected for a request made using this protocol InverseDirection() Protocol }
type RemoteType ¶
type SGCollection ¶
func MergeSGCollections ¶
func MergeSGCollections(collections ...*SGCollection) *SGCollection
func NewSGCollection ¶
func NewSGCollection() *SGCollection
func (*SGCollection) LookupOrCreate ¶
func (c *SGCollection) LookupOrCreate(name SGName) *SG
func (*SGCollection) SortedSGNames ¶
func (c *SGCollection) SortedSGNames() []SGName
func (*SGCollection) Write ¶
func (c *SGCollection) Write(w Writer) error
type SGResource ¶
type SGResource string
const ( SGResourceNIF SGResource = "nif" SGResourceBareMetalNIF SGResource = "bnif" SGResourceLoadBalancer SGResource = "loadbalancer" SGResourceVPE SGResource = "vpe" SGResourceVPNServer SGResource = "vpn" )
type SGRule ¶
type SGRule struct { Direction Direction Remote RemoteType Protocol Protocol Explanation string }
type SGWriter ¶
type SGWriter interface {
WriteSG(*SGCollection) error
}
type Spec ¶
type Spec struct { // Required connections Connections []Connection Defs Definitions }
type TCPUDP ¶
type TCPUDP struct { Protocol TransportLayerProtocolName PortRangePair PortRangePair }
func (TCPUDP) InverseDirection ¶
type TrackedProtocol ¶
type TransportLayerProtocolName ¶
type TransportLayerProtocolName string
const ( TCP TransportLayerProtocolName = "TCP" UDP TransportLayerProtocolName = "UDP" )
Click to show internal directories.
Click to hide internal directories.