// VPP: 20.05-release
// source: /usr/share/vpp/api/core/interface_types.api.json
-/*
-Package interface_types contains generated code for VPP API file interface_types.api ().
-
-It consists of:
- 1 alias
- 6 enums
-*/
+// Package interface_types contains generated bindings for API file interface_types.api.
+//
+// Contents:
+// 1 alias
+// 6 enums
+//
package interface_types
import (
- "bytes"
- "context"
- "encoding/binary"
- "fmt"
- "io"
- "math"
- "net"
- "strconv"
- "strings"
-
api "git.fd.io/govpp.git/api"
- codec "git.fd.io/govpp.git/codec"
- struc "github.com/lunixbochs/struc"
+ "strconv"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the GoVPP api package it is being compiled against.
// A compilation error at this line likely means your copy of the
// GoVPP api package needs to be updated.
-const _ = api.GoVppAPIPackageIsVersion2 // please upgrade the GoVPP api package
-
-const (
- // ModuleName is the name of this module.
- ModuleName = "interface_types"
- // APIVersion is the API version of this module.
- APIVersion = ""
- // VersionCrc is the CRC of this module.
- VersionCrc = 0x23822dac
-)
+const _ = api.GoVppAPIPackageIsVersion2
-// IfStatusFlags represents VPP binary API enum 'if_status_flags'.
+// IfStatusFlags defines enum 'if_status_flags'.
type IfStatusFlags uint32
const (
if ok {
return s
}
- return "IfStatusFlags(" + strconv.Itoa(int(x)) + ")"
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
}
-// IfType represents VPP binary API enum 'if_type'.
+// IfType defines enum 'if_type'.
type IfType uint32
const (
return "IfType(" + strconv.Itoa(int(x)) + ")"
}
-// LinkDuplex represents VPP binary API enum 'link_duplex'.
+// LinkDuplex defines enum 'link_duplex'.
type LinkDuplex uint32
const (
return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
}
-// MtuProto represents VPP binary API enum 'mtu_proto'.
+// MtuProto defines enum 'mtu_proto'.
type MtuProto uint32
const (
return "MtuProto(" + strconv.Itoa(int(x)) + ")"
}
-// RxMode represents VPP binary API enum 'rx_mode'.
+// RxMode defines enum 'rx_mode'.
type RxMode uint32
const (
return "RxMode(" + strconv.Itoa(int(x)) + ")"
}
-// SubIfFlags represents VPP binary API enum 'sub_if_flags'.
+// SubIfFlags defines enum 'sub_if_flags'.
type SubIfFlags uint32
const (
if ok {
return s
}
- return "SubIfFlags(" + strconv.Itoa(int(x)) + ")"
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
}
-// InterfaceIndex represents VPP binary API alias 'interface_index'.
+// InterfaceIndex defines alias 'interface_index'.
type InterfaceIndex uint32
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = api.RegisterMessage
-var _ = codec.DecodeString
-var _ = bytes.NewBuffer
-var _ = context.Background
-var _ = io.Copy
-var _ = strconv.Itoa
-var _ = strings.Contains
-var _ = struc.Pack
-var _ = binary.BigEndian
-var _ = math.Float32bits
-var _ = net.ParseIP
-var _ = fmt.Errorf