summaryrefslogtreecommitdiffstats
path: root/binapi/lb/lb.ba.go
blob: 9fdfc7f24769b544627f654c0514a6d2a4313f14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
// versions:
//  binapi-generator: v0.4.0-dev
//  VPP:              20.05-release
// source: /usr/share/vpp/api/plugins/lb.api.json

// Package lb contains generated bindings for API file lb.api.
//
// Contents:
//  16 messages
//
package lb

import (
	api "git.fd.io/govpp.git/api"
	interface_types "git.fd.io/govpp.git/binapi/interface_types"
	ip_types "git.fd.io/govpp.git/binapi/ip_types"
	lb_types "git.fd.io/govpp.git/binapi/lb_types"
	codec "git.fd.io/govpp.git/codec"
)

// This is a compile-time assertion to ensure that this generated file
// is compatible with the GoVPP api package it is being compiled against.
// A compilation error at this line likely means your copy of the
// GoVPP api package needs to be updated.
const _ = api.GoVppAPIPackageIsVersion2

const (
	APIFile    = "lb"
	APIVersion = "1.0.0"
	VersionCrc = 0x5e4e85b1
)

// LbAddDelAs defines message 'lb_add_del_as'.
type LbAddDelAs struct {
	Pfx       ip_types.AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"`
	Protocol  uint8                      `binapi:"u8,name=protocol,default=255" json:"protocol,omitempty"`
	Port      uint16                     `binapi:"u16,name=port" json:"port,omitempty"`
	AsAddress ip_types.Address           `binapi:"address,name=as_address" json:"as_address,omitempty"`
	IsDel     bool                       `binapi:"bool,name=is_del" json:"is_del,omitempty"`
	IsFlush   bool                       `binapi:"bool,name=is_flush" json:"is_flush,omitempty"`
}

func (m *LbAddDelAs) Reset()               { *m = LbAddDelAs{} }
func (*LbAddDelAs) GetMessageName() string { return "lb_add_del_as" }
func (*LbAddDelAs) GetCrcString() string   { return "78628987" }
func (*LbAddDelAs) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *LbAddDelAs) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 1      // m.Pfx.Address.Af
	size += 1 * 16 // m.Pfx.Address.Un
	size += 1      // m.Pfx.Len
	size += 1      // m.Protocol
	size += 2      // m.Port
	size += 1      // m.AsAddress.Af
	size += 1 * 16 // m.AsAddress.Un
	size += 1      // m.IsDel
	size += 1      // m.IsFlush
	return size
}
func (m *LbAddDelAs) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeUint8(uint8(m.Pfx.Address.Af))
	buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 16)
	buf.EncodeUint8(m.Pfx.Len)
	buf.EncodeUint8(m.Protocol)
	buf.EncodeUint16(m.Port)
	buf.EncodeUint8(uint8(m.AsAddress.Af))
	buf.EncodeBytes(m.AsAddress.Un.XXX_UnionData[:], 16)
	buf.EncodeBool(m.IsDel)
	buf.EncodeBool(m.IsFlush)
	return buf.Bytes(), nil
}
func (m *LbAddDelAs) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Pfx.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
	copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
	m.Pfx.Len = buf.DecodeUint8()
	m.Protocol = buf.DecodeUint8()
	m.Port = buf.DecodeUint16()
	m.AsAddress.Af = ip_types.AddressFamily(buf.DecodeUint8())
	copy(m.AsAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
	m.IsDel = buf.DecodeBool()
	m.IsFlush = buf.DecodeBool()
	return nil
}

// LbAddDelAsReply defines message 'lb_add_del_as_reply'.
type LbAddDelAsReply struct {
	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}

func (m *LbAddDelAsReply) Reset()               { *m = LbAddDelAsReply{} }
func (*LbAddDelAsReply) GetMessageName() string { return "lb_add_del_as_reply" }
func (*LbAddDelAsReply) GetCrcString() string   { return "e8d4e804" }
func (*LbAddDelAsReply) GetMessageType() api.MessageType {
	return api.ReplyMessage
}

