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