Improve binapi generator
[govpp.git] / binapi / gso / gso.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.4.0-dev
4 //  VPP:              20.05-release
5 // source: /usr/share/vpp/api/core/gso.api.json
6
7 // Package gso contains generated bindings for API file gso.api.
8 //
9 // Contents:
10 //   2 messages
11 //
12 package gso
13
14 import (
15         api "git.fd.io/govpp.git/api"
16         interface_types "git.fd.io/govpp.git/binapi/interface_types"
17         codec "git.fd.io/govpp.git/codec"
18 )
19
20 // This is a compile-time assertion to ensure that this generated file
21 // is compatible with the GoVPP api package it is being compiled against.
22 // A compilation error at this line likely means your copy of the
23 // GoVPP api package needs to be updated.
24 const _ = api.GoVppAPIPackageIsVersion2
25
26 const (
27         APIFile    = "gso"
28         APIVersion = "1.0.0"
29         VersionCrc = 0x2ec8641f
30 )
31
32 // FeatureGsoEnableDisable defines message 'feature_gso_enable_disable'.
33 type FeatureGsoEnableDisable struct {
34         SwIfIndex     interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
35         EnableDisable bool                           `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
36 }
37
38 func (m *FeatureGsoEnableDisable) Reset()               { *m = FeatureGsoEnableDisable{} }
39 func (*FeatureGsoEnableDisable) GetMessageName() string { return "feature_gso_enable_disable" }
40 func (*FeatureGsoEnableDisable) GetCrcString() string   { return "5501adee" }
41 func (*FeatureGsoEnableDisable) GetMessageType() api.MessageType {
42         return api.RequestMessage
43 }
44
45 func (m *FeatureGsoEnableDisable) Size() int {
46         if m == nil {
47                 return 0
48         }
49         var size int
50         size += 4 // m.SwIfIndex
51         size += 1 // m.EnableDisable
52         return size
53 }
54 func (m *FeatureGsoEnableDisable) Marshal(b []byte) ([]byte, error) {
55         var buf *codec.Buffer
56         if b == nil {
57                 buf = codec.NewBuffer(make([]byte, m.Size()))
58         } else {
59                 buf = codec.NewBuffer(b)
60         }
61         buf.EncodeUint32(uint32(m.SwIfIndex))
62         buf.EncodeBool(m.EnableDisable)
63         return buf.Bytes(), nil
64 }
65 func (m *FeatureGsoEnableDisable) Unmarshal(b []byte) error {
66         buf := codec.NewBuffer(b)
67         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
68         m.EnableDisable = buf.DecodeBool()
69         return nil
70 }
71
72 // FeatureGsoEnableDisableReply defines message 'feature_gso_enable_disable_reply'.
73 type FeatureGsoEnableDisableReply struct {
74         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
75 }
76
77 func (m *FeatureGsoEnableDisableReply) Reset() { *m = FeatureGsoEnableDisableReply{} }
78 func (*FeatureGsoEnableDisableReply) GetMessageName() string {
79         return "feature_gso_enable_disable_reply"
80 }
81 func (*FeatureGsoEnableDisableReply) GetCrcString() string { return "e8d4e804" }
82 func (*FeatureGsoEnableDisableReply) GetMessageType() api.MessageType {
83         return api.ReplyMessage
84 }
85
86 func (m *FeatureGsoEnableDisableReply) Size() int {
87         if m == nil {
88                 return 0
89         }
90         var size int
91         size += 4 // m.Retval
92         return size
93 }
94 func (m *FeatureGsoEnableDisableReply) Marshal(b []byte) ([]byte, error) {
95         var buf *codec.Buffer
96         if b == nil {
97                 buf = codec.NewBuffer(make([]byte, m.Size()))
98         } else {
99                 buf = codec.NewBuffer(b)
100         }
101         buf.EncodeUint32(uint32(m.Retval))
102         return buf.Bytes(), nil
103 }
104 func (m *FeatureGsoEnableDisableReply) Unmarshal(b []byte) error {
105         buf := codec.NewBuffer(b)
106         m.Retval = int32(buf.DecodeUint32())
107         return nil
108 }
109
110 func init() { file_gso_binapi_init() }
111 func file_gso_binapi_init() {
112         api.RegisterMessage((*FeatureGsoEnableDisable)(nil), "feature_gso_enable_disable_5501adee")
113         api.RegisterMessage((*FeatureGsoEnableDisableReply)(nil), "feature_gso_enable_disable_reply_e8d4e804")
114 }
115
116 // Messages returns list of all messages in this module.
117 func AllMessages() []api.Message {
118         return []api.Message{
119                 (*FeatureGsoEnableDisable)(nil),
120                 (*FeatureGsoEnableDisableReply)(nil),
121         }
122 }