Documentation ¶
Index ¶
Constants ¶
View Source
const ( AccessPolicyDefault = iota // AccessPolicyInternetOnly allows peer to access only // internet resources but not its network neighbours. AccessPolicyInternetOnly // AccessPolicyAllowAll allows peer to access internet resources // as well ass connecting to their network neighbours. // This is a trusted policy. AccessPolicyAllowAll )
View Source
const ( // Block ports from specified port range, allowing all others RestrictionModeBlockList = iota // Allow ports from specified port range, blocking all owhers RestrictionModeAllowList )
View Source
const ( Bitps Rate = 1 Kbitps = Bitps * 1000 Mbitps = Kbitps * 1000 Gbitps = Mbitps * 1000 )
Variables ¶
This section is empty.
Functions ¶
func AliasAllowAll ¶ added in v0.2.5
func AliasAllowAll() accessPolicy
func AliasInternetOnly ¶ added in v0.2.5
func AliasInternetOnly() accessPolicy
Types ¶
type Config ¶ added in v0.2.5
type Config struct { Subnet *xnet.IPNet Interface string AccessPolicy NetworkAccess RateLimiter *RateLimiterConfig PortRestrictions *PortRestrictionConfig }
type IPAM ¶ added in v0.2.5
type IPAM struct {
// contains filtered or unexported fields
}
IPAM implements IP Address Manager and provides the following features:
- assigns IP addresses for peers;
- implements network policies using netfilter rules;
- limits the available bandwidth using traffic control rules;
type ListMode ¶ added in v0.3.3
type ListMode struct {
// contains filtered or unexported fields
}
func (ListMode) MarshalText ¶ added in v0.3.3
func (*ListMode) UnmarshalText ¶ added in v0.3.3
type NetworkAccess ¶ added in v0.2.5
type NetworkAccess struct {
DefaultPolicy accessPolicy `yaml:"default_policy,omitempty"`
}
type Policy ¶ added in v0.2.5
Policy define peer's network access rules. What peer it can talk to, and on what bandwidth.
type PortRange ¶ added in v0.3.3
type PortRange struct {
// contains filtered or unexported fields
}
func (PortRange) MarshalText ¶ added in v0.3.3
func (*PortRange) UnmarshalText ¶ added in v0.3.3
type PortRestrictionConfig ¶ added in v0.3.3
type PortRestrictionConfig struct { UDP ProtocolPortConfig `yaml:"udp,omitempty"` TCP ProtocolPortConfig `yaml:"tcp,omitempty"` }
func DefaultPortRestrictions ¶ added in v0.3.3
func DefaultPortRestrictions() *PortRestrictionConfig
type ProtocolPortConfig ¶ added in v0.3.3
type Rate ¶ added in v0.2.5
type Rate uint64
Rate represents the desired bandwidth, keep in mind that values must follow SI, not IEC.
func (*Rate) UnmarshalText ¶ added in v0.2.5
type RateLimiterConfig ¶ added in v0.2.5
type RateLimiterConfig struct {
TotalBandwidth Rate `yaml:"total_bandwidth,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.