Improve binapi generator
[govpp.git] / binapi / igmp / igmp.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/igmp.api.json
6
7 // Package igmp contains generated bindings for API file igmp.api.
8 //
9 // Contents:
10 //   2 enums
11 //   2 structs
12 //  19 messages
13 //
14 package igmp
15
16 import (
17         api "git.fd.io/govpp.git/api"
18         interface_types "git.fd.io/govpp.git/binapi/interface_types"
19         ip_types "git.fd.io/govpp.git/binapi/ip_types"
20         codec "git.fd.io/govpp.git/codec"
21         "strconv"
22 )
23
24 // This is a compile-time assertion to ensure that this generated file
25 // is compatible with the GoVPP api package it is being compiled against.
26 // A compilation error at this line likely means your copy of the
27 // GoVPP api package needs to be updated.
28 const _ = api.GoVppAPIPackageIsVersion2
29
30 const (
31         APIFile    = "igmp"
32         APIVersion = "1.0.0"
33         VersionCrc = 0x290eccf8
34 )
35
36 // FilterMode defines enum 'filter_mode'.
37 type FilterMode uint32
38
39 const (
40         EXCLUDE FilterMode = 0
41         INCLUDE FilterMode = 1
42 )
43
44 var (
45         FilterMode_name = map[uint32]string{
46                 0: "EXCLUDE",
47                 1: "INCLUDE",
48         }
49         FilterMode_value = map[string]uint32{
50                 "EXCLUDE": 0,
51                 "INCLUDE": 1,
52         }
53 )
54
55 func (x FilterMode) String() string {
56         s, ok := FilterMode_name[uint32(x)]
57         if ok {
58                 return s
59         }
60         return "FilterMode(" + strconv.Itoa(int(x)) + ")"
61 }
62
63 // GroupPrefixType defines enum 'group_prefix_type'.
64 type GroupPrefixType uint32
65
66 const (
67         ASM GroupPrefixType = 0
68         SSM GroupPrefixType = 1
69 )
70
71 var (
72         GroupPrefixType_name = map[uint32]string{
73                 0: "ASM",
74                 1: "SSM",
75         }
76         GroupPrefixType_value = map[string]uint32{
77                 "ASM": 0,
78                 "SSM": 1,
79         }
80 )
81
82 func (x GroupPrefixType) String() string {
83         s, ok := GroupPrefixType_name[uint32(x)]
84         if ok {
85                 return s
86         }
87         return "GroupPrefixType(" + strconv.Itoa(int(x)) + ")"
88 }
89
90 // GroupPrefix defines type 'group_prefix'.
91 type GroupPrefix struct {
92         Type   GroupPrefixType `binapi:"group_prefix_type,name=type" json:"type,omitempty"`
93         Prefix ip_types.Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
94 }
95
96 // IgmpGroup defines type 'igmp_group'.
97 type IgmpGroup struct {
98         Filter    FilterMode                     `binapi:"filter_mode,name=filter" json:"filter,omitempty"`
99         NSrcs     uint8                          `binapi:"u8,name=n_srcs" json:"-"`
100         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
101         Gaddr     ip_types.IP4Address            `binapi:"ip4_address,name=gaddr" json:"gaddr,omitempty"`
102         Saddrs    []ip_types.IP4Address          `binapi:"ip4_address[n_srcs],name=saddrs" json:"saddrs,omitempty"`
103 }
104
105 // IgmpClearInterface defines message 'igmp_clear_interface'.
106 type IgmpClearInterface struct {
107         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
108 }
109
110 func (m *IgmpClearInterface) Reset()               { *m = IgmpClearInterface{} }
111 func (*IgmpClearInterface) GetMessageName() string { return "igmp_clear_interface" }
112 func (*IgmpClearInterface) GetCrcString() string   { return "f9e6675e" }
113 func (*IgmpClearInterface) GetMessageType() api.MessageType {
114         return api.RequestMessage
115 }
116
117 func (m *IgmpClearInterface) Size() int {
118         if m == nil {
119                 return 0
120         }
121         var size int
122         size += 4 // m.SwIfIndex
123         return size
124 }
125 func (m *IgmpClearInterface) Marshal(b []byte) ([]byte, error) {
126         var buf *codec.Buffer
127         if b == nil {
128                 buf = codec.NewBuffer(make([]byte, m.Size()))
129         } else {
130                 buf = codec.NewBuffer(b)
131         }
132         buf.EncodeUint32(uint32(m.SwIfIndex))
133         return buf.Bytes(), nil
134 }
135 func (m *IgmpClearInterface) Unmarshal(b []byte) error {
136         buf := codec.NewBuffer(b)
137         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
138         return nil
139 }
140
141 // IgmpClearInterfaceReply defines message 'igmp_clear_interface_reply'.
142 type IgmpClearInterfaceReply struct {
143         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
144 }
145
146 func (m *IgmpClearInterfaceReply) Reset()               { *m = IgmpClearInterfaceReply{} }
147 func (*IgmpClearInterfaceReply) GetMessageName() string { return "igmp_clear_interface_reply" }
148 func (*IgmpClearInterfaceReply) GetCrcString() string   { return "e8d4e804" }
149 func (*IgmpClearInterfaceReply) GetMessageType() api.MessageType {
150         return api.ReplyMessage
151 }
152
153 func (m *IgmpClearInterfaceReply) Size() int {
154         if m == nil {
155                 return 0
156         }
157         var size int
158         size += 4 // m.Retval
159         return size
160 }
161 func (m *IgmpClearInterfaceReply) Marshal(b []byte) ([]byte, error) {
162         var buf *codec.Buffer
163         if b == nil {
164                 buf = codec.NewBuffer(make([]byte, m.Size()))
165         } else {
166                 buf = codec.NewBuffer(b)
167         }
168         buf.EncodeUint32(uint32(m.Retval))
169         return buf.Bytes(), nil
170 }
171 func (m *IgmpClearInterfaceReply) Unmarshal(b []byte) error {
172         buf := codec.NewBuffer(b)
173         m.Retval = int32(buf.DecodeUint32())
174         return nil
175 }
176
177 // IgmpDetails defines message 'igmp_details'.
178 type IgmpDetails struct {
179         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
180         Saddr     ip_types.IP4Address            `binapi:"ip4_address,name=saddr" json:"saddr,omitempty"`
181         Gaddr     ip_types.IP4Address            `binapi:"ip4_address,name=gaddr" json:"gaddr,omitempty"`
182 }
183
184 func (m *IgmpDetails) Reset()               { *m = IgmpDetails{} }
185 func (*IgmpDetails) GetMessageName() string { return "igmp_details" }
186 func (*IgmpDetails) GetCrcString() string   { return "52f12a89" }
187 func (*IgmpDetails) GetMessageType() api.MessageType {
188         return api.ReplyMessage
189 }
190
191 func (m *IgmpDetails) Size() int {
192         if m == nil {
193                 return 0
194         }
195         var size int
196         size += 4     // m.SwIfIndex
197         size += 1 * 4 // m.Saddr
198         size += 1 * 4 // m.Gaddr
199         return size
200 }
201 func (m *IgmpDetails) Marshal(b []byte) ([]byte, error) {
202         var buf *codec.Buffer
203         if b == nil {
204                 buf = codec.NewBuffer(make([]byte, m.Size()))
205         } else {
206                 buf = codec.NewBuffer(b)
207         }
208         buf.EncodeUint32(uint32(m.SwIfIndex))
209         buf.EncodeBytes(m.Saddr[:], 4)
210         buf.EncodeBytes(m.Gaddr[:], 4)
211         return buf.Bytes(), nil
212 }
213 func (m *IgmpDetails) Unmarshal(b []byte) error {
214         buf := codec.NewBuffer(b)
215         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
216         copy(m.Saddr[:], buf.DecodeBytes(4))
217         copy(m.Gaddr[:], buf.DecodeBytes(4))
218         return nil
219 }
220
221 // IgmpDump defines message 'igmp_dump'.
222 type IgmpDump struct {
223         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
224 }
225
226 func (m *IgmpDump) Reset()               { *m = IgmpDump{} }
227 func (*IgmpDump) GetMessageName() string { return "igmp_dump" }
228 func (*IgmpDump) GetCrcString() string   { return "f9e6675e" }
229 func (*IgmpDump) GetMessageType() api.MessageType {
230         return api.RequestMessage
231 }
232
233 func (m *IgmpDump) Size() int {
234         if m == nil {
235                 return 0
236         }
237         var size int
238         size += 4 // m.SwIfIndex
239         return size
240 }
241 func (m *IgmpDump) Marshal(b []byte) ([]byte, error) {
242         var buf *codec.Buffer
243         if b == nil {
244                 buf = codec.NewBuffer(make([]byte, m.Size()))
245         } else {
246                 buf = codec.NewBuffer(b)
247         }
248         buf.EncodeUint32(uint32(m.SwIfIndex))
249         return buf.Bytes(), nil
250 }
251 func (m *IgmpDump) Unmarshal(b []byte) error {
252         buf := codec.NewBuffer(b)
253         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
254         return nil
255 }
256
257 // IgmpEnableDisable defines message 'igmp_enable_disable'.
258 type IgmpEnableDisable struct {
259         Enable    bool                           `binapi:"bool,name=enable" json:"enable,omitempty"`
260         Mode      uint8                          `binapi:"u8,name=mode" json:"mode,omitempty"`
261         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
262 }
263
264 func (m *IgmpEnableDisable) Reset()               { *m = IgmpEnableDisable{} }
265 func (*IgmpEnableDisable) GetMessageName() string { return "igmp_enable_disable" }
266 func (*IgmpEnableDisable) GetCrcString() string   { return "b1edfb96" }
267 func (*IgmpEnableDisable) GetMessageType() api.MessageType {
268         return api.RequestMessage
269 }
270
271 func (m *IgmpEnableDisable) Size() int {
272         if m == nil {
273                 return 0
274         }
275         var size int
276         size += 1 // m.Enable
277         size += 1 // m.Mode
278         size += 4 // m.SwIfIndex
279         return size
280 }
281 func (m *IgmpEnableDisable) Marshal(b []byte) ([]byte, error) {
282         var buf *codec.Buffer
283         if b == nil {
284                 buf = codec.NewBuffer(make([]byte, m.Size()))
285         } else {
286                 buf = codec.NewBuffer(b)
287         }
288         buf.EncodeBool(m.Enable)
289         buf.EncodeUint8(uint8(m.Mode))
290         buf.EncodeUint32(uint32(m.SwIfIndex))
291         return buf.Bytes(), nil
292 }
293 func (m *IgmpEnableDisable) Unmarshal(b []byte) error {
294         buf := codec.NewBuffer(b)
295         m.Enable = buf.DecodeBool()
296         m.Mode = buf.DecodeUint8()
297         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
298         return nil
299 }
300
301 // IgmpEnableDisableReply defines message 'igmp_enable_disable_reply'.
302 type IgmpEnableDisableReply struct {
303         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
304 }
305
306 func (m *IgmpEnableDisableReply) Reset()               { *m = IgmpEnableDisableReply{} }
307 func (*IgmpEnableDisableReply) GetMessageName() string { return "igmp_enable_disable_reply" }
308 func (*IgmpEnableDisableReply) GetCrcString() string   { return "e8d4e804" }
309 func (*IgmpEnableDisableReply) GetMessageType() api.MessageType {
310         return api.ReplyMessage
311 }
312
313 func (m *IgmpEnableDisableReply) Size() int {
314         if m == nil {
315                 return 0
316         }
317         var size int
318         size += 4 // m.Retval
319         return size
320 }
321 func (m *IgmpEnableDisableReply) Marshal(b []byte) ([]byte, error) {
322         var buf *codec.Buffer
323         if b == nil {
324                 buf = codec.NewBuffer(make([]byte, m.Size()))
325         } else {
326                 buf = codec.NewBuffer(b)
327         }
328         buf.EncodeUint32(uint32(m.Retval))
329         return buf.Bytes(), nil
330 }
331 func (m *IgmpEnableDisableReply) Unmarshal(b []byte) error {
332         buf := codec.NewBuffer(b)
333         m.Retval = int32(buf.DecodeUint32())
334         return nil
335 }
336
337 // IgmpEvent defines message 'igmp_event'.
338 type IgmpEvent struct {
339         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
340         Filter    FilterMode                     `binapi:"filter_mode,name=filter" json:"filter,omitempty"`
341         Saddr     ip_types.IP4Address            `binapi:"ip4_address,name=saddr" json:"saddr,omitempty"`
342         Gaddr     ip_types.IP4Address            `binapi:"ip4_address,name=gaddr" json:"gaddr,omitempty"`
343 }
344
345 func (m *IgmpEvent) Reset()               { *m = IgmpEvent{} }
346 func (*IgmpEvent) GetMessageName() string { return "igmp_event" }
347 func (*IgmpEvent) GetCrcString() string   { return "d7696eaf" }
348 func (*IgmpEvent) GetMessageType() api.MessageType {
349         return api.OtherMessage
350 }
351
352 func (m *IgmpEvent) Size() int {
353         if m == nil {
354                 return 0
355         }
356         var size int
357         size += 4     // m.SwIfIndex
358         size += 4     // m.Filter
359         size += 1 * 4 // m.Saddr
360         size += 1 * 4 // m.Gaddr
361         return size
362 }
363 func (m *IgmpEvent) Marshal(b []byte) ([]byte, error) {
364         var buf *codec.Buffer
365         if b == nil {
366                 buf = codec.NewBuffer(make([]byte, m.Size()))
367         } else {
368                 buf = codec.NewBuffer(b)
369         }
370         buf.EncodeUint32(uint32(m.SwIfIndex))
371         buf.EncodeUint32(uint32(m.Filter))
372         buf.EncodeBytes(m.Saddr[:], 4)
373         buf.EncodeBytes(m.Gaddr[:], 4)
374         return buf.Bytes(), nil
375 }
376 func (m *IgmpEvent) Unmarshal(b []byte) error {
377         buf := codec.NewBuffer(b)
378         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
379         m.Filter = FilterMode(buf.DecodeUint32())
380         copy(m.Saddr[:], buf.DecodeBytes(4))
381         copy(m.Gaddr[:], buf.DecodeBytes(4))
382         return nil
383 }
384
385 // IgmpGroupPrefixDetails defines message 'igmp_group_prefix_details'.
386 type IgmpGroupPrefixDetails struct {
387         Gp GroupPrefix `binapi:"group_prefix,name=gp" json:"gp,omitempty"`
388 }
389
390 func (m *IgmpGroupPrefixDetails) Reset()               { *m = IgmpGroupPrefixDetails{} }
391 func (*IgmpGroupPrefixDetails) GetMessageName() string { return "igmp_group_prefix_details" }
392 func (*IgmpGroupPrefixDetails) GetCrcString() string   { return "c3b3c526" }
393 func (*IgmpGroupPrefixDetails) GetMessageType() api.MessageType {
394         return api.ReplyMessage
395 }
396
397 func (m *IgmpGroupPrefixDetails) Size() int {
398         if m == nil {
399                 return 0
400         }
401         var size int
402         size += 4      // m.Gp.Type
403         size += 1      // m.Gp.Prefix.Address.Af
404         size += 1 * 16 // m.Gp.Prefix.Address.Un
405         size += 1      // m.Gp.Prefix.Len
406         return size
407 }
408 func (m *IgmpGroupPrefixDetails) Marshal(b []byte) ([]byte, error) {
409         var buf *codec.Buffer
410         if b == nil {
411                 buf = codec.NewBuffer(make([]byte, m.Size()))
412         } else {
413                 buf = codec.NewBuffer(b)
414         }
415         buf.EncodeUint32(uint32(m.Gp.Type))
416         buf.EncodeUint8(uint8(m.Gp.Prefix.Address.Af))
417         buf.EncodeBytes(m.Gp.Prefix.Address.Un.XXX_UnionData[:], 0)
418         buf.EncodeUint8(uint8(m.Gp.Prefix.Len))
419         return buf.Bytes(), nil
420 }
421 func (m *IgmpGroupPrefixDetails) Unmarshal(b []byte) error {
422         buf := codec.NewBuffer(b)
423         m.Gp.Type = GroupPrefixType(buf.DecodeUint32())
424         m.Gp.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
425         copy(m.Gp.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
426         m.Gp.Prefix.Len = buf.DecodeUint8()
427         return nil
428 }
429
430 // IgmpGroupPrefixDump defines message 'igmp_group_prefix_dump'.
431 type IgmpGroupPrefixDump struct{}
432
433 func (m *IgmpGroupPrefixDump) Reset()               { *m = IgmpGroupPrefixDump{} }
434 func (*IgmpGroupPrefixDump) GetMessageName() string { return "igmp_group_prefix_dump" }
435 func (*IgmpGroupPrefixDump) GetCrcString() string   { return "51077d14" }
436 func (*IgmpGroupPrefixDump) GetMessageType() api.MessageType {
437         return api.RequestMessage
438 }
439
440 func (m *IgmpGroupPrefixDump) Size() int {
441         if m == nil {
442                 return 0
443         }
444         var size int
445         return size
446 }
447 func (m *IgmpGroupPrefixDump) Marshal(b []byte) ([]byte, error) {
448         var buf *codec.Buffer
449         if b == nil {
450                 buf = codec.NewBuffer(make([]byte, m.Size()))
451         } else {
452                 buf = codec.NewBuffer(b)
453         }
454         return buf.Bytes(), nil
455 }
456 func (m *IgmpGroupPrefixDump) Unmarshal(b []byte) error {
457         return nil
458 }
459
460 // IgmpGroupPrefixSet defines message 'igmp_group_prefix_set'.
461 type IgmpGroupPrefixSet struct {
462         Gp GroupPrefix `binapi:"group_prefix,name=gp" json:"gp,omitempty"`
463 }
464
465 func (m *IgmpGroupPrefixSet) Reset()               { *m = IgmpGroupPrefixSet{} }
466 func (*IgmpGroupPrefixSet) GetMessageName() string { return "igmp_group_prefix_set" }
467 func (*IgmpGroupPrefixSet) GetCrcString() string   { return "d4f20ac5" }
468 func (*IgmpGroupPrefixSet) GetMessageType() api.MessageType {
469         return api.RequestMessage
470 }
471
472 func (m *IgmpGroupPrefixSet) Size() int {
473         if m == nil {
474                 return 0
475         }
476         var size int
477         size += 4      // m.Gp.Type
478         size += 1      // m.Gp.Prefix.Address.Af
479         size += 1 * 16 // m.Gp.Prefix.Address.Un
480         size += 1      // m.Gp.Prefix.Len
481         return size
482 }
483 func (m *IgmpGroupPrefixSet) Marshal(b []byte) ([]byte, error) {
484         var buf *codec.Buffer
485         if b == nil {
486                 buf = codec.NewBuffer(make([]byte, m.Size()))
487         } else {
488                 buf = codec.NewBuffer(b)
489         }
490         buf.EncodeUint32(uint32(m.Gp.Type))
491         buf.EncodeUint8(uint8(m.Gp.Prefix.Address.Af))
492         buf.EncodeBytes(m.Gp.Prefix.Address.Un.XXX_UnionData[:], 0)
493         buf.EncodeUint8(uint8(m.Gp.Prefix.Len))
494         return buf.Bytes(), nil
495 }
496 func (m *IgmpGroupPrefixSet) Unmarshal(b []byte) error {
497         buf := codec.NewBuffer(b)
498         m.Gp.Type = GroupPrefixType(buf.DecodeUint32())
499         m.Gp.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
500         copy(m.Gp.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
501         m.Gp.Prefix.Len = buf.DecodeUint8()
502         return nil
503 }
504
505 // IgmpGroupPrefixSetReply defines message 'igmp_group_prefix_set_reply'.
506 type IgmpGroupPrefixSetReply struct {
507         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
508 }
509
510 func (m *IgmpGroupPrefixSetReply) Reset()               { *m = IgmpGroupPrefixSetReply{} }
511 func (*IgmpGroupPrefixSetReply) GetMessageName() string { return "igmp_group_prefix_set_reply" }
512 func (*IgmpGroupPrefixSetReply) GetCrcString() string   { return "e8d4e804" }
513 func (*IgmpGroupPrefixSetReply) GetMessageType() api.MessageType {
514         return api.ReplyMessage
515 }
516
517 func (m *IgmpGroupPrefixSetReply) Size() int {
518         if m == nil {
519                 return 0
520         }
521         var size int
522         size += 4 // m.Retval
523         return size
524 }
525 func (m *IgmpGroupPrefixSetReply) Marshal(b []byte) ([]byte, error) {
526         var buf *codec.Buffer
527         if b == nil {
528                 buf = codec.NewBuffer(make([]byte, m.Size()))
529         } else {
530                 buf = codec.NewBuffer(b)
531         }
532         buf.EncodeUint32(uint32(m.Retval))
533         return buf.Bytes(), nil
534 }
535 func (m *IgmpGroupPrefixSetReply) Unmarshal(b []byte) error {
536         buf := codec.NewBuffer(b)
537         m.Retval = int32(buf.DecodeUint32())
538         return nil
539 }
540
541 // IgmpListen defines message 'igmp_listen'.
542 type IgmpListen struct {
543         Group IgmpGroup `binapi:"igmp_group,name=group" json:"group,omitempty"`
544 }
545
546 func (m *IgmpListen) Reset()               { *m = IgmpListen{} }
547 func (*IgmpListen) GetMessageName() string { return "igmp_listen" }
548 func (*IgmpListen) GetCrcString() string   { return "3f93a51a" }
549 func (*IgmpListen) GetMessageType() api.MessageType {
550         return api.RequestMessage
551 }
552
553 func (m *IgmpListen) Size() int {
554         if m == nil {
555                 return 0
556         }
557         var size int
558         size += 4     // m.Group.Filter
559         size += 1     // m.Group.NSrcs
560         size += 4     // m.Group.SwIfIndex
561         size += 1 * 4 // m.Group.Gaddr
562         for j2 := 0; j2 < len(m.Group.Saddrs); j2++ {
563                 var s2 ip_types.IP4Address
564                 _ = s2
565                 if j2 < len(m.Group.Saddrs) {
566                         s2 = m.Group.Saddrs[j2]
567                 }
568                 size += 1 * 4 // s2
569         }
570         return size
571 }
572 func (m *IgmpListen) Marshal(b []byte) ([]byte, error) {
573         var buf *codec.Buffer
574         if b == nil {
575                 buf = codec.NewBuffer(make([]byte, m.Size()))
576         } else {
577                 buf = codec.NewBuffer(b)
578         }
579         buf.EncodeUint32(uint32(m.Group.Filter))
580         buf.EncodeUint8(uint8(len(m.Group.Saddrs)))
581         buf.EncodeUint32(uint32(m.Group.SwIfIndex))
582         buf.EncodeBytes(m.Group.Gaddr[:], 4)
583         for j1 := 0; j1 < len(m.Group.Saddrs); j1++ {
584                 var v1 ip_types.IP4Address
585                 if j1 < len(m.Group.Saddrs) {
586                         v1 = m.Group.Saddrs[j1]
587                 }
588                 buf.EncodeBytes(v1[:], 4)
589         }
590         return buf.Bytes(), nil
591 }
592 func (m *IgmpListen) Unmarshal(b []byte) error {
593         buf := codec.NewBuffer(b)
594         m.Group.Filter = FilterMode(buf.DecodeUint32())
595         m.Group.NSrcs = buf.DecodeUint8()
596         m.Group.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
597         copy(m.Group.Gaddr[:], buf.DecodeBytes(4))
598         m.Group.Saddrs = make([]ip_types.IP4Address, int(m.Group.NSrcs))
599         for j1 := 0; j1 < len(m.Group.Saddrs); j1++ {
600                 copy(m.Group.Saddrs[j1][:], buf.DecodeBytes(4))
601         }
602         return nil
603 }
604
605 // IgmpListenReply defines message 'igmp_listen_reply'.
606 type IgmpListenReply struct {
607         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
608 }
609
610 func (m *IgmpListenReply) Reset()               { *m = IgmpListenReply{} }
611 func (*IgmpListenReply) GetMessageName() string { return "igmp_listen_reply" }
612 func (*IgmpListenReply) GetCrcString() string   { return "e8d4e804" }
613 func (*IgmpListenReply) GetMessageType() api.MessageType {
614         return api.ReplyMessage
615 }
616
617 func (m *IgmpListenReply) Size() int {
618         if m == nil {
619                 return 0
620         }
621         var size int
622         size += 4 // m.Retval
623         return size
624 }
625 func (m *IgmpListenReply) Marshal(b []byte) ([]byte, error) {
626         var buf *codec.Buffer
627         if b == nil {
628                 buf = codec.NewBuffer(make([]byte, m.Size()))
629         } else {
630                 buf = codec.NewBuffer(b)
631         }
632         buf.EncodeUint32(uint32(m.Retval))
633         return buf.Bytes(), nil
634 }
635 func (m *IgmpListenReply) Unmarshal(b []byte) error {
636         buf := codec.NewBuffer(b)
637         m.Retval = int32(buf.DecodeUint32())
638         return nil
639 }
640
641 // IgmpProxyDeviceAddDel defines message 'igmp_proxy_device_add_del'.
642 type IgmpProxyDeviceAddDel struct {
643         Add       uint8                          `binapi:"u8,name=add" json:"add,omitempty"`
644         VrfID     uint32                         `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
645         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
646 }
647
648 func (m *IgmpProxyDeviceAddDel) Reset()               { *m = IgmpProxyDeviceAddDel{} }
649 func (*IgmpProxyDeviceAddDel) GetMessageName() string { return "igmp_proxy_device_add_del" }
650 func (*IgmpProxyDeviceAddDel) GetCrcString() string   { return "0b9be9ce" }
651 func (*IgmpProxyDeviceAddDel) GetMessageType() api.MessageType {
652         return api.RequestMessage
653 }
654
655 func (m *IgmpProxyDeviceAddDel) Size() int {
656         if m == nil {
657                 return 0
658         }
659         var size int
660         size += 1 // m.Add
661         size += 4 // m.VrfID
662         size += 4 // m.SwIfIndex
663         return size
664 }
665 func (m *IgmpProxyDeviceAddDel) Marshal(b []byte) ([]byte, error) {
666         var buf *codec.Buffer
667         if b == nil {
668                 buf = codec.NewBuffer(make([]byte, m.Size()))
669         } else {
670                 buf = codec.NewBuffer(b)
671         }
672         buf.EncodeUint8(uint8(m.Add))
673         buf.EncodeUint32(uint32(m.VrfID))
674         buf.EncodeUint32(uint32(m.SwIfIndex))
675         return buf.Bytes(), nil
676 }
677 func (m *IgmpProxyDeviceAddDel) Unmarshal(b []byte) error {
678         buf := codec.NewBuffer(b)
679         m.Add = buf.DecodeUint8()
680         m.VrfID = buf.DecodeUint32()
681         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
682         return nil
683 }
684
685 // IgmpProxyDeviceAddDelInterface defines message 'igmp_proxy_device_add_del_interface'.
686 type IgmpProxyDeviceAddDelInterface struct {
687         Add       bool                           `binapi:"bool,name=add" json:"add,omitempty"`
688         VrfID     uint32                         `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
689         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
690 }
691
692 func (m *IgmpProxyDeviceAddDelInterface) Reset() { *m = IgmpProxyDeviceAddDelInterface{} }
693 func (*IgmpProxyDeviceAddDelInterface) GetMessageName() string {
694         return "igmp_proxy_device_add_del_interface"
695 }
696 func (*IgmpProxyDeviceAddDelInterface) GetCrcString() string { return "1a9ec24a" }
697 func (*IgmpProxyDeviceAddDelInterface) GetMessageType() api.MessageType {
698         return api.RequestMessage
699 }
700
701 func (m *IgmpProxyDeviceAddDelInterface) Size() int {
702         if m == nil {
703                 return 0
704         }
705         var size int
706         size += 1 // m.Add
707         size += 4 // m.VrfID
708         size += 4 // m.SwIfIndex
709         return size
710 }
711 func (m *IgmpProxyDeviceAddDelInterface) Marshal(b []byte) ([]byte, error) {
712         var buf *codec.Buffer
713         if b == nil {
714                 buf = codec.NewBuffer(make([]byte, m.Size()))
715         } else {
716                 buf = codec.NewBuffer(b)
717         }
718         buf.EncodeBool(m.Add)
719         buf.EncodeUint32(uint32(m.VrfID))
720         buf.EncodeUint32(uint32(m.SwIfIndex))
721         return buf.Bytes(), nil
722 }
723 func (m *IgmpProxyDeviceAddDelInterface) Unmarshal(b []byte) error {
724         buf := codec.NewBuffer(b)
725         m.Add = buf.DecodeBool()
726         m.VrfID = buf.DecodeUint32()
727         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
728         return nil
729 }
730
731 // IgmpProxyDeviceAddDelInterfaceReply defines message 'igmp_proxy_device_add_del_interface_reply'.
732 type IgmpProxyDeviceAddDelInterfaceReply struct {
733         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
734 }
735
736 func (m *IgmpProxyDeviceAddDelInterfaceReply) Reset() { *m = IgmpProxyDeviceAddDelInterfaceReply{} }
737 func (*IgmpProxyDeviceAddDelInterfaceReply) GetMessageName() string {
738         return "igmp_proxy_device_add_del_interface_reply"
739 }
740 func (*IgmpProxyDeviceAddDelInterfaceReply) GetCrcString() string { return "e8d4e804" }
741 func (*IgmpProxyDeviceAddDelInterfaceReply) GetMessageType() api.MessageType {
742         return api.ReplyMessage
743 }
744
745 func (m *IgmpProxyDeviceAddDelInterfaceReply) Size() int {
746         if m == nil {
747                 return 0
748         }
749         var size int
750         size += 4 // m.Retval
751         return size
752 }
753 func (m *IgmpProxyDeviceAddDelInterfaceReply) Marshal(b []byte) ([]byte, error) {
754         var buf *codec.Buffer
755         if b == nil {
756                 buf = codec.NewBuffer(make([]byte, m.Size()))
757         } else {
758                 buf = codec.NewBuffer(b)
759         }
760         buf.EncodeUint32(uint32(m.Retval))
761         return buf.Bytes(), nil
762 }
763 func (m *IgmpProxyDeviceAddDelInterfaceReply) Unmarshal(b []byte) error {
764         buf := codec.NewBuffer(b)
765         m.Retval = int32(buf.DecodeUint32())
766         return nil
767 }
768
769 // IgmpProxyDeviceAddDelReply defines message 'igmp_proxy_device_add_del_reply'.
770 type IgmpProxyDeviceAddDelReply struct {
771         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
772 }
773
774 func (m *IgmpProxyDeviceAddDelReply) Reset()               { *m = IgmpProxyDeviceAddDelReply{} }
775 func (*IgmpProxyDeviceAddDelReply) GetMessageName() string { return "igmp_proxy_device_add_del_reply" }
776 func (*IgmpProxyDeviceAddDelReply) GetCrcString() string   { return "e8d4e804" }
777 func (*IgmpProxyDeviceAddDelReply) GetMessageType() api.MessageType {
778         return api.ReplyMessage
779 }
780
781 func (m *IgmpProxyDeviceAddDelReply) Size() int {
782         if m == nil {
783                 return 0
784         }
785         var size int
786         size += 4 // m.Retval
787         return size
788 }
789 func (m *IgmpProxyDeviceAddDelReply) Marshal(b []byte) ([]byte, error) {
790         var buf *codec.Buffer
791         if b == nil {
792                 buf = codec.NewBuffer(make([]byte, m.Size()))
793         } else {
794                 buf = codec.NewBuffer(b)
795         }
796         buf.EncodeUint32(uint32(m.Retval))
797         return buf.Bytes(), nil
798 }
799 func (m *IgmpProxyDeviceAddDelReply) Unmarshal(b []byte) error {
800         buf := codec.NewBuffer(b)
801         m.Retval = int32(buf.DecodeUint32())
802         return nil
803 }
804
805 // WantIgmpEvents defines message 'want_igmp_events'.
806 type WantIgmpEvents struct {
807         Enable uint32 `binapi:"u32,name=enable" json:"enable,omitempty"`
808         PID    uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
809 }
810
811 func (m *WantIgmpEvents) Reset()               { *m = WantIgmpEvents{} }
812 func (*WantIgmpEvents) GetMessageName() string { return "want_igmp_events" }
813 func (*WantIgmpEvents) GetCrcString() string   { return "cfaccc1f" }
814 func (*WantIgmpEvents) GetMessageType() api.MessageType {
815         return api.RequestMessage
816 }
817
818 func (m *WantIgmpEvents) Size() int {
819         if m == nil {
820                 return 0
821         }
822         var size int
823         size += 4 // m.Enable
824         size += 4 // m.PID
825         return size
826 }
827 func (m *WantIgmpEvents) Marshal(b []byte) ([]byte, error) {
828         var buf *codec.Buffer
829         if b == nil {
830                 buf = codec.NewBuffer(make([]byte, m.Size()))
831         } else {
832                 buf = codec.NewBuffer(b)
833         }
834         buf.EncodeUint32(uint32(m.Enable))
835         buf.EncodeUint32(uint32(m.PID))
836         return buf.Bytes(), nil
837 }
838 func (m *WantIgmpEvents) Unmarshal(b []byte) error {
839         buf := codec.NewBuffer(b)
840         m.Enable = buf.DecodeUint32()
841         m.PID = buf.DecodeUint32()
842         return nil
843 }
844
845 // WantIgmpEventsReply defines message 'want_igmp_events_reply'.
846 type WantIgmpEventsReply struct {
847         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
848 }
849
850 func (m *WantIgmpEventsReply) Reset()               { *m = WantIgmpEventsReply{} }
851 func (*WantIgmpEventsReply) GetMessageName() string { return "want_igmp_events_reply" }
852 func (*WantIgmpEventsReply) GetCrcString() string   { return "e8d4e804" }
853 func (*WantIgmpEventsReply) GetMessageType() api.MessageType {
854         return api.ReplyMessage
855 }
856
857 func (m *WantIgmpEventsReply) Size() int {
858         if m == nil {
859                 return 0
860         }
861         var size int
862         size += 4 // m.Retval
863         return size
864 }
865 func (m *WantIgmpEventsReply) Marshal(b []byte) ([]byte, error) {
866         var buf *codec.Buffer
867         if b == nil {
868                 buf = codec.NewBuffer(make([]byte, m.Size()))
869         } else {
870                 buf = codec.NewBuffer(b)
871         }
872         buf.EncodeUint32(uint32(m.Retval))
873         return buf.Bytes(), nil
874 }
875 func (m *WantIgmpEventsReply) Unmarshal(b []byte) error {
876         buf := codec.NewBuffer(b)
877         m.Retval = int32(buf.DecodeUint32())
878         return nil
879 }
880
881 func init() { file_igmp_binapi_init() }
882 func file_igmp_binapi_init() {
883         api.RegisterMessage((*IgmpClearInterface)(nil), "igmp_clear_interface_f9e6675e")
884         api.RegisterMessage((*IgmpClearInterfaceReply)(nil), "igmp_clear_interface_reply_e8d4e804")
885         api.RegisterMessage((*IgmpDetails)(nil), "igmp_details_52f12a89")
886         api.RegisterMessage((*IgmpDump)(nil), "igmp_dump_f9e6675e")
887         api.RegisterMessage((*IgmpEnableDisable)(nil), "igmp_enable_disable_b1edfb96")
888         api.RegisterMessage((*IgmpEnableDisableReply)(nil), "igmp_enable_disable_reply_e8d4e804")
889         api.RegisterMessage((*IgmpEvent)(nil), "igmp_event_d7696eaf")
890         api.RegisterMessage((*IgmpGroupPrefixDetails)(nil), "igmp_group_prefix_details_c3b3c526")
891         api.RegisterMessage((*IgmpGroupPrefixDump)(nil), "igmp_group_prefix_dump_51077d14")
892         api.RegisterMessage((*IgmpGroupPrefixSet)(nil), "igmp_group_prefix_set_d4f20ac5")
893         api.RegisterMessage((*IgmpGroupPrefixSetReply)(nil), "igmp_group_prefix_set_reply_e8d4e804")
894         api.RegisterMessage((*IgmpListen)(nil), "igmp_listen_3f93a51a")
895         api.RegisterMessage((*IgmpListenReply)(nil), "igmp_listen_reply_e8d4e804")
896         api.RegisterMessage((*IgmpProxyDeviceAddDel)(nil), "igmp_proxy_device_add_del_0b9be9ce")
897         api.RegisterMessage((*IgmpProxyDeviceAddDelInterface)(nil), "igmp_proxy_device_add_del_interface_1a9ec24a")
898         api.RegisterMessage((*IgmpProxyDeviceAddDelInterfaceReply)(nil), "igmp_proxy_device_add_del_interface_reply_e8d4e804")
899         api.RegisterMessage((*IgmpProxyDeviceAddDelReply)(nil), "igmp_proxy_device_add_del_reply_e8d4e804")
900         api.RegisterMessage((*WantIgmpEvents)(nil), "want_igmp_events_cfaccc1f")
901         api.RegisterMessage((*WantIgmpEventsReply)(nil), "want_igmp_events_reply_e8d4e804")
902 }
903
904 // Messages returns list of all messages in this module.
905 func AllMessages() []api.Message {
906         return []api.Message{
907                 (*IgmpClearInterface)(nil),
908                 (*IgmpClearInterfaceReply)(nil),
909                 (*IgmpDetails)(nil),
910                 (*IgmpDump)(nil),
911                 (*IgmpEnableDisable)(nil),
912                 (*IgmpEnableDisableReply)(nil),
913                 (*IgmpEvent)(nil),
914                 (*IgmpGroupPrefixDetails)(nil),
915                 (*IgmpGroupPrefixDump)(nil),
916                 (*IgmpGroupPrefixSet)(nil),
917                 (*IgmpGroupPrefixSetReply)(nil),
918                 (*IgmpListen)(nil),
919                 (*IgmpListenReply)(nil),
920                 (*IgmpProxyDeviceAddDel)(nil),
921                 (*IgmpProxyDeviceAddDelInterface)(nil),
922                 (*IgmpProxyDeviceAddDelInterfaceReply)(nil),
923                 (*IgmpProxyDeviceAddDelReply)(nil),
924                 (*WantIgmpEvents)(nil),
925                 (*WantIgmpEventsReply)(nil),
926         }
927 }