Refactored binapi generator with message encoding
[govpp.git] / examples / binapi / vpe / vpe.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.4.0-alpha-1-g435c3f4-dirty
4 //  VPP:              20.01-45~g7a071e370~b63
5 // source: /usr/share/vpp/api/core/vpe.api.json
6
7 /*
8 Package vpe contains generated code for VPP binary API defined by vpe.api (version 1.6.0).
9
10 It consists of:
11           2 aliases
12           1 enum
13          26 messages
14           2 types
15 */
16 package vpe
17
18 import (
19         "bytes"
20         "context"
21         "encoding/binary"
22         "io"
23         "math"
24         "strconv"
25
26         api "git.fd.io/govpp.git/api"
27         codec "git.fd.io/govpp.git/codec"
28         struc "github.com/lunixbochs/struc"
29 )
30
31 // This is a compile-time assertion to ensure that this generated file
32 // is compatible with the GoVPP api package it is being compiled against.
33 // A compilation error at this line likely means your copy of the
34 // GoVPP api package needs to be updated.
35 const _ = api.GoVppAPIPackageIsVersion2 // please upgrade the GoVPP api package
36
37 const (
38         // ModuleName is the name of this module.
39         ModuleName = "vpe"
40         // APIVersion is the API version of this module.
41         APIVersion = "1.6.0"
42         // VersionCrc is the CRC of this module.
43         VersionCrc = 0xc6c0bcf6
44 )
45
46 // LogLevel represents VPP binary API enum 'log_level'.
47 type LogLevel uint32
48
49 const (
50         VPE_API_LOG_LEVEL_EMERG    LogLevel = 0
51         VPE_API_LOG_LEVEL_ALERT    LogLevel = 1
52         VPE_API_LOG_LEVEL_CRIT     LogLevel = 2
53         VPE_API_LOG_LEVEL_ERR      LogLevel = 3
54         VPE_API_LOG_LEVEL_WARNING  LogLevel = 4
55         VPE_API_LOG_LEVEL_NOTICE   LogLevel = 5
56         VPE_API_LOG_LEVEL_INFO     LogLevel = 6
57         VPE_API_LOG_LEVEL_DEBUG    LogLevel = 7
58         VPE_API_LOG_LEVEL_DISABLED LogLevel = 8
59 )
60
61 var (
62         LogLevel_name = map[uint32]string{
63                 0: "VPE_API_LOG_LEVEL_EMERG",
64                 1: "VPE_API_LOG_LEVEL_ALERT",
65                 2: "VPE_API_LOG_LEVEL_CRIT",
66                 3: "VPE_API_LOG_LEVEL_ERR",
67                 4: "VPE_API_LOG_LEVEL_WARNING",
68                 5: "VPE_API_LOG_LEVEL_NOTICE",
69                 6: "VPE_API_LOG_LEVEL_INFO",
70                 7: "VPE_API_LOG_LEVEL_DEBUG",
71                 8: "VPE_API_LOG_LEVEL_DISABLED",
72         }
73         LogLevel_value = map[string]uint32{
74                 "VPE_API_LOG_LEVEL_EMERG":    0,
75                 "VPE_API_LOG_LEVEL_ALERT":    1,
76                 "VPE_API_LOG_LEVEL_CRIT":     2,
77                 "VPE_API_LOG_LEVEL_ERR":      3,
78                 "VPE_API_LOG_LEVEL_WARNING":  4,
79                 "VPE_API_LOG_LEVEL_NOTICE":   5,
80                 "VPE_API_LOG_LEVEL_INFO":     6,
81                 "VPE_API_LOG_LEVEL_DEBUG":    7,
82                 "VPE_API_LOG_LEVEL_DISABLED": 8,
83         }
84 )
85
86 func (x LogLevel) String() string {
87         s, ok := LogLevel_name[uint32(x)]
88         if ok {
89                 return s
90         }
91         return "LogLevel(" + strconv.Itoa(int(x)) + ")"
92 }
93
94 // Timedelta represents VPP binary API alias 'timedelta'.
95 type Timedelta float64
96
97 // Timestamp represents VPP binary API alias 'timestamp'.
98 type Timestamp float64
99
100 // ThreadData represents VPP binary API type 'thread_data'.
101 type ThreadData struct {
102         ID        uint32 `binapi:"u32,name=id" json:"id,omitempty"`
103         Name      []byte `binapi:"u8[64],name=name" json:"name,omitempty" struc:"[64]byte"`
104         Type      []byte `binapi:"u8[64],name=type" json:"type,omitempty" struc:"[64]byte"`
105         PID       uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
106         CPUID     uint32 `binapi:"u32,name=cpu_id" json:"cpu_id,omitempty"`
107         Core      uint32 `binapi:"u32,name=core" json:"core,omitempty"`
108         CPUSocket uint32 `binapi:"u32,name=cpu_socket" json:"cpu_socket,omitempty"`
109 }
110
111 func (*ThreadData) GetTypeName() string { return "thread_data" }
112
113 // Version represents VPP binary API type 'version'.
114 type Version struct {
115         Major         uint32 `binapi:"u32,name=major" json:"major,omitempty"`
116         Minor         uint32 `binapi:"u32,name=minor" json:"minor,omitempty"`
117         Patch         uint32 `binapi:"u32,name=patch" json:"patch,omitempty"`
118         PreRelease    []byte `binapi:"u8[17],name=pre_release" json:"pre_release,omitempty" struc:"[17]byte"`
119         BuildMetadata []byte `binapi:"u8[17],name=build_metadata" json:"build_metadata,omitempty" struc:"[17]byte"`
120 }
121
122 func (*Version) GetTypeName() string { return "version" }
123
124 // AddNodeNext represents VPP binary API message 'add_node_next'.
125 type AddNodeNext struct {
126         NodeName []byte `binapi:"u8[64],name=node_name" json:"node_name,omitempty" struc:"[64]byte"`
127         NextName []byte `binapi:"u8[64],name=next_name" json:"next_name,omitempty" struc:"[64]byte"`
128 }
129
130 func (m *AddNodeNext) Reset()                        { *m = AddNodeNext{} }
131 func (*AddNodeNext) GetMessageName() string          { return "add_node_next" }
132 func (*AddNodeNext) GetCrcString() string            { return "9ab92f7a" }
133 func (*AddNodeNext) GetMessageType() api.MessageType { return api.RequestMessage }
134
135 func (m *AddNodeNext) Size() int {
136         if m == nil {
137                 return 0
138         }
139         var size int
140         // field[1] m.NodeName
141         size += 64
142         // field[1] m.NextName
143         size += 64
144         return size
145 }
146 func (m *AddNodeNext) Marshal(b []byte) ([]byte, error) {
147         o := binary.BigEndian
148         _ = o
149         pos := 0
150         _ = pos
151         var buf []byte
152         if b == nil {
153                 buf = make([]byte, m.Size())
154         } else {
155                 buf = b
156         }
157         // field[1] m.NodeName
158         for i := 0; i < 64; i++ {
159                 var x uint8
160                 if i < len(m.NodeName) {
161                         x = uint8(m.NodeName[i])
162                 }
163                 buf[pos] = uint8(x)
164                 pos += 1
165         }
166         // field[1] m.NextName
167         for i := 0; i < 64; i++ {
168                 var x uint8
169                 if i < len(m.NextName) {
170                         x = uint8(m.NextName[i])
171                 }
172                 buf[pos] = uint8(x)
173                 pos += 1
174         }
175         return buf, nil
176 }
177 func (m *AddNodeNext) Unmarshal(tmp []byte) error {
178         o := binary.BigEndian
179         _ = o
180         pos := 0
181         _ = pos
182         // field[1] m.NodeName
183         m.NodeName = make([]uint8, 64)
184         for i := 0; i < len(m.NodeName); i++ {
185                 m.NodeName[i] = uint8(tmp[pos])
186                 pos += 1
187         }
188         // field[1] m.NextName
189         m.NextName = make([]uint8, 64)
190         for i := 0; i < len(m.NextName); i++ {
191                 m.NextName[i] = uint8(tmp[pos])
192                 pos += 1
193         }
194         return nil
195 }
196
197 // AddNodeNextReply represents VPP binary API message 'add_node_next_reply'.
198 type AddNodeNextReply struct {
199         Retval    int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
200         NextIndex uint32 `binapi:"u32,name=next_index" json:"next_index,omitempty"`
201 }
202
203 func (m *AddNodeNextReply) Reset()                        { *m = AddNodeNextReply{} }
204 func (*AddNodeNextReply) GetMessageName() string          { return "add_node_next_reply" }
205 func (*AddNodeNextReply) GetCrcString() string            { return "2ed75f32" }
206 func (*AddNodeNextReply) GetMessageType() api.MessageType { return api.ReplyMessage }
207
208 func (m *AddNodeNextReply) Size() int {
209         if m == nil {
210                 return 0
211         }
212         var size int
213         // field[1] m.Retval
214         size += 4
215         // field[1] m.NextIndex
216         size += 4
217         return size
218 }
219 func (m *AddNodeNextReply) Marshal(b []byte) ([]byte, error) {
220         o := binary.BigEndian
221         _ = o
222         pos := 0
223         _ = pos
224         var buf []byte
225         if b == nil {
226                 buf = make([]byte, m.Size())
227         } else {
228                 buf = b
229         }
230         // field[1] m.Retval
231         o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
232         pos += 4
233         // field[1] m.NextIndex
234         o.PutUint32(buf[pos:pos+4], uint32(m.NextIndex))
235         pos += 4
236         return buf, nil
237 }
238 func (m *AddNodeNextReply) Unmarshal(tmp []byte) error {
239         o := binary.BigEndian
240         _ = o
241         pos := 0
242         _ = pos
243         // field[1] m.Retval
244         m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
245         pos += 4
246         // field[1] m.NextIndex
247         m.NextIndex = uint32(o.Uint32(tmp[pos : pos+4]))
248         pos += 4
249         return nil
250 }
251
252 // Cli represents VPP binary API message 'cli'.
253 type Cli struct {
254         CmdInShmem uint64 `binapi:"u64,name=cmd_in_shmem" json:"cmd_in_shmem,omitempty"`
255 }
256
257 func (m *Cli) Reset()                        { *m = Cli{} }
258 func (*Cli) GetMessageName() string          { return "cli" }
259 func (*Cli) GetCrcString() string            { return "23bfbfff" }
260 func (*Cli) GetMessageType() api.MessageType { return api.RequestMessage }
261
262 func (m *Cli) Size() int {
263         if m == nil {
264                 return 0
265         }
266         var size int
267         // field[1] m.CmdInShmem
268         size += 8
269         return size
270 }
271 func (m *Cli) Marshal(b []byte) ([]byte, error) {
272         o := binary.BigEndian
273         _ = o
274         pos := 0
275         _ = pos
276         var buf []byte
277         if b == nil {
278                 buf = make([]byte, m.Size())
279         } else {
280                 buf = b
281         }
282         // field[1] m.CmdInShmem
283         o.PutUint64(buf[pos:pos+8], uint64(m.CmdInShmem))
284         pos += 8
285         return buf, nil
286 }
287 func (m *Cli) Unmarshal(tmp []byte) error {
288         o := binary.BigEndian
289         _ = o
290         pos := 0
291         _ = pos
292         // field[1] m.CmdInShmem
293         m.CmdInShmem = uint64(o.Uint64(tmp[pos : pos+8]))
294         pos += 8
295         return nil
296 }
297
298 // CliInband represents VPP binary API message 'cli_inband'.
299 type CliInband struct {
300         XXX_CmdLen uint32 `struc:"sizeof=Cmd"`
301         Cmd        string `json:"cmd,omitempty"`
302 }
303
304 func (m *CliInband) Reset()                        { *m = CliInband{} }
305 func (*CliInband) GetMessageName() string          { return "cli_inband" }
306 func (*CliInband) GetCrcString() string            { return "f8377302" }
307 func (*CliInband) GetMessageType() api.MessageType { return api.RequestMessage }
308
309 func (m *CliInband) Size() int {
310         if m == nil {
311                 return 0
312         }
313         var size int
314         // field[1] m.Cmd
315         size += 4 + len(m.Cmd)
316         return size
317 }
318 func (m *CliInband) Marshal(b []byte) ([]byte, error) {
319         o := binary.BigEndian
320         _ = o
321         pos := 0
322         _ = pos
323         var buf []byte
324         if b == nil {
325                 buf = make([]byte, m.Size())
326         } else {
327                 buf = b
328         }
329         // field[1] m.Cmd
330         o.PutUint32(buf[pos:pos+4], uint32(len(m.Cmd)))
331         pos += 4
332         copy(buf[pos:pos+len(m.Cmd)], m.Cmd[:])
333         pos += len(m.Cmd)
334         return buf, nil
335 }
336 func (m *CliInband) Unmarshal(tmp []byte) error {
337         o := binary.BigEndian
338         _ = o
339         pos := 0
340         _ = pos
341         // field[1] m.Cmd
342         {
343                 siz := o.Uint32(tmp[pos : pos+4])
344                 pos += 4
345                 m.Cmd = codec.DecodeString(tmp[pos : pos+int(siz)])
346                 pos += len(m.Cmd)
347         }
348         return nil
349 }
350
351 // CliInbandReply represents VPP binary API message 'cli_inband_reply'.
352 type CliInbandReply struct {
353         Retval       int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
354         XXX_ReplyLen uint32 `struc:"sizeof=Reply"`
355         Reply        string `json:"reply,omitempty"`
356 }
357
358 func (m *CliInbandReply) Reset()                        { *m = CliInbandReply{} }
359 func (*CliInbandReply) GetMessageName() string          { return "cli_inband_reply" }
360 func (*CliInbandReply) GetCrcString() string            { return "05879051" }
361 func (*CliInbandReply) GetMessageType() api.MessageType { return api.ReplyMessage }
362
363 func (m *CliInbandReply) Size() int {
364         if m == nil {
365                 return 0
366         }
367         var size int
368         // field[1] m.Retval
369         size += 4
370         // field[1] m.Reply
371         size += 4 + len(m.Reply)
372         return size
373 }
374 func (m *CliInbandReply) Marshal(b []byte) ([]byte, error) {
375         o := binary.BigEndian
376         _ = o
377         pos := 0
378         _ = pos
379         var buf []byte
380         if b == nil {
381                 buf = make([]byte, m.Size())
382         } else {
383                 buf = b
384         }
385         // field[1] m.Retval
386         o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
387         pos += 4
388         // field[1] m.Reply
389         o.PutUint32(buf[pos:pos+4], uint32(len(m.Reply)))
390         pos += 4
391         copy(buf[pos:pos+len(m.Reply)], m.Reply[:])
392         pos += len(m.Reply)
393         return buf, nil
394 }
395 func (m *CliInbandReply) Unmarshal(tmp []byte) error {
396         o := binary.BigEndian
397         _ = o
398         pos := 0
399         _ = pos
400         // field[1] m.Retval
401         m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
402         pos += 4
403         // field[1] m.Reply
404         {
405                 siz := o.Uint32(tmp[pos : pos+4])
406                 pos += 4
407                 m.Reply = codec.DecodeString(tmp[pos : pos+int(siz)])
408                 pos += len(m.Reply)
409         }
410         return nil
411 }
412
413 // CliReply represents VPP binary API message 'cli_reply'.
414 type CliReply struct {
415         Retval       int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
416         ReplyInShmem uint64 `binapi:"u64,name=reply_in_shmem" json:"reply_in_shmem,omitempty"`
417 }
418
419 func (m *CliReply) Reset()                        { *m = CliReply{} }
420 func (*CliReply) GetMessageName() string          { return "cli_reply" }
421 func (*CliReply) GetCrcString() string            { return "06d68297" }
422 func (*CliReply) GetMessageType() api.MessageType { return api.ReplyMessage }
423
424 func (m *CliReply) Size() int {
425         if m == nil {
426                 return 0
427         }
428         var size int
429         // field[1] m.Retval
430         size += 4
431         // field[1] m.ReplyInShmem
432         size += 8
433         return size
434 }
435 func (m *CliReply) Marshal(b []byte) ([]byte, error) {
436         o := binary.BigEndian
437         _ = o
438         pos := 0
439         _ = pos
440         var buf []byte
441         if b == nil {
442                 buf = make([]byte, m.Size())
443         } else {
444                 buf = b
445         }
446         // field[1] m.Retval
447         o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
448         pos += 4
449         // field[1] m.ReplyInShmem
450         o.PutUint64(buf[pos:pos+8], uint64(m.ReplyInShmem))
451         pos += 8
452         return buf, nil
453 }
454 func (m *CliReply) Unmarshal(tmp []byte) error {
455         o := binary.BigEndian
456         _ = o
457         pos := 0
458         _ = pos
459         // field[1] m.Retval
460         m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
461         pos += 4
462         // field[1] m.ReplyInShmem
463         m.ReplyInShmem = uint64(o.Uint64(tmp[pos : pos+8]))
464         pos += 8
465         return nil
466 }
467
468 // ControlPing represents VPP binary API message 'control_ping'.
469 type ControlPing struct{}
470
471 func (m *ControlPing) Reset()                        { *m = ControlPing{} }
472 func (*ControlPing) GetMessageName() string          { return "control_ping" }
473 func (*ControlPing) GetCrcString() string            { return "51077d14" }
474 func (*ControlPing) GetMessageType() api.MessageType { return api.RequestMessage }
475
476 func (m *ControlPing) Size() int {
477         if m == nil {
478                 return 0
479         }
480         var size int
481         return size
482 }
483 func (m *ControlPing) Marshal(b []byte) ([]byte, error) {
484         o := binary.BigEndian
485         _ = o
486         pos := 0
487         _ = pos
488         var buf []byte
489         if b == nil {
490                 buf = make([]byte, m.Size())
491         } else {
492                 buf = b
493         }
494         return buf, nil
495 }
496 func (m *ControlPing) Unmarshal(tmp []byte) error {
497         o := binary.BigEndian
498         _ = o
499         pos := 0
500         _ = pos
501         return nil
502 }
503
504 // ControlPingReply represents VPP binary API message 'control_ping_reply'.
505 type ControlPingReply struct {
506         Retval      int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
507         ClientIndex uint32 `binapi:"u32,name=client_index" json:"client_index,omitempty"`
508         VpePID      uint32 `binapi:"u32,name=vpe_pid" json:"vpe_pid,omitempty"`
509 }
510
511 func (m *ControlPingReply) Reset()                        { *m = ControlPingReply{} }
512 func (*ControlPingReply) GetMessageName() string          { return "control_ping_reply" }
513 func (*ControlPingReply) GetCrcString() string            { return "f6b0b8ca" }
514 func (*ControlPingReply) GetMessageType() api.MessageType { return api.ReplyMessage }
515
516 func (m *ControlPingReply) Size() int {
517         if m == nil {
518                 return 0
519         }
520         var size int
521         // field[1] m.Retval
522         size += 4
523         // field[1] m.ClientIndex
524         size += 4
525         // field[1] m.VpePID
526         size += 4
527         return size
528 }
529 func (m *ControlPingReply) Marshal(b []byte) ([]byte, error) {
530         o := binary.BigEndian
531         _ = o
532         pos := 0
533         _ = pos
534         var buf []byte
535         if b == nil {
536                 buf = make([]byte, m.Size())
537         } else {
538                 buf = b
539         }
540         // field[1] m.Retval
541         o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
542         pos += 4
543         // field[1] m.ClientIndex
544         o.PutUint32(buf[pos:pos+4], uint32(m.ClientIndex))
545         pos += 4
546         // field[1] m.VpePID
547         o.PutUint32(buf[pos:pos+4], uint32(m.VpePID))
548         pos += 4
549         return buf, nil
550 }
551 func (m *ControlPingReply) Unmarshal(tmp []byte) error {
552         o := binary.BigEndian
553         _ = o
554         pos := 0
555         _ = pos
556         // field[1] m.Retval
557         m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
558         pos += 4
559         // field[1] m.ClientIndex
560         m.ClientIndex = uint32(o.Uint32(tmp[pos : pos+4]))
561         pos += 4
562         // field[1] m.VpePID
563         m.VpePID = uint32(o.Uint32(tmp[pos : pos+4]))
564         pos += 4
565         return nil
566 }
567
568 // GetF64EndianValue represents VPP binary API message 'get_f64_endian_value'.
569 type GetF64EndianValue struct {
570         F64One float64 `binapi:"f64,name=f64_one,default=1" json:"f64_one,omitempty"`
571 }
572
573 func (m *GetF64EndianValue) Reset()                        { *m = GetF64EndianValue{} }
574 func (*GetF64EndianValue) GetMessageName() string          { return "get_f64_endian_value" }
575 func (*GetF64EndianValue) GetCrcString() string            { return "809fcd44" }
576 func (*GetF64EndianValue) GetMessageType() api.MessageType { return api.RequestMessage }
577
578 func (m *GetF64EndianValue) Size() int {
579         if m == nil {
580                 return 0
581         }
582         var size int
583         // field[1] m.F64One
584         size += 8
585         return size
586 }
587 func (m *GetF64EndianValue) Marshal(b []byte) ([]byte, error) {
588         o := binary.BigEndian
589         _ = o
590         pos := 0
591         _ = pos
592         var buf []byte
593         if b == nil {
594                 buf = make([]byte, m.Size())
595         } else {
596                 buf = b
597         }
598         // field[1] m.F64One
599         o.PutUint64(buf[pos:pos+8], math.Float64bits(float64(m.F64One)))
600         pos += 8
601         return buf, nil
602 }
603 func (m *GetF64EndianValue) Unmarshal(tmp []byte) error {
604         o := binary.BigEndian
605         _ = o
606         pos := 0
607         _ = pos
608         // field[1] m.F64One
609         m.F64One = float64(math.Float64frombits(o.Uint64(tmp[pos : pos+8])))
610         pos += 8
611         return nil
612 }
613
614 // GetF64EndianValueReply represents VPP binary API message 'get_f64_endian_value_reply'.
615 type GetF64EndianValueReply struct {
616         Retval       uint32  `binapi:"u32,name=retval" json:"retval,omitempty"`
617         F64OneResult float64 `binapi:"f64,name=f64_one_result" json:"f64_one_result,omitempty"`
618 }
619
620 func (m *GetF64EndianValueReply) Reset()                        { *m = GetF64EndianValueReply{} }
621 func (*GetF64EndianValueReply) GetMessageName() string          { return "get_f64_endian_value_reply" }
622 func (*GetF64EndianValueReply) GetCrcString() string            { return "7e02e404" }
623 func (*GetF64EndianValueReply) GetMessageType() api.MessageType { return api.ReplyMessage }
624
625 func (m *GetF64EndianValueReply) Size() int {
626         if m == nil {
627                 return 0
628         }
629         var size int
630         // field[1] m.Retval
631         size += 4
632         // field[1] m.F64OneResult
633         size += 8
634         return size
635 }
636 func (m *GetF64EndianValueReply) Marshal(b []byte) ([]byte, error) {
637         o := binary.BigEndian
638         _ = o
639         pos := 0
640         _ = pos
641         var buf []byte
642         if b == nil {
643                 buf = make([]byte, m.Size())
644         } else {
645                 buf = b
646         }
647         // field[1] m.Retval
648         o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
649         pos += 4
650         // field[1] m.F64OneResult
651         o.PutUint64(buf[pos:pos+8], math.Float64bits(float64(m.F64OneResult)))
652         pos += 8
653         return buf, nil
654 }
655 func (m *GetF64EndianValueReply) Unmarshal(tmp []byte) error {
656         o := binary.BigEndian
657         _ = o
658         pos := 0
659         _ = pos
660         // field[1] m.Retval
661         m.Retval = uint32(o.Uint32(tmp[pos : pos+4]))
662         pos += 4
663         // field[1] m.F64OneResult
664         m.F64OneResult = float64(math.Float64frombits(o.Uint64(tmp[pos : pos+8])))
665         pos += 8
666         return nil
667 }
668
669 // GetF64IncrementByOne represents VPP binary API message 'get_f64_increment_by_one'.
670 type GetF64IncrementByOne struct {
671         F64Value float64 `binapi:"f64,name=f64_value,default=1" json:"f64_value,omitempty"`
672 }
673
674 func (m *GetF64IncrementByOne) Reset()                        { *m = GetF64IncrementByOne{} }
675 func (*GetF64IncrementByOne) GetMessageName() string          { return "get_f64_increment_by_one" }
676 func (*GetF64IncrementByOne) GetCrcString() string            { return "b64f027e" }
677 func (*GetF64IncrementByOne) GetMessageType() api.MessageType { return api.RequestMessage }
678
679 func (m *GetF64IncrementByOne) Size() int {
680         if m == nil {
681                 return 0
682         }
683         var size int
684         // field[1] m.F64Value
685         size += 8
686         return size
687 }
688 func (m *GetF64IncrementByOne) Marshal(b []byte) ([]byte, error) {
689         o := binary.BigEndian
690         _ = o
691         pos := 0
692         _ = pos
693         var buf []byte
694         if b == nil {
695                 buf = make([]byte, m.Size())
696         } else {
697                 buf = b
698         }
699         // field[1] m.F64Value
700         o.PutUint64(buf[pos:pos+8], math.Float64bits(float64(m.F64Value)))
701         pos += 8
702         return buf, nil
703 }
704 func (m *GetF64IncrementByOne) Unmarshal(tmp []byte) error {
705         o := binary.BigEndian
706         _ = o
707         pos := 0
708         _ = pos
709         // field[1] m.F64Value
710         m.F64Value = float64(math.Float64frombits(o.Uint64(tmp[pos : pos+8])))
711         pos += 8
712         return nil
713 }
714
715 // GetF64IncrementByOneReply represents VPP binary API message 'get_f64_increment_by_one_reply'.
716 type GetF64IncrementByOneReply struct {
717         Retval   uint32  `binapi:"u32,name=retval" json:"retval,omitempty"`
718         F64Value float64 `binapi:"f64,name=f64_value" json:"f64_value,omitempty"`
719 }
720
721 func (m *GetF64IncrementByOneReply) Reset()                        { *m = GetF64IncrementByOneReply{} }
722 func (*GetF64IncrementByOneReply) GetMessageName() string          { return "get_f64_increment_by_one_reply" }
723 func (*GetF64IncrementByOneReply) GetCrcString() string            { return "d25dbaa3" }
724 func (*GetF64IncrementByOneReply) GetMessageType() api.MessageType { return api.ReplyMessage }
725
726 func (m *GetF64IncrementByOneReply) Size() int {
727         if m == nil {
728                 return 0
729         }
730         var size int
731         // field[1] m.Retval
732         size += 4
733         // field[1] m.F64Value
734         size += 8
735         return size
736 }
737 func (m *GetF64IncrementByOneReply) Marshal(b []byte) ([]byte, error) {
738         o := binary.BigEndian
739         _ = o
740         pos := 0
741         _ = pos
742         var buf []byte
743         if b == nil {
744                 buf = make([]byte, m.Size())
745         } else {
746                 buf = b
747         }
748         // field[1] m.Retval
749         o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
750         pos += 4
751         // field[1] m.F64Value
752         o.PutUint64(buf[pos:pos+8], math.Float64bits(float64(m.F64Value)))
753         pos += 8
754         return buf, nil
755 }
756 func (m *GetF64IncrementByOneReply) Unmarshal(tmp []byte) error {
757         o := binary.BigEndian
758         _ = o
759         pos := 0
760         _ = pos
761         // field[1] m.Retval
762         m.Retval = uint32(o.Uint32(tmp[pos : pos+4]))
763         pos += 4
764         // field[1] m.F64Value
765         m.F64Value = float64(math.Float64frombits(o.Uint64(tmp[pos : pos+8])))
766         pos += 8
767         return nil
768 }
769
770 // GetNextIndex represents VPP binary API message 'get_next_index'.
771 type GetNextIndex struct {
772         NodeName []byte `binapi:"u8[64],name=node_name" json:"node_name,omitempty" struc:"[64]byte"`
773         NextName []byte `binapi:"u8[64],name=next_name" json:"next_name,omitempty" struc:"[64]byte"`
774 }
775
776 func (m *GetNextIndex) Reset()                        { *m = GetNextIndex{} }
777 func (*GetNextIndex) GetMessageName() string          { return "get_next_index" }
778 func (*GetNextIndex) GetCrcString() string            { return "9ab92f7a" }
779 func (*GetNextIndex) GetMessageType() api.MessageType { return api.RequestMessage }
780
781 func (m *GetNextIndex) Size() int {
782         if m == nil {
783                 return 0
784         }
785         var size int
786         // field[1] m.NodeName
787         size += 64
788         // field[1] m.NextName
789         size += 64
790         return size
791 }
792 func (m *GetNextIndex) Marshal(b []byte) ([]byte, error) {
793         o := binary.BigEndian
794         _ = o
795         pos := 0
796         _ = pos
797         var buf []byte
798         if b == nil {
799                 buf = make([]byte, m.Size())
800         } else {
801                 buf = b
802         }
803         // field[1] m.NodeName
804         for i := 0; i < 64; i++ {
805                 var x uint8
806                 if i < len(m.NodeName) {
807                         x = uint8(m.NodeName[i])
808                 }
809                 buf[pos] = uint8(x)
810                 pos += 1
811         }
812         // field[1] m.NextName
813         for i := 0; i < 64; i++ {
814                 var x uint8
815                 if i < len(m.NextName) {
816                         x = uint8(m.NextName[i])
817                 }
818                 buf[pos] = uint8(x)
819                 pos += 1
820         }
821         return buf, nil
822 }
823 func (m *GetNextIndex) Unmarshal(tmp []byte) error {
824         o := binary.BigEndian
825         _ = o
826         pos := 0
827         _ = pos
828         // field[1] m.NodeName
829         m.NodeName = make([]uint8, 64)
830         for i := 0; i < len(m.NodeName); i++ {
831                 m.NodeName[i] = uint8(tmp[pos])
832                 pos += 1
833         }
834         // field[1] m.NextName
835         m.NextName = make([]uint8, 64)
836         for i := 0; i < len(m.NextName); i++ {
837                 m.NextName[i] = uint8(tmp[pos])
838                 pos += 1
839         }
840         return nil
841 }
842
843 // GetNextIndexReply represents VPP binary API message 'get_next_index_reply'.
844 type GetNextIndexReply struct {
845         Retval    int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
846         NextIndex uint32 `binapi:"u32,name=next_index" json:"next_index,omitempty"`
847 }
848
849 func (m *GetNextIndexReply) Reset()                        { *m = GetNextIndexReply{} }
850 func (*GetNextIndexReply) GetMessageName() string          { return "get_next_index_reply" }
851 func (*GetNextIndexReply) GetCrcString() string            { return "2ed75f32" }
852 func (*GetNextIndexReply) GetMessageType() api.MessageType { return api.ReplyMessage }
853
854 func (m *GetNextIndexReply) Size() int {
855         if m == nil {
856                 return 0
857         }
858         var size int
859         // field[1] m.Retval
860         size += 4
861         // field[1] m.NextIndex
862         size += 4
863         return size
864 }
865 func (m *GetNextIndexReply) Marshal(b []byte) ([]byte, error) {
866         o := binary.BigEndian
867         _ = o
868         pos := 0
869         _ = pos
870         var buf []byte
871         if b == nil {
872                 buf = make([]byte, m.Size())
873         } else {
874                 buf = b
875         }
876         // field[1] m.Retval
877         o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
878         pos += 4
879         // field[1] m.NextIndex
880         o.PutUint32(buf[pos:pos+4], uint32(m.NextIndex))
881         pos += 4
882         return buf, nil
883 }
884 func (m *GetNextIndexReply) Unmarshal(tmp []byte) error {
885         o := binary.BigEndian
886         _ = o
887         pos := 0
888         _ = pos
889         // field[1] m.Retval
890         m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
891         pos += 4
892         // field[1] m.NextIndex
893         m.NextIndex = uint32(o.Uint32(tmp[pos : pos+4]))
894         pos += 4
895         return nil
896 }
897
898 // GetNodeGraph represents VPP binary API message 'get_node_graph'.
899 type GetNodeGraph struct{}
900
901 func (m *GetNodeGraph) Reset()                        { *m = GetNodeGraph{} }
902 func (*GetNodeGraph) GetMessageName() string          { return "get_node_graph" }
903 func (*GetNodeGraph) GetCrcString() string            { return "51077d14" }
904 func (*GetNodeGraph) GetMessageType() api.MessageType { return api.RequestMessage }
905
906 func (m *GetNodeGraph) Size() int {
907         if m == nil {
908                 return 0
909         }
910         var size int
911         return size
912 }
913 func (m *GetNodeGraph) Marshal(b []byte) ([]byte, error) {
914         o := binary.BigEndian
915         _ = o
916         pos := 0
917         _ = pos
918         var buf []byte
919         if b == nil {
920                 buf = make([]byte, m.Size())
921         } else {
922                 buf = b
923         }
924         return buf, nil
925 }
926 func (m *GetNodeGraph) Unmarshal(tmp []byte) error {
927         o := binary.BigEndian
928         _ = o
929         pos := 0
930         _ = pos
931         return nil
932 }
933
934 // GetNodeGraphReply represents VPP binary API message 'get_node_graph_reply'.
935 type GetNodeGraphReply struct {
936         Retval       int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
937         ReplyInShmem uint64 `binapi:"u64,name=reply_in_shmem" json:"reply_in_shmem,omitempty"`
938 }
939
940 func (m *GetNodeGraphReply) Reset()                        { *m = GetNodeGraphReply{} }
941 func (*GetNodeGraphReply) GetMessageName() string          { return "get_node_graph_reply" }
942 func (*GetNodeGraphReply) GetCrcString() string            { return "06d68297" }
943 func (*GetNodeGraphReply) GetMessageType() api.MessageType { return api.ReplyMessage }
944
945 func (m *GetNodeGraphReply) Size() int {
946         if m == nil {
947                 return 0
948         }
949         var size int
950         // field[1] m.Retval
951         size += 4
952         // field[1] m.ReplyInShmem
953         size += 8
954         return size
955 }
956 func (m *GetNodeGraphReply) Marshal(b []byte) ([]byte, error) {
957         o := binary.BigEndian
958         _ = o
959         pos := 0
960         _ = pos
961         var buf []byte
962         if b == nil {
963                 buf = make([]byte, m.Size())
964         } else {
965                 buf = b
966         }
967         // field[1] m.Retval
968         o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
969         pos += 4
970         // field[1] m.ReplyInShmem
971         o.PutUint64(buf[pos:pos+8], uint64(m.ReplyInShmem))
972         pos += 8
973         return buf, nil
974 }
975 func (m *GetNodeGraphReply) Unmarshal(tmp []byte) error {
976         o := binary.BigEndian
977         _ = o
978         pos := 0
979         _ = pos
980         // field[1] m.Retval
981         m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
982         pos += 4
983         // field[1] m.ReplyInShmem
984         m.ReplyInShmem = uint64(o.Uint64(tmp[pos : pos+8]))
985         pos += 8
986         return nil
987 }
988
989 // GetNodeIndex represents VPP binary API message 'get_node_index'.
990 type GetNodeIndex struct {
991         NodeName []byte `binapi:"u8[64],name=node_name" json:"node_name,omitempty" struc:"[64]byte"`
992 }
993
994 func (m *GetNodeIndex) Reset()                        { *m = GetNodeIndex{} }
995 func (*GetNodeIndex) GetMessageName() string          { return "get_node_index" }
996 func (*GetNodeIndex) GetCrcString() string            { return "6c9a495d" }
997 func (*GetNodeIndex) GetMessageType() api.MessageType { return api.RequestMessage }
998
999 func (m *GetNodeIndex) Size() int {
1000         if m == nil {
1001                 return 0
1002         }
1003         var size int
1004         // field[1] m.NodeName
1005         size += 64
1006         return size
1007 }
1008 func (m *GetNodeIndex) Marshal(b []byte) ([]byte, error) {
1009         o := binary.BigEndian
1010         _ = o
1011         pos := 0
1012         _ = pos
1013         var buf []byte
1014         if b == nil {
1015                 buf = make([]byte, m.Size())
1016         } else {
1017                 buf = b
1018         }
1019         // field[1] m.NodeName
1020         for i := 0; i < 64; i++ {
1021                 var x uint8
1022                 if i < len(m.NodeName) {
1023                         x = uint8(m.NodeName[i])
1024                 }
1025                 buf[pos] = uint8(x)
1026                 pos += 1
1027         }
1028         return buf, nil
1029 }
1030 func (m *GetNodeIndex) Unmarshal(tmp []byte) error {
1031         o := binary.BigEndian
1032         _ = o
1033         pos := 0
1034         _ = pos
1035         // field[1] m.NodeName
1036         m.NodeName = make([]uint8, 64)
1037         for i := 0; i < len(m.NodeName); i++ {
1038                 m.NodeName[i] = uint8(tmp[pos])
1039                 pos += 1
1040         }
1041         return nil
1042 }
1043
1044 // GetNodeIndexReply represents VPP binary API message 'get_node_index_reply'.
1045 type GetNodeIndexReply struct {
1046         Retval    int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
1047         NodeIndex uint32 `binapi:"u32,name=node_index" json:"node_index,omitempty"`
1048 }
1049
1050 func (m *GetNodeIndexReply) Reset()                        { *m = GetNodeIndexReply{} }
1051 func (*GetNodeIndexReply) GetMessageName() string          { return "get_node_index_reply" }
1052 func (*GetNodeIndexReply) GetCrcString() string            { return "a8600b89" }
1053 func (*GetNodeIndexReply) GetMessageType() api.MessageType { return api.ReplyMessage }
1054
1055 func (m *GetNodeIndexReply) Size() int {
1056         if m == nil {
1057                 return 0
1058         }
1059         var size int
1060         // field[1] m.Retval
1061         size += 4
1062         // field[1] m.NodeIndex
1063         size += 4
1064         return size
1065 }
1066 func (m *GetNodeIndexReply) Marshal(b []byte) ([]byte, error) {
1067         o := binary.BigEndian
1068         _ = o
1069         pos := 0
1070         _ = pos
1071         var buf []byte
1072         if b == nil {
1073                 buf = make([]byte, m.Size())
1074         } else {
1075                 buf = b
1076         }
1077         // field[1] m.Retval
1078         o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
1079         pos += 4
1080         // field[1] m.NodeIndex
1081         o.PutUint32(buf[pos:pos+4], uint32(m.NodeIndex))
1082         pos += 4
1083         return buf, nil
1084 }
1085 func (m *GetNodeIndexReply) Unmarshal(tmp []byte) error {
1086         o := binary.BigEndian
1087         _ = o
1088         pos := 0
1089         _ = pos
1090         // field[1] m.Retval
1091         m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
1092         pos += 4
1093         // field[1] m.NodeIndex
1094         m.NodeIndex = uint32(o.Uint32(tmp[pos : pos+4]))
1095         pos += 4
1096         return nil
1097 }
1098
1099 // LogDetails represents VPP binary API message 'log_details'.
1100 type LogDetails struct {
1101         Timestamp Timestamp `binapi:"timestamp,name=timestamp" json:"timestamp,omitempty"`
1102         Level     LogLevel  `binapi:"log_level,name=level" json:"level,omitempty"`
1103         MsgClass  string    `binapi:"string[32],name=msg_class" json:"msg_class,omitempty" struc:"[32]byte"`
1104         Message   string    `binapi:"string[256],name=message" json:"message,omitempty" struc:"[256]byte"`
1105 }
1106
1107 func (m *LogDetails) Reset()                        { *m = LogDetails{} }
1108 func (*LogDetails) GetMessageName() string          { return "log_details" }
1109 func (*LogDetails) GetCrcString() string            { return "255827a1" }
1110 func (*LogDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
1111
1112 func (m *LogDetails) Size() int {
1113         if m == nil {
1114                 return 0
1115         }
1116         var size int
1117         // field[1] m.Timestamp
1118         size += 8
1119         // field[1] m.Level
1120         size += 4
1121         // field[1] m.MsgClass
1122         size += 32
1123         // field[1] m.Message
1124         size += 256
1125         return size
1126 }
1127 func (m *LogDetails) Marshal(b []byte) ([]byte, error) {
1128         o := binary.BigEndian
1129         _ = o
1130         pos := 0
1131         _ = pos
1132         var buf []byte
1133         if b == nil {
1134                 buf = make([]byte, m.Size())
1135         } else {
1136                 buf = b
1137         }
1138         // field[1] m.Timestamp
1139         o.PutUint64(buf[pos:pos+8], math.Float64bits(float64(m.Timestamp)))
1140         pos += 8
1141         // field[1] m.Level
1142         o.PutUint32(buf[pos:pos+4], uint32(m.Level))
1143         pos += 4
1144         // field[1] m.MsgClass
1145         copy(buf[pos:pos+32], m.MsgClass)
1146         pos += 32
1147         // field[1] m.Message
1148         copy(buf[pos:pos+256], m.Message)
1149         pos += 256
1150         return buf, nil
1151 }
1152 func (m *LogDetails) Unmarshal(tmp []byte) error {
1153         o := binary.BigEndian
1154         _ = o
1155         pos := 0
1156         _ = pos
1157         // field[1] m.Timestamp
1158         m.Timestamp = Timestamp(math.Float64frombits(o.Uint64(tmp[pos : pos+8])))
1159         pos += 8
1160         // field[1] m.Level
1161         m.Level = LogLevel(o.Uint32(tmp[pos : pos+4]))
1162         pos += 4
1163         // field[1] m.MsgClass
1164         {
1165                 nul := bytes.Index(tmp[pos:pos+32], []byte{0x00})
1166                 m.MsgClass = codec.DecodeString(tmp[pos : pos+nul])
1167                 pos += 32
1168         }
1169         // field[1] m.Message
1170         {
1171                 nul := bytes.Index(tmp[pos:pos+256], []byte{0x00})
1172                 m.Message = codec.DecodeString(tmp[pos : pos+nul])
1173                 pos += 256
1174         }
1175         return nil
1176 }
1177
1178 // LogDump represents VPP binary API message 'log_dump'.
1179 type LogDump struct {
1180         StartTimestamp Timestamp `binapi:"timestamp,name=start_timestamp" json:"start_timestamp,omitempty"`
1181 }
1182
1183 func (m *LogDump) Reset()                        { *m = LogDump{} }
1184 func (*LogDump) GetMessageName() string          { return "log_dump" }
1185 func (*LogDump) GetCrcString() string            { return "6ab31753" }
1186 func (*LogDump) GetMessageType() api.MessageType { return api.RequestMessage }
1187
1188 func (m *LogDump) Size() int {
1189         if m == nil {
1190                 return 0
1191         }
1192         var size int
1193         // field[1] m.StartTimestamp
1194         size += 8
1195         return size
1196 }
1197 func (m *LogDump) Marshal(b []byte) ([]byte, error) {
1198         o := binary.BigEndian
1199         _ = o
1200         pos := 0
1201         _ = pos
1202         var buf []byte
1203         if b == nil {
1204                 buf = make([]byte, m.Size())
1205         } else {
1206                 buf = b
1207         }
1208         // field[1] m.StartTimestamp
1209         o.PutUint64(buf[pos:pos+8], math.Float64bits(float64(m.StartTimestamp)))
1210         pos += 8
1211         return buf, nil
1212 }
1213 func (m *LogDump) Unmarshal(tmp []byte) error {
1214         o := binary.BigEndian
1215         _ = o
1216         pos := 0
1217         _ = pos
1218         // field[1] m.StartTimestamp
1219         m.StartTimestamp = Timestamp(math.Float64frombits(o.Uint64(tmp[pos : pos+8])))
1220         pos += 8
1221         return nil
1222 }
1223
1224 // ShowThreads represents VPP binary API message 'show_threads'.
1225 type ShowThreads struct{}
1226
1227 func (m *ShowThreads) Reset()                        { *m = ShowThreads{} }
1228 func (*ShowThreads) GetMessageName() string          { return "show_threads" }
1229 func (*ShowThreads) GetCrcString() string            { return "51077d14" }
1230 func (*ShowThreads) GetMessageType() api.MessageType { return api.RequestMessage }
1231
1232 func (m *ShowThreads) Size() int {
1233         if m == nil {
1234                 return 0
1235         }
1236         var size int
1237         return size
1238 }
1239 func (m *ShowThreads) Marshal(b []byte) ([]byte, error) {
1240         o := binary.BigEndian
1241         _ = o
1242         pos := 0
1243         _ = pos
1244         var buf []byte
1245         if b == nil {
1246                 buf = make([]byte, m.Size())
1247         } else {
1248                 buf = b
1249         }
1250         return buf, nil
1251 }
1252 func (m *ShowThreads) Unmarshal(tmp []byte) error {
1253         o := binary.BigEndian
1254         _ = o
1255         pos := 0
1256         _ = pos
1257         return nil
1258 }
1259
1260 // ShowThreadsReply represents VPP binary API message 'show_threads_reply'.
1261 type ShowThreadsReply struct {
1262         Retval     int32        `binapi:"i32,name=retval" json:"retval,omitempty"`
1263         Count      uint32       `binapi:"u32,name=count" json:"count,omitempty" struc:"sizeof=ThreadData"`
1264         ThreadData []ThreadData `binapi:"thread_data[count],name=thread_data" json:"thread_data,omitempty"`
1265 }
1266
1267 func (m *ShowThreadsReply) Reset()                        { *m = ShowThreadsReply{} }
1268 func (*ShowThreadsReply) GetMessageName() string          { return "show_threads_reply" }
1269 func (*ShowThreadsReply) GetCrcString() string            { return "f5e0b66f" }
1270 func (*ShowThreadsReply) GetMessageType() api.MessageType { return api.ReplyMessage }
1271
1272 func (m *ShowThreadsReply) Size() int {
1273         if m == nil {
1274                 return 0
1275         }
1276         var size int
1277         // field[1] m.Retval
1278         size += 4
1279         // field[1] m.Count
1280         size += 4
1281         // field[1] m.ThreadData
1282         for j1 := 0; j1 < len(m.ThreadData); j1++ {
1283                 var s1 ThreadData
1284                 _ = s1
1285                 if j1 < len(m.ThreadData) {
1286                         s1 = m.ThreadData[j1]
1287                 }
1288                 // field[2] s1.ID
1289                 size += 4
1290                 // field[2] s1.Name
1291                 size += 64
1292                 // field[2] s1.Type
1293                 size += 64
1294                 // field[2] s1.PID
1295                 size += 4
1296                 // field[2] s1.CPUID
1297                 size += 4
1298                 // field[2] s1.Core
1299                 size += 4
1300                 // field[2] s1.CPUSocket
1301                 size += 4
1302         }
1303         return size
1304 }
1305 func (m *ShowThreadsReply) Marshal(b []byte) ([]byte, error) {
1306         o := binary.BigEndian
1307         _ = o
1308         pos := 0
1309         _ = pos
1310         var buf []byte
1311         if b == nil {
1312                 buf = make([]byte, m.Size())
1313         } else {
1314                 buf = b
1315         }
1316         // field[1] m.Retval
1317         o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
1318         pos += 4
1319         // field[1] m.Count
1320         o.PutUint32(buf[pos:pos+4], uint32(len(m.ThreadData)))
1321         pos += 4
1322         // field[1] m.ThreadData
1323         for j1 := 0; j1 < len(m.ThreadData); j1++ {
1324                 var v1 ThreadData
1325                 if j1 < len(m.ThreadData) {
1326                         v1 = m.ThreadData[j1]
1327                 }
1328                 // field[2] v1.ID
1329                 o.PutUint32(buf[pos:pos+4], uint32(v1.ID))
1330                 pos += 4
1331                 // field[2] v1.Name
1332                 for i := 0; i < 64; i++ {
1333                         var x uint8
1334                         if i < len(v1.Name) {
1335                                 x = uint8(v1.Name[i])
1336                         }
1337                         buf[pos] = uint8(x)
1338                         pos += 1
1339                 }
1340                 // field[2] v1.Type
1341                 for i := 0; i < 64; i++ {
1342                         var x uint8
1343                         if i < len(v1.Type) {
1344                                 x = uint8(v1.Type[i])
1345                         }
1346                         buf[pos] = uint8(x)
1347                         pos += 1
1348                 }
1349                 // field[2] v1.PID
1350                 o.PutUint32(buf[pos:pos+4], uint32(v1.PID))
1351                 pos += 4
1352                 // field[2] v1.CPUID
1353                 o.PutUint32(buf[pos:pos+4], uint32(v1.CPUID))
1354                 pos += 4
1355                 // field[2] v1.Core
1356                 o.PutUint32(buf[pos:pos+4], uint32(v1.Core))
1357                 pos += 4
1358                 // field[2] v1.CPUSocket
1359                 o.PutUint32(buf[pos:pos+4], uint32(v1.CPUSocket))
1360                 pos += 4
1361         }
1362         return buf, nil
1363 }
1364 func (m *ShowThreadsReply) Unmarshal(tmp []byte) error {
1365         o := binary.BigEndian
1366         _ = o
1367         pos := 0
1368         _ = pos
1369         // field[1] m.Retval
1370         m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
1371         pos += 4
1372         // field[1] m.Count
1373         m.Count = uint32(o.Uint32(tmp[pos : pos+4]))
1374         pos += 4
1375         // field[1] m.ThreadData
1376         m.ThreadData = make([]ThreadData, int(m.Count))
1377         for j1 := 0; j1 < int(m.Count); j1++ {
1378                 // field[2] m.ThreadData[j1].ID
1379                 m.ThreadData[j1].ID = uint32(o.Uint32(tmp[pos : pos+4]))
1380                 pos += 4
1381                 // field[2] m.ThreadData[j1].Name
1382                 m.ThreadData[j1].Name = make([]uint8, 64)
1383                 for i := 0; i < len(m.ThreadData[j1].Name); i++ {
1384                         m.ThreadData[j1].Name[i] = uint8(tmp[pos])
1385                         pos += 1
1386                 }
1387                 // field[2] m.ThreadData[j1].Type
1388                 m.ThreadData[j1].Type = make([]uint8, 64)
1389                 for i := 0; i < len(m.ThreadData[j1].Type); i++ {
1390                         m.ThreadData[j1].Type[i] = uint8(tmp[pos])
1391                         pos += 1
1392                 }
1393                 // field[2] m.ThreadData[j1].PID
1394                 m.ThreadData[j1].PID = uint32(o.Uint32(tmp[pos : pos+4]))
1395                 pos += 4
1396                 // field[2] m.ThreadData[j1].CPUID
1397                 m.ThreadData[j1].CPUID = uint32(o.Uint32(tmp[pos : pos+4]))
1398                 pos += 4
1399                 // field[2] m.ThreadData[j1].Core
1400                 m.ThreadData[j1].Core = uint32(o.Uint32(tmp[pos : pos+4]))
1401                 pos += 4
1402                 // field[2] m.ThreadData[j1].CPUSocket
1403                 m.ThreadData[j1].CPUSocket = uint32(o.Uint32(tmp[pos : pos+4]))
1404                 pos += 4
1405         }
1406         return nil
1407 }
1408
1409 // ShowVersion represents VPP binary API message 'show_version'.
1410 type ShowVersion struct{}
1411
1412 func (m *ShowVersion) Reset()                        { *m = ShowVersion{} }
1413 func (*ShowVersion) GetMessageName() string          { return "show_version" }
1414 func (*ShowVersion) GetCrcString() string            { return "51077d14" }
1415 func (*ShowVersion) GetMessageType() api.MessageType { return api.RequestMessage }
1416
1417 func (m *ShowVersion) Size() int {
1418         if m == nil {
1419                 return 0
1420         }
1421         var size int
1422         return size
1423 }
1424 func (m *ShowVersion) Marshal(b []byte) ([]byte, error) {
1425         o := binary.BigEndian
1426         _ = o
1427         pos := 0
1428         _ = pos
1429         var buf []byte
1430         if b == nil {
1431                 buf = make([]byte, m.Size())
1432         } else {
1433                 buf = b
1434         }
1435         return buf, nil
1436 }
1437 func (m *ShowVersion) Unmarshal(tmp []byte) error {
1438         o := binary.BigEndian
1439         _ = o
1440         pos := 0
1441         _ = pos
1442         return nil
1443 }
1444
1445 // ShowVersionReply represents VPP binary API message 'show_version_reply'.
1446 type ShowVersionReply struct {
1447         Retval         int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
1448         Program        string `binapi:"string[32],name=program" json:"program,omitempty" struc:"[32]byte"`
1449         Version        string `binapi:"string[32],name=version" json:"version,omitempty" struc:"[32]byte"`
1450         BuildDate      string `binapi:"string[32],name=build_date" json:"build_date,omitempty" struc:"[32]byte"`
1451         BuildDirectory string `binapi:"string[256],name=build_directory" json:"build_directory,omitempty" struc:"[256]byte"`
1452 }
1453
1454 func (m *ShowVersionReply) Reset()                        { *m = ShowVersionReply{} }
1455 func (*ShowVersionReply) GetMessageName() string          { return "show_version_reply" }
1456 func (*ShowVersionReply) GetCrcString() string            { return "c919bde1" }
1457 func (*ShowVersionReply) GetMessageType() api.MessageType { return api.ReplyMessage }
1458
1459 func (m *ShowVersionReply) Size() int {
1460         if m == nil {
1461                 return 0
1462         }
1463         var size int
1464         // field[1] m.Retval
1465         size += 4
1466         // field[1] m.Program
1467         size += 32
1468         // field[1] m.Version
1469         size += 32
1470         // field[1] m.BuildDate
1471         size += 32
1472         // field[1] m.BuildDirectory
1473         size += 256
1474         return size
1475 }
1476 func (m *ShowVersionReply) Marshal(b []byte) ([]byte, error) {
1477         o := binary.BigEndian
1478         _ = o
1479         pos := 0
1480         _ = pos
1481         var buf []byte
1482         if b == nil {
1483                 buf = make([]byte, m.Size())
1484         } else {
1485                 buf = b
1486         }
1487         // field[1] m.Retval
1488         o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
1489         pos += 4
1490         // field[1] m.Program
1491         copy(buf[pos:pos+32], m.Program)
1492         pos += 32
1493         // field[1] m.Version
1494         copy(buf[pos:pos+32], m.Version)
1495         pos += 32
1496         // field[1] m.BuildDate
1497         copy(buf[pos:pos+32], m.BuildDate)
1498         pos += 32
1499         // field[1] m.BuildDirectory
1500         copy(buf[pos:pos+256], m.BuildDirectory)
1501         pos += 256
1502         return buf, nil
1503 }
1504 func (m *ShowVersionReply) Unmarshal(tmp []byte) error {
1505         o := binary.BigEndian
1506         _ = o
1507         pos := 0
1508         _ = pos
1509         // field[1] m.Retval
1510         m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
1511         pos += 4
1512         // field[1] m.Program
1513         {
1514                 nul := bytes.Index(tmp[pos:pos+32], []byte{0x00})
1515                 m.Program = codec.DecodeString(tmp[pos : pos+nul])
1516                 pos += 32
1517         }
1518         // field[1] m.Version
1519         {
1520                 nul := bytes.Index(tmp[pos:pos+32], []byte{0x00})
1521                 m.Version = codec.DecodeString(tmp[pos : pos+nul])
1522                 pos += 32
1523         }
1524         // field[1] m.BuildDate
1525         {
1526                 nul := bytes.Index(tmp[pos:pos+32], []byte{0x00})
1527                 m.BuildDate = codec.DecodeString(tmp[pos : pos+nul])
1528                 pos += 32
1529         }
1530         // field[1] m.BuildDirectory
1531         {
1532                 nul := bytes.Index(tmp[pos:pos+256], []byte{0x00})
1533                 m.BuildDirectory = codec.DecodeString(tmp[pos : pos+nul])
1534                 pos += 256
1535         }
1536         return nil
1537 }
1538
1539 // ShowVpeSystemTime represents VPP binary API message 'show_vpe_system_time'.
1540 type ShowVpeSystemTime struct{}
1541
1542 func (m *ShowVpeSystemTime) Reset()                        { *m = ShowVpeSystemTime{} }
1543 func (*ShowVpeSystemTime) GetMessageName() string          { return "show_vpe_system_time" }
1544 func (*ShowVpeSystemTime) GetCrcString() string            { return "51077d14" }
1545 func (*ShowVpeSystemTime) GetMessageType() api.MessageType { return api.RequestMessage }
1546
1547 func (m *ShowVpeSystemTime) Size() int {
1548         if m == nil {
1549                 return 0
1550         }
1551         var size int
1552         return size
1553 }
1554 func (m *ShowVpeSystemTime) Marshal(b []byte) ([]byte, error) {
1555         o := binary.BigEndian
1556         _ = o
1557         pos := 0
1558         _ = pos
1559         var buf []byte
1560         if b == nil {
1561                 buf = make([]byte, m.Size())
1562         } else {
1563                 buf = b
1564         }
1565         return buf, nil
1566 }
1567 func (m *ShowVpeSystemTime) Unmarshal(tmp []byte) error {
1568         o := binary.BigEndian
1569         _ = o
1570         pos := 0
1571         _ = pos
1572         return nil
1573 }
1574
1575 // ShowVpeSystemTimeReply represents VPP binary API message 'show_vpe_system_time_reply'.
1576 type ShowVpeSystemTimeReply struct {
1577         Retval        int32     `binapi:"i32,name=retval" json:"retval,omitempty"`
1578         VpeSystemTime Timestamp `binapi:"timestamp,name=vpe_system_time" json:"vpe_system_time,omitempty"`
1579 }
1580
1581 func (m *ShowVpeSystemTimeReply) Reset()                        { *m = ShowVpeSystemTimeReply{} }
1582 func (*ShowVpeSystemTimeReply) GetMessageName() string          { return "show_vpe_system_time_reply" }
1583 func (*ShowVpeSystemTimeReply) GetCrcString() string            { return "7ffd8193" }
1584 func (*ShowVpeSystemTimeReply) GetMessageType() api.MessageType { return api.ReplyMessage }
1585
1586 func (m *ShowVpeSystemTimeReply) Size() int {
1587         if m == nil {
1588                 return 0
1589         }
1590         var size int
1591         // field[1] m.Retval
1592         size += 4
1593         // field[1] m.VpeSystemTime
1594         size += 8
1595         return size
1596 }
1597 func (m *ShowVpeSystemTimeReply) Marshal(b []byte) ([]byte, error) {
1598         o := binary.BigEndian
1599         _ = o
1600         pos := 0
1601         _ = pos
1602         var buf []byte
1603         if b == nil {
1604                 buf = make([]byte, m.Size())
1605         } else {
1606                 buf = b
1607         }
1608         // field[1] m.Retval
1609         o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
1610         pos += 4
1611         // field[1] m.VpeSystemTime
1612         o.PutUint64(buf[pos:pos+8], math.Float64bits(float64(m.VpeSystemTime)))
1613         pos += 8
1614         return buf, nil
1615 }
1616 func (m *ShowVpeSystemTimeReply) Unmarshal(tmp []byte) error {
1617         o := binary.BigEndian
1618         _ = o
1619         pos := 0
1620         _ = pos
1621         // field[1] m.Retval
1622         m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
1623         pos += 4
1624         // field[1] m.VpeSystemTime
1625         m.VpeSystemTime = Timestamp(math.Float64frombits(o.Uint64(tmp[pos : pos+8])))
1626         pos += 8
1627         return nil
1628 }
1629
1630 func init() { file_vpe_binapi_init() }
1631 func file_vpe_binapi_init() {
1632         api.RegisterMessage((*AddNodeNext)(nil), "vpe.AddNodeNext")
1633         api.RegisterMessage((*AddNodeNextReply)(nil), "vpe.AddNodeNextReply")
1634         api.RegisterMessage((*Cli)(nil), "vpe.Cli")
1635         api.RegisterMessage((*CliInband)(nil), "vpe.CliInband")
1636         api.RegisterMessage((*CliInbandReply)(nil), "vpe.CliInbandReply")
1637         api.RegisterMessage((*CliReply)(nil), "vpe.CliReply")
1638         api.RegisterMessage((*ControlPing)(nil), "vpe.ControlPing")
1639         api.RegisterMessage((*ControlPingReply)(nil), "vpe.ControlPingReply")
1640         api.RegisterMessage((*GetF64EndianValue)(nil), "vpe.GetF64EndianValue")
1641         api.RegisterMessage((*GetF64EndianValueReply)(nil), "vpe.GetF64EndianValueReply")
1642         api.RegisterMessage((*GetF64IncrementByOne)(nil), "vpe.GetF64IncrementByOne")
1643         api.RegisterMessage((*GetF64IncrementByOneReply)(nil), "vpe.GetF64IncrementByOneReply")
1644         api.RegisterMessage((*GetNextIndex)(nil), "vpe.GetNextIndex")
1645         api.RegisterMessage((*GetNextIndexReply)(nil), "vpe.GetNextIndexReply")
1646         api.RegisterMessage((*GetNodeGraph)(nil), "vpe.GetNodeGraph")
1647         api.RegisterMessage((*GetNodeGraphReply)(nil), "vpe.GetNodeGraphReply")
1648         api.RegisterMessage((*GetNodeIndex)(nil), "vpe.GetNodeIndex")
1649         api.RegisterMessage((*GetNodeIndexReply)(nil), "vpe.GetNodeIndexReply")
1650         api.RegisterMessage((*LogDetails)(nil), "vpe.LogDetails")
1651         api.RegisterMessage((*LogDump)(nil), "vpe.LogDump")
1652         api.RegisterMessage((*ShowThreads)(nil), "vpe.ShowThreads")
1653         api.RegisterMessage((*ShowThreadsReply)(nil), "vpe.ShowThreadsReply")
1654         api.RegisterMessage((*ShowVersion)(nil), "vpe.ShowVersion")
1655         api.RegisterMessage((*ShowVersionReply)(nil), "vpe.ShowVersionReply")
1656         api.RegisterMessage((*ShowVpeSystemTime)(nil), "vpe.ShowVpeSystemTime")
1657         api.RegisterMessage((*ShowVpeSystemTimeReply)(nil), "vpe.ShowVpeSystemTimeReply")
1658 }
1659
1660 // Messages returns list of all messages in this module.
1661 func AllMessages() []api.Message {
1662         return []api.Message{
1663                 (*AddNodeNext)(nil),
1664                 (*AddNodeNextReply)(nil),
1665                 (*Cli)(nil),
1666                 (*CliInband)(nil),
1667                 (*CliInbandReply)(nil),
1668                 (*CliReply)(nil),
1669                 (*ControlPing)(nil),
1670                 (*ControlPingReply)(nil),
1671                 (*GetF64EndianValue)(nil),
1672                 (*GetF64EndianValueReply)(nil),
1673                 (*GetF64IncrementByOne)(nil),
1674                 (*GetF64IncrementByOneReply)(nil),
1675                 (*GetNextIndex)(nil),
1676                 (*GetNextIndexReply)(nil),
1677                 (*GetNodeGraph)(nil),
1678                 (*GetNodeGraphReply)(nil),
1679                 (*GetNodeIndex)(nil),
1680                 (*GetNodeIndexReply)(nil),
1681                 (*LogDetails)(nil),
1682                 (*LogDump)(nil),
1683                 (*ShowThreads)(nil),
1684                 (*ShowThreadsReply)(nil),
1685                 (*ShowVersion)(nil),
1686                 (*ShowVersionReply)(nil),
1687                 (*ShowVpeSystemTime)(nil),
1688                 (*ShowVpeSystemTimeReply)(nil),
1689         }
1690 }
1691
1692 // Reference imports to suppress errors if they are not otherwise used.
1693 var _ = api.RegisterMessage
1694 var _ = codec.DecodeString
1695 var _ = bytes.NewBuffer
1696 var _ = context.Background
1697 var _ = io.Copy
1698 var _ = strconv.Itoa
1699 var _ = struc.Pack
1700 var _ = binary.BigEndian
1701 var _ = math.Float32bits