hns

package
v1.11.0-cni-plu...-ddfc3b1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0, Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Allow ActionType = "Allow"
	Block ActionType = "Block"

	In  DirectionType = "In"
	Out DirectionType = "Out"

	Host   RuleType = "Host"
	Switch RuleType = "Switch"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ACLPolicy

type ACLPolicy struct {
	Type            PolicyType
	Id              string
	Protocol        uint16
	Protocols       string
	InternalPort    uint16
	Action          ActionType
	Direction       DirectionType
	LocalAddresses  string
	RemoteAddresses string
	LocalPorts      string
	LocalPort       uint16
	RemotePorts     string
	RemotePort      uint16
	RuleType        RuleType
	Priority        uint16
	ServiceName     string
}

type API

type API struct{}

func (API) GetHNSSupportedFeatures

func (a API) GetHNSSupportedFeatures() HNSSupportedFeatures

func (API) HNSListEndpointRequest

func (a API) HNSListEndpointRequest() ([]HNSEndpoint, error)

type ActionType

type ActionType string

type DirectionType

type DirectionType string

type EndpointState

type EndpointState uint16

EndpointState represents the states of an HNS Endpoint lifecycle.

const (
	Uninitialized   EndpointState = iota
	Created         EndpointState = 1
	Attached        EndpointState = 2
	AttachedSharing EndpointState = 3
	Detached        EndpointState = 4
	Degraded        EndpointState = 5
	Destroyed       EndpointState = 6
)

func (EndpointState) String

func (es EndpointState) String() string

EndpointState const The lifecycle of an Endpoint goes through created, attached, AttachedSharing - endpoint is being shared with other containers, detached, after being attached, degraded and finally destroyed.

type HNSAclFeatures

type HNSAclFeatures struct {
	AclAddressLists       bool
	AclNoHostRulePriority bool
	AclPortRanges         bool
	AclRuleId             bool
}

type HNSEndpoint

type HNSEndpoint struct {
	Id                 string            `json:"ID,omitempty"`
	Name               string            `json:",omitempty"`
	VirtualNetwork     string            `json:",omitempty"`
	VirtualNetworkName string            `json:",omitempty"`
	Policies           []json.RawMessage `json:",omitempty"`
	MacAddress         string            `json:",omitempty"`
	IPAddress          net.IP            `json:",omitempty"`
	IPv6Address        net.IP            `json:",omitempty"`
	DNSSuffix          string            `json:",omitempty"`
	DNSServerList      string            `json:",omitempty"`
	DNSDomain          string            `json:",omitempty"`
	GatewayAddress     string            `json:",omitempty"`
	GatewayAddressV6   string            `json:",omitempty"`
	EnableInternalDNS  bool              `json:",omitempty"`
	DisableICC         bool              `json:",omitempty"`
	PrefixLength       uint8             `json:",omitempty"`
	IPv6PrefixLength   uint8             `json:",omitempty"`
	IsRemoteEndpoint   bool              `json:",omitempty"`
	EnableLowMetric    bool              `json:",omitempty"`
	//Namespace          *Namespace        `json:",omitempty"`
	EncapOverhead    uint16        `json:",omitempty"`
	SharedContainers []string      `json:",omitempty"`
	State            EndpointState `json:",omitempty"`
}

HNSEndpoint represents a network endpoint in HNS

func (*HNSEndpoint) ApplyACLPolicy

func (endpoint *HNSEndpoint) ApplyACLPolicy(policies ...*ACLPolicy) error

ApplyACLPolicy applies a set of ACL Policies on the Endpoint

type HNSSupportedFeatures

type HNSSupportedFeatures struct {
	Acl HNSAclFeatures
}

type Policy

type Policy struct {
	Type PolicyType `json:"Type"`
}

type PolicyType

type PolicyType string

Type of Request Support in ModifySystem

const (
	Nat                  PolicyType = "NAT"
	ACL                  PolicyType = "ACL"
	PA                   PolicyType = "PA"
	VLAN                 PolicyType = "VLAN"
	VSID                 PolicyType = "VSID"
	VNet                 PolicyType = "VNET"
	L2Driver             PolicyType = "L2Driver"
	Isolation            PolicyType = "Isolation"
	QOS                  PolicyType = "QOS"
	OutboundNat          PolicyType = "OutBoundNAT"
	ExternalLoadBalancer PolicyType = "ELB"
	Route                PolicyType = "ROUTE"
	Proxy                PolicyType = "PROXY"
)

RequestType const

type RuleType

type RuleType string

Jump to

Keyboard shortcuts

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