Documentation ¶
Index ¶
- Constants
- func AddMulticastRouteToIface(cidr string, ifaceIdx int) error
- func AsignAddrToLink(name, addr string, up bool) error
- func ConvertBytes(bytes uint64) string
- func DelLinkByName(name string) error
- func GetLinkStatsByName(name string, linkMsg []LinkMessages) (uint64, uint64, string, string)
- func GetMacFromIP(ip net.IP) net.HardwareAddr
- func IdxFromString(step int, str string) int
- func IsIPConflictErr(err error) bool
- func IsRouteNotExist(err error) bool
- func IsRunOutOfIP(err error) bool
- func IsTapNotExist(err error) bool
- func IsUnauthedErr(err error) bool
- func IsUnsupportedPkt(err error) bool
- func NewTap(br string) (*water.Interface, error)
- func ParseRoutesStream(data []byte) map[string]string
- func RandStr(n int) string
- func SetLinkMaster(iface, br string) error
- func SetMacToTap(name, ip string) error
- func SyncRoutesForIface(ifaceName, ip string, routes map[string]string) error
- func ValidateDHCPRange(ipRange string) (net.IP, int)
- func ValidateIPv4Addr(addr string) bool
- func ValidateIPv4WithNetmask(addr string) bool
- func ValidateKey(key string) bool
- func ValidatePasswd(passwd string) bool
- func ValidatePort(port int) bool
- func ValidateUsername(name string) bool
- type LinkMessages
Constants ¶
View Source
const (
UNKNOW_IP = "UNKNOW_IP"
)
Variables ¶
This section is empty.
Functions ¶
func AsignAddrToLink ¶
func ConvertBytes ¶
func DelLinkByName ¶
func GetLinkStatsByName ¶
func GetMacFromIP ¶
func GetMacFromIP(ip net.IP) net.HardwareAddr
func IdxFromString ¶
func IsIPConflictErr ¶
func IsRouteNotExist ¶
func IsRunOutOfIP ¶
func IsTapNotExist ¶
func IsUnauthedErr ¶
func IsUnsupportedPkt ¶
func ParseRoutesStream ¶
func SetLinkMaster ¶
func SetMacToTap ¶
When create tap interface, the mac address will change when a endpoint close then reconnect to it, if there is another endpoint try to access this endpoint, the ip neigh entry is still the old, it must waiting for the ip neigh entry staled maybe we can generate mac address according the ip address
func SyncRoutesForIface ¶
func ValidateIPv4Addr ¶
func ValidateIPv4WithNetmask ¶
func ValidateKey ¶
func ValidatePasswd ¶
func ValidatePort ¶
func ValidateUsername ¶
Types ¶
type LinkMessages ¶
type LinkMessages struct { InterfaceName string RX_SIZE string TX_SIZE string RX_PKT uint64 TX_PKT uint64 }
func GetLinkStats ¶
func GetLinkStats() []LinkMessages
Click to show internal directories.
Click to hide internal directories.