func (m *LbAddDelAsReply) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 4 // m.Retval
	return size
}
func (m *LbAddDelAsReply) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeInt32(m.Retval)
	return buf.Bytes(), nil
}
func (m *LbAddDelAsReply) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Retval = buf.DecodeInt32()
	return nil
}

// LbAddDelIntfNat4 defines message 'lb_add_del_intf_nat4'.
type LbAddDelIntfNat4 struct {
	IsAdd     bool                           `binapi:"bool,name=is_add" json:"is_add,omitempty"`
	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
}

func (m *LbAddDelIntfNat4) Reset()               { *m = LbAddDelIntfNat4{} }
func (*LbAddDelIntfNat4) GetMessageName() string { return "lb_add_del_intf_nat4" }
func (*LbAddDelIntfNat4) GetCrcString() string   { return "47d6e753" }
func (*LbAddDelIntfNat4) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *LbAddDelIntfNat4) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 1 // m.IsAdd
	size += 4 // m.SwIfIndex
	return size
}
func (m *LbAddDelIntfNat4) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeBool(m.IsAdd)
	buf.EncodeUint32(uint32(m.SwIfIndex))
	return buf.Bytes(), nil
}
func (m *LbAddDelIntfNat4) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.IsAdd = buf.DecodeBool()
	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
	return nil
}

// LbAddDelIntfNat4Reply defines message 'lb_add_del_intf_nat4_reply'.
type LbAddDelIntfNat4Reply struct {
	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}

func (m *LbAddDelIntfNat4Reply) Reset()               { *m = LbAddDelIntfNat4Reply{} }
func (*LbAddDelIntfNat4Reply) GetMessageName() string { return "lb_add_del_intf_nat4_reply" }
func (*LbAddDelIntfNat4Reply) GetCrcString() string   { return "e8d4e804" }
func (*LbAddDelIntfNat4Reply) GetMessageType() api.MessageType {
	return api.ReplyMessage
}

func (m *LbAddDelIntfNat4Reply) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 4 // m.Retval
	return size
}
func (m *LbAddDelIntfNat4Reply) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeInt32(m.Retval)
	return buf.Bytes(), nil
}
func (m *LbAddDelIntfNat4Reply) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Retval = buf.DecodeInt32()
	return nil
}

// LbAddDelIntfNat6 defines message 'lb_add_del_intf_nat6'.
type LbAddDelIntfNat6 struct {
	IsAdd     bool                           `binapi:"bool,name=is_add" json:"is_add,omitempty"`
	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
}

func (m *LbAddDelIntfNat6) Reset()               { *m = LbAddDelIntfNat6{} }
func (*LbAddDelIntfNat6) GetMessageName() string { return "lb_add_del_intf_nat6" }
func (*LbAddDelIntfNat6) GetCrcString() string   { return "47d6e753" }
func (*LbAddDelIntfNat6) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *LbAddDelIntfNat6) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 1 // m.IsAdd
	size += 4 // m.SwIfIndex
	return size
}
func (m *LbAddDelIntfNat6) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeBool(m.IsAdd)
	buf.EncodeUint32(uint32(m.SwIfIndex))
	return buf.Bytes(), nil
}
func (m *LbAddDelIntfNat6) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.IsAdd = buf.DecodeBool()
	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
	return nil
}

// LbAddDelIntfNat6Reply defines message 'lb_add_del_intf_nat6_reply'.
type LbAddDelIntfNat6Reply struct {
	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}

func (m *LbAddDelIntfNat6Reply) Reset()               { *m = LbAddDelIntfNat6Reply{} }
func (*LbAddDelIntfNat6Reply) GetMessageName() string { return "lb_add_del_intf_nat6_reply" }
func (*LbAddDelIntfNat6Reply) GetCrcString() string   { return "e8d4e804" }
func (*LbAddDelIntfNat6Reply) GetMessageType() api.MessageType {
	return api.ReplyMessage
}

func (m *LbAddDelIntfNat6Reply) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 4 // m.Retval
	return size
}
func (m *LbAddDelIntfNat6Reply) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeInt32(m.Retval)
	return buf.Bytes(), nil
}
func (m *LbAddDelIntfNat6Reply) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Retval = buf.DecodeInt32()
	return nil
}

