X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=examples%2Fbinapi%2Fip_types%2Fip_types.ba.go;h=23ae315c349dc29a145cea1bb1a3c916d81ef825;hb=df67791c6ffc96331f75aec7d3addfe2efca7739;hp=181274612fd7da56520910bbc35d6c455b14339a;hpb=d4d3b9c6fa67fe454f8d8adc7502b3b645ecab10;p=govpp.git diff --git a/examples/binapi/ip_types/ip_types.ba.go b/examples/binapi/ip_types/ip_types.ba.go index 1812746..23ae315 100644 --- a/examples/binapi/ip_types/ip_types.ba.go +++ b/examples/binapi/ip_types/ip_types.ba.go @@ -1,59 +1,73 @@ // Code generated by GoVPP's binapi-generator. DO NOT EDIT. +// versions: +// binapi-generator: v0.4.0-dev +// VPP: 20.05-release // 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 API file ip_types.api (3.0.0). It consists of: - 4 enums 5 aliases + 4 enums 6 types 1 union */ package ip_types import ( - bytes "bytes" - context "context" + "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" - io "io" - strconv "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 = "ip_types" // APIVersion is the API version of this module. APIVersion = "3.0.0" // VersionCrc is the CRC of this module. - VersionCrc = 0x80424562 + VersionCrc = 0x9cb1c2e2 ) // AddressFamily represents VPP binary API enum 'address_family'. -type AddressFamily uint32 +type AddressFamily uint8 const ( ADDRESS_IP4 AddressFamily = 0 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[uint8]string{ + 0: "ADDRESS_IP4", + 1: "ADDRESS_IP6", + } + AddressFamily_value = map[string]uint8{ + "ADDRESS_IP4": 0, + "ADDRESS_IP6": 1, + } +) func (x AddressFamily) String() string { - s, ok := AddressFamily_name[uint32(x)] + s, ok := AddressFamily_name[uint8(x)] if ok { return s } - return strconv.Itoa(int(x)) + return "AddressFamily(" + strconv.Itoa(int(x)) + ")" } // IPDscp represents VPP binary API enum 'ip_dscp'. @@ -83,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'. @@ -149,30 +164,31 @@ 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'. -type IPProto uint32 +type IPProto uint8 const ( IP_API_PROTO_HOPOPT IPProto = 0 @@ -181,50 +197,54 @@ const ( IP_API_PROTO_TCP IPProto = 6 IP_API_PROTO_UDP IPProto = 17 IP_API_PROTO_GRE IPProto = 47 - IP_API_PROTO_AH IPProto = 50 - IP_API_PROTO_ESP IPProto = 51 + IP_API_PROTO_ESP IPProto = 50 + IP_API_PROTO_AH IPProto = 51 + IP_API_PROTO_ICMP6 IPProto = 58 IP_API_PROTO_EIGRP IPProto = 88 IP_API_PROTO_OSPF IPProto = 89 IP_API_PROTO_SCTP IPProto = 132 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[uint8]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_ESP", + 51: "IP_API_PROTO_AH", + 58: "IP_API_PROTO_ICMP6", + 88: "IP_API_PROTO_EIGRP", + 89: "IP_API_PROTO_OSPF", + 132: "IP_API_PROTO_SCTP", + 255: "IP_API_PROTO_RESERVED", + } + IPProto_value = map[string]uint8{ + "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_ESP": 50, + "IP_API_PROTO_AH": 51, + "IP_API_PROTO_ICMP6": 58, + "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)] + s, ok := IPProto_name[uint8(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'. @@ -244,50 +264,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" } @@ -333,16 +353,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