Improve binapi generator
[govpp.git] / binapi / trace / trace.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/trace.api.json
6
7 // Package trace contains generated bindings for API file trace.api.
8 //
9 // Contents:
10 //   6 messages
11 //
12 package trace
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    = "trace"
27         APIVersion = "1.0.0"
28         VersionCrc = 0x397cbf90
29 )
30
31 // TraceProfileAdd defines message 'trace_profile_add'.
32 type TraceProfileAdd struct {
33         TraceType uint8  `binapi:"u8,name=trace_type" json:"trace_type,omitempty"`
34         NumElts   uint8  `binapi:"u8,name=num_elts" json:"num_elts,omitempty"`
35         TraceTsp  uint8  `binapi:"u8,name=trace_tsp" json:"trace_tsp,omitempty"`
36         NodeID    uint32 `binapi:"u32,name=node_id" json:"node_id,omitempty"`
37         AppData   uint32 `binapi:"u32,name=app_data" json:"app_data,omitempty"`
38 }
39
40 func (m *TraceProfileAdd) Reset()               { *m = TraceProfileAdd{} }
41 func (*TraceProfileAdd) GetMessageName() string { return "trace_profile_add" }
42 func (*TraceProfileAdd) GetCrcString() string   { return "de08aa6d" }
43 func (*TraceProfileAdd) GetMessageType() api.MessageType {
44         return api.RequestMessage
45 }
46
47 func (m *TraceProfileAdd) Size() int {
48         if m == nil {
49                 return 0
50         }
51         var size int
52         size += 1 // m.TraceType
53         size += 1 // m.NumElts
54         size += 1 // m.TraceTsp
55         size += 4 // m.NodeID
56         size += 4 // m.AppData
57         return size
58 }
59 func (m *TraceProfileAdd) Marshal(b []byte) ([]byte, error) {
60         var buf *codec.Buffer
61         if b == nil {
62                 buf = codec.NewBuffer(make([]byte, m.Size()))
63         } else {
64                 buf = codec.NewBuffer(b)
65         }
66         buf.EncodeUint8(uint8(m.TraceType))
67         buf.EncodeUint8(uint8(m.NumElts))
68         buf.EncodeUint8(uint8(m.TraceTsp))
69         buf.EncodeUint32(uint32(m.NodeID))
70         buf.EncodeUint32(uint32(m.AppData))
71         return buf.Bytes(), nil
72 }
73 func (m *TraceProfileAdd) Unmarshal(b []byte) error {
74         buf := codec.NewBuffer(b)
75         m.TraceType = buf.DecodeUint8()
76         m.NumElts = buf.DecodeUint8()
77         m.TraceTsp = buf.DecodeUint8()
78         m.NodeID = buf.DecodeUint32()
79         m.AppData = buf.DecodeUint32()
80         return nil
81 }
82
83 // TraceProfileAddReply defines message 'trace_profile_add_reply'.
84 type TraceProfileAddReply struct {
85         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
86 }
87
88 func (m *TraceProfileAddReply) Reset()               { *m = TraceProfileAddReply{} }
89 func (*TraceProfileAddReply) GetMessageName() string { return "trace_profile_add_reply" }
90 func (*TraceProfileAddReply) GetCrcString() string   { return "e8d4e804" }
91 func (*TraceProfileAddReply) GetMessageType() api.MessageType {
92         return api.ReplyMessage
93 }
94
95 func (m *TraceProfileAddReply) Size() int {
96         if m == nil {
97                 return 0
98         }
99         var size int
100         size += 4 // m.Retval
101         return size
102 }
103 func (m *TraceProfileAddReply) Marshal(b []byte) ([]byte, error) {
104         var buf *codec.Buffer
105         if b == nil {
106                 buf = codec.NewBuffer(make([]byte, m.Size()))
107         } else {
108                 buf = codec.NewBuffer(b)
109         }
110         buf.EncodeUint32(uint32(m.Retval))
111         return buf.Bytes(), nil
112 }
113 func (m *TraceProfileAddReply) Unmarshal(b []byte) error {
114         buf := codec.NewBuffer(b)
115         m.Retval = int32(buf.DecodeUint32())
116         return nil
117 }
118
119 // TraceProfileDel defines message 'trace_profile_del'.
120 type TraceProfileDel struct{}
121
122 func (m *TraceProfileDel) Reset()               { *m = TraceProfileDel{} }
123 func (*TraceProfileDel) GetMessageName() string { return "trace_profile_del" }
124 func (*TraceProfileDel) GetCrcString() string   { return "51077d14" }
125 func (*TraceProfileDel) GetMessageType() api.MessageType {
126         return api.RequestMessage
127 }
128
129 func (m *TraceProfileDel) Size() int {
130         if m == nil {
131                 return 0
132         }
133         var size int
134         return size
135 }
136 func (m *TraceProfileDel) Marshal(b []byte) ([]byte, error) {
137         var buf *codec.Buffer
138         if b == nil {
139                 buf = codec.NewBuffer(make([]byte, m.Size()))
140         } else {
141                 buf = codec.NewBuffer(b)
142         }
143         return buf.Bytes(), nil
144 }
145 func (m *TraceProfileDel) Unmarshal(b []byte) error {
146         return nil
147 }
148
149 // TraceProfileDelReply defines message 'trace_profile_del_reply'.
150 type TraceProfileDelReply struct {
151         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
152 }
153
154 func (m *TraceProfileDelReply) Reset()               { *m = TraceProfileDelReply{} }
155 func (*TraceProfileDelReply) GetMessageName() string { return "trace_profile_del_reply" }
156 func (*TraceProfileDelReply) GetCrcString() string   { return "e8d4e804" }
157 func (*TraceProfileDelReply) GetMessageType() api.MessageType {
158         return api.ReplyMessage
159 }
160
161 func (m *TraceProfileDelReply) Size() int {
162         if m == nil {
163                 return 0
164         }
165         var size int
166         size += 4 // m.Retval
167         return size
168 }
169 func (m *TraceProfileDelReply) Marshal(b []byte) ([]byte, error) {
170         var buf *codec.Buffer
171         if b == nil {
172                 buf = codec.NewBuffer(make([]byte, m.Size()))
173         } else {
174                 buf = codec.NewBuffer(b)
175         }
176         buf.EncodeUint32(uint32(m.Retval))
177         return buf.Bytes(), nil
178 }
179 func (m *TraceProfileDelReply) Unmarshal(b []byte) error {
180         buf := codec.NewBuffer(b)
181         m.Retval = int32(buf.DecodeUint32())
182         return nil
183 }
184
185 // TraceProfileShowConfig defines message 'trace_profile_show_config'.
186 type TraceProfileShowConfig struct{}
187
188 func (m *TraceProfileShowConfig) Reset()               { *m = TraceProfileShowConfig{} }
189 func (*TraceProfileShowConfig) GetMessageName() string { return "trace_profile_show_config" }
190 func (*TraceProfileShowConfig) GetCrcString() string   { return "51077d14" }
191 func (*TraceProfileShowConfig) GetMessageType() api.MessageType {
192         return api.RequestMessage
193 }
194
195 func (m *TraceProfileShowConfig) Size() int {
196         if m == nil {
197                 return 0
198         }
199         var size int
200         return size
201 }
202 func (m *TraceProfileShowConfig) Marshal(b []byte) ([]byte, error) {
203         var buf *codec.Buffer
204         if b == nil {
205                 buf = codec.NewBuffer(make([]byte, m.Size()))
206         } else {
207                 buf = codec.NewBuffer(b)
208         }
209         return buf.Bytes(), nil
210 }
211 func (m *TraceProfileShowConfig) Unmarshal(b []byte) error {
212         return nil
213 }
214
215 // TraceProfileShowConfigReply defines message 'trace_profile_show_config_reply'.
216 type TraceProfileShowConfigReply struct {
217         Retval    int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
218         TraceType uint8  `binapi:"u8,name=trace_type" json:"trace_type,omitempty"`
219         NumElts   uint8  `binapi:"u8,name=num_elts" json:"num_elts,omitempty"`
220         TraceTsp  uint8  `binapi:"u8,name=trace_tsp" json:"trace_tsp,omitempty"`
221         NodeID    uint32 `binapi:"u32,name=node_id" json:"node_id,omitempty"`
222         AppData   uint32 `binapi:"u32,name=app_data" json:"app_data,omitempty"`
223 }
224
225 func (m *TraceProfileShowConfigReply) Reset()               { *m = TraceProfileShowConfigReply{} }
226 func (*TraceProfileShowConfigReply) GetMessageName() string { return "trace_profile_show_config_reply" }
227 func (*TraceProfileShowConfigReply) GetCrcString() string   { return "0f1d374c" }
228 func (*TraceProfileShowConfigReply) GetMessageType() api.MessageType {
229         return api.ReplyMessage
230 }
231
232 func (m *TraceProfileShowConfigReply) Size() int {
233         if m == nil {
234                 return 0
235         }
236         var size int
237         size += 4 // m.Retval
238         size += 1 // m.TraceType
239         size += 1 // m.NumElts
240         size += 1 // m.TraceTsp
241         size += 4 // m.NodeID
242         size += 4 // m.AppData
243         return size
244 }
245 func (m *TraceProfileShowConfigReply) Marshal(b []byte) ([]byte, error) {
246         var buf *codec.Buffer
247         if b == nil {
248                 buf = codec.NewBuffer(make([]byte, m.Size()))
249         } else {
250                 buf = codec.NewBuffer(b)
251         }
252         buf.EncodeUint32(uint32(m.Retval))
253         buf.EncodeUint8(uint8(m.TraceType))
254         buf.EncodeUint8(uint8(m.NumElts))
255         buf.EncodeUint8(uint8(m.TraceTsp))
256         buf.EncodeUint32(uint32(m.NodeID))
257         buf.EncodeUint32(uint32(m.AppData))
258         return buf.Bytes(), nil
259 }
260 func (m *TraceProfileShowConfigReply) Unmarshal(b []byte) error {
261         buf := codec.NewBuffer(b)
262         m.Retval = int32(buf.DecodeUint32())
263         m.TraceType = buf.DecodeUint8()
264         m.NumElts = buf.DecodeUint8()
265         m.TraceTsp = buf.DecodeUint8()
266         m.NodeID = buf.DecodeUint32()
267         m.AppData = buf.DecodeUint32()
268         return nil
269 }
270
271 func init() { file_trace_binapi_init() }
272 func file_trace_binapi_init() {
273         api.RegisterMessage((*TraceProfileAdd)(nil), "trace_profile_add_de08aa6d")
274         api.RegisterMessage((*TraceProfileAddReply)(nil), "trace_profile_add_reply_e8d4e804")
275         api.RegisterMessage((*TraceProfileDel)(nil), "trace_profile_del_51077d14")
276         api.RegisterMessage((*TraceProfileDelReply)(nil), "trace_profile_del_reply_e8d4e804")
277         api.RegisterMessage((*TraceProfileShowConfig)(nil), "trace_profile_show_config_51077d14")
278         api.RegisterMessage((*TraceProfileShowConfigReply)(nil), "trace_profile_show_config_reply_0f1d374c")
279 }
280
281 // Messages returns list of all messages in this module.
282 func AllMessages() []api.Message {
283         return []api.Message{
284                 (*TraceProfileAdd)(nil),
285                 (*TraceProfileAddReply)(nil),
286                 (*TraceProfileDel)(nil),
287                 (*TraceProfileDelReply)(nil),
288                 (*TraceProfileShowConfig)(nil),
289                 (*TraceProfileShowConfigReply)(nil),
290         }
291 }