Improve binapi generator
[govpp.git] / binapi / avf / avf.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/plugins/avf.api.json
6
7 // Package avf contains generated bindings for API file avf.api.
8 //
9 // Contents:
10 //   4 messages
11 //
12 package avf
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    = "avf"
28         APIVersion = "1.0.0"
29         VersionCrc = 0xbaaa7124
30 )
31
32 // AvfCreate defines message 'avf_create'.
33 type AvfCreate struct {
34         PciAddr    uint32 `binapi:"u32,name=pci_addr" json:"pci_addr,omitempty"`
35         EnableElog int32  `binapi:"i32,name=enable_elog" json:"enable_elog,omitempty"`
36         RxqNum     uint16 `binapi:"u16,name=rxq_num" json:"rxq_num,omitempty"`
37         RxqSize    uint16 `binapi:"u16,name=rxq_size" json:"rxq_size,omitempty"`
38         TxqSize    uint16 `binapi:"u16,name=txq_size" json:"txq_size,omitempty"`
39 }
40
41 func (m *AvfCreate) Reset()               { *m = AvfCreate{} }
42 func (*AvfCreate) GetMessageName() string { return "avf_create" }
43 func (*AvfCreate) GetCrcString() string   { return "daab8ae2" }
44 func (*AvfCreate) GetMessageType() api.MessageType {
45         return api.RequestMessage
46 }
47
48 func (m *AvfCreate) Size() int {
49         if m == nil {
50                 return 0
51         }
52         var size int
53         size += 4 // m.PciAddr
54         size += 4 // m.EnableElog
55         size += 2 // m.RxqNum
56         size += 2 // m.RxqSize
57         size += 2 // m.TxqSize
58         return size
59 }
60 func (m *AvfCreate) Marshal(b []byte) ([]byte, error) {
61         var buf *codec.Buffer
62         if b == nil {
63                 buf = codec.NewBuffer(make([]byte, m.Size()))
64         } else {
65                 buf = codec.NewBuffer(b)
66         }
67         buf.EncodeUint32(uint32(m.PciAddr))
68         buf.EncodeUint32(uint32(m.EnableElog))
69         buf.EncodeUint16(uint16(m.RxqNum))
70         buf.EncodeUint16(uint16(m.RxqSize))
71         buf.EncodeUint16(uint16(m.TxqSize))
72         return buf.Bytes(), nil
73 }
74 func (m *AvfCreate) Unmarshal(b []byte) error {
75         buf := codec.NewBuffer(b)
76         m.PciAddr = buf.DecodeUint32()
77         m.EnableElog = int32(buf.DecodeUint32())
78         m.RxqNum = buf.DecodeUint16()
79         m.RxqSize = buf.DecodeUint16()
80         m.TxqSize = buf.DecodeUint16()
81         return nil
82 }
83
84 // AvfCreateReply defines message 'avf_create_reply'.
85 type AvfCreateReply struct {
86         Retval    int32                          `binapi:"i32,name=retval" json:"retval,omitempty"`
87         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
88 }
89
90 func (m *AvfCreateReply) Reset()               { *m = AvfCreateReply{} }
91 func (*AvfCreateReply) GetMessageName() string { return "avf_create_reply" }
92 func (*AvfCreateReply) GetCrcString() string   { return "5383d31f" }
93 func (*AvfCreateReply) GetMessageType() api.MessageType {
94         return api.ReplyMessage
95 }
96
97 func (m *AvfCreateReply) Size() int {
98         if m == nil {
99                 return 0
100         }
101         var size int
102         size += 4 // m.Retval
103         size += 4 // m.SwIfIndex
104         return size
105 }
106 func (m *AvfCreateReply) Marshal(b []byte) ([]byte, error) {
107         var buf *codec.Buffer
108         if b == nil {
109                 buf = codec.NewBuffer(make([]byte, m.Size()))
110         } else {
111                 buf = codec.NewBuffer(b)
112         }
113         buf.EncodeUint32(uint32(m.Retval))
114         buf.EncodeUint32(uint32(m.SwIfIndex))
115         return buf.Bytes(), nil
116 }
117 func (m *AvfCreateReply) Unmarshal(b []byte) error {
118         buf := codec.NewBuffer(b)
119         m.Retval = int32(buf.DecodeUint32())
120         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
121         return nil
122 }
123
124 // AvfDelete defines message 'avf_delete'.
125 type AvfDelete struct {
126         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
127 }
128
129 func (m *AvfDelete) Reset()               { *m = AvfDelete{} }
130 func (*AvfDelete) GetMessageName() string { return "avf_delete" }
131 func (*AvfDelete) GetCrcString() string   { return "f9e6675e" }
132 func (*AvfDelete) GetMessageType() api.MessageType {
133         return api.RequestMessage
134 }
135
136 func (m *AvfDelete) Size() int {
137         if m == nil {
138                 return 0
139         }
140         var size int
141         size += 4 // m.SwIfIndex
142         return size
143 }
144 func (m *AvfDelete) Marshal(b []byte) ([]byte, error) {
145         var buf *codec.Buffer
146         if b == nil {
147                 buf = codec.NewBuffer(make([]byte, m.Size()))
148         } else {
149                 buf = codec.NewBuffer(b)
150         }
151         buf.EncodeUint32(uint32(m.SwIfIndex))
152         return buf.Bytes(), nil
153 }
154 func (m *AvfDelete) Unmarshal(b []byte) error {
155         buf := codec.NewBuffer(b)
156         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
157         return nil
158 }
159
160 // AvfDeleteReply defines message 'avf_delete_reply'.
161 type AvfDeleteReply struct {
162         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
163 }
164
165 func (m *AvfDeleteReply) Reset()               { *m = AvfDeleteReply{} }
166 func (*AvfDeleteReply) GetMessageName() string { return "avf_delete_reply" }
167 func (*AvfDeleteReply) GetCrcString() string   { return "e8d4e804" }
168 func (*AvfDeleteReply) GetMessageType() api.MessageType {
169         return api.ReplyMessage
170 }
171
172 func (m *AvfDeleteReply) Size() int {
173         if m == nil {
174                 return 0
175         }
176         var size int
177         size += 4 // m.Retval
178         return size
179 }
180 func (m *AvfDeleteReply) Marshal(b []byte) ([]byte, error) {
181         var buf *codec.Buffer
182         if b == nil {
183                 buf = codec.NewBuffer(make([]byte, m.Size()))
184         } else {
185                 buf = codec.NewBuffer(b)
186         }
187         buf.EncodeUint32(uint32(m.Retval))
188         return buf.Bytes(), nil
189 }
190 func (m *AvfDeleteReply) Unmarshal(b []byte) error {
191         buf := codec.NewBuffer(b)
192         m.Retval = int32(buf.DecodeUint32())
193         return nil
194 }
195
196 func init() { file_avf_binapi_init() }
197 func file_avf_binapi_init() {
198         api.RegisterMessage((*AvfCreate)(nil), "avf_create_daab8ae2")
199         api.RegisterMessage((*AvfCreateReply)(nil), "avf_create_reply_5383d31f")
200         api.RegisterMessage((*AvfDelete)(nil), "avf_delete_f9e6675e")
201         api.RegisterMessage((*AvfDeleteReply)(nil), "avf_delete_reply_e8d4e804")
202 }
203
204 // Messages returns list of all messages in this module.
205 func AllMessages() []api.Message {
206         return []api.Message{
207                 (*AvfCreate)(nil),
208                 (*AvfCreateReply)(nil),
209                 (*AvfDelete)(nil),
210                 (*AvfDeleteReply)(nil),
211         }
212 }