Files
openlan/pkg/schema/ipsec.go
2024-01-08 20:56:21 +08:00

46 lines
1.2 KiB
Go

package schema
import "net"
type Esp struct {
Name string `json:"name"`
Address string `json:"address"`
Members []EspMember `json:"members,omitempty"`
}
type EspState struct {
Name string `json:"name"`
AliveTime int64 `json:"alive"`
Spi int `json:"spi"`
Local net.IP `json:"source"`
Mode uint8 `json:"mode"`
Proto uint8 `json:"proto"`
Remote net.IP `json:"destination"`
Auth string `json:"auth"`
Crypt string `json:"crypt"`
Encap string `json:"encap" `
RemotePort int `json:"remotePort"`
TxBytes uint64 `json:"txBytes"`
TxPackages uint64 `json:"txPackages"`
RxBytes uint64 `json:"rxBytes"`
RxPackages uint64 `json:"rxPackages"`
}
type EspPolicy struct {
Name string `json:"name"`
Spi int `json:"spi"`
Local net.IP `json:"local"`
Remote net.IP `json:"remote"`
Source string `json:"source"`
Dest string `json:"destination"`
Priority int `json:"priority"`
}
type EspMember struct {
Name string `json:"name"`
Spi uint32 `json:"spi"`
Peer string `json:"peer"`
State EspState `json:"state"`
Policy []EspPolicy `json:"policy"`
}