diff options
author | 2020-07-17 10:36:28 +0200 | |
---|---|---|
committer | 2020-07-17 11:43:41 +0200 | |
commit | d1f24d37bd447b64e402298bb8eb2479681facf9 (patch) | |
tree | a3fc21ba730a91d8a402c7a5bf9c614e3677c4fc /binapi/sr_types/sr_types.ba.go | |
parent | 1548c7e12531e3d055567d761c580a1c7ff0ac40 (diff) |
Improve binapi generator
- simplified Size/Marshal/Unmarshal methods
- replace struc in unions with custom marshal/unmarshal
- fix imports in generated files
- fix mock adapter
- generate rpc service using low-level stream API (dumps generate control ping or stream msg..)
- move examples/binapi to binapi and generate all API for latest release
- add binapigen.Plugin for developing custom generator plugins
- optionally generate HTTP handlers (REST API) for RPC services
- add govpp program for browsing VPP API
Change-Id: I092e9ed2b0c17972b3476463c3d4b14dd76ed42b
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Diffstat (limited to 'binapi/sr_types/sr_types.ba.go')
-rw-r--r-- | binapi/sr_types/sr_types.ba.go | 137 |
1 files changed, 137 insertions, 0 deletions
diff --git a/binapi/sr_types/sr_types.ba.go b/binapi/sr_types/sr_types.ba.go new file mode 100644 index 0000000..df9f0f6 --- /dev/null +++ b/binapi/sr_types/sr_types.ba.go @@ -0,0 +1,137 @@ +// 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/sr_types.api.json + +// Package sr_types contains generated bindings for API file sr_types.api. +// +// Contents: +// 3 enums +// +package sr_types + +import ( + api "git.fd.io/govpp.git/api" + "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 + +// SrBehavior defines enum 'sr_behavior'. +type SrBehavior uint8 + +const ( + SR_BEHAVIOR_API_END SrBehavior = 1 + SR_BEHAVIOR_API_X SrBehavior = 2 + SR_BEHAVIOR_API_T SrBehavior = 3 + SR_BEHAVIOR_API_D_FIRST SrBehavior = 4 + SR_BEHAVIOR_API_DX2 SrBehavior = 5 + SR_BEHAVIOR_API_DX6 SrBehavior = 6 + SR_BEHAVIOR_API_DX4 SrBehavior = 7 + SR_BEHAVIOR_API_DT6 SrBehavior = 8 + SR_BEHAVIOR_API_DT4 SrBehavior = 9 + SR_BEHAVIOR_API_LAST SrBehavior = 10 +) + +var ( + SrBehavior_name = map[uint8]string{ + 1: "SR_BEHAVIOR_API_END", + 2: "SR_BEHAVIOR_API_X", + 3: "SR_BEHAVIOR_API_T", + 4: "SR_BEHAVIOR_API_D_FIRST", + 5: "SR_BEHAVIOR_API_DX2", + 6: "SR_BEHAVIOR_API_DX6", + 7: "SR_BEHAVIOR_API_DX4", + 8: "SR_BEHAVIOR_API_DT6", + 9: "SR_BEHAVIOR_API_DT4", + 10: "SR_BEHAVIOR_API_LAST", + } + SrBehavior_value = map[string]uint8{ + "SR_BEHAVIOR_API_END": 1, + "SR_BEHAVIOR_API_X": 2, + "SR_BEHAVIOR_API_T": 3, + "SR_BEHAVIOR_API_D_FIRST": 4, + "SR_BEHAVIOR_API_DX2": 5, + "SR_BEHAVIOR_API_DX6": 6, + "SR_BEHAVIOR_API_DX4": 7, + "SR_BEHAVIOR_API_DT6": 8, + "SR_BEHAVIOR_API_DT4": 9, + "SR_BEHAVIOR_API_LAST": 10, + } +) + +func (x SrBehavior) String() string { + s, ok := SrBehavior_name[uint8(x)] + if ok { + return s + } + return "SrBehavior(" + strconv.Itoa(int(x)) + ")" +} + +// SrPolicyOp defines enum 'sr_policy_op'. +type SrPolicyOp uint8 + +const ( + SR_POLICY_OP_API_NONE SrPolicyOp = 0 + SR_POLICY_OP_API_ADD SrPolicyOp = 1 + SR_POLICY_OP_API_DEL SrPolicyOp = 2 + SR_POLICY_OP_API_MOD SrPolicyOp = 3 +) + +var ( + SrPolicyOp_name = map[uint8]string{ + 0: "SR_POLICY_OP_API_NONE", + 1: "SR_POLICY_OP_API_ADD", + 2: "SR_POLICY_OP_API_DEL", + 3: "SR_POLICY_OP_API_MOD", + } + SrPolicyOp_value = map[string]uint8{ + "SR_POLICY_OP_API_NONE": 0, + "SR_POLICY_OP_API_ADD": 1, + "SR_POLICY_OP_API_DEL": 2, + "SR_POLICY_OP_API_MOD": 3, + } +) + +func (x SrPolicyOp) String() string { + s, ok := SrPolicyOp_name[uint8(x)] + if ok { + return s + } + return "SrPolicyOp(" + strconv.Itoa(int(x)) + ")" +} + +// SrSteer defines enum 'sr_steer'. +type SrSteer uint8 + +const ( + SR_STEER_API_L2 SrSteer = 2 + SR_STEER_API_IPV4 SrSteer = 4 + SR_STEER_API_IPV6 SrSteer = 6 +) + +var ( + SrSteer_name = map[uint8]string{ + 2: "SR_STEER_API_L2", + 4: "SR_STEER_API_IPV4", + 6: "SR_STEER_API_IPV6", + } + SrSteer_value = map[string]uint8{ + "SR_STEER_API_L2": 2, + "SR_STEER_API_IPV4": 4, + "SR_STEER_API_IPV6": 6, + } +) + +func (x SrSteer) String() string { + s, ok := SrSteer_name[uint8(x)] + if ok { + return s + } + return "SrSteer(" + strconv.Itoa(int(x)) + ")" +} |