// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
// versions:
-// binapi-generator: v0.4.0-dev
-// VPP: 20.05-release
+// binapi-generator: v0.3.5-56-gc0da1f2-dirty
+// VPP: 21.06-release
// source: /usr/share/vpp/api/core/ip_types.api.json
// Package ip_types contains generated bindings for API file ip_types.api.
//
// Contents:
// 5 aliases
-// 4 enums
-// 6 structs
+// 5 enums
+// 8 structs
// 1 union
//
package ip_types
import (
"fmt"
- api "git.fd.io/govpp.git/api"
- codec "git.fd.io/govpp.git/codec"
"net"
"strconv"
"strings"
+
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
)
// This is a compile-time assertion to ensure that this generated file
return "IPEcn(" + strconv.Itoa(int(x)) + ")"
}
+// IPFeatureLocation defines enum 'ip_feature_location'.
+type IPFeatureLocation uint8
+
+const (
+ IP_API_FEATURE_INPUT IPFeatureLocation = 0
+ IP_API_FEATURE_OUTPUT IPFeatureLocation = 1
+ IP_API_FEATURE_LOCAL IPFeatureLocation = 2
+ IP_API_FEATURE_PUNT IPFeatureLocation = 3
+ IP_API_FEATURE_DROP IPFeatureLocation = 4
+)
+
+var (
+ IPFeatureLocation_name = map[uint8]string{
+ 0: "IP_API_FEATURE_INPUT",
+ 1: "IP_API_FEATURE_OUTPUT",
+ 2: "IP_API_FEATURE_LOCAL",
+ 3: "IP_API_FEATURE_PUNT",
+ 4: "IP_API_FEATURE_DROP",
+ }
+ IPFeatureLocation_value = map[string]uint8{
+ "IP_API_FEATURE_INPUT": 0,
+ "IP_API_FEATURE_OUTPUT": 1,
+ "IP_API_FEATURE_LOCAL": 2,
+ "IP_API_FEATURE_PUNT": 3,
+ "IP_API_FEATURE_DROP": 4,
+ }
+)
+
+func (x IPFeatureLocation) String() string {
+ s, ok := IPFeatureLocation_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "IPFeatureLocation(" + strconv.Itoa(int(x)) + ")"
+}
+
// IPProto defines enum 'ip_proto'.
type IPProto uint8
return nil
}
+// IP4AddressAndMask defines type 'ip4_address_and_mask'.
+type IP4AddressAndMask struct {
+ Addr IP4Address `binapi:"ip4_address,name=addr" json:"addr,omitempty"`
+ Mask IP4Address `binapi:"ip4_address,name=mask" json:"mask,omitempty"`
+}
+
// IP4Prefix defines type 'ip4_prefix'.
type IP4Prefix struct {
Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
return nil
}
+// IP6AddressAndMask defines type 'ip6_address_and_mask'.
+type IP6AddressAndMask struct {
+ Addr IP6Address `binapi:"ip6_address,name=addr" json:"addr,omitempty"`
+ Mask IP6Address `binapi:"ip6_address,name=mask" json:"mask,omitempty"`
+}
+
// IP6Prefix defines type 'ip6_prefix'.
type IP6Prefix struct {
Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
// AddressUnion defines union 'address_union'.
type AddressUnion struct {
- // IP4 *IP4Address
- // IP6 *IP6Address
+ // AddressUnion can be one of:
+ // - IP4 *IP4Address
+ // - IP6 *IP6Address
XXX_UnionData [16]byte
}
return
}
func (u *AddressUnion) SetIP4(a IP4Address) {
- var buf = codec.NewBuffer(u.XXX_UnionData[:])
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
buf.EncodeBytes(a[:], 4)
}
func (u *AddressUnion) GetIP4() (a IP4Address) {
- var buf = codec.NewBuffer(u.XXX_UnionData[:])
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
copy(a[:], buf.DecodeBytes(4))
return
}
return
}
func (u *AddressUnion) SetIP6(a IP6Address) {
- var buf = codec.NewBuffer(u.XXX_UnionData[:])
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
buf.EncodeBytes(a[:], 16)
}
func (u *AddressUnion) GetIP6() (a IP6Address) {
- var buf = codec.NewBuffer(u.XXX_UnionData[:])
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
copy(a[:], buf.DecodeBytes(16))
return
}