aboutsummaryrefslogtreecommitdiffstats
path: root/binapi/cnat/cnat.ba.go
blob: ca357548e9da6d4894c00ece76b87579e634c767 (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
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
// versions:
//  binapi-generator: v0.6.0-dev
//  VPP:              22.02-release
// source: /usr/share/vpp/api/plugins/cnat.api.json

// Package cnat contains generated bindings for API file cnat.api.
//
// Contents:
//   5 enums
//   4 structs
//  20 messages
//
package cnat

import (
	"strconv"

	api "go.fd.io/govpp/api"
	_ "go.fd.io/govpp/binapi/fib_types"
	interface_types "go.fd.io/govpp/binapi/interface_types"
	ip_types "go.fd.io/govpp/binapi/ip_types"
	codec "go.fd.io/govpp/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    = "cnat"
	APIVersion = "0.2.0"
	VersionCrc = 0xfd05573b
)

// CnatEndpointTupleFlags defines enum 'cnat_endpoint_tuple_flags'.
type CnatEndpointTupleFlags uint8

const (
	CNAT_EPT_NO_NAT CnatEndpointTupleFlags = 1
)

var (
	CnatEndpointTupleFlags_name = map[uint8]string{
		1: "CNAT_EPT_NO_NAT",
	}
	CnatEndpointTupleFlags_value = map[string]uint8{
		"CNAT_EPT_NO_NAT": 1,
	}
)

func (x CnatEndpointTupleFlags) String() string {
	s, ok := CnatEndpointTupleFlags_name[uint8(x)]
	if ok {
		return s
	}
	str := func(n uint8) string {
		s, ok := CnatEndpointTupleFlags_name[uint8(n)]
		if ok {
			return s
		}
		return "CnatEndpointTupleFlags(" + strconv.Itoa(int(n)) + ")"
	}
	for i := uint8(0); i <= 8; i++ {
		val := uint8(x)
		if val&(1<<i) != 0 {
			if s != "" {
				s += "|"
			}
			s += str(1 << i)
		}
	}
	if s == "" {
		return str(uint8(x))
	}
	return s
}

// CnatLbType defines enum 'cnat_lb_type'.
type CnatLbType uint8

const (
	CNAT_LB_TYPE_DEFAULT CnatLbType = 0
	CNAT_LB_TYPE_MAGLEV  CnatLbType = 1
)

var (
	CnatLbType_name = map[uint8]string{
		0: "CNAT_LB_TYPE_DEFAULT",
		1: "CNAT_LB_TYPE_MAGLEV",
	}
	CnatLbType_value = map[string]uint8{
		"CNAT_LB_TYPE_DEFAULT": 0,
		"CNAT_LB_TYPE_MAGLEV":  1,
	}
)

func (x CnatLbType) String() string {
	s, ok := CnatLbType_name[uint8(x)]
	if ok {
		return s
	}
	return "CnatLbType(" + strconv.Itoa(int(x)) + ")"
}

// CnatSnatPolicies defines enum 'cnat_snat_policies'.
type CnatSnatPolicies uint8

const (
	CNAT_POLICY_NONE   CnatSnatPolicies = 0
	CNAT_POLICY_IF_PFX CnatSnatPolicies = 1
	CNAT_POLICY_K8S    CnatSnatPolicies = 2
)

var (
	CnatSnatPolicies_name = map[uint8]string{
		0: "CNAT_POLICY_NONE",
		1: "CNAT_POLICY_IF_PFX",
		2: "CNAT_POLICY_K8S",
	}
	CnatSnatPolicies_value = map[string]uint8{
		"CNAT_POLICY_NONE":   0,
		"CNAT_POLICY_IF_PFX": 1,
		"CNAT_POLICY_K8S":    2,
	}
)

func (x CnatSnatPolicies) String() string {
	s, ok := CnatSnatPolicies_name[uint8(x)]
	if ok {
		return s
	}
	return "CnatSnatPolicies(" + strconv.Itoa(int(x)) + ")"
}

// CnatSnatPolicyTable defines enum 'cnat_snat_policy_table'.
type CnatSnatPolicyTable uint8

const (
	CNAT_POLICY_INCLUDE_V4 CnatSnatPolicyTable = 0
	CNAT_POLICY_INCLUDE_V6 CnatSnatPolicyTable = 1
	CNAT_POLICY_POD        CnatSnatPolicyTable = 2
)

var (
	CnatSnatPolicyTable_name = map[uint8]string{
		0: "CNAT_POLICY_INCLUDE_V4",
		1: "CNAT_POLICY_INCLUDE_V6",
		2: "CNAT_POLICY_POD",
	}
	CnatSnatPolicyTable_value = map[string]uint8{
		"CNAT_POLICY_INCLUDE_V4": 0,
		"CNAT_POLICY_INCLUDE_V6": 1,
		"CNAT_POLICY_POD":        2,
	}
)

func (x CnatSnatPolicyTable) String() string {
	s, ok := CnatSnatPolicyTable_name[uint8(x)]
	if ok {
		return s
	}
	return "CnatSnatPolicyTable(" + strconv.Itoa(int(x)) + ")"
}

// CnatTranslationFlags defines enum 'cnat_translation_flags'.
type CnatTranslationFlags uint8

const (
	CNAT_TRANSLATION_ALLOC_PORT CnatTranslationFlags = 1
)

var (
	CnatTranslationFlags_name = map[uint8]string{
		1: "CNAT_TRANSLATION_ALLOC_PORT",
	}
	CnatTranslationFlags_value = map[string]uint8{
		"CNAT_TRANSLATION_ALLOC_PORT": 1,
	}
)

func (x CnatTranslationFlags) String() string {
	s, ok := CnatTranslationFlags_name[uint8(x)]
	if ok {
		return s
	}
	str := func(n uint8) string {
		s, ok := CnatTranslationFlags_name[uint8(n)]
		if ok {
			return s
		}
		return "CnatTranslationFlags(" + strconv.Itoa(int(n)) + ")"
	}
	for i := uint8(0); i <= 8; i++ {
		val := uint8(x)
		if val&(1<<i) != 0 {
			if s != "" {
				s += "|"
			}
			s += str(1 << i)
		}
	}
	if s == "" {
		return str(uint8(x))
	}
	return s
}

// CnatEndpoint defines type 'cnat_endpoint'.
type CnatEndpoint struct {
	Addr      ip_types.Address               `binapi:"address,name=addr" json:"addr,omitempty"`
	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
	IfAf      ip_types.AddressFamily         `binapi:"address_family,name=if_af" json:"if_af,omitempty"`
	Port      uint16                         `binapi:"u16,name=port" json:"port,omitempty"`
}

// CnatEndpointTuple defines type 'cnat_endpoint_tuple'.
type CnatEndpointTuple struct {
	DstEp CnatEndpoint `binapi:"cnat_endpoint,name=dst_ep" json:"dst_ep,omitempty"`
	SrcEp CnatEndpoint `binapi:"cnat_endpoint,name=src_ep" json:"src_ep,omitempty"`
	Flags uint8        `binapi:"u8,name=flags" json:"flags,omitempty"`
}

// CnatSession defines type 'cnat_session'.
type CnatSession struct {
	Src       CnatEndpoint     `binapi:"cnat_endpoint,name=src" json:"src,omitempty"`
	Dst       CnatEndpoint     `binapi:"cnat_endpoint,name=dst" json:"dst,omitempty"`
	New       CnatEndpoint     `binapi:"cnat_endpoint,name=new" json:"new,omitempty"`
	IPProto   ip_types.IPProto `binapi:"ip_proto,name=ip_proto" json:"ip_proto,omitempty"`
	Location  uint8            `binapi:"u8,name=location" json:"location,omitempty"`
	Timestamp float64          `binapi:"f64,name=timestamp" json:"timestamp,omitempty"`
}

// CnatTranslation defines type 'cnat_translation'.
type CnatTranslation struct {
	Vip      CnatEndpoint        `binapi:"cnat_endpoint,name=vip" json:"vip,omitempty"`
	ID       uint32              `binapi:"u32,name=id" json:"id,omitempty"`
	IPProto  ip_types.IPProto    `binapi:"ip_proto,name=ip_proto" json:"ip_proto,omitempty"`
	IsRealIP uint8               `binapi:"u8,name=is_real_ip" json:"is_real_ip,omitempty"`
	Flags    uint8               `binapi:"u8,name=flags" json:"flags,omitempty"`
	LbType   CnatLbType          `binapi:"cnat_lb_type,name=lb_type" json:"lb_type,omitempty"`
	NPaths   uint32              `binapi:"u32,name=n_paths" json:"-"`
	Paths    []CnatEndpointTuple `binapi:"cnat_endpoint_tuple[n_paths],name=paths" json:"paths,omitempty"`
}

// CnatGetSnatAddresses defines message 'cnat_get_snat_addresses'.
// InProgress: the message form may change in the future versions
type CnatGetSnatAddresses struct{}

func (m *CnatGetSnatAddresses) Reset()               { *m = CnatGetSnatAddresses{} }
func (*CnatGetSnatAddresses) GetMessageName() string { return "cnat_get_snat_addresses" }
func (*CnatGetSnatAddresses) GetCrcString() string   { return "51077d14" }
func (*CnatGetSnatAddresses) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *CnatGetSnatAddresses) Size() (size int) {
	if m == nil {
		return 0
	}
	return size
}
func (m *CnatGetSnatAddresses) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	return buf.Bytes(), nil
}
func (m *CnatGetSnatAddresses) Unmarshal(b []byte) error {
	return nil
}

// CnatGetSnatAddressesReply defines message 'cnat_get_snat_addresses_reply'.
// InProgress: the message form may change in the future versions
type CnatGetSnatAddressesReply struct {
	Retval    int32                          `binapi:"i32,name=retval" json:"retval,omitempty"`
	ID        uint32                         `binapi:"u32,name=id" json:"id,omitempty"`
	SnatIP4   ip_types.IP4Address            `binapi:"ip4_address,name=snat_ip4" json:"snat_ip4,omitempty"`
	SnatIP6   ip_types.IP6Address            `binapi:"ip6_address,name=snat_ip6" json:"snat_ip6,omitempty"`
	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
}

func (m *CnatGetSnatAddressesReply) Reset()               { *m = CnatGetSnatAddressesReply{} }
func (*CnatGetSnatAddressesReply) GetMessageName() string { return "cnat_get_snat_addresses_reply" }
func (*CnatGetSnatAddressesReply) GetCrcString() string   { return "879513c1" }
func (*CnatGetSnatAddressesReply) GetMessageType() api.MessageType {
	return api.ReplyMessage
}

func (m *CnatGetSnatAddressesReply) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 4      // m.Retval
	size += 4      // m.ID
	size += 1 * 4  // m.SnatIP4
	size += 1 * 16 // m.SnatIP6
	size += 4      // m.SwIfIndex
	return size
}
func (m *CnatGetSnatAddressesReply) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeInt32(m.Retval)
	buf.EncodeUint32(m.ID)
	buf.EncodeBytes(m.SnatIP4[:], 4)
	buf.EncodeBytes(m.SnatIP6[:], 16)
	buf.EncodeUint32(uint32(m.SwIfIndex))
	return buf.Bytes(), nil
}
func (m *CnatGetSnatAddressesReply) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Retval = buf.DecodeInt32()
	m.ID = buf.DecodeUint32()
	copy(m.SnatIP4[:], buf.DecodeBytes(4))
	copy(m.SnatIP6[:], buf.DecodeBytes(16))
	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
	return nil
}

// CnatSessionDetails defines message 'cnat_session_details'.
// InProgress: the message form may change in the future versions
type CnatSessionDetails struct {
	Session CnatSession `binapi:"cnat_session,name=session" json:"session,omitempty"`
}

func (m *CnatSessionDetails) Reset()               { *m = CnatSessionDetails{} }
func (*CnatSessionDetails) GetMessageName() string { return "cnat_session_details" }
func (*CnatSessionDetails) GetCrcString() string   { return "7e5017c7" }
func (*CnatSessionDetails) GetMessageType() api.MessageType {
	return api.ReplyMessage
}

func (m *CnatSessionDetails) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 1      // m.Session.Src.Addr.Af
	size += 1 * 16 // m.Session.Src.Addr.Un
	size += 4      // m.Session.Src.SwIfIndex
	size += 1      // m.Session.Src.IfAf
	size += 2      // m.Session.Src.Port
	size += 1      // m.Session.Dst.Addr.Af
	size += 1 * 16 // m.Session.Dst.Addr.Un
	size += 4      // m.Session.Dst.SwIfIndex
	size += 1      // m.Session.Dst.IfAf
	size += 2      // m.Session.Dst.Port
	size += 1      // m.Session.New.Addr.Af
	size += 1 * 16 // m.Session.New.Addr.Un
	size += 4      // m.Session.New.SwIfIndex
	size += 1      // m.Session.New.IfAf
	size += 2      // m.Session.New.Port
	size += 1      // m.Session.IPProto
	size += 1      // m.Session.Location
	size += 8      // m.Session.Timestamp
	return size
}
func (m *CnatSessionDetails) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeUint8(uint8(m.Session.Src.Addr.Af))
	buf.EncodeBytes(m.Session.Src.Addr.Un.XXX_UnionData[:], 16)
	buf.EncodeUint32(uint32(m.Session.Src.SwIfIndex))
	buf.EncodeUint8(uint8(m.Session.Src.IfAf))
	buf.EncodeUint16(m.Session.Src.Port)
	buf.EncodeUint8(uint8(m.Session.Dst.Addr.Af))
	buf.EncodeBytes(m.Session.Dst.Addr.Un.XXX_UnionData[:], 16)
	buf.EncodeUint32(uint32(m.Session.Dst.SwIfIndex))
	buf.EncodeUint8(uint8(m.Session.Dst.IfAf))
	buf.EncodeUint16(m.Session.Dst.Port)
	buf.EncodeUint8(uint8(m.Session.New.Addr.Af))
	buf.EncodeBytes(m.Session.New.Addr.Un.XXX_UnionData[:], 16)
	buf.EncodeUint32(uint32(m.Session.New.SwIfIndex))
	buf.EncodeUint8(uint8(m.Session.New.IfAf))
	buf.EncodeUint16(m.Session.New.Port)
	buf.EncodeUint8(uint8(m.Session.IPProto))
	buf.EncodeUint8(m.Session.Location)
	buf.EncodeFloat64(m.Session.Timestamp)
	return buf.Bytes(), nil
}
func (m *CnatSessionDetails) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Session.Src.Addr.Af = ip_types.AddressFamily(buf.DecodeUint8())
	copy(m.Session.Src.Addr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
	m.Session.Src.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
	m.Session.Src.IfAf = ip_types.AddressFamily(buf.DecodeUint8())
	m.Session.Src.Port = buf.DecodeUint16()
	m.Session.Dst.Addr.Af = ip_types.AddressFamily(buf.DecodeUint8())
	copy(m.Session.Dst.Addr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
	m.Session.Dst.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
	m.Session.Dst.IfAf = ip_types.AddressFamily(buf.DecodeUint8())
	m.Session.Dst.Port = buf.DecodeUint16()
	m.Session.New.Addr.Af = ip_types.AddressFamily(buf.DecodeUint8())
	copy(m.Session.New.Addr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
	m.Session.New.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
	m.Session.New.IfAf = ip_types.AddressFamily(buf.DecodeUint8())
	m.Session.New.Port = buf.DecodeUint16()
	m.Session.IPProto = ip_types.IPProto(buf.DecodeUint8())
	m.Session.Location = buf.DecodeUint8()
	m.Session.Timestamp = buf.DecodeFloat64()
	return nil
}

// CnatSessionDump defines message 'cnat_session_dump'.
// InProgress: the message form may change in the future versions
type CnatSessionDump struct{}

func (m *CnatSessionDump) Reset()               { *m = CnatSessionDump{} }
func (*CnatSessionDump) GetMessageName() string { return "cnat_session_dump" }
func (*CnatSessionDump) GetCrcString() string   { return "51077d14" }
func (*CnatSessionDump) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *CnatSessionDump) Size() (size int) {
	if m == nil {
		return 0
	}
	return size
}
func (m *CnatSessionDump) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	return buf.Bytes(), nil
}
func (m *CnatSessionDump) Unmarshal(b []byte) error {
	return nil
}

// CnatSessionPurge defines message 'cnat_session_purge'.
// InProgress: the message form may change in the future versions
type CnatSessionPurge struct{}

func (m *CnatSessionPurge) Reset()               { *m = CnatSessionPurge{} }
func (*CnatSessionPurge) GetMessageName() string { return "cnat_session_purge" }
func (*CnatSessionPurge) GetCrcString() string   { return "51077d14" }
func (*CnatSessionPurge) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *CnatSessionPurge) Size() (size int) {
	if m == nil {
		return 0
	}
	return size
}
func (m *CnatSessionPurge) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	return buf.Bytes(), nil
}
func (m *CnatSessionPurge) Unmarshal(b []byte) error {
	return nil
}

// CnatSessionPurgeReply defines message 'cnat_session_purge_reply'.
// InProgress: the message form may change in the future versions
type CnatSessionPurgeReply struct {
	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}

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

func (m *CnatSessionPurgeReply) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 4 // m.Retval
	return size
}
func (m *CnatSessionPurgeReply) 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 *CnatSessionPurgeReply) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Retval = buf.DecodeInt32()
	return nil
}

// CnatSetSnatAddresses defines message 'cnat_set_snat_addresses'.
// InProgress: the message form may change in the future versions
type CnatSetSnatAddresses struct {
	SnatIP4   ip_types.IP4Address            `binapi:"ip4_address,name=snat_ip4" json:"snat_ip4,omitempty"`
	SnatIP6   ip_types.IP6Address            `binapi:"ip6_address,name=snat_ip6" json:"snat_ip6,omitempty"`
	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
}

func (m *CnatSetSnatAddresses) Reset()               { *m = CnatSetSnatAddresses{} }
func (*CnatSetSnatAddresses) GetMessageName() string { return "cnat_set_snat_addresses" }
func (*CnatSetSnatAddresses) GetCrcString() string   { return "d997e96c" }
func (*CnatSetSnatAddresses) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *CnatSetSnatAddresses) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 1 * 4  // m.SnatIP4
	size += 1 * 16 // m.SnatIP6
	size += 4      // m.SwIfIndex
	return size
}
func (m *CnatSetSnatAddresses) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeBytes(m.SnatIP4[:], 4)
	buf.EncodeBytes(m.SnatIP6[:], 16)
	buf.EncodeUint32(uint32(m.SwIfIndex))
	return buf.Bytes(), nil
}
func (m *CnatSetSnatAddresses) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	copy(m.SnatIP4[:], buf.DecodeBytes(4))
	copy(m.SnatIP6[:], buf.DecodeBytes(16))
	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
	return nil
}

// CnatSetSnatAddressesReply defines message 'cnat_set_snat_addresses_reply'.
// InProgress: the message form may change in the future versions
type CnatSetSnatAddressesReply struct {
	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}

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

func (m *CnatSetSnatAddressesReply) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 4 // m.Retval
	return size
}
func (m *CnatSetSnatAddressesReply) 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 *CnatSetSnatAddressesReply) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Retval = buf.DecodeInt32()
	return nil
}

// CnatSetSnatPolicy defines message 'cnat_set_snat_policy'.
// InProgress: the message form may change in the future versions
type CnatSetSnatPolicy struct {
	Policy CnatSnatPolicies `binapi:"cnat_snat_policies,name=policy" json:"policy,omitempty"`
}

func (m *CnatSetSnatPolicy) Reset()               { *m = CnatSetSnatPolicy{} }
func (*CnatSetSnatPolicy) GetMessageName() string { return "cnat_set_snat_policy" }
func (*CnatSetSnatPolicy) GetCrcString() string   { return "d3e6eaf4" }
func (*CnatSetSnatPolicy) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *CnatSetSnatPolicy) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 1 // m.Policy
	return size
}
func (m *CnatSetSnatPolicy) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeUint8(uint8(m.Policy))
	return buf.Bytes(), nil
}
func (m *CnatSetSnatPolicy) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Policy = CnatSnatPolicies(buf.DecodeUint8())
	return nil
}

// CnatSetSnatPolicyReply defines message 'cnat_set_snat_policy_reply'.
// InProgress: the message form may change in the future versions
type CnatSetSnatPolicyReply struct {
	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}

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

func (m *CnatSetSnatPolicyReply) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 4 // m.Retval
	return size
}
func (m *CnatSetSnatPolicyReply) 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 *CnatSetSnatPolicyReply) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Retval = buf.DecodeInt32()
	return nil
}

// CnatSnatPolicyAddDelExcludePfx defines message 'cnat_snat_policy_add_del_exclude_pfx'.
// InProgress: the message form may change in the future versions
type CnatSnatPolicyAddDelExcludePfx struct {
	IsAdd  uint8           `binapi:"u8,name=is_add" json:"is_add,omitempty"`
	Prefix ip_types.Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
}

func (m *CnatSnatPolicyAddDelExcludePfx) Reset() { *m = CnatSnatPolicyAddDelExcludePfx{} }
func (*CnatSnatPolicyAddDelExcludePfx) GetMessageName() string {
	return "cnat_snat_policy_add_del_exclude_pfx"
}
func (*CnatSnatPolicyAddDelExcludePfx) GetCrcString() string { return "e26dd79a" }
func (*CnatSnatPolicyAddDelExcludePfx) GetMessageType() api.MessageType {
	return api.RequestMessage
}

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

// CnatSnatPolicyAddDelExcludePfxReply defines message 'cnat_snat_policy_add_del_exclude_pfx_reply'.
// InProgress: the message form may change in the future versions
type CnatSnatPolicyAddDelExcludePfxReply struct {
	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}

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

func (m *CnatSnatPolicyAddDelExcludePfxReply) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 4 // m.Retval
	return size
}
func (m *CnatSnatPolicyAddDelExcludePfxReply) 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 *CnatSnatPolicyAddDelExcludePfxReply) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Retval = buf.DecodeInt32()
	return nil
}

// CnatSnatPolicyAddDelIf defines message 'cnat_snat_policy_add_del_if'.
// InProgress: the message form may change in the future versions
type CnatSnatPolicyAddDelIf struct {
	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
	IsAdd     uint8                          `binapi:"u8,name=is_add" json:"is_add,omitempty"`
	Table     CnatSnatPolicyTable            `binapi:"cnat_snat_policy_table,name=table" json:"table,omitempty"`
}

func (m *CnatSnatPolicyAddDelIf) Reset()               { *m = CnatSnatPolicyAddDelIf{} }
func (*CnatSnatPolicyAddDelIf) GetMessageName() string { return "cnat_snat_policy_add_del_if" }
func (*CnatSnatPolicyAddDelIf) GetCrcString() string   { return "6828deca" }
func (*CnatSnatPolicyAddDelIf) GetMessageType() api.MessageType {
	return api.RequestMessage
}

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

// CnatSnatPolicyAddDelIfReply defines message 'cnat_snat_policy_add_del_if_reply'.
// InProgress: the message form may change in the future versions
type CnatSnatPolicyAddDelIfReply struct {
	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}

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

func (m *CnatSnatPolicyAddDelIfReply) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 4 // m.Retval
	return size
}
func (m *CnatSnatPolicyAddDelIfReply) 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 *CnatSnatPolicyAddDelIfReply) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Retval = buf.DecodeInt32()
	return nil
}

// CnatTranslationDel defines message 'cnat_translation_del'.
// InProgress: the message form may change in the future versions
type CnatTranslationDel struct {
	ID uint32 `binapi:"u32,name=id" json:"id,omitempty"`
}

func (m *CnatTranslationDel) Reset()               { *m = CnatTranslationDel{} }
func (*CnatTranslationDel) GetMessageName() string { return "cnat_translation_del" }
func (*CnatTranslationDel) GetCrcString() string   { return "3a91bde5" }
func (*CnatTranslationDel) GetMessageType() api.MessageType {
	return api.RequestMessage
}

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

// CnatTranslationDelReply defines message 'cnat_translation_del_reply'.
// InProgress: the message form may change in the future versions
type CnatTranslationDelReply struct {
	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}

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

func (m *CnatTranslationDelReply) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 4 // m.Retval
	return size
}
func (m *CnatTranslationDelReply) 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 *CnatTranslationDelReply) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Retval = buf.DecodeInt32()
	return nil
}

// CnatTranslationDetails defines message 'cnat_translation_details'.
// InProgress: the message form may change in the future versions
type CnatTranslationDetails struct {
	Translation CnatTranslation `binapi:"cnat_translation,name=translation" json:"translation,omitempty"`
}

func (m *CnatTranslationDetails) Reset()               { *m = CnatTranslationDetails{} }
func (*CnatTranslationDetails) GetMessageName() string { return "cnat_translation_details" }
func (*CnatTranslationDetails) GetCrcString() string   { return "347e1f16" }
func (*CnatTranslationDetails) GetMessageType() api.MessageType {
	return api.ReplyMessage
}

