Documentation ¶
Overview ¶
Package types provides conversion from Go native types to vpp binapi types
Index ¶
- func FromVppAddress(addr ip_types.Address) net.IP
- func FromVppAddressWithPrefix(prefix ip_types.AddressWithPrefix) *net.IPNet
- func FromVppIPAddressUnion(un ip_types.AddressUnion, isv6 bool) net.IP
- func FromVppPrefix(prefix ip_types.Prefix) *net.IPNet
- func IsV6toFibProto(isv6 bool) fib_types.FibPathNhProto
- func ToVppAddress(addr net.IP) ip_types.Address
- func ToVppAddressWithPrefix(prefix *net.IPNet) ip_types.AddressWithPrefix
- func ToVppMacAddress(hardwareAddr *net.HardwareAddr) ethernet_types.MacAddress
- func ToVppPrefix(prefix *net.IPNet) ip_types.Prefix
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromVppAddress ¶
FromVppAddress - converts ip_types.Address to net.IP
func FromVppAddressWithPrefix ¶
func FromVppAddressWithPrefix(prefix ip_types.AddressWithPrefix) *net.IPNet
FromVppAddressWithPrefix - converts ip_types.AddressWithPrefix to *net.IPNet
func FromVppIPAddressUnion ¶
func FromVppIPAddressUnion(un ip_types.AddressUnion, isv6 bool) net.IP
FromVppIPAddressUnion - converts ip_types.AddressUnion to net.IP
func FromVppPrefix ¶
FromVppPrefix - converts ip_types.Prefix to *net.IPNet
func IsV6toFibProto ¶
func IsV6toFibProto(isv6 bool) fib_types.FibPathNhProto
IsV6toFibProto - returns fib_types.FIB_API_PATH_NH_PROTO_IP6 if isv6 is true
fib_types.FIB_API_PATH_NH_PROTO_IP4 if isv6 is false
Example:
Given a *net.IPNet dst: types.IsV6toFibProto(dst.IP.To4() == nil)
func ToVppAddress ¶
ToVppAddress - converts addr to ip_types.Address
func ToVppAddressWithPrefix ¶
func ToVppAddressWithPrefix(prefix *net.IPNet) ip_types.AddressWithPrefix
ToVppAddressWithPrefix - converts prefix to ip_types.AddressWithPrefix
func ToVppMacAddress ¶
func ToVppMacAddress(hardwareAddr *net.HardwareAddr) ethernet_types.MacAddress
ToVppMacAddress - converts *net.HardwareAddr to ethernet_types.MacAddress
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.