mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-29 22:55:06 +03:00
44 lines
1.3 KiB
Go
44 lines
1.3 KiB
Go
package defaults
|
|
|
|
import "github.com/RiV-chain/RiV-mesh/src/config"
|
|
|
|
type MulticastInterfaceConfig = config.MulticastInterfaceConfig
|
|
|
|
// Defines which parameters are expected by default for configuration on a
|
|
// specific platform. These values are populated in the relevant defaults_*.go
|
|
// for the platform being targeted. They must be set.
|
|
type platformDefaultParameters struct {
|
|
// Admin socket
|
|
DefaultAdminListen string
|
|
|
|
// Configuration (used for meshctl)
|
|
DefaultConfigFile string
|
|
|
|
// Multicast interfaces
|
|
DefaultMulticastInterfaces []MulticastInterfaceConfig
|
|
|
|
// TUN/TAP
|
|
MaximumIfMTU uint64
|
|
DefaultIfMTU uint64
|
|
DefaultIfName string
|
|
}
|
|
|
|
// Generates default configuration and returns a pointer to the resulting
|
|
// NodeConfig. This is used when outputting the -genconf parameter and also when
|
|
// using -autoconf.
|
|
func GenerateConfig() *config.NodeConfig {
|
|
// Create a node configuration and populate it.
|
|
cfg := new(config.NodeConfig)
|
|
cfg.NewKeys()
|
|
cfg.Listen = []string{}
|
|
cfg.AdminListen = GetDefaults().DefaultAdminListen
|
|
cfg.Peers = []string{}
|
|
cfg.InterfacePeers = map[string][]string{}
|
|
cfg.AllowedPublicKeys = []string{}
|
|
cfg.MulticastInterfaces = GetDefaults().DefaultMulticastInterfaces
|
|
cfg.IfName = GetDefaults().DefaultIfName
|
|
cfg.IfMTU = GetDefaults().DefaultIfMTU
|
|
cfg.NodeInfoPrivacy = false
|
|
|
|
return cfg
|
|
}
|