7b182baec15f14a96bd8023efab112bc89574b53
[govpp.git] / binapi / pg / pg.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.5.0-dev
4 //  VPP:              21.06-release
5 // source: /usr/share/vpp/api/core/pg.api.json
6
7 // Package pg contains generated bindings for API file pg.api.
8 //
9 // Contents:
10 //   8 messages
11 //
12 package pg
13
14 import (
15         api "git.fd.io/govpp.git/api"
16         interface_types "git.fd.io/govpp.git/binapi/interface_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    = "pg"
28         APIVersion = "2.0.0"
29         VersionCrc = 0x3a037a0e
30 )
31
32 // PgCapture defines message 'pg_capture'.
33 type PgCapture struct {
34         InterfaceID  interface_types.InterfaceIndex `binapi:"interface_index,name=interface_id" json:"interface_id,omitempty"`
35         IsEnabled    bool                           `binapi:"bool,name=is_enabled,default=true" json:"is_enabled,omitempty"`
36         Count        uint32                         `binapi:"u32,name=count" json:"count,omitempty"`
37         PcapFileName string                         `binapi:"string[],name=pcap_file_name" json:"pcap_file_name,omitempty"`
38 }
39
40 func (m *PgCapture) Reset()               { *m = PgCapture{} }
41 func (*PgCapture) GetMessageName() string { return "pg_capture" }
42 func (*PgCapture) GetCrcString() string   { return "3712fb6c" }
43 func (*PgCapture) GetMessageType() api.MessageType {
44         return api.RequestMessage
45 }
46
47 func (m *PgCapture) Size() (size int) {
48         if m == nil {
49                 return 0
50         }
51         size += 4                       // m.InterfaceID
52         size += 1                       // m.IsEnabled
53         size += 4                       // m.Count
54         size += 4 + len(m.PcapFileName) // m.PcapFileName
55         return size
56 }
57 func (m *PgCapture) Marshal(b []byte) ([]byte, error) {
58         if b == nil {
59                 b = make([]byte, m.Size())
60         }
61         buf := codec.NewBuffer(b)
62         buf.EncodeUint32(uint32(m.InterfaceID))
63         buf.EncodeBool(m.IsEnabled)
64         buf.EncodeUint32(m.Count)
65         buf.EncodeString(m.PcapFileName, 0)
66         return buf.Bytes(), nil
67 }
68 func (m *PgCapture) Unmarshal(b []byte) error {
69         buf := codec.NewBuffer(b)
70         m.InterfaceID = interface_types.InterfaceIndex(buf.DecodeUint32())
71         m.IsEnabled = buf.DecodeBool()
72         m.Count = buf.DecodeUint32()
73         m.PcapFileName = buf.DecodeString(0)
74         return nil
75 }
76
77 // PgCaptureReply defines message 'pg_capture_reply'.
78 type PgCaptureReply struct {
79         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
80 }
81
82 func (m *PgCaptureReply) Reset()               { *m = PgCaptureReply{} }
83 func (*PgCaptureReply) GetMessageName() string { return "pg_capture_reply" }
84 func (*PgCaptureReply) GetCrcString() string   { return "e8d4e804" }
85 func (*PgCaptureReply) GetMessageType() api.MessageType {
86         return api.ReplyMessage
87 }
88
89 func (m *PgCaptureReply) Size() (size int) {
90         if m == nil {
91                 return 0
92         }
93         size += 4 // m.Retval
94         return size
95 }
96 func (m *PgCaptureReply) Marshal(b []byte) ([]byte, error) {
97         if b == nil {
98                 b = make([]byte, m.Size())
99         }
100         buf := codec.NewBuffer(b)
101         buf.EncodeInt32(m.Retval)
102         return buf.Bytes(), nil
103 }
104 func (m *PgCaptureReply) Unmarshal(b []byte) error {
105         buf := codec.NewBuffer(b)
106         m.Retval = buf.DecodeInt32()
107         return nil
108 }
109
110 // PgCreateInterface defines message 'pg_create_interface'.
111 type PgCreateInterface struct {
112         InterfaceID interface_types.InterfaceIndex `binapi:"interface_index,name=interface_id" json:"interface_id,omitempty"`
113         GsoEnabled  bool                           `binapi:"bool,name=gso_enabled" json:"gso_enabled,omitempty"`
114         GsoSize     uint32                         `binapi:"u32,name=gso_size" json:"gso_size,omitempty"`
115 }
116
117 func (m *PgCreateInterface) Reset()               { *m = PgCreateInterface{} }
118 func (*PgCreateInterface) GetMessageName() string { return "pg_create_interface" }
119 func (*PgCreateInterface) GetCrcString() string   { return "b7c893d7" }
120 func (*PgCreateInterface) GetMessageType() api.MessageType {
121         return api.RequestMessage
122 }
123
124 func (m *PgCreateInterface) Size() (size int) {
125         if m == nil {
126                 return 0
127         }
128         size += 4 // m.InterfaceID
129         size += 1 // m.GsoEnabled
130         size += 4 // m.GsoSize
131         return size
132 }
133 func (m *PgCreateInterface) Marshal(b []byte) ([]byte, error) {
134         if b == nil {
135                 b = make([]byte, m.Size())
136         }
137         buf := codec.NewBuffer(b)
138         buf.EncodeUint32(uint32(m.InterfaceID))
139         buf.EncodeBool(m.GsoEnabled)
140         buf.EncodeUint32(m.GsoSize)
141         return buf.Bytes(), nil
142 }
143 func (m *PgCreateInterface) Unmarshal(b []byte) error {
144         buf := codec.NewBuffer(b)
145         m.InterfaceID = interface_types.InterfaceIndex(buf.DecodeUint32())
146         m.GsoEnabled = buf.DecodeBool()
147         m.GsoSize = buf.DecodeUint32()
148         return nil
149 }
150
151 // PgCreateInterfaceReply defines message 'pg_create_interface_reply'.
152 type PgCreateInterfaceReply struct {
153         Retval    int32                          `binapi:"i32,name=retval" json:"retval,omitempty"`
154         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
155 }
156
157 func (m *PgCreateInterfaceReply) Reset()               { *m = PgCreateInterfaceReply{} }
158 func (*PgCreateInterfaceReply) GetMessageName() string { return "pg_create_interface_reply" }
159 func (*PgCreateInterfaceReply) GetCrcString() string   { return "5383d31f" }
160 func (*PgCreateInterfaceReply) GetMessageType() api.MessageType {
161         return api.ReplyMessage
162 }
163
164 func (m *PgCreateInterfaceReply) Size() (size int) {
165         if m == nil {
166                 return 0
167         }
168         size += 4 // m.Retval
169         size += 4 // m.SwIfIndex
170         return size
171 }
172 func (m *PgCreateInterfaceReply) Marshal(b []byte) ([]byte, error) {
173         if b == nil {
174                 b = make([]byte, m.Size())
175         }
176         buf := codec.NewBuffer(b)
177         buf.EncodeInt32(m.Retval)
178         buf.EncodeUint32(uint32(m.SwIfIndex))
179         return buf.Bytes(), nil
180 }
181 func (m *PgCreateInterfaceReply) Unmarshal(b []byte) error {
182         buf := codec.NewBuffer(b)
183         m.Retval = buf.DecodeInt32()
184         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
185         return nil
186 }
187
188 // PgEnableDisable defines message 'pg_enable_disable'.
189 type PgEnableDisable struct {
190         IsEnabled  bool   `binapi:"bool,name=is_enabled,default=true" json:"is_enabled,omitempty"`
191         StreamName string `binapi:"string[],name=stream_name" json:"stream_name,omitempty"`
192 }
193
194 func (m *PgEnableDisable) Reset()               { *m = PgEnableDisable{} }
195 func (*PgEnableDisable) GetMessageName() string { return "pg_enable_disable" }
196 func (*PgEnableDisable) GetCrcString() string   { return "01f94f3a" }
197 func (*PgEnableDisable) GetMessageType() api.MessageType {
198         return api.RequestMessage
199 }
200
201 func (m *PgEnableDisable) Size() (size int) {
202         if m == nil {
203                 return 0
204         }
205         size += 1                     // m.IsEnabled
206         size += 4 + len(m.StreamName) // m.StreamName
207         return size
208 }
209 func (m *PgEnableDisable) Marshal(b []byte) ([]byte, error) {
210         if b == nil {
211                 b = make([]byte, m.Size())
212         }
213         buf := codec.NewBuffer(b)
214         buf.EncodeBool(m.IsEnabled)
215         buf.EncodeString(m.StreamName, 0)
216         return buf.Bytes(), nil
217 }
218 func (m *PgEnableDisable) Unmarshal(b []byte) error {
219         buf := codec.NewBuffer(b)
220         m.IsEnabled = buf.DecodeBool()
221         m.StreamName = buf.DecodeString(0)
222         return nil
223 }
224
225 // PgEnableDisableReply defines message 'pg_enable_disable_reply'.
226 type PgEnableDisableReply struct {
227         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
228 }
229
230 func (m *PgEnableDisableReply) Reset()               { *m = PgEnableDisableReply{} }
231 func (*PgEnableDisableReply) GetMessageName() string { return "pg_enable_disable_reply" }
232 func (*PgEnableDisableReply) GetCrcString() string   { return "e8d4e804" }
233 func (*PgEnableDisableReply) GetMessageType() api.MessageType {
234         return api.ReplyMessage
235 }
236
237 func (m *PgEnableDisableReply) Size() (size int) {
238         if m == nil {
239                 return 0
240         }
241         size += 4 // m.Retval
242         return size
243 }
244 func (m *PgEnableDisableReply) Marshal(b []byte) ([]byte, error) {
245         if b == nil {
246                 b = make([]byte, m.Size())
247         }
248         buf := codec.NewBuffer(b)
249         buf.EncodeInt32(m.Retval)
250         return buf.Bytes(), nil
251 }
252 func (m *PgEnableDisableReply) Unmarshal(b []byte) error {
253         buf := codec.NewBuffer(b)
254         m.Retval = buf.DecodeInt32()
255         return nil
256 }
257
258 // PgInterfaceEnableDisableCoalesce defines message 'pg_interface_enable_disable_coalesce'.
259 // InProgress: the message form may change in the future versions
260 type PgInterfaceEnableDisableCoalesce struct {
261         SwIfIndex       interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
262         CoalesceEnabled bool                           `binapi:"bool,name=coalesce_enabled" json:"coalesce_enabled,omitempty"`
263 }
264
265 func (m *PgInterfaceEnableDisableCoalesce) Reset() { *m = PgInterfaceEnableDisableCoalesce{} }
266 func (*PgInterfaceEnableDisableCoalesce) GetMessageName() string {
267         return "pg_interface_enable_disable_coalesce"
268 }
269 func (*PgInterfaceEnableDisableCoalesce) GetCrcString() string { return "a2ef99e7" }
270 func (*PgInterfaceEnableDisableCoalesce) GetMessageType() api.MessageType {
271         return api.RequestMessage
272 }
273
274 func (m *PgInterfaceEnableDisableCoalesce) Size() (size int) {
275         if m == nil {
276                 return 0
277         }
278         size += 4 // m.SwIfIndex
279         size += 1 // m.CoalesceEnabled
280         return size
281 }
282 func (m *PgInterfaceEnableDisableCoalesce) Marshal(b []byte) ([]byte, error) {
283         if b == nil {
284                 b = make([]byte, m.Size())
285         }
286         buf := codec.NewBuffer(b)
287         buf.EncodeUint32(uint32(m.SwIfIndex))
288         buf.EncodeBool(m.CoalesceEnabled)
289         return buf.Bytes(), nil
290 }
291 func (m *PgInterfaceEnableDisableCoalesce) Unmarshal(b []byte) error {
292         buf := codec.NewBuffer(b)
293         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
294         m.CoalesceEnabled = buf.DecodeBool()
295         return nil
296 }
297
298 // PgInterfaceEnableDisableCoalesceReply defines message 'pg_interface_enable_disable_coalesce_reply'.
299 // InProgress: the message form may change in the future versions
300 type PgInterfaceEnableDisableCoalesceReply struct {
301         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
302 }
303
304 func (m *PgInterfaceEnableDisableCoalesceReply) Reset() { *m = PgInterfaceEnableDisableCoalesceReply{} }
305 func (*PgInterfaceEnableDisableCoalesceReply) GetMessageName() string {
306         return "pg_interface_enable_disable_coalesce_reply"
307 }
308 func (*PgInterfaceEnableDisableCoalesceReply) GetCrcString() string { return "e8d4e804" }
309 func (*PgInterfaceEnableDisableCoalesceReply) GetMessageType() api.MessageType {
310         return api.ReplyMessage
311 }
312
313 func (m *PgInterfaceEnableDisableCoalesceReply) Size() (size int) {
314         if m == nil {
315                 return 0
316         }
317         size += 4 // m.Retval
318         return size
319 }
320 func (m *PgInterfaceEnableDisableCoalesceReply) Marshal(b []byte) ([]byte, error) {
321         if b == nil {
322                 b = make([]byte, m.Size())
323         }
324         buf := codec.NewBuffer(b)
325         buf.EncodeInt32(m.Retval)
326         return buf.Bytes(), nil
327 }
328 func (m *PgInterfaceEnableDisableCoalesceReply) Unmarshal(b []byte) error {
329         buf := codec.NewBuffer(b)
330         m.Retval = buf.DecodeInt32()
331         return nil
332 }
333
334 func init() { file_pg_binapi_init() }
335 func file_pg_binapi_init() {
336         api.RegisterMessage((*PgCapture)(nil), "pg_capture_3712fb6c")
337         api.RegisterMessage((*PgCaptureReply)(nil), "pg_capture_reply_e8d4e804")
338         api.RegisterMessage((*PgCreateInterface)(nil), "pg_create_interface_b7c893d7")
339         api.RegisterMessage((*PgCreateInterfaceReply)(nil), "pg_create_interface_reply_5383d31f")
340         api.RegisterMessage((*PgEnableDisable)(nil), "pg_enable_disable_01f94f3a")
341         api.RegisterMessage((*PgEnableDisableReply)(nil), "pg_enable_disable_reply_e8d4e804")
342         api.RegisterMessage((*PgInterfaceEnableDisableCoalesce)(nil), "pg_interface_enable_disable_coalesce_a2ef99e7")
343         api.RegisterMessage((*PgInterfaceEnableDisableCoalesceReply)(nil), "pg_interface_enable_disable_coalesce_reply_e8d4e804")
344 }
345
346 // Messages returns list of all messages in this module.
347 func AllMessages() []api.Message {
348         return []api.Message{
349                 (*PgCapture)(nil),
350                 (*PgCaptureReply)(nil),
351                 (*PgCreateInterface)(nil),
352                 (*PgCreateInterfaceReply)(nil),
353                 (*PgEnableDisable)(nil),
354                 (*PgEnableDisableReply)(nil),
355                 (*PgInterfaceEnableDisableCoalesce)(nil),
356                 (*PgInterfaceEnableDisableCoalesceReply)(nil),
357         }
358 }