diff options
author | Ondrej Fabry <ofabry@cisco.com> | 2020-07-22 04:40:55 +0200 |
---|---|---|
committer | Ondrej Fabry <ofabry@cisco.com> | 2020-07-22 04:40:55 +0200 |
commit | 58da9ac6e691a8c660eb8ca838a154e11da0db68 (patch) | |
tree | a1bbda04c6d0621ce0fc20779276620f1820190b /api | |
parent | a155cd438c6558da266c1c5931361ea088b35653 (diff) |
Fix binapigen decoding and minor improvements
- fixed allocating byte slices before copying decoded data
- simplified encoding functions
- several minor improvements
Change-Id: I6669424b89eb86333805cb1b57e4551169980cc2
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Diffstat (limited to 'api')
-rw-r--r-- | api/binapi.go | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/api/binapi.go b/api/binapi.go index 04fdc9e..cb4ab85 100644 --- a/api/binapi.go +++ b/api/binapi.go @@ -19,11 +19,14 @@ import ( "reflect" ) -// MessageType represents the type of a VPP message. -// Note: this is currently derived from the message header (fields), -// and in many cases it does not represent the actual type of VPP message. -// This means that some replies can be identified as requests, etc. -// TODO: use services to identify type of message +// GoVppAPIPackageIsVersionX is referenced from generated binapi files +// to assert that that code is compatible with this version of the GoVPP api package. +const ( + GoVppAPIPackageIsVersion1 = true + GoVppAPIPackageIsVersion2 = true +) + +// MessageType represents the type of a VPP message derived from message header fields. type MessageType int const ( @@ -80,8 +83,3 @@ func GetRegisteredMessages() map[string]Message { func GetRegisteredMessageTypes() map[reflect.Type]string { return registeredMessageTypes } - -// GoVppAPIPackageIsVersionX is referenced from generated binapi files -// to assert that that code is compatible with this version of the GoVPP api package. -const GoVppAPIPackageIsVersion1 = true -const GoVppAPIPackageIsVersion2 = true |