types

package
v1.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2023 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Overview

Package types provides conversion from Go native types to vpp binapi types

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromVppAddress

func FromVppAddress(addr ip_types.Address) net.IP

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

func FromVppPrefix(prefix ip_types.Prefix) *net.IPNet

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

func ToVppAddress(addr net.IP) ip_types.Address

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

func ToVppPrefix

func ToVppPrefix(prefix *net.IPNet) ip_types.Prefix

ToVppPrefix - converts prefix to ip_types.Prefix

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL