mirror of
https://github.com/sot-tech/mochi.git
synced 2026-07-18 14:18:10 -07:00
Organize peers by subnet.
This commit restructures PeerMaps to be a map from Subnet to PeerID to Peer. This reduces the complexity require to gather peers from the same subnet.
This commit is contained in:
+7
-4
@@ -40,16 +40,19 @@ type DriverConfig struct {
|
||||
Params map[string]string `json:"params,omitempty"`
|
||||
}
|
||||
|
||||
type SubnetConfig struct {
|
||||
PreferredSubnet bool `json:"preferred_subnet,omitempty"`
|
||||
PreferredIPv4Subnet int `json:"preferred_ipv4_subnet,omitempty"`
|
||||
PreferredIPv6Subnet int `json:"preferred_ipv6_subnet,omitempty"`
|
||||
}
|
||||
|
||||
// NetConfig is the configuration used to tune networking behaviour.
|
||||
type NetConfig struct {
|
||||
AllowIPSpoofing bool `json:"allow_ip_spoofing"`
|
||||
DualStackedPeers bool `json:"dual_stacked_peers"`
|
||||
RealIPHeader string `json:"real_ip_header"`
|
||||
RespectAF bool `json:"respect_af"`
|
||||
|
||||
PreferredSubnet bool `json:"preferred_subnet,omitempty"`
|
||||
PreferredIPv4Subnet int `json:"preferred_ipv4_subnet,omitempty"`
|
||||
PreferredIPv6Subnet int `json:"preferred_ipv6_subnet,omitempty"`
|
||||
SubnetConfig
|
||||
}
|
||||
|
||||
type StatsConfig struct {
|
||||
|
||||
Reference in New Issue
Block a user