func (m *CnatTranslationDetails) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 1      // m.Translation.Vip.Addr.Af
	size += 1 * 16 // m.Translation.Vip.Addr.Un
	size += 4      // m.Translation.Vip.SwIfIndex
	size += 1      // m.Translation.Vip.IfAf
	size += 2      // m.Translation.Vip.Port
	size += 4      // m.Translation.ID
	size += 1      // m.Translation.IPProto
	size += 1      // m.Translation.IsRealIP
	size += 1      // m.Translation.Flags
	size += 1      // m.Translation.LbType
	size += 4      // m.Translation.NPaths
	for j2 := 0; j2 < len(m.Translation.Paths); j2++ {
		var s2 CnatEndpointTuple
		_ = s2
		if j2 < len(m.Translation.Paths) {
			s2 = m.Translation.Paths[j2]
		}
		size += 1      // s2.DstEp.Addr.Af
		size += 1 * 16 // s2.DstEp.Addr.Un
		size += 4      // s2.DstEp.SwIfIndex
		size += 1      // s2.DstEp.IfAf
		size += 2      // s2.DstEp.Port
		size += 1      // s2.SrcEp.Addr.Af
		size += 1 * 16 // s2.SrcEp.Addr.Un
		size += 4      // s2.SrcEp.SwIfIndex
		size += 1      // s2.SrcEp.IfAf
		size += 2      // s2.SrcEp.Port
		size += 1      // s2.Flags
	}
	return size
}
func (m *CnatTranslationDetails) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeUint8(uint8(m.Translation.Vip.Addr.Af))
	buf.EncodeBytes(m.Translation.Vip.Addr.Un.XXX_UnionData[:], 16)
	buf.EncodeUint32(uint32(m.Translation.Vip.SwIfIndex))
	buf.EncodeUint8(uint8(m.Translation.Vip.IfAf))
	buf.EncodeUint16(m.Translation.Vip.Port)
	buf.EncodeUint32(m.Translation.ID)
	buf.EncodeUint8(uint8(m.Translation.IPProto))
	buf.EncodeUint8(m.Translation.IsRealIP)
	buf.EncodeUint8(m.Translation.Flags)
	buf.EncodeUint8(uint8(m.Translation.LbType))
	buf.EncodeUint32(uint32(len(m.Translation.Paths)))
	for j1 := 0; j1 < len(m.Translation.Paths); j1++ {
		var v1 CnatEndpointTuple // Paths
		if j1 < len(m.Translation.Paths) {
			v1 = m.Translation.Paths[j1]
		}
		buf.EncodeUint8(uint8(v1.DstEp.Addr.Af))
		buf.EncodeBytes(v1.DstEp.Addr.Un.XXX_UnionData[:], 16)
		buf.EncodeUint32(uint32(v1.DstEp.SwIfIndex))
		buf.EncodeUint8(uint8(v1.DstEp.IfAf))
		buf.EncodeUint16(v1.DstEp.Port)
		buf.EncodeUint8(uint8(v1.SrcEp.Addr.Af))
		buf.EncodeBytes(v1.SrcEp.Addr.Un.XXX_UnionData[:], 16)
		buf.EncodeUint32(uint32(v1.SrcEp.SwIfIndex))
		buf.EncodeUint8(uint8(v1.SrcEp.IfAf))
		buf.EncodeUint16(v1.SrcEp.Port)
		buf.EncodeUint8(v1.Flags)
	}
	return buf.Bytes(), nil
}
func (m *CnatTranslationDetails) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Translation.Vip.Addr.Af = ip_types.AddressFamily(buf.DecodeUint8())
	copy(m.Translation.Vip.Addr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
	m.Translation.Vip.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
	m.Translation.Vip.IfAf = ip_types.AddressFamily(buf.DecodeUint8())
	m.Translation.Vip.Port = buf.DecodeUint16()
	m.Translation.ID = buf.DecodeUint32()
	m.Translation.IPProto = ip_types.IPProto(buf.DecodeUint8())
	m.Translation.IsRealIP = buf.DecodeUint8()
	m.Translation.Flags = buf.DecodeUint8()
	m.Translation.LbType = CnatLbType(buf.DecodeUint8())
	m.Translation.NPaths = buf.DecodeUint32()
	m.Translation.Paths = make([]CnatEndpointTuple, m.Translation.NPaths)
	for j1 := 0; j1 < len(m.Translation.Paths); j1++ {
		m.Translation.Paths[j1].DstEp.Addr.Af = ip_types.AddressFamily(buf.DecodeUint8())
		copy(m.Translation.Paths[j1].DstEp.Addr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
		m.Translation.Paths[j1].DstEp.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
		m.Translation.Paths[j1].DstEp.IfAf = ip_types.AddressFamily(buf.DecodeUint8())
		m.Translation.Paths[j1].DstEp.Port = buf.DecodeUint16()
		m.Translation.Paths[j1].SrcEp.Addr.Af = ip_types.AddressFamily(buf.DecodeUint8())
		copy(m.Translation.Paths[j1].SrcEp.Addr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
		m.Translation.Paths[j1].SrcEp.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
		m.Translation.Paths[j1].SrcEp.IfAf = ip_types.AddressFamily(buf.DecodeUint8())
		m.Translation.Paths[j1].SrcEp.Port = buf.DecodeUint16()
		m.Translation.Paths[j1].Flags = buf.DecodeUint8()
	}
	return nil
}

// CnatTranslationDump defines message 'cnat_translation_dump'.
// InProgress: the message form may change in the future versions
type CnatTranslationDump struct{}

func (m *CnatTranslationDump) Reset()               { *m = CnatTranslationDump{} }
func (*CnatTranslationDump) GetMessageName() string { return "cnat_translation_dump" }
func (*CnatTranslationDump) GetCrcString() string   { return "51077d14" }
func (*CnatTranslationDump) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *CnatTranslationDump) Size() (size int) {
	if m == nil {
		return 0
	}
	return size
}
func (m *CnatTranslationDump) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	return buf.Bytes(), nil
}
func (m *CnatTranslationDump) Unmarshal(b []byte) error {
	return nil
}

// CnatTranslationUpdate defines message 'cnat_translation_update'.
// InProgress: the message form may change in the future versions
type CnatTranslationUpdate struct {
	Translation CnatTranslation `binapi:"cnat_translation,name=translation" json:"translation,omitempty"`
}

