Files
openlan/pkg/schema/network.go
Daniel Ding da0d6d853d
Some checks failed
Coverage CI / build (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled
Ubuntu CI / build (push) Has been cancelled
fea: show kernel neighbors.
2025-11-26 15:02:51 +08:00

78 lines
2.0 KiB
Go
Executable File

package schema
type Lease struct {
Address string `json:"address"`
Alias string `json:"alias"`
Client string `json:"client"`
Type string `json:"type"`
Network string `json:"network"`
}
type PrefixRoute struct {
Prefix string `json:"prefix"`
NextHop string `json:"nexthop,omitempty"`
FindHop string `json:"findhop,omitempty"`
Metric int `json:"metric"`
Link string `json:"link,omitempty"`
Table int `json:"table,omitempty"`
Source string `json:"source,omitempty"`
Protocol string `json:"protocol,omitempty"`
MultiPath []MultiPath `json:"multipath,omitempty"`
}
type KernelRoute struct {
Prefix string `json:"prefix"`
NextHop string `json:"nexthop,omitempty"`
Metric int `json:"metric"`
Link string `json:"link,omitempty"`
Table int `json:"table,omitempty"`
Source string `json:"source,omitempty"`
Protocol string `json:"protocol,omitempty"`
}
type KernelNeighbor struct {
Link string `json:"link,omitempty"`
Address string `json:"address,omitempty"`
HwAddr string `json:"hwaddr,omitempty"`
State string `json:"state,omitempty"`
}
type MultiPath struct {
NextHop string `json:"nexthop"`
Weight int `json:"weight"`
}
type Subnet struct {
IfAddr string `json:"address,omitempty"`
IpStart string `json:"startAt,omitempty"`
IpEnd string `json:"endAt,omitempty"`
Netmask string `json:"netmask"`
}
type Network struct {
Name string `json:"name"`
Config interface{} `json:"config"`
}
type FindHop struct {
Name string `json:"name"`
Mode string `json:"mode"`
Check string `json:"check"`
NextHop string `json:"nexthop"`
Available string `json:"available"`
}
type DNAT struct {
Protocol string `json:"protocol"`
Dest string `json:"destination,omitempty"`
Dport int `json:"dport"`
ToDest string `json:"todestination"`
ToDport int `json:"todport"`
}
type RouterTunnel struct {
Protocol string `json:"protocol"`
Remote string `json:"remote"`
Address string `json:"address"`
}