// LbAddDelVip defines message 'lb_add_del_vip'.
type LbAddDelVip struct {
	Pfx                 ip_types.AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"`
	Protocol            uint8                      `binapi:"u8,name=protocol,default=255" json:"protocol,omitempty"`
	Port                uint16                     `binapi:"u16,name=port" json:"port,omitempty"`
	Encap               lb_types.LbEncapType       `binapi:"lb_encap_type,name=encap" json:"encap,omitempty"`
	Dscp                uint8                      `binapi:"u8,name=dscp" json:"dscp,omitempty"`
	Type                lb_types.LbSrvType         `binapi:"lb_srv_type,name=type" json:"type,omitempty"`
	TargetPort          uint16                     `binapi:"u16,name=target_port" json:"target_port,omitempty"`
	NodePort            uint16                     `binapi:"u16,name=node_port" json:"node_port,omitempty"`
	NewFlowsTableLength uint32                     `binapi:"u32,name=new_flows_table_length,default=1024" json:"new_flows_table_length,omitempty"`
	IsDel               bool                       `binapi:"bool,name=is_del" json:"is_del,omitempty"`
}

func (m *LbAddDelVip) Reset()               { *m = LbAddDelVip{} }
func (*LbAddDelVip) GetMessageName() string { return "lb_add_del_vip" }
func (*LbAddDelVip) GetCrcString() string   { return "d15b7ddc" }
func (*LbAddDelVip) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *LbAddDelVip) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 1      // m.Pfx.Address.Af
	size += 1 * 16 // m.Pfx.Address.Un
	size += 1      // m.Pfx.Len
	size += 1      // m.Protocol
	size += 2      // m.Port
	size += 4      // m.Encap
	size += 1      // m.Dscp
	size += 4      // m.Type
	size += 2      // m.TargetPort
	size += 2      // m.NodePort
	size += 4      // m.NewFlowsTableLength
	size += 1      // m.IsDel
	return size
}
func (m *LbAddDelVip) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeUint8(uint8(m.Pfx.Address.Af))
	buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 16)
	buf.EncodeUint8(m.Pfx.Len)
	buf.EncodeUint8(m.Protocol)
	buf.EncodeUint16(m.Port)
	buf.EncodeUint32(uint32(m.Encap))
	buf.EncodeUint8(m.Dscp)
	buf.EncodeUint32(uint32(m.Type))
	buf.EncodeUint16(m.TargetPort)
	buf.EncodeUint16(m.NodePort)
	buf.EncodeUint32(m.NewFlowsTableLength)
	buf.EncodeBool(m.IsDel)
	return buf.Bytes(), nil
}
func (m *LbAddDelVip) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Pfx.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
	copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
	m.Pfx.Len = buf.DecodeUint8()
	m.Protocol = buf.DecodeUint8()
	m.Port = buf.DecodeUint16()
	m.Encap = lb_types.LbEncapType(buf.DecodeUint32())
	m.Dscp = buf.DecodeUint8()
	m.Type = lb_types.LbSrvType(buf.DecodeUint32())
	m.TargetPort = buf.DecodeUint16()
	m.NodePort = buf.DecodeUint16()
	m.NewFlowsTableLength = buf.DecodeUint32()
	m.IsDel = buf.DecodeBool()
	return nil
}

// LbAddDelVipReply defines message 'lb_add_del_vip_reply'.
type LbAddDelVipReply struct {
	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}

func (m *LbAddDelVipReply) Reset()               { *m = LbAddDelVipReply{} }
func (*LbAddDelVipReply) GetMessageName() string { return "lb_add_del_vip_reply" }
func (*LbAddDelVipReply) GetCrcString() string   { return "e8d4e804" }
func (*LbAddDelVipReply) GetMessageType() api.MessageType {
	return api.ReplyMessage
}

func (m *LbAddDelVipReply) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 4 // m.Retval
	return size
}
func (m *LbAddDelVipReply) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeInt32(m.Retval)
	return buf.Bytes(), nil
}
func (m *LbAddDelVipReply) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Retval = buf.DecodeInt32()
	return nil
}

// LbAsDetails defines message 'lb_as_details'.
type LbAsDetails struct {
	Vip        lb_types.LbVip   `binapi:"lb_vip,name=vip" json:"vip,omitempty"`
	AppSrv     ip_types.Address `binapi:"address,name=app_srv" json:"app_srv,omitempty"`
	Flags      uint8            `binapi:"u8,name=flags" json:"flags,omitempty"`
	InUseSince uint32           `binapi:"u32,name=in_use_since" json:"in_use_since,omitempty"`
}

func (m *LbAsDetails) Reset()               { *m = LbAsDetails{} }
func (*LbAsDetails) GetMessageName() string { return "lb_as_details" }
func (*LbAsDetails) GetCrcString() string   { return "9c39f60e" }
func (*LbAsDetails) GetMessageType() api.MessageType {
	return api.ReplyMessage
}

func (m *LbAsDetails) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 1      // m.Vip.Pfx.Address.Af
	size += 1 * 16 // m.Vip.Pfx.Address.Un
	size += 1      // m.Vip.Pfx.Len
	size += 1      // m.Vip.Protocol
	size += 2      // m.Vip.Port
	size += 1      // m.AppSrv.Af
	size += 1 * 16 // m.AppSrv.Un
	size += 1      // m.Flags
	size += 4      // m.InUseSince
	return size
}
func (m *LbAsDetails) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeUint8(uint8(m.Vip.Pfx.Address.Af))
	buf.EncodeBytes(m.Vip.Pfx.Address.Un.XXX_UnionData[:], 16)
	buf.EncodeUint8(m.Vip.Pfx.Len)
	buf.EncodeUint8(uint8(m.Vip.Protocol))
	buf.EncodeUint16(m.Vip.Port)
	buf.EncodeUint8(uint8(m.AppSrv.Af))
	buf.EncodeBytes(m.AppSrv.Un.XXX_UnionData[:], 16)
	buf.EncodeUint8(m.Flags)
	buf.EncodeUint32(m.InUseSince)
	return buf.Bytes(), nil
}
func (m *LbAsDetails) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Vip.Pfx.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
	copy(m.Vip.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
	m.Vip.Pfx.Len = buf.DecodeUint8()
	m.Vip.Protocol = ip_types.IPProto(buf.DecodeUint8())
	m.Vip.Port = buf.DecodeUint16()
	m.AppSrv.Af = ip_types.AddressFamily(buf.DecodeUint8())
	copy(m.AppSrv.Un.XXX_UnionData[:], buf.DecodeBytes(16))
	m.Flags = buf.DecodeUint8()
	m.InUseSince = buf.DecodeUint32()
	return nil
}

// LbAsDump defines message 'lb_as_dump'.
type LbAsDump struct {
	Pfx      ip_types.AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"`
	Protocol uint8                      `binapi:"u8,name=protocol" json:"protocol,omitempty"`
	Port     uint16                     `binapi:"u16,name=port" json:"port,omitempty"`
}

func (m *LbAsDump) Reset()               { *m = LbAsDump{} }
func (*LbAsDump) GetMessageName() string { return "lb_as_dump" }
func (*LbAsDump) GetCrcString() string   { return "1063f819" }
func (*LbAsDump) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *LbAsDump) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 1      // m.Pfx.Address.Af
	size += 1 * 16 // m.Pfx.Address.Un
	size += 1      // m.Pfx.Len
	size += 1      // m.Protocol
	size += 2      // m.Port
	return size
}
func (m *LbAsDump) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeUint8(uint8(m.Pfx.Address.Af))
	buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 16)
	buf.EncodeUint8(m.Pfx.Len)
	buf.EncodeUint8(m.Protocol)
	buf.EncodeUint16(m.Port)
	return buf.Bytes(), nil
}
func (m *LbAsDump) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Pfx.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
	copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
	m.Pfx.Len = buf.DecodeUint8()
	m.Protocol = buf.DecodeUint8()
	m.Port = buf.DecodeUint16()
	return nil
}