func (m *CnatTranslationUpdate) Reset()               { *m = CnatTranslationUpdate{} }
func (*CnatTranslationUpdate) GetMessageName() string { return "cnat_translation_update" }
func (*CnatTranslationUpdate) GetCrcString() string   { return "cd5aedf5" }
func (*CnatTranslationUpdate) GetMessageType() api.MessageType {
	return api.RequestMessage
}

func (m *CnatTranslationUpdate) Size() (size int) {
	if m == nil {
		return 0
	}
	size += 1      // m.Translation.Vip.Addr.Af
	size += 1 * 16 // m.Translation.Vip.Addr.Un
	size += 4      // m.Translation.Vip.SwIfIndex
	size += 1      // m.Translation.Vip.IfAf
	size += 2      // m.Translation.Vip.Port
	size += 4      // m.Translation.ID
	size += 1      // m.Translation.IPProto
	size += 1      // m.Translation.IsRealIP
	size += 1      // m.Translation.Flags
	size += 1      // m.Translation.LbType
	size += 4      // m.Translation.NPaths
	for j2 := 0; j2 < len(m.Translation.Paths); j2++ {
		var s2 CnatEndpointTuple
		_ = s2
		if j2 < len(m.Translation.Paths) {
			s2 = m.Translation.Paths[j2]
		}
		size += 1      // s2.DstEp.Addr.Af
		size += 1 * 16 // s2.DstEp.Addr.Un
		size += 4      // s2.DstEp.SwIfIndex
		size += 1      // s2.DstEp.IfAf
		size += 2      // s2.DstEp.Port
		size += 1      // s2.SrcEp.Addr.Af
		size += 1 * 16 // s2.SrcEp.Addr.Un
		size += 4      // s2.SrcEp.SwIfIndex
		size += 1      // s2.SrcEp.IfAf
		size += 2      // s2.SrcEp.Port
		size += 1      // s2.Flags
	}
	return size
}
func (m *CnatTranslationUpdate) Marshal(b []byte) ([]byte, error) {
	if b == nil {
		b = make([]byte, m.Size())
	}
	buf := codec.NewBuffer(b)
	buf.EncodeUint8(uint8(m.Translation.Vip.Addr.Af))
	buf.EncodeBytes(m.Translation.Vip.Addr.Un.XXX_UnionData[:], 16)
	buf.EncodeUint32(uint32(m.Translation.Vip.SwIfIndex))
	buf.EncodeUint8(uint8(m.Translation.Vip.IfAf))
	buf.EncodeUint16(m.Translation.Vip.Port)
	buf.EncodeUint32(m.Translation.ID)
	buf.EncodeUint8(uint8(m.Translation.IPProto))
	buf.EncodeUint8(m.Translation.IsRealIP)
	buf.EncodeUint8(m.Translation.Flags)
	buf.EncodeUint8(uint8(m.Translation.LbType))
	buf.EncodeUint32(uint32(len(m.Translation.Paths)))
	for j1 := 0; j1 < len(m.Translation.Paths); j1++ {
		var v1 CnatEndpointTuple // Paths
		if j1 < len(m.Translation.Paths) {
			v1 = m.Translation.Paths[j1]
		}
		buf.EncodeUint8(uint8(v1.DstEp.Addr.Af))
		buf.EncodeBytes(v1.DstEp.Addr.Un.XXX_UnionData[:], 16)
		buf.EncodeUint32(uint32(v1.DstEp.SwIfIndex))
		buf.EncodeUint8(uint8(v1.DstEp.IfAf))
		buf.EncodeUint16(v1.DstEp.Port)
		buf.EncodeUint8(uint8(v1.SrcEp.Addr.Af))
		buf.EncodeBytes(v1.SrcEp.Addr.Un.XXX_UnionData[:], 16)
		buf.EncodeUint32(uint32(v1.SrcEp.SwIfIndex))
		buf.EncodeUint8(uint8(v1.SrcEp.IfAf))
		buf.EncodeUint16(v1.SrcEp.Port)
		buf.EncodeUint8(v1.Flags)
	}
	return buf.Bytes(), nil
}
func (m *CnatTranslationUpdate) Unmarshal(b []byte) error {
	buf := codec.NewBuffer(b)
	m.Translation.Vip.Addr.Af = ip_types.AddressFamily(buf.DecodeUint8())
	copy(m.Translation.Vip.Addr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
	m.Translation.Vip.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
	m.Translation.Vip.IfAf = ip_types.AddressFamily(buf.DecodeUint8())
	m.Translation.Vip.Port = buf.DecodeUint16()
	m.Translation.ID = buf.DecodeUint32()
	m.Translation.IPProto = ip_types.IPProto(buf.DecodeUint8())
	m.Translation.IsRealIP = buf.DecodeUint8()
	m.Translation.Flags = buf.DecodeUint8()
	m.Translation.LbType = CnatLbType(buf.DecodeUint8())
	m.Translation.NPaths = buf.DecodeUint32()
	m.Translation.Paths = make([]CnatEndpointTuple, m.Translation.NPaths)
	for j1 := 0; j1 < len(m.Translation.Paths); j1++ {
		m.Translation.Paths[j1].DstEp.Addr.Af = ip_types.AddressFamily(buf.DecodeUint8())
		copy(m.Translation.Paths[j1].DstEp.Addr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
		m.Translation.Paths[j1].DstEp.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
		m.Translation.Paths[j1].DstEp.IfAf = ip_types.AddressFamily(buf.DecodeUint8())
		m.Translation.Paths[j1].DstEp.Port = buf.DecodeUint16()
		m.Translation.Paths[j1].SrcEp.Addr.Af = ip_types.AddressFamily(buf.DecodeUint8())
		copy(m.Translation.Paths[j1].SrcEp.Addr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
		m.Translation.Paths[j1].SrcEp.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
		m.Translation.Paths[j1].SrcEp.IfAf = ip_types.AddressFamily(buf.DecodeUint8())
		m.Translation.Paths[j1].SrcEp.Port = buf.DecodeUint16()
		m.Translation.Paths[j1].Flags = buf.DecodeUint8()
	}
	return nil
}

// CnatTranslationUpdateReply defines message 'cnat_translation_update_reply'.
// InProgress: the message form may change in the future versions
type CnatTranslationUpdateReply struct {
	Retval int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
	ID     uint32 `binapi:"u32,name=id" json:"id,omitempty"`
}

func (m *CnatTranslationUpdateReply) Reset()               { *m = CnatTranslationUpdateReply{} }
func (*CnatTranslationUpdateReply) GetMessageName() string { return "cnat_translation_update_reply" }
func (*CnatTranslationUpdateReply) GetCrcString() string   { return "e2fc8294" }
func (*CnatTranslationUpdateReply) GetMessageType() api.MessageType {
	return api.ReplyMessage
}

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

func init() { file_cnat_binapi_init() }
func file_cnat_binapi_init() {
	api.RegisterMessage((*CnatGetSnatAddresses)(nil), "cnat_get_snat_addresses_51077d14")
	api.RegisterMessage((*CnatGetSnatAddressesReply)(nil), "cnat_get_snat_addresses_reply_879513c1")
	api.RegisterMessage((*CnatSessionDetails)(nil), "cnat_session_details_7e5017c7")
	api.RegisterMessage((*CnatSessionDump)(nil), "cnat_session_dump_51077d14")
	api.RegisterMessage((*CnatSessionPurge)(nil), "cnat_session_purge_51077d14")
	api.RegisterMessage((*CnatSessionPurgeReply)(nil), "cnat_session_purge_reply_e8d4e804")
	api.RegisterMessage((*CnatSetSnatAddresses)(nil), "cnat_set_snat_addresses_d997e96c")
	api.RegisterMessage((*CnatSetSnatAddressesReply)(nil), "cnat_set_snat_addresses_reply_e8d4e804")
	api.RegisterMessage((*CnatSetSnatPolicy)(nil), "cnat_set_snat_policy_d3e6eaf4")
	api.RegisterMessage((*CnatSetSnatPolicyReply)(nil), "cnat_set_snat_policy_reply_e8d4e804")
	api.RegisterMessage((*CnatSnatPolicyAddDelExcludePfx)(nil), "cnat_snat_policy_add_del_exclude_pfx_e26dd79a")
	api.RegisterMessage((*CnatSnatPolicyAddDelExcludePfxReply)(nil), "cnat_snat_policy_add_del_exclude_pfx_reply_e8d4e804")
	api.RegisterMessage((*CnatSnatPolicyAddDelIf)(nil), "cnat_snat_policy_add_del_if_6828deca")
	api.RegisterMessage((*CnatSnatPolicyAddDelIfReply)(nil), "cnat_snat_policy_add_del_if_reply_e8d4e804")
	api.RegisterMessage((*CnatTranslationDel)(nil), "cnat_translation_del_3a91bde5")
	api.RegisterMessage((*CnatTranslationDelReply)(nil), "cnat_translation_del_reply_e8d4e804")
	api.RegisterMessage((*CnatTranslationDetails)(nil), "cnat_translation_details_347e1f16")
	api.RegisterMessage((*CnatTranslationDump)(nil), "cnat_translation_dump_51077d14")
	api.RegisterMessage((*CnatTranslationUpdate)(nil), "cnat_translation_update_cd5aedf5")
	api.RegisterMessage((*CnatTranslationUpdateReply)(nil), "cnat_translation_update_reply_e2fc8294")
}

// Messages returns list of all messages in this module.
func AllMessages() []api.Message {
	return []api.Message{
		(*CnatGetSnatAddresses)(nil),
		(*CnatGetSnatAddressesReply)(nil),
		(*CnatSessionDetails)(nil),
		(*CnatSessionDump)(nil),
		(*CnatSessionPurge)(nil),
		(*CnatSessionPurgeReply)(nil),
		(*CnatSetSnatAddresses)(nil),
		(*CnatSetSnatAddressesReply)(nil),
		(*CnatSetSnatPolicy)(nil),
		(*CnatSetSnatPolicyReply)(nil),
		(*CnatSnatPolicyAddDelExcludePfx)(nil),
		(*CnatSnatPolicyAddDelExcludePfxReply)(nil),
		(*CnatSnatPolicyAddDelIf)(nil),
		(*CnatSnatPolicyAddDelIfReply)(nil),
		(*CnatTranslationDel)(nil),
		(*CnatTranslationDelReply)(nil),
		(*CnatTranslationDetails)(nil),
		(*CnatTranslationDump)(nil),
		(*CnatTranslationUpdate)(nil),
		(*CnatTranslationUpdateReply)(nil),
	}
}