Files
openlan/pkg/config/ipsec.go
2024-06-14 22:30:26 +08:00

29 lines
577 B
Go

package config
type IPSecTunnel struct {
Left string `json:"local"`
LeftId string `json:"localid"`
LeftPort string `json:"localport"`
Right string `json:"remote"`
RightId string `json:"remoteid"`
RightPort string `json:"remoteport"`
Transport string `json:"transport"`
}
func (s *IPSecTunnel) Correct() {
if s.Left == "" {
s.Left = "%defaultroute"
}
}
type IPSecSpecifies struct {
Name string `json:"name"`
Tunnels []IPSecTunnel `json:"tunnels"`
}
func (s *IPSecSpecifies) Correct() {
for _, t := range s.Tunnels {
t.Correct()
}
}