aboutsummaryrefslogtreecommitdiffstats
path: root/examples/binapi/ip_types/ip_types.ba.go
diff options
context:
space:
mode:
Diffstat (limited to 'examples/binapi/ip_types/ip_types.ba.go')
-rw-r--r--examples/binapi/ip_types/ip_types.ba.go261
1 files changed, 137 insertions, 124 deletions
diff --git a/examples/binapi/ip_types/ip_types.ba.go b/examples/binapi/ip_types/ip_types.ba.go
index e812b8b..9335060 100644
--- a/examples/binapi/ip_types/ip_types.ba.go
+++ b/examples/binapi/ip_types/ip_types.ba.go
@@ -1,12 +1,15 @@
// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+// binapi-generator: v0.4.0-alpha-1-g435c3f4-dirty
+// VPP: 20.01-45~g7a071e370~b63
// source: /usr/share/vpp/api/core/ip_types.api.json
/*
-Package ip_types is a generated VPP binary API for 'ip_types' module.
+Package ip_types contains generated code for VPP binary API defined by ip_types.api (version 3.0.0).
It consists of:
- 4 enums
5 aliases
+ 4 enums
6 types
1 union
*/
@@ -15,13 +18,22 @@ package ip_types
import (
"bytes"
"context"
+ "encoding/binary"
"io"
+ "math"
"strconv"
api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
struc "github.com/lunixbochs/struc"
)
+// 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 = "ip_types"
@@ -39,22 +51,23 @@ const (
ADDRESS_IP6 AddressFamily = 1
)
-var AddressFamily_name = map[uint32]string{
- 0: "ADDRESS_IP4",
- 1: "ADDRESS_IP6",
-}
-
-var AddressFamily_value = map[string]uint32{
- "ADDRESS_IP4": 0,
- "ADDRESS_IP6": 1,
-}
+var (
+ AddressFamily_name = map[uint32]string{
+ 0: "ADDRESS_IP4",
+ 1: "ADDRESS_IP6",
+ }
+ AddressFamily_value = map[string]uint32{
+ "ADDRESS_IP4": 0,
+ "ADDRESS_IP6": 1,
+ }
+)
func (x AddressFamily) String() string {
s, ok := AddressFamily_name[uint32(x)]
if ok {
return s
}
- return strconv.Itoa(int(x))
+ return "AddressFamily(" + strconv.Itoa(int(x)) + ")"
}
// IPDscp represents VPP binary API enum 'ip_dscp'.
@@ -84,60 +97,61 @@ const (
IP_API_DSCP_CS7 IPDscp = 50
)
-var IPDscp_name = map[uint8]string{
- 0: "IP_API_DSCP_CS0",
- 8: "IP_API_DSCP_CS1",
- 10: "IP_API_DSCP_AF11",
- 12: "IP_API_DSCP_AF12",
- 14: "IP_API_DSCP_AF13",
- 16: "IP_API_DSCP_CS2",
- 18: "IP_API_DSCP_AF21",
- 20: "IP_API_DSCP_AF22",
- 22: "IP_API_DSCP_AF23",
- 24: "IP_API_DSCP_CS3",
- 26: "IP_API_DSCP_AF31",
- 28: "IP_API_DSCP_AF32",
- 30: "IP_API_DSCP_AF33",
- 32: "IP_API_DSCP_CS4",
- 34: "IP_API_DSCP_AF41",
- 36: "IP_API_DSCP_AF42",
- 38: "IP_API_DSCP_AF43",
- 40: "IP_API_DSCP_CS5",
- 46: "IP_API_DSCP_EF",
- 48: "IP_API_DSCP_CS6",
- 50: "IP_API_DSCP_CS7",
-}
-
-var IPDscp_value = map[string]uint8{
- "IP_API_DSCP_CS0": 0,
- "IP_API_DSCP_CS1": 8,
- "IP_API_DSCP_AF11": 10,
- "IP_API_DSCP_AF12": 12,
- "IP_API_DSCP_AF13": 14,
- "IP_API_DSCP_CS2": 16,
- "IP_API_DSCP_AF21": 18,
- "IP_API_DSCP_AF22": 20,
- "IP_API_DSCP_AF23": 22,
- "IP_API_DSCP_CS3": 24,
- "IP_API_DSCP_AF31": 26,
- "IP_API_DSCP_AF32": 28,
- "IP_API_DSCP_AF33": 30,
- "IP_API_DSCP_CS4": 32,
- "IP_API_DSCP_AF41": 34,
- "IP_API_DSCP_AF42": 36,
- "IP_API_DSCP_AF43": 38,
- "IP_API_DSCP_CS5": 40,
- "IP_API_DSCP_EF": 46,
- "IP_API_DSCP_CS6": 48,
- "IP_API_DSCP_CS7": 50,
-}
+var (
+ IPDscp_name = map[uint8]string{
+ 0: "IP_API_DSCP_CS0",
+ 8: "IP_API_DSCP_CS1",
+ 10: "IP_API_DSCP_AF11",
+ 12: "IP_API_DSCP_AF12",
+ 14: "IP_API_DSCP_AF13",
+ 16: "IP_API_DSCP_CS2",
+ 18: "IP_API_DSCP_AF21",
+ 20: "IP_API_DSCP_AF22",
+ 22: "IP_API_DSCP_AF23",
+ 24: "IP_API_DSCP_CS3",
+ 26: "IP_API_DSCP_AF31",
+ 28: "IP_API_DSCP_AF32",
+ 30: "IP_API_DSCP_AF33",
+ 32: "IP_API_DSCP_CS4",
+ 34: "IP_API_DSCP_AF41",
+ 36: "IP_API_DSCP_AF42",
+ 38: "IP_API_DSCP_AF43",
+ 40: "IP_API_DSCP_CS5",
+ 46: "IP_API_DSCP_EF",
+ 48: "IP_API_DSCP_CS6",
+ 50: "IP_API_DSCP_CS7",
+ }
+ IPDscp_value = map[string]uint8{
+ "IP_API_DSCP_CS0": 0,
+ "IP_API_DSCP_CS1": 8,
+ "IP_API_DSCP_AF11": 10,
+ "IP_API_DSCP_AF12": 12,
+ "IP_API_DSCP_AF13": 14,
+ "IP_API_DSCP_CS2": 16,
+ "IP_API_DSCP_AF21": 18,
+ "IP_API_DSCP_AF22": 20,
+ "IP_API_DSCP_AF23": 22,
+ "IP_API_DSCP_CS3": 24,
+ "IP_API_DSCP_AF31": 26,
+ "IP_API_DSCP_AF32": 28,
+ "IP_API_DSCP_AF33": 30,
+ "IP_API_DSCP_CS4": 32,
+ "IP_API_DSCP_AF41": 34,
+ "IP_API_DSCP_AF42": 36,
+ "IP_API_DSCP_AF43": 38,
+ "IP_API_DSCP_CS5": 40,
+ "IP_API_DSCP_EF": 46,
+ "IP_API_DSCP_CS6": 48,
+ "IP_API_DSCP_CS7": 50,
+ }
+)
func (x IPDscp) String() string {
s, ok := IPDscp_name[uint8(x)]
if ok {
return s
}
- return strconv.Itoa(int(x))
+ return "IPDscp(" + strconv.Itoa(int(x)) + ")"
}
// IPEcn represents VPP binary API enum 'ip_ecn'.
@@ -150,26 +164,27 @@ const (
IP_API_ECN_CE IPEcn = 3
)
-var IPEcn_name = map[uint8]string{
- 0: "IP_API_ECN_NONE",
- 1: "IP_API_ECN_ECT0",
- 2: "IP_API_ECN_ECT1",
- 3: "IP_API_ECN_CE",
-}
-
-var IPEcn_value = map[string]uint8{
- "IP_API_ECN_NONE": 0,
- "IP_API_ECN_ECT0": 1,
- "IP_API_ECN_ECT1": 2,
- "IP_API_ECN_CE": 3,
-}
+var (
+ IPEcn_name = map[uint8]string{
+ 0: "IP_API_ECN_NONE",
+ 1: "IP_API_ECN_ECT0",
+ 2: "IP_API_ECN_ECT1",
+ 3: "IP_API_ECN_CE",
+ }
+ IPEcn_value = map[string]uint8{
+ "IP_API_ECN_NONE": 0,
+ "IP_API_ECN_ECT0": 1,
+ "IP_API_ECN_ECT1": 2,
+ "IP_API_ECN_CE": 3,
+ }
+)
func (x IPEcn) String() string {
s, ok := IPEcn_name[uint8(x)]
if ok {
return s
}
- return strconv.Itoa(int(x))
+ return "IPEcn(" + strconv.Itoa(int(x)) + ")"
}
// IPProto represents VPP binary API enum 'ip_proto'.
@@ -190,42 +205,43 @@ const (
IP_API_PROTO_RESERVED IPProto = 255
)
-var IPProto_name = map[uint32]string{
- 0: "IP_API_PROTO_HOPOPT",
- 1: "IP_API_PROTO_ICMP",
- 2: "IP_API_PROTO_IGMP",
- 6: "IP_API_PROTO_TCP",
- 17: "IP_API_PROTO_UDP",
- 47: "IP_API_PROTO_GRE",
- 50: "IP_API_PROTO_AH",
- 51: "IP_API_PROTO_ESP",
- 88: "IP_API_PROTO_EIGRP",
- 89: "IP_API_PROTO_OSPF",
- 132: "IP_API_PROTO_SCTP",
- 255: "IP_API_PROTO_RESERVED",
-}
-
-var IPProto_value = map[string]uint32{
- "IP_API_PROTO_HOPOPT": 0,
- "IP_API_PROTO_ICMP": 1,
- "IP_API_PROTO_IGMP": 2,
- "IP_API_PROTO_TCP": 6,
- "IP_API_PROTO_UDP": 17,
- "IP_API_PROTO_GRE": 47,
- "IP_API_PROTO_AH": 50,
- "IP_API_PROTO_ESP": 51,
- "IP_API_PROTO_EIGRP": 88,
- "IP_API_PROTO_OSPF": 89,
- "IP_API_PROTO_SCTP": 132,
- "IP_API_PROTO_RESERVED": 255,
-}
+var (
+ IPProto_name = map[uint32]string{
+ 0: "IP_API_PROTO_HOPOPT",
+ 1: "IP_API_PROTO_ICMP",
+ 2: "IP_API_PROTO_IGMP",
+ 6: "IP_API_PROTO_TCP",
+ 17: "IP_API_PROTO_UDP",
+ 47: "IP_API_PROTO_GRE",
+ 50: "IP_API_PROTO_AH",
+ 51: "IP_API_PROTO_ESP",
+ 88: "IP_API_PROTO_EIGRP",
+ 89: "IP_API_PROTO_OSPF",
+ 132: "IP_API_PROTO_SCTP",
+ 255: "IP_API_PROTO_RESERVED",
+ }
+ IPProto_value = map[string]uint32{
+ "IP_API_PROTO_HOPOPT": 0,
+ "IP_API_PROTO_ICMP": 1,
+ "IP_API_PROTO_IGMP": 2,
+ "IP_API_PROTO_TCP": 6,
+ "IP_API_PROTO_UDP": 17,
+ "IP_API_PROTO_GRE": 47,
+ "IP_API_PROTO_AH": 50,
+ "IP_API_PROTO_ESP": 51,
+ "IP_API_PROTO_EIGRP": 88,
+ "IP_API_PROTO_OSPF": 89,
+ "IP_API_PROTO_SCTP": 132,
+ "IP_API_PROTO_RESERVED": 255,
+ }
+)
func (x IPProto) String() string {
s, ok := IPProto_name[uint32(x)]
if ok {
return s
}
- return strconv.Itoa(int(x))
+ return "IPProto(" + strconv.Itoa(int(x)) + ")"
}
// AddressWithPrefix represents VPP binary API alias 'address_with_prefix'.
@@ -245,50 +261,50 @@ type IP6AddressWithPrefix IP6Prefix
// Address represents VPP binary API type 'address'.
type Address struct {
- Af AddressFamily
- Un AddressUnion
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
}
func (*Address) GetTypeName() string { return "address" }
// IP4Prefix represents VPP binary API type 'ip4_prefix'.
type IP4Prefix struct {
- Address IP4Address
- Len uint8
+ Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
}
func (*IP4Prefix) GetTypeName() string { return "ip4_prefix" }
// IP6Prefix represents VPP binary API type 'ip6_prefix'.
type IP6Prefix struct {
- Address IP6Address
- Len uint8
+ Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
}
func (*IP6Prefix) GetTypeName() string { return "ip6_prefix" }
// Mprefix represents VPP binary API type 'mprefix'.
type Mprefix struct {
- Af AddressFamily
- GrpAddressLength uint16
- GrpAddress AddressUnion
- SrcAddress AddressUnion
+ Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
+ GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
+ GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
+ SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
}
func (*Mprefix) GetTypeName() string { return "mprefix" }
// Prefix represents VPP binary API type 'prefix'.
type Prefix struct {
- Address Address
- Len uint8
+ Address Address `binapi:"address,name=address" json:"address,omitempty"`
+ Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
}
func (*Prefix) GetTypeName() string { return "prefix" }
// PrefixMatcher represents VPP binary API type 'prefix_matcher'.
type PrefixMatcher struct {
- Le uint8
- Ge uint8
+ Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
+ Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
}
func (*PrefixMatcher) GetTypeName() string { return "prefix_matcher" }
@@ -334,16 +350,13 @@ func (u *AddressUnion) GetIP6() (a IP6Address) {
return
}
-// 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.GoVppAPIPackageIsVersion1 // please upgrade the GoVPP api package
-
// 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 _ = struc.Pack
+var _ = binary.BigEndian
+var _ = math.Float32bits