Improve binapi generator
[govpp.git] / binapi / pot / pot.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/pot.api.json
6
7 // Package pot contains generated bindings for API file pot.api.
8 //
9 // Contents:
10 //   8 messages
11 //
12 package pot
13
14 import (
15         api "git.fd.io/govpp.git/api"
16         codec "git.fd.io/govpp.git/codec"
17 )
18
19 // This is a compile-time assertion to ensure that this generated file
20 // is compatible with the GoVPP api package it is being compiled against.
21 // A compilation error at this line likely means your copy of the
22 // GoVPP api package needs to be updated.
23 const _ = api.GoVppAPIPackageIsVersion2
24
25 const (
26         APIFile    = "pot"
27         APIVersion = "1.0.0"
28         VersionCrc = 0xa9d8e55c
29 )
30
31 // PotProfileActivate defines message 'pot_profile_activate'.
32 type PotProfileActivate struct {
33         ID       uint8  `binapi:"u8,name=id" json:"id,omitempty"`
34         ListName string `binapi:"string[],name=list_name" json:"list_name,omitempty"`
35 }
36
37 func (m *PotProfileActivate) Reset()               { *m = PotProfileActivate{} }
38 func (*PotProfileActivate) GetMessageName() string { return "pot_profile_activate" }
39 func (*PotProfileActivate) GetCrcString() string   { return "0770af98" }
40 func (*PotProfileActivate) GetMessageType() api.MessageType {
41         return api.RequestMessage
42 }
43
44 func (m *PotProfileActivate) Size() int {
45         if m == nil {
46                 return 0
47         }
48         var size int
49         size += 1                   // m.ID
50         size += 4 + len(m.ListName) // m.ListName
51         return size
52 }
53 func (m *PotProfileActivate) Marshal(b []byte) ([]byte, error) {
54         var buf *codec.Buffer
55         if b == nil {
56                 buf = codec.NewBuffer(make([]byte, m.Size()))
57         } else {
58                 buf = codec.NewBuffer(b)
59         }
60         buf.EncodeUint8(uint8(m.ID))
61         buf.EncodeString(m.ListName, 0)
62         return buf.Bytes(), nil
63 }
64 func (m *PotProfileActivate) Unmarshal(b []byte) error {
65         buf := codec.NewBuffer(b)
66         m.ID = buf.DecodeUint8()
67         m.ListName = buf.DecodeString(0)
68         return nil
69 }
70
71 // PotProfileActivateReply defines message 'pot_profile_activate_reply'.
72 type PotProfileActivateReply struct {
73         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
74 }
75
76 func (m *PotProfileActivateReply) Reset()               { *m = PotProfileActivateReply{} }
77 func (*PotProfileActivateReply) GetMessageName() string { return "pot_profile_activate_reply" }
78 func (*PotProfileActivateReply) GetCrcString() string   { return "e8d4e804" }
79 func (*PotProfileActivateReply) GetMessageType() api.MessageType {
80         return api.ReplyMessage
81 }
82
83 func (m *PotProfileActivateReply) Size() int {
84         if m == nil {
85                 return 0
86         }
87         var size int
88         size += 4 // m.Retval
89         return size
90 }
91 func (m *PotProfileActivateReply) Marshal(b []byte) ([]byte, error) {
92         var buf *codec.Buffer
93         if b == nil {
94                 buf = codec.NewBuffer(make([]byte, m.Size()))
95         } else {
96                 buf = codec.NewBuffer(b)
97         }
98         buf.EncodeUint32(uint32(m.Retval))
99         return buf.Bytes(), nil
100 }
101 func (m *PotProfileActivateReply) Unmarshal(b []byte) error {
102         buf := codec.NewBuffer(b)
103         m.Retval = int32(buf.DecodeUint32())
104         return nil
105 }
106
107 // PotProfileAdd defines message 'pot_profile_add'.
108 type PotProfileAdd struct {
109         ID               uint8  `binapi:"u8,name=id" json:"id,omitempty"`
110         Validator        uint8  `binapi:"u8,name=validator" json:"validator,omitempty"`
111         SecretKey        uint64 `binapi:"u64,name=secret_key" json:"secret_key,omitempty"`
112         SecretShare      uint64 `binapi:"u64,name=secret_share" json:"secret_share,omitempty"`
113         Prime            uint64 `binapi:"u64,name=prime" json:"prime,omitempty"`
114         MaxBits          uint8  `binapi:"u8,name=max_bits" json:"max_bits,omitempty"`
115         Lpc              uint64 `binapi:"u64,name=lpc" json:"lpc,omitempty"`
116         PolynomialPublic uint64 `binapi:"u64,name=polynomial_public" json:"polynomial_public,omitempty"`
117         ListName         string `binapi:"string[],name=list_name" json:"list_name,omitempty"`
118 }
119
120 func (m *PotProfileAdd) Reset()               { *m = PotProfileAdd{} }
121 func (*PotProfileAdd) GetMessageName() string { return "pot_profile_add" }
122 func (*PotProfileAdd) GetCrcString() string   { return "ad5da3a3" }
123 func (*PotProfileAdd) GetMessageType() api.MessageType {
124         return api.RequestMessage
125 }
126
127 func (m *PotProfileAdd) Size() int {
128         if m == nil {
129                 return 0
130         }
131         var size int
132         size += 1                   // m.ID
133         size += 1                   // m.Validator
134         size += 8                   // m.SecretKey
135         size += 8                   // m.SecretShare
136         size += 8                   // m.Prime
137         size += 1                   // m.MaxBits
138         size += 8                   // m.Lpc
139         size += 8                   // m.PolynomialPublic
140         size += 4 + len(m.ListName) // m.ListName
141         return size
142 }
143 func (m *PotProfileAdd) Marshal(b []byte) ([]byte, error) {
144         var buf *codec.Buffer
145         if b == nil {
146                 buf = codec.NewBuffer(make([]byte, m.Size()))
147         } else {
148                 buf = codec.NewBuffer(b)
149         }
150         buf.EncodeUint8(uint8(m.ID))
151         buf.EncodeUint8(uint8(m.Validator))
152         buf.EncodeUint64(uint64(m.SecretKey))
153         buf.EncodeUint64(uint64(m.SecretShare))
154         buf.EncodeUint64(uint64(m.Prime))
155         buf.EncodeUint8(uint8(m.MaxBits))
156         buf.EncodeUint64(uint64(m.Lpc))
157         buf.EncodeUint64(uint64(m.PolynomialPublic))
158         buf.EncodeString(m.ListName, 0)
159         return buf.Bytes(), nil
160 }
161 func (m *PotProfileAdd) Unmarshal(b []byte) error {
162         buf := codec.NewBuffer(b)
163         m.ID = buf.DecodeUint8()
164         m.Validator = buf.DecodeUint8()
165         m.SecretKey = buf.DecodeUint64()
166         m.SecretShare = buf.DecodeUint64()
167         m.Prime = buf.DecodeUint64()
168         m.MaxBits = buf.DecodeUint8()
169         m.Lpc = buf.DecodeUint64()
170         m.PolynomialPublic = buf.DecodeUint64()
171         m.ListName = buf.DecodeString(0)
172         return nil
173 }
174
175 // PotProfileAddReply defines message 'pot_profile_add_reply'.
176 type PotProfileAddReply struct {
177         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
178 }
179
180 func (m *PotProfileAddReply) Reset()               { *m = PotProfileAddReply{} }
181 func (*PotProfileAddReply) GetMessageName() string { return "pot_profile_add_reply" }
182 func (*PotProfileAddReply) GetCrcString() string   { return "e8d4e804" }
183 func (*PotProfileAddReply) GetMessageType() api.MessageType {
184         return api.ReplyMessage
185 }
186
187 func (m *PotProfileAddReply) Size() int {
188         if m == nil {
189                 return 0
190         }
191         var size int
192         size += 4 // m.Retval
193         return size
194 }
195 func (m *PotProfileAddReply) Marshal(b []byte) ([]byte, error) {
196         var buf *codec.Buffer
197         if b == nil {
198                 buf = codec.NewBuffer(make([]byte, m.Size()))
199         } else {
200                 buf = codec.NewBuffer(b)
201         }
202         buf.EncodeUint32(uint32(m.Retval))
203         return buf.Bytes(), nil
204 }
205 func (m *PotProfileAddReply) Unmarshal(b []byte) error {
206         buf := codec.NewBuffer(b)
207         m.Retval = int32(buf.DecodeUint32())
208         return nil
209 }
210
211 // PotProfileDel defines message 'pot_profile_del'.
212 type PotProfileDel struct {
213         ListName string `binapi:"string[],name=list_name" json:"list_name,omitempty"`
214 }
215
216 func (m *PotProfileDel) Reset()               { *m = PotProfileDel{} }
217 func (*PotProfileDel) GetMessageName() string { return "pot_profile_del" }
218 func (*PotProfileDel) GetCrcString() string   { return "cd63f53b" }
219 func (*PotProfileDel) GetMessageType() api.MessageType {
220         return api.RequestMessage
221 }
222
223 func (m *PotProfileDel) Size() int {
224         if m == nil {
225                 return 0
226         }
227         var size int
228         size += 4 + len(m.ListName) // m.ListName
229         return size
230 }
231 func (m *PotProfileDel) Marshal(b []byte) ([]byte, error) {
232         var buf *codec.Buffer
233         if b == nil {
234                 buf = codec.NewBuffer(make([]byte, m.Size()))
235         } else {
236                 buf = codec.NewBuffer(b)
237         }
238         buf.EncodeString(m.ListName, 0)
239         return buf.Bytes(), nil
240 }
241 func (m *PotProfileDel) Unmarshal(b []byte) error {
242         buf := codec.NewBuffer(b)
243         m.ListName = buf.DecodeString(0)
244         return nil
245 }
246
247 // PotProfileDelReply defines message 'pot_profile_del_reply'.
248 type PotProfileDelReply struct {
249         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
250 }
251
252 func (m *PotProfileDelReply) Reset()               { *m = PotProfileDelReply{} }
253 func (*PotProfileDelReply) GetMessageName() string { return "pot_profile_del_reply" }
254 func (*PotProfileDelReply) GetCrcString() string   { return "e8d4e804" }
255 func (*PotProfileDelReply) GetMessageType() api.MessageType {
256         return api.ReplyMessage
257 }
258
259 func (m *PotProfileDelReply) Size() int {
260         if m == nil {
261                 return 0
262         }
263         var size int
264         size += 4 // m.Retval
265         return size
266 }
267 func (m *PotProfileDelReply) Marshal(b []byte) ([]byte, error) {
268         var buf *codec.Buffer
269         if b == nil {
270                 buf = codec.NewBuffer(make([]byte, m.Size()))
271         } else {
272                 buf = codec.NewBuffer(b)
273         }
274         buf.EncodeUint32(uint32(m.Retval))
275         return buf.Bytes(), nil
276 }
277 func (m *PotProfileDelReply) Unmarshal(b []byte) error {
278         buf := codec.NewBuffer(b)
279         m.Retval = int32(buf.DecodeUint32())
280         return nil
281 }
282
283 // PotProfileShowConfigDetails defines message 'pot_profile_show_config_details'.
284 type PotProfileShowConfigDetails struct {
285         Retval           int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
286         ID               uint8  `binapi:"u8,name=id" json:"id,omitempty"`
287         Validator        uint8  `binapi:"u8,name=validator" json:"validator,omitempty"`
288         SecretKey        uint64 `binapi:"u64,name=secret_key" json:"secret_key,omitempty"`
289         SecretShare      uint64 `binapi:"u64,name=secret_share" json:"secret_share,omitempty"`
290         Prime            uint64 `binapi:"u64,name=prime" json:"prime,omitempty"`
291         BitMask          uint64 `binapi:"u64,name=bit_mask" json:"bit_mask,omitempty"`
292         Lpc              uint64 `binapi:"u64,name=lpc" json:"lpc,omitempty"`
293         PolynomialPublic uint64 `binapi:"u64,name=polynomial_public" json:"polynomial_public,omitempty"`
294 }
295
296 func (m *PotProfileShowConfigDetails) Reset()               { *m = PotProfileShowConfigDetails{} }
297 func (*PotProfileShowConfigDetails) GetMessageName() string { return "pot_profile_show_config_details" }
298 func (*PotProfileShowConfigDetails) GetCrcString() string   { return "b7ce0618" }
299 func (*PotProfileShowConfigDetails) GetMessageType() api.MessageType {
300         return api.ReplyMessage
301 }
302
303 func (m *PotProfileShowConfigDetails) Size() int {
304         if m == nil {
305                 return 0
306         }
307         var size int
308         size += 4 // m.Retval
309         size += 1 // m.ID
310         size += 1 // m.Validator
311         size += 8 // m.SecretKey
312         size += 8 // m.SecretShare
313         size += 8 // m.Prime
314         size += 8 // m.BitMask
315         size += 8 // m.Lpc
316         size += 8 // m.PolynomialPublic
317         return size
318 }
319 func (m *PotProfileShowConfigDetails) Marshal(b []byte) ([]byte, error) {
320         var buf *codec.Buffer
321         if b == nil {
322                 buf = codec.NewBuffer(make([]byte, m.Size()))
323         } else {
324                 buf = codec.NewBuffer(b)
325         }
326         buf.EncodeUint32(uint32(m.Retval))
327         buf.EncodeUint8(uint8(m.ID))
328         buf.EncodeUint8(uint8(m.Validator))
329         buf.EncodeUint64(uint64(m.SecretKey))
330         buf.EncodeUint64(uint64(m.SecretShare))
331         buf.EncodeUint64(uint64(m.Prime))
332         buf.EncodeUint64(uint64(m.BitMask))
333         buf.EncodeUint64(uint64(m.Lpc))
334         buf.EncodeUint64(uint64(m.PolynomialPublic))
335         return buf.Bytes(), nil
336 }
337 func (m *PotProfileShowConfigDetails) Unmarshal(b []byte) error {
338         buf := codec.NewBuffer(b)
339         m.Retval = int32(buf.DecodeUint32())
340         m.ID = buf.DecodeUint8()
341         m.Validator = buf.DecodeUint8()
342         m.SecretKey = buf.DecodeUint64()
343         m.SecretShare = buf.DecodeUint64()
344         m.Prime = buf.DecodeUint64()
345         m.BitMask = buf.DecodeUint64()
346         m.Lpc = buf.DecodeUint64()
347         m.PolynomialPublic = buf.DecodeUint64()
348         return nil
349 }
350
351 // PotProfileShowConfigDump defines message 'pot_profile_show_config_dump'.
352 type PotProfileShowConfigDump struct {
353         ID uint8 `binapi:"u8,name=id" json:"id,omitempty"`
354 }
355
356 func (m *PotProfileShowConfigDump) Reset()               { *m = PotProfileShowConfigDump{} }
357 func (*PotProfileShowConfigDump) GetMessageName() string { return "pot_profile_show_config_dump" }
358 func (*PotProfileShowConfigDump) GetCrcString() string   { return "005b7d59" }
359 func (*PotProfileShowConfigDump) GetMessageType() api.MessageType {
360         return api.RequestMessage
361 }
362
363 func (m *PotProfileShowConfigDump) Size() int {
364         if m == nil {
365                 return 0
366         }
367         var size int
368         size += 1 // m.ID
369         return size
370 }
371 func (m *PotProfileShowConfigDump) Marshal(b []byte) ([]byte, error) {
372         var buf *codec.Buffer
373         if b == nil {
374                 buf = codec.NewBuffer(make([]byte, m.Size()))
375         } else {
376                 buf = codec.NewBuffer(b)
377         }
378         buf.EncodeUint8(uint8(m.ID))
379         return buf.Bytes(), nil
380 }
381 func (m *PotProfileShowConfigDump) Unmarshal(b []byte) error {
382         buf := codec.NewBuffer(b)
383         m.ID = buf.DecodeUint8()
384         return nil
385 }
386
387 func init() { file_pot_binapi_init() }
388 func file_pot_binapi_init() {
389         api.RegisterMessage((*PotProfileActivate)(nil), "pot_profile_activate_0770af98")
390         api.RegisterMessage((*PotProfileActivateReply)(nil), "pot_profile_activate_reply_e8d4e804")
391         api.RegisterMessage((*PotProfileAdd)(nil), "pot_profile_add_ad5da3a3")
392         api.RegisterMessage((*PotProfileAddReply)(nil), "pot_profile_add_reply_e8d4e804")
393         api.RegisterMessage((*PotProfileDel)(nil), "pot_profile_del_cd63f53b")
394         api.RegisterMessage((*PotProfileDelReply)(nil), "pot_profile_del_reply_e8d4e804")
395         api.RegisterMessage((*PotProfileShowConfigDetails)(nil), "pot_profile_show_config_details_b7ce0618")
396         api.RegisterMessage((*PotProfileShowConfigDump)(nil), "pot_profile_show_config_dump_005b7d59")
397 }
398
399 // Messages returns list of all messages in this module.
400 func AllMessages() []api.Message {
401         return []api.Message{
402                 (*PotProfileActivate)(nil),
403                 (*PotProfileActivateReply)(nil),
404                 (*PotProfileAdd)(nil),
405                 (*PotProfileAddReply)(nil),
406                 (*PotProfileDel)(nil),
407                 (*PotProfileDelReply)(nil),
408                 (*PotProfileShowConfigDetails)(nil),
409                 (*PotProfileShowConfigDump)(nil),
410         }
411 }