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 ( 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() aliasToInt
func AliasInternetOnly ¶ added in v0.2.5
func AliasInternetOnly() aliasToInt
Types ¶
type Config ¶ added in v0.2.5
type Config struct { Subnet *xnet.IPNet Interface string AccessPolicy NetworkAccess RateLimiter *RateLimiterConfig }
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 NetworkAccess ¶ added in v0.2.5
type NetworkAccess struct {
DefaultPolicy aliasToInt `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 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.