GoVPP release v0.5.0
[govpp.git] / binapi / vpe / vpe.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.5.0
4 //  VPP:              22.02-release
5 // source: /usr/share/vpp/api/core/vpe.api.json
6
7 // Package vpe contains generated bindings for API file vpe.api.
8 //
9 // Contents:
10 //   6 messages
11 //
12 package vpe
13
14 import (
15         api "git.fd.io/govpp.git/api"
16         vpe_types "git.fd.io/govpp.git/binapi/vpe_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    = "vpe"
28         APIVersion = "1.7.0"
29         VersionCrc = 0xbbfa7484
30 )
31
32 // LogDetails defines message 'log_details'.
33 type LogDetails struct {
34         Timestamp vpe_types.Timestamp `binapi:"timestamp,name=timestamp" json:"timestamp,omitempty"`
35         Level     vpe_types.LogLevel  `binapi:"log_level,name=level" json:"level,omitempty"`
36         MsgClass  string              `binapi:"string[32],name=msg_class" json:"msg_class,omitempty"`
37         Message   string              `binapi:"string[256],name=message" json:"message,omitempty"`
38 }
39
40 func (m *LogDetails) Reset()               { *m = LogDetails{} }
41 func (*LogDetails) GetMessageName() string { return "log_details" }
42 func (*LogDetails) GetCrcString() string   { return "03d61cc0" }
43 func (*LogDetails) GetMessageType() api.MessageType {
44         return api.ReplyMessage
45 }
46
47 func (m *LogDetails) Size() (size int) {
48         if m == nil {
49                 return 0
50         }
51         size += 8   // m.Timestamp
52         size += 4   // m.Level
53         size += 32  // m.MsgClass
54         size += 256 // m.Message
55         return size
56 }
57 func (m *LogDetails) Marshal(b []byte) ([]byte, error) {
58         if b == nil {
59                 b = make([]byte, m.Size())
60         }
61         buf := codec.NewBuffer(b)
62         buf.EncodeFloat64(float64(m.Timestamp))
63         buf.EncodeUint32(uint32(m.Level))
64         buf.EncodeString(m.MsgClass, 32)
65         buf.EncodeString(m.Message, 256)
66         return buf.Bytes(), nil
67 }
68 func (m *LogDetails) Unmarshal(b []byte) error {
69         buf := codec.NewBuffer(b)
70         m.Timestamp = vpe_types.Timestamp(buf.DecodeFloat64())
71         m.Level = vpe_types.LogLevel(buf.DecodeUint32())
72         m.MsgClass = buf.DecodeString(32)
73         m.Message = buf.DecodeString(256)
74         return nil
75 }
76
77 // LogDump defines message 'log_dump'.
78 type LogDump struct {
79         StartTimestamp vpe_types.Timestamp `binapi:"timestamp,name=start_timestamp" json:"start_timestamp,omitempty"`
80 }
81
82 func (m *LogDump) Reset()               { *m = LogDump{} }
83 func (*LogDump) GetMessageName() string { return "log_dump" }
84 func (*LogDump) GetCrcString() string   { return "6ab31753" }
85 func (*LogDump) GetMessageType() api.MessageType {
86         return api.RequestMessage
87 }
88
89 func (m *LogDump) Size() (size int) {
90         if m == nil {
91                 return 0
92         }
93         size += 8 // m.StartTimestamp
94         return size
95 }
96 func (m *LogDump) Marshal(b []byte) ([]byte, error) {
97         if b == nil {
98                 b = make([]byte, m.Size())
99         }
100         buf := codec.NewBuffer(b)
101         buf.EncodeFloat64(float64(m.StartTimestamp))
102         return buf.Bytes(), nil
103 }
104 func (m *LogDump) Unmarshal(b []byte) error {
105         buf := codec.NewBuffer(b)
106         m.StartTimestamp = vpe_types.Timestamp(buf.DecodeFloat64())
107         return nil
108 }
109
110 // ShowVersion defines message 'show_version'.
111 type ShowVersion struct{}
112
113 func (m *ShowVersion) Reset()               { *m = ShowVersion{} }
114 func (*ShowVersion) GetMessageName() string { return "show_version" }
115 func (*ShowVersion) GetCrcString() string   { return "51077d14" }
116 func (*ShowVersion) GetMessageType() api.MessageType {
117         return api.RequestMessage
118 }
119
120 func (m *ShowVersion) Size() (size int) {
121         if m == nil {
122                 return 0
123         }
124         return size
125 }
126 func (m *ShowVersion) Marshal(b []byte) ([]byte, error) {
127         if b == nil {
128                 b = make([]byte, m.Size())
129         }
130         buf := codec.NewBuffer(b)
131         return buf.Bytes(), nil
132 }
133 func (m *ShowVersion) Unmarshal(b []byte) error {
134         return nil
135 }
136
137 // ShowVersionReply defines message 'show_version_reply'.
138 type ShowVersionReply struct {
139         Retval         int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
140         Program        string `binapi:"string[32],name=program" json:"program,omitempty"`
141         Version        string `binapi:"string[32],name=version" json:"version,omitempty"`
142         BuildDate      string `binapi:"string[32],name=build_date" json:"build_date,omitempty"`
143         BuildDirectory string `binapi:"string[256],name=build_directory" json:"build_directory,omitempty"`
144 }
145
146 func (m *ShowVersionReply) Reset()               { *m = ShowVersionReply{} }
147 func (*ShowVersionReply) GetMessageName() string { return "show_version_reply" }
148 func (*ShowVersionReply) GetCrcString() string   { return "c919bde1" }
149 func (*ShowVersionReply) GetMessageType() api.MessageType {
150         return api.ReplyMessage
151 }
152
153 func (m *ShowVersionReply) Size() (size int) {
154         if m == nil {
155                 return 0
156         }
157         size += 4   // m.Retval
158         size += 32  // m.Program
159         size += 32  // m.Version
160         size += 32  // m.BuildDate
161         size += 256 // m.BuildDirectory
162         return size
163 }
164 func (m *ShowVersionReply) Marshal(b []byte) ([]byte, error) {
165         if b == nil {
166                 b = make([]byte, m.Size())
167         }
168         buf := codec.NewBuffer(b)
169         buf.EncodeInt32(m.Retval)
170         buf.EncodeString(m.Program, 32)
171         buf.EncodeString(m.Version, 32)
172         buf.EncodeString(m.BuildDate, 32)
173         buf.EncodeString(m.BuildDirectory, 256)
174         return buf.Bytes(), nil
175 }
176 func (m *ShowVersionReply) Unmarshal(b []byte) error {
177         buf := codec.NewBuffer(b)
178         m.Retval = buf.DecodeInt32()
179         m.Program = buf.DecodeString(32)
180         m.Version = buf.DecodeString(32)
181         m.BuildDate = buf.DecodeString(32)
182         m.BuildDirectory = buf.DecodeString(256)
183         return nil
184 }
185
186 // ShowVpeSystemTime defines message 'show_vpe_system_time'.
187 type ShowVpeSystemTime struct{}
188
189 func (m *ShowVpeSystemTime) Reset()               { *m = ShowVpeSystemTime{} }
190 func (*ShowVpeSystemTime) GetMessageName() string { return "show_vpe_system_time" }
191 func (*ShowVpeSystemTime) GetCrcString() string   { return "51077d14" }
192 func (*ShowVpeSystemTime) GetMessageType() api.MessageType {
193         return api.RequestMessage
194 }
195
196 func (m *ShowVpeSystemTime) Size() (size int) {
197         if m == nil {
198                 return 0
199         }
200         return size
201 }
202 func (m *ShowVpeSystemTime) Marshal(b []byte) ([]byte, error) {
203         if b == nil {
204                 b = make([]byte, m.Size())
205         }
206         buf := codec.NewBuffer(b)
207         return buf.Bytes(), nil
208 }
209 func (m *ShowVpeSystemTime) Unmarshal(b []byte) error {
210         return nil
211 }
212
213 // ShowVpeSystemTimeReply defines message 'show_vpe_system_time_reply'.
214 type ShowVpeSystemTimeReply struct {
215         Retval        int32               `binapi:"i32,name=retval" json:"retval,omitempty"`
216         VpeSystemTime vpe_types.Timestamp `binapi:"timestamp,name=vpe_system_time" json:"vpe_system_time,omitempty"`
217 }
218
219 func (m *ShowVpeSystemTimeReply) Reset()               { *m = ShowVpeSystemTimeReply{} }
220 func (*ShowVpeSystemTimeReply) GetMessageName() string { return "show_vpe_system_time_reply" }
221 func (*ShowVpeSystemTimeReply) GetCrcString() string   { return "7ffd8193" }
222 func (*ShowVpeSystemTimeReply) GetMessageType() api.MessageType {
223         return api.ReplyMessage
224 }
225
226 func (m *ShowVpeSystemTimeReply) Size() (size int) {
227         if m == nil {
228                 return 0
229         }
230         size += 4 // m.Retval
231         size += 8 // m.VpeSystemTime
232         return size
233 }
234 func (m *ShowVpeSystemTimeReply) Marshal(b []byte) ([]byte, error) {
235         if b == nil {
236                 b = make([]byte, m.Size())
237         }
238         buf := codec.NewBuffer(b)
239         buf.EncodeInt32(m.Retval)
240         buf.EncodeFloat64(float64(m.VpeSystemTime))
241         return buf.Bytes(), nil
242 }
243 func (m *ShowVpeSystemTimeReply) Unmarshal(b []byte) error {
244         buf := codec.NewBuffer(b)
245         m.Retval = buf.DecodeInt32()
246         m.VpeSystemTime = vpe_types.Timestamp(buf.DecodeFloat64())
247         return nil
248 }
249
250 func init() { file_vpe_binapi_init() }
251 func file_vpe_binapi_init() {
252         api.RegisterMessage((*LogDetails)(nil), "log_details_03d61cc0")
253         api.RegisterMessage((*LogDump)(nil), "log_dump_6ab31753")
254         api.RegisterMessage((*ShowVersion)(nil), "show_version_51077d14")
255         api.RegisterMessage((*ShowVersionReply)(nil), "show_version_reply_c919bde1")
256         api.RegisterMessage((*ShowVpeSystemTime)(nil), "show_vpe_system_time_51077d14")
257         api.RegisterMessage((*ShowVpeSystemTimeReply)(nil), "show_vpe_system_time_reply_7ffd8193")
258 }
259
260 // Messages returns list of all messages in this module.
261 func AllMessages() []api.Message {
262         return []api.Message{
263                 (*LogDetails)(nil),
264                 (*LogDump)(nil),
265                 (*ShowVersion)(nil),
266                 (*ShowVersionReply)(nil),
267                 (*ShowVpeSystemTime)(nil),
268                 (*ShowVpeSystemTimeReply)(nil),
269         }
270 }