Documentation
¶
Index ¶
- Constants
- Variables
- func NewVirtualRouter(id uint8, peers []net.IP, priority uint8, ipAddrs []netlink.Addr, ...) (*virtualRouter, error)
- func VRRPConn(src net.IP, isForMulticastTarget bool) (*net.IPConn, error)
- func VRRPMulticastReaderConn(multicastAddress, local net.IP) (*net.IPConn, error)
- type EVENT
- type KowabungaVRRP
- type KowabungaVRRPAuthType
- type KowabungaVRRPType
- type Kowarp
- type PseudoHeader
- type RxBroker
- type STATE
- type VirtualRoute
Constants ¶
const ( KowabungaVRRPDefaultAdvertisementInterval uint16 = 100 //in centisecond KowabungaVRRPDefaultRouteMetric int = 50 )
const ( KowabungaVRRPVersion uint8 = 15 KowabungaVRRPAuthNoAuth KowabungaVRRPAuthType = 0x00 // No Authentication KowabungaVRRPAuthReserved1 KowabungaVRRPAuthType = 0x01 // Reserved field 1 KowabungaVRRPAuthReserved2 KowabungaVRRPAuthType = 0x02 // Reserved field 2 KowabungaVRRPTTL uint8 = 255 KowabungaVRRPIPv4BaseLength uint16 = 8 VRRPReservedProtocolId uint16 = 112 )
const ( BroadcastAddress = "ff:ff:ff:ff:ff:ff" KowabungaVRRPMulticastAddress = "224.0.0.18" )
const (
ErrorKowarpNotRoot = "Kowarp is not running with root privileges"
)
Variables ¶
var KowabungaVRRPVMacPrefix = "00-00-5E-00-01-"
var VRRPNetworkBroker vrrpNet = vrrpNet{ // contains filtered or unexported fields }
var VirtualRouters map[uint8]*virtualRouter
Functions ¶
func NewVirtualRouter ¶
Types ¶
type KowabungaVRRP ¶
type KowabungaVRRP struct {
Version uint8 // The version field specifies the VRRP protocol version of this packet (v255 KowabungaCustom)
Type KowabungaVRRPType // The type field specifies the type of this VRRP packet. The only type defined is ADVERTISEMENT
VirtualRtrID uint8 // identifies the virtual router this packet is reporting status for
Priority uint8 // specifies the sending VRRP router's priority for the virtual router (100 = default)
CountIPAddr uint8 // The number of IP addresses contained in this VRRP advertisement.
AdverInt uint16 // The Advertisement interval indicates the time interval (in centiseconds) between ADVERTISEMENTS. The default must be 100 centiseconds (1 second).
Checksum uint16 // used to detect data corruption in the VRRP message.
IPAddresses []net.IP // one or more IP addresses associated with the virtual router. Specified in the CountIPAddr field.
// contains filtered or unexported fields
}
KowabungaVRRP represents an VRRP v15 message. Derived from VRRP3 impl. IPV4 only 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | IPv4 Fields | ... ... | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Version| Type | Virtual Rtr ID| Priority |Count IPvX Addr| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |(rsvd) | Max Adver Int | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + + | IPvX Address(es) | + + + + + + + + | | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
func (*KowabungaVRRP) DecodeFromBytes ¶
func (v *KowabungaVRRP) DecodeFromBytes(data []byte) error
func (*KowabungaVRRP) Serialize ¶
computeChecksum=true to send packet computeChecksum=false when receive
func (*KowabungaVRRP) ValidateChecksum ¶
type KowabungaVRRPAuthType ¶
type KowabungaVRRPAuthType uint8
func (KowabungaVRRPAuthType) String ¶
func (v KowabungaVRRPAuthType) String() string
type KowabungaVRRPType ¶
type KowabungaVRRPType uint8
const (
KowabungaVRRPAdvertisement KowabungaVRRPType = 0x01 // router advertisement
)
func (KowabungaVRRPType) String ¶
func (v KowabungaVRRPType) String() string
String conversions for VRRP message types
type PseudoHeader ¶
type PseudoHeader struct {
SourceAddress net.IP
DestinationAddress net.IP
// contains filtered or unexported fields
}
Pseudo header required for checksum computation. see RFC2460
func (PseudoHeader) Serialize ¶
func (header PseudoHeader) Serialize() []byte
type VirtualRoute ¶
type VirtualRoute struct {
Destination net.IPNet
Gateway net.IP
Interface net.Interface
Metric int
}
func (*VirtualRoute) Equal ¶
func (r1 *VirtualRoute) Equal(r2 *VirtualRoute) bool