@@ -70,6 +70,22 @@ func (m *Machine) IsGateway() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// SetGateway enables/disables a Machine ring0 integration
|
||||
func (m *Machine) SetGateway(enabled bool) error {
|
||||
m.mu.Lock()
|
||||
defer m.mu.Unlock()
|
||||
|
||||
ri, found := m.getRingInfo(0)
|
||||
switch {
|
||||
case !found && !enabled:
|
||||
return nil
|
||||
case !found:
|
||||
return m.createRingInfo(0, true)
|
||||
default:
|
||||
ri.Enabled = enabled
|
||||
return m.writeRingInfo(ri)
|
||||
}
|
||||
}
|
||||
func (m *Machine) getPeerByName(name string) (*Machine, bool) {
|
||||
return m.zone.zones.GetMachineByName(name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user