// LbConf defines message 'lb_conf'.
type LbConf struct {
	IP4SrcAddress        ip_types.IP4Address `binapi:"ip4_address,name=ip4_src_address" json:"ip4_src_address,omitempty"`
	IP6SrcAddress        ip_types.IP6Address `binapi:"ip6_address,name=ip6_src_address" json:"ip6_src_address,omitempty"`
	StickyBucketsPerCore uint32              `binapi:"u32,name=sticky_buckets_per_core,default=4294967295" json:"sticky_buckets_per_core,omitempty"`
	FlowTimeout          uint32              `binapi:"u32,name=flow_timeout,default=4294967295" json:"flow_timeout,omitempty"`
}

func (m *LbConf) Reset()               { *m = LbConf{} }
func (*LbConf) GetMessageName() string { return "lb_conf" }
func (*LbConf) GetCrcString() string   { return "22ddb739" }
func (*LbConf) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *LbConf) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 1 * 4  // m.IP4SrcAddress
	size += 1 * 16 // m.IP6SrcAddress
	size += 4      // m.StickyBucketsPerCore
	size += 4      // m.FlowTimeout
	return size
}
func (m *LbConf) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeBytes(m.IP4SrcAddress[:], 4)
	buf.EncodeBytes(m.IP6SrcAddress[:], 16)
	buf.EncodeUint32(m.StickyBucketsPerCore)
	buf.EncodeUint32(m.FlowTimeout)
	return buf.Bytes(), nil
}
func (m *LbConf) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	copy(m.IP4SrcAddress[:], buf.DecodeBytes(4))
	copy(m.IP6SrcAddress[:], buf.DecodeBytes(16))
	m.StickyBucketsPerCore = buf.DecodeUint32()
	m.FlowTimeout = buf.DecodeUint32()
	return nil
}

// LbConfReply defines message 'lb_conf_reply'.
type LbConfReply struct {
	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}

func (m *LbConfReply) Reset()               { *m = LbConfReply{} }
func (*LbConfReply) GetMessageName() string { return "lb_conf_reply" }
func (*LbConfReply) GetCrcString() string   { return "e8d4e804" }
func (*LbConfReply) GetMessageType() api.MessageType {
	return api.ReplyMessage
}

func (m *LbConfReply) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 4 // m.Retval
	return size
}
func (m *LbConfReply) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeInt32(m.Retval)
	return buf.Bytes(), nil
}
func (m *LbConfReply) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Retval = buf.DecodeInt32()
	return nil
}

// LbFlushVip defines message 'lb_flush_vip'.
type LbFlushVip struct {
	Pfx      ip_types.AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"`
	Protocol uint8                      `binapi:"u8,name=protocol" json:"protocol,omitempty"`
	Port     uint16                     `binapi:"u16,name=port" json:"port,omitempty"`
}

func (m *LbFlushVip) Reset()               { *m = LbFlushVip{} }
func (*LbFlushVip) GetMessageName() string { return "lb_flush_vip" }
func (*LbFlushVip) GetCrcString() string   { return "1063f819" }
func (*LbFlushVip) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *LbFlushVip) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 1      // m.Pfx.Address.Af
	size += 1 * 16 // m.Pfx.Address.Un
	size += 1      // m.Pfx.Len
	size += 1      // m.Protocol
	size += 2      // m.Port
	return size
}
func (m *LbFlushVip) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeUint8(uint8(m.Pfx.Address.Af))
	buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 16)
	buf.EncodeUint8(m.Pfx.Len)
	buf.EncodeUint8(m.Protocol)
	buf.EncodeUint16(m.Port)
	return buf.Bytes(), nil
}
func (m *LbFlushVip) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Pfx.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
	copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
	m.Pfx.Len = buf.DecodeUint8()
	m.Protocol = buf.DecodeUint8()
	m.Port = buf.DecodeUint16()
	return nil
}

// LbFlushVipReply defines message 'lb_flush_vip_reply'.
type LbFlushVipReply struct {
	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}

func (m *LbFlushVipReply) Reset()               { *m = LbFlushVipReply{} }
func (*LbFlushVipReply) GetMessageName() string { return "lb_flush_vip_reply" }
func (*LbFlushVipReply) GetCrcString() string   { return "e8d4e804" }
func (*LbFlushVipReply) GetMessageType() api.MessageType {
	return api.ReplyMessage
}

func (m *LbFlushVipReply) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 4 // m.Retval
	return size
}
func (m *LbFlushVipReply) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeInt32(m.Retval)
	return buf.Bytes(), nil
}
func (m *LbFlushVipReply) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Retval = buf.DecodeInt32()
	return nil
}

// LbVipDetails defines message 'lb_vip_details'.
type LbVipDetails struct {
	Vip             lb_types.LbVip       `binapi:"lb_vip,name=vip" json:"vip,omitempty"`
	Encap           lb_types.LbEncapType `binapi:"lb_encap_type,name=encap" json:"encap,omitempty"`
	Dscp            ip_types.IPDscp      `binapi:"ip_dscp,name=dscp" json:"dscp,omitempty"`
	SrvType         lb_types.LbSrvType   `binapi:"lb_srv_type,name=srv_type" json:"srv_type,omitempty"`
	TargetPort      uint16               `binapi:"u16,name=target_port" json:"target_port,omitempty"`
	FlowTableLength uint16               `binapi:"u16,name=flow_table_length" json:"flow_table_length,omitempty"`
}

func (m *LbVipDetails) Reset()               { *m = LbVipDetails{} }
func (*LbVipDetails) GetMessageName() string { return "lb_vip_details" }
func (*LbVipDetails) GetCrcString() string   { return "08f39bed" }
func (*LbVipDetails) GetMessageType() api.MessageType {
	return api.ReplyMessage
}

func (m *LbVipDetails) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 1      // m.Vip.Pfx.Address.Af
	size += 1 * 16 // m.Vip.Pfx.Address.Un
	size += 1      // m.Vip.Pfx.Len
	size += 1      // m.Vip.Protocol
	size += 2      // m.Vip.Port
	size += 4      // m.Encap
	size += 1      // m.Dscp
	size += 4      // m.SrvType
	size += 2      // m.TargetPort
	size += 2      // m.FlowTableLength
	return size
}
func (m *LbVipDetails) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeUint8(uint8(m.Vip.Pfx.Address.Af))
	buf.EncodeBytes(m.Vip.Pfx.Address.Un.XXX_UnionData[:], 16)
	buf.EncodeUint8(m.Vip.Pfx.Len)
	buf.EncodeUint8(uint8(m.Vip.Protocol))
	buf.EncodeUint16(m.Vip.Port)
	buf.EncodeUint32(uint32(m.Encap))
	buf.EncodeUint8(uint8(m.Dscp))
	buf.EncodeUint32(uint32(m.SrvType))
	buf.EncodeUint16(m.TargetPort)
	buf.EncodeUint16(m.FlowTableLength)
	return buf.Bytes(), nil
}
func (m *LbVipDetails) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Vip.Pfx.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
	copy(m.Vip.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
	m.Vip.Pfx.Len = buf.DecodeUint8()
	m.Vip.Protocol = ip_types.IPProto(buf.DecodeUint8())
	m.Vip.Port = buf.DecodeUint16()
	m.Encap = lb_types.LbEncapType(buf.DecodeUint32())
	m.Dscp = ip_types.IPDscp(buf.DecodeUint8())
	m.SrvType = lb_types.LbSrvType(buf.DecodeUint32())
	m.TargetPort = buf.DecodeUint16()
	m.FlowTableLength = buf.DecodeUint16()
	return nil
}

// LbVipDump defines message 'lb_vip_dump'.
type LbVipDump struct {
	Pfx        ip_types.AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"`
	PfxMatcher ip_types.PrefixMatcher     `binapi:"prefix_matcher,name=pfx_matcher" json:"pfx_matcher,omitempty"`
	Protocol   uint8                      `binapi:"u8,name=protocol,default=255" json:"protocol,omitempty"`
	Port       uint16                     `binapi:"u16,name=port" json:"port,omitempty"`
}

func (m *LbVipDump) Reset()               { *m = LbVipDump{} }
func (*LbVipDump) GetMessageName() string { return "lb_vip_dump" }
func (*LbVipDump) GetCrcString() string   { return "c7bcb124" }
func (*LbVipDump) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *LbVipDump) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 1      // m.Pfx.Address.Af
	size += 1 * 16 // m.Pfx.Address.Un
	size += 1      // m.Pfx.Len
	size += 1      // m.PfxMatcher.Le
	size += 1      // m.PfxMatcher.Ge
	size += 1      // m.Protocol
	size += 2      // m.Port
	return size
}
func (m *LbVipDump) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeUint8(uint8(m.Pfx.Address.Af))
	buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 16)
	buf.EncodeUint8(m.Pfx.Len)
	buf.EncodeUint8(m.PfxMatcher.Le)
	buf.EncodeUint8(m.PfxMatcher.Ge)
	buf.EncodeUint8(m.Protocol)
	buf.EncodeUint16(m.Port)
	return buf.Bytes(), nil
}
func (m *LbVipDump) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Pfx.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
	copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
	m.Pfx.Len = buf.DecodeUint8()
	m.PfxMatcher.Le = buf.DecodeUint8()
	m.PfxMatcher.Ge = buf.DecodeUint8()
	m.Protocol = buf.DecodeUint8()
	m.Port = buf.DecodeUint16()
	return nil
}

func init() { file_lb_binapi_init() }
func file_lb_binapi_init() {
	api.RegisterMessage((*LbAddDelAs)(nil), "lb_add_del_as_78628987")
	api.RegisterMessage((*LbAddDelAsReply)(nil), "lb_add_del_as_reply_e8d4e804")
	api.RegisterMessage((*LbAddDelIntfNat4)(nil), "lb_add_del_intf_nat4_47d6e753")
	api.RegisterMessage((*LbAddDelIntfNat4Reply)(nil), "lb_add_del_intf_nat4_reply_e8d4e804")
	api.RegisterMessage((*LbAddDelIntfNat6)(nil), "lb_add_del_intf_nat6_47d6e753")
	api.RegisterMessage((*LbAddDelIntfNat6Reply)(nil), "lb_add_del_intf_nat6_reply_e8d4e804")
	api.RegisterMessage((*LbAddDelVip)(nil), "lb_add_del_vip_d15b7ddc")
	api.RegisterMessage((*LbAddDelVipReply)(nil), "lb_add_del_vip_reply_e8d4e804")
	api.RegisterMessage((*LbAsDetails)(nil), "lb_as_details_9c39f60e")
	api.RegisterMessage((*LbAsDump)(nil), "lb_as_dump_1063f819")
	api.RegisterMessage((*LbConf)(nil), "lb_conf_22ddb739")
	api.RegisterMessage((*LbConfReply)(nil), "lb_conf_reply_e8d4e804")
	api.RegisterMessage((*LbFlushVip)(nil), "lb_flush_vip_1063f819")
	api.RegisterMessage((*LbFlushVipReply)(nil), "lb_flush_vip_reply_e8d4e804")
	api.RegisterMessage((*LbVipDetails)(nil), "lb_vip_details_08f39bed")
	api.RegisterMessage((*LbVipDump)(nil), "lb_vip_dump_c7bcb124")
}

// Messages returns list of all messages in this module.
func AllMessages() []api.Message {
	return []api.Message{
		(*LbAddDelAs)(nil),
		(*LbAddDelAsReply)(nil),
		(*LbAddDelIntfNat4)(nil),
		(*LbAddDelIntfNat4Reply)(nil),
		(*LbAddDelIntfNat6)(nil),
		(*LbAddDelIntfNat6Reply)(nil),
		(*LbAddDelVip)(nil),
		(*LbAddDelVipReply)(nil),
		(*LbAsDetails)(nil),
		(*LbAsDump)(nil),
		(*LbConf)(nil),
		(*LbConfReply)(nil),
		(*LbFlushVip)(nil),
		(*LbFlushVipReply)(nil),
		(*LbVipDetails)(nil),
		(*LbVipDump)(nil),
	}
}