-
Notifications
You must be signed in to change notification settings - Fork 80
/
classify.ba.go
2067 lines (1916 loc) · 71.1 KB
/
classify.ba.go
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
// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
// versions:
// binapi-generator: v0.7.0
// VPP: 22.10-release
// source: /usr/share/vpp/api/core/classify.api.json
// Package classify contains generated bindings for API file classify.api.
//
// Contents:
// - 3 enums
// - 44 messages
package classify
import (
"strconv"
api "go.fd.io/govpp/api"
interface_types "go.fd.io/govpp/binapi/interface_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 = "classify"
APIVersion = "3.1.0"
VersionCrc = 0x92a4f2c8
)
// ClassifyAction defines enum 'classify_action'.
type ClassifyAction uint8
const (
CLASSIFY_API_ACTION_NONE ClassifyAction = 0
CLASSIFY_API_ACTION_SET_IP4_FIB_INDEX ClassifyAction = 1
CLASSIFY_API_ACTION_SET_IP6_FIB_INDEX ClassifyAction = 2
CLASSIFY_API_ACTION_SET_METADATA ClassifyAction = 3
)
var (
ClassifyAction_name = map[uint8]string{
0: "CLASSIFY_API_ACTION_NONE",
1: "CLASSIFY_API_ACTION_SET_IP4_FIB_INDEX",
2: "CLASSIFY_API_ACTION_SET_IP6_FIB_INDEX",
3: "CLASSIFY_API_ACTION_SET_METADATA",
}
ClassifyAction_value = map[string]uint8{
"CLASSIFY_API_ACTION_NONE": 0,
"CLASSIFY_API_ACTION_SET_IP4_FIB_INDEX": 1,
"CLASSIFY_API_ACTION_SET_IP6_FIB_INDEX": 2,
"CLASSIFY_API_ACTION_SET_METADATA": 3,
}
)
func (x ClassifyAction) String() string {
s, ok := ClassifyAction_name[uint8(x)]
if ok {
return s
}
return "ClassifyAction(" + strconv.Itoa(int(x)) + ")"
}
// FlowClassifyTable defines enum 'flow_classify_table'.
type FlowClassifyTable uint8
const (
FLOW_CLASSIFY_API_TABLE_IP4 FlowClassifyTable = 0
FLOW_CLASSIFY_API_TABLE_IP6 FlowClassifyTable = 1
)
var (
FlowClassifyTable_name = map[uint8]string{
0: "FLOW_CLASSIFY_API_TABLE_IP4",
1: "FLOW_CLASSIFY_API_TABLE_IP6",
}
FlowClassifyTable_value = map[string]uint8{
"FLOW_CLASSIFY_API_TABLE_IP4": 0,
"FLOW_CLASSIFY_API_TABLE_IP6": 1,
}
)
func (x FlowClassifyTable) String() string {
s, ok := FlowClassifyTable_name[uint8(x)]
if ok {
return s
}
return "FlowClassifyTable(" + strconv.Itoa(int(x)) + ")"
}
// PolicerClassifyTable defines enum 'policer_classify_table'.
type PolicerClassifyTable uint8
const (
POLICER_CLASSIFY_API_TABLE_IP4 PolicerClassifyTable = 0
POLICER_CLASSIFY_API_TABLE_IP6 PolicerClassifyTable = 1
POLICER_CLASSIFY_API_TABLE_L2 PolicerClassifyTable = 2
)
var (
PolicerClassifyTable_name = map[uint8]string{
0: "POLICER_CLASSIFY_API_TABLE_IP4",
1: "POLICER_CLASSIFY_API_TABLE_IP6",
2: "POLICER_CLASSIFY_API_TABLE_L2",
}
PolicerClassifyTable_value = map[string]uint8{
"POLICER_CLASSIFY_API_TABLE_IP4": 0,
"POLICER_CLASSIFY_API_TABLE_IP6": 1,
"POLICER_CLASSIFY_API_TABLE_L2": 2,
}
)
func (x PolicerClassifyTable) String() string {
s, ok := PolicerClassifyTable_name[uint8(x)]
if ok {
return s
}
return "PolicerClassifyTable(" + strconv.Itoa(int(x)) + ")"
}
// ClassifyAddDelSession defines message 'classify_add_del_session'.
type ClassifyAddDelSession struct {
IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
TableIndex uint32 `binapi:"u32,name=table_index" json:"table_index,omitempty"`
HitNextIndex uint32 `binapi:"u32,name=hit_next_index,default=4294967295" json:"hit_next_index,omitempty"`
OpaqueIndex uint32 `binapi:"u32,name=opaque_index,default=4294967295" json:"opaque_index,omitempty"`
Advance int32 `binapi:"i32,name=advance,default=0" json:"advance,omitempty"`
Action ClassifyAction `binapi:"classify_action,name=action,default=0" json:"action,omitempty"`
Metadata uint32 `binapi:"u32,name=metadata,default=0" json:"metadata,omitempty"`
MatchLen uint32 `binapi:"u32,name=match_len" json:"-"`
Match []byte `binapi:"u8[match_len],name=match" json:"match,omitempty"`
}
func (m *ClassifyAddDelSession) Reset() { *m = ClassifyAddDelSession{} }
func (*ClassifyAddDelSession) GetMessageName() string { return "classify_add_del_session" }
func (*ClassifyAddDelSession) GetCrcString() string { return "f20879f0" }
func (*ClassifyAddDelSession) GetMessageType() api.MessageType {
return api.RequestMessage
}
func (m *ClassifyAddDelSession) Size() (size int) {
if m == nil {
return 0
}
size += 1 // m.IsAdd
size += 4 // m.TableIndex
size += 4 // m.HitNextIndex
size += 4 // m.OpaqueIndex
size += 4 // m.Advance
size += 1 // m.Action
size += 4 // m.Metadata
size += 4 // m.MatchLen
size += 1 * len(m.Match) // m.Match
return size
}
func (m *ClassifyAddDelSession) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeBool(m.IsAdd)
buf.EncodeUint32(m.TableIndex)
buf.EncodeUint32(m.HitNextIndex)
buf.EncodeUint32(m.OpaqueIndex)
buf.EncodeInt32(m.Advance)
buf.EncodeUint8(uint8(m.Action))
buf.EncodeUint32(m.Metadata)
buf.EncodeUint32(uint32(len(m.Match)))
buf.EncodeBytes(m.Match, 0)
return buf.Bytes(), nil
}
func (m *ClassifyAddDelSession) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.IsAdd = buf.DecodeBool()
m.TableIndex = buf.DecodeUint32()
m.HitNextIndex = buf.DecodeUint32()
m.OpaqueIndex = buf.DecodeUint32()
m.Advance = buf.DecodeInt32()
m.Action = ClassifyAction(buf.DecodeUint8())
m.Metadata = buf.DecodeUint32()
m.MatchLen = buf.DecodeUint32()
m.Match = make([]byte, m.MatchLen)
copy(m.Match, buf.DecodeBytes(len(m.Match)))
return nil
}
// ClassifyAddDelSessionReply defines message 'classify_add_del_session_reply'.
type ClassifyAddDelSessionReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
func (m *ClassifyAddDelSessionReply) Reset() { *m = ClassifyAddDelSessionReply{} }
func (*ClassifyAddDelSessionReply) GetMessageName() string { return "classify_add_del_session_reply" }
func (*ClassifyAddDelSessionReply) GetCrcString() string { return "e8d4e804" }
func (*ClassifyAddDelSessionReply) GetMessageType() api.MessageType {
return api.ReplyMessage
}
func (m *ClassifyAddDelSessionReply) Size() (size int) {
if m == nil {
return 0
}
size += 4 // m.Retval
return size
}
func (m *ClassifyAddDelSessionReply) 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 *ClassifyAddDelSessionReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.Retval = buf.DecodeInt32()
return nil
}
// ClassifyAddDelTable defines message 'classify_add_del_table'.
type ClassifyAddDelTable struct {
IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
DelChain bool `binapi:"bool,name=del_chain" json:"del_chain,omitempty"`
TableIndex uint32 `binapi:"u32,name=table_index,default=4294967295" json:"table_index,omitempty"`
Nbuckets uint32 `binapi:"u32,name=nbuckets,default=2" json:"nbuckets,omitempty"`
MemorySize uint32 `binapi:"u32,name=memory_size,default=2097152" json:"memory_size,omitempty"`
SkipNVectors uint32 `binapi:"u32,name=skip_n_vectors,default=0" json:"skip_n_vectors,omitempty"`
MatchNVectors uint32 `binapi:"u32,name=match_n_vectors,default=1" json:"match_n_vectors,omitempty"`
NextTableIndex uint32 `binapi:"u32,name=next_table_index,default=4294967295" json:"next_table_index,omitempty"`
MissNextIndex uint32 `binapi:"u32,name=miss_next_index,default=4294967295" json:"miss_next_index,omitempty"`
CurrentDataFlag uint8 `binapi:"u8,name=current_data_flag,default=0" json:"current_data_flag,omitempty"`
CurrentDataOffset int16 `binapi:"i16,name=current_data_offset,default=0" json:"current_data_offset,omitempty"`
MaskLen uint32 `binapi:"u32,name=mask_len" json:"-"`
Mask []byte `binapi:"u8[mask_len],name=mask" json:"mask,omitempty"`
}
func (m *ClassifyAddDelTable) Reset() { *m = ClassifyAddDelTable{} }
func (*ClassifyAddDelTable) GetMessageName() string { return "classify_add_del_table" }
func (*ClassifyAddDelTable) GetCrcString() string { return "6849e39e" }
func (*ClassifyAddDelTable) GetMessageType() api.MessageType {
return api.RequestMessage
}
func (m *ClassifyAddDelTable) Size() (size int) {
if m == nil {
return 0
}
size += 1 // m.IsAdd
size += 1 // m.DelChain
size += 4 // m.TableIndex
size += 4 // m.Nbuckets
size += 4 // m.MemorySize
size += 4 // m.SkipNVectors
size += 4 // m.MatchNVectors
size += 4 // m.NextTableIndex
size += 4 // m.MissNextIndex
size += 1 // m.CurrentDataFlag
size += 2 // m.CurrentDataOffset
size += 4 // m.MaskLen
size += 1 * len(m.Mask) // m.Mask
return size
}
func (m *ClassifyAddDelTable) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeBool(m.IsAdd)
buf.EncodeBool(m.DelChain)
buf.EncodeUint32(m.TableIndex)
buf.EncodeUint32(m.Nbuckets)
buf.EncodeUint32(m.MemorySize)
buf.EncodeUint32(m.SkipNVectors)
buf.EncodeUint32(m.MatchNVectors)
buf.EncodeUint32(m.NextTableIndex)
buf.EncodeUint32(m.MissNextIndex)
buf.EncodeUint8(m.CurrentDataFlag)
buf.EncodeInt16(m.CurrentDataOffset)
buf.EncodeUint32(uint32(len(m.Mask)))
buf.EncodeBytes(m.Mask, 0)
return buf.Bytes(), nil
}
func (m *ClassifyAddDelTable) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.IsAdd = buf.DecodeBool()
m.DelChain = buf.DecodeBool()
m.TableIndex = buf.DecodeUint32()
m.Nbuckets = buf.DecodeUint32()
m.MemorySize = buf.DecodeUint32()
m.SkipNVectors = buf.DecodeUint32()
m.MatchNVectors = buf.DecodeUint32()
m.NextTableIndex = buf.DecodeUint32()
m.MissNextIndex = buf.DecodeUint32()
m.CurrentDataFlag = buf.DecodeUint8()
m.CurrentDataOffset = buf.DecodeInt16()
m.MaskLen = buf.DecodeUint32()
m.Mask = make([]byte, m.MaskLen)
copy(m.Mask, buf.DecodeBytes(len(m.Mask)))
return nil
}
// ClassifyAddDelTableReply defines message 'classify_add_del_table_reply'.
type ClassifyAddDelTableReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
NewTableIndex uint32 `binapi:"u32,name=new_table_index" json:"new_table_index,omitempty"`
SkipNVectors uint32 `binapi:"u32,name=skip_n_vectors" json:"skip_n_vectors,omitempty"`
MatchNVectors uint32 `binapi:"u32,name=match_n_vectors" json:"match_n_vectors,omitempty"`
}
func (m *ClassifyAddDelTableReply) Reset() { *m = ClassifyAddDelTableReply{} }
func (*ClassifyAddDelTableReply) GetMessageName() string { return "classify_add_del_table_reply" }
func (*ClassifyAddDelTableReply) GetCrcString() string { return "05486349" }
func (*ClassifyAddDelTableReply) GetMessageType() api.MessageType {
return api.ReplyMessage
}
func (m *ClassifyAddDelTableReply) Size() (size int) {
if m == nil {
return 0
}
size += 4 // m.Retval
size += 4 // m.NewTableIndex
size += 4 // m.SkipNVectors
size += 4 // m.MatchNVectors
return size
}
func (m *ClassifyAddDelTableReply) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeInt32(m.Retval)
buf.EncodeUint32(m.NewTableIndex)
buf.EncodeUint32(m.SkipNVectors)
buf.EncodeUint32(m.MatchNVectors)
return buf.Bytes(), nil
}
func (m *ClassifyAddDelTableReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.Retval = buf.DecodeInt32()
m.NewTableIndex = buf.DecodeUint32()
m.SkipNVectors = buf.DecodeUint32()
m.MatchNVectors = buf.DecodeUint32()
return nil
}
// ClassifyPcapGetTables defines message 'classify_pcap_get_tables'.
type ClassifyPcapGetTables struct {
SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
}
func (m *ClassifyPcapGetTables) Reset() { *m = ClassifyPcapGetTables{} }
func (*ClassifyPcapGetTables) GetMessageName() string { return "classify_pcap_get_tables" }
func (*ClassifyPcapGetTables) GetCrcString() string { return "f9e6675e" }
func (*ClassifyPcapGetTables) GetMessageType() api.MessageType {
return api.RequestMessage
}
func (m *ClassifyPcapGetTables) Size() (size int) {
if m == nil {
return 0
}
size += 4 // m.SwIfIndex
return size
}
func (m *ClassifyPcapGetTables) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeUint32(uint32(m.SwIfIndex))
return buf.Bytes(), nil
}
func (m *ClassifyPcapGetTables) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
return nil
}
// ClassifyPcapGetTablesReply defines message 'classify_pcap_get_tables_reply'.
type ClassifyPcapGetTablesReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
Count uint32 `binapi:"u32,name=count" json:"-"`
Indices []uint32 `binapi:"u32[count],name=indices" json:"indices,omitempty"`
}
func (m *ClassifyPcapGetTablesReply) Reset() { *m = ClassifyPcapGetTablesReply{} }
func (*ClassifyPcapGetTablesReply) GetMessageName() string { return "classify_pcap_get_tables_reply" }
func (*ClassifyPcapGetTablesReply) GetCrcString() string { return "5f5bc9e6" }
func (*ClassifyPcapGetTablesReply) GetMessageType() api.MessageType {
return api.ReplyMessage
}
func (m *ClassifyPcapGetTablesReply) Size() (size int) {
if m == nil {
return 0
}
size += 4 // m.Retval
size += 4 // m.Count
size += 4 * len(m.Indices) // m.Indices
return size
}
func (m *ClassifyPcapGetTablesReply) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeInt32(m.Retval)
buf.EncodeUint32(uint32(len(m.Indices)))
for i := 0; i < len(m.Indices); i++ {
var x uint32
if i < len(m.Indices) {
x = uint32(m.Indices[i])
}
buf.EncodeUint32(x)
}
return buf.Bytes(), nil
}
func (m *ClassifyPcapGetTablesReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.Retval = buf.DecodeInt32()
m.Count = buf.DecodeUint32()
m.Indices = make([]uint32, m.Count)
for i := 0; i < len(m.Indices); i++ {
m.Indices[i] = buf.DecodeUint32()
}
return nil
}
// ClassifyPcapLookupTable defines message 'classify_pcap_lookup_table'.
type ClassifyPcapLookupTable struct {
SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"`
SkipNVectors uint32 `binapi:"u32,name=skip_n_vectors,default=0" json:"skip_n_vectors,omitempty"`
MatchNVectors uint32 `binapi:"u32,name=match_n_vectors,default=1" json:"match_n_vectors,omitempty"`
MaskLen uint32 `binapi:"u32,name=mask_len" json:"-"`
Mask []byte `binapi:"u8[mask_len],name=mask" json:"mask,omitempty"`
}
func (m *ClassifyPcapLookupTable) Reset() { *m = ClassifyPcapLookupTable{} }
func (*ClassifyPcapLookupTable) GetMessageName() string { return "classify_pcap_lookup_table" }
func (*ClassifyPcapLookupTable) GetCrcString() string { return "e1b4cc6b" }
func (*ClassifyPcapLookupTable) GetMessageType() api.MessageType {
return api.RequestMessage
}
func (m *ClassifyPcapLookupTable) Size() (size int) {
if m == nil {
return 0
}
size += 4 // m.SwIfIndex
size += 4 // m.SkipNVectors
size += 4 // m.MatchNVectors
size += 4 // m.MaskLen
size += 1 * len(m.Mask) // m.Mask
return size
}
func (m *ClassifyPcapLookupTable) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeUint32(uint32(m.SwIfIndex))
buf.EncodeUint32(m.SkipNVectors)
buf.EncodeUint32(m.MatchNVectors)
buf.EncodeUint32(uint32(len(m.Mask)))
buf.EncodeBytes(m.Mask, 0)
return buf.Bytes(), nil
}
func (m *ClassifyPcapLookupTable) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
m.SkipNVectors = buf.DecodeUint32()
m.MatchNVectors = buf.DecodeUint32()
m.MaskLen = buf.DecodeUint32()
m.Mask = make([]byte, m.MaskLen)
copy(m.Mask, buf.DecodeBytes(len(m.Mask)))
return nil
}
// ClassifyPcapLookupTableReply defines message 'classify_pcap_lookup_table_reply'.
type ClassifyPcapLookupTableReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
TableIndex uint32 `binapi:"u32,name=table_index" json:"table_index,omitempty"`
}
func (m *ClassifyPcapLookupTableReply) Reset() { *m = ClassifyPcapLookupTableReply{} }
func (*ClassifyPcapLookupTableReply) GetMessageName() string {
return "classify_pcap_lookup_table_reply"
}
func (*ClassifyPcapLookupTableReply) GetCrcString() string { return "9c6c6773" }
func (*ClassifyPcapLookupTableReply) GetMessageType() api.MessageType {
return api.ReplyMessage
}
func (m *ClassifyPcapLookupTableReply) Size() (size int) {
if m == nil {
return 0
}
size += 4 // m.Retval
size += 4 // m.TableIndex
return size
}
func (m *ClassifyPcapLookupTableReply) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeInt32(m.Retval)
buf.EncodeUint32(m.TableIndex)
return buf.Bytes(), nil
}
func (m *ClassifyPcapLookupTableReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.Retval = buf.DecodeInt32()
m.TableIndex = buf.DecodeUint32()
return nil
}
// ClassifyPcapSetTable defines message 'classify_pcap_set_table'.
type ClassifyPcapSetTable struct {
SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
TableIndex uint32 `binapi:"u32,name=table_index,default=4294967295" json:"table_index,omitempty"`
SortMasks bool `binapi:"bool,name=sort_masks,default=0" json:"sort_masks,omitempty"`
}
func (m *ClassifyPcapSetTable) Reset() { *m = ClassifyPcapSetTable{} }
func (*ClassifyPcapSetTable) GetMessageName() string { return "classify_pcap_set_table" }
func (*ClassifyPcapSetTable) GetCrcString() string { return "006051b3" }
func (*ClassifyPcapSetTable) GetMessageType() api.MessageType {
return api.RequestMessage
}
func (m *ClassifyPcapSetTable) Size() (size int) {
if m == nil {
return 0
}
size += 4 // m.SwIfIndex
size += 4 // m.TableIndex
size += 1 // m.SortMasks
return size
}
func (m *ClassifyPcapSetTable) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeUint32(uint32(m.SwIfIndex))
buf.EncodeUint32(m.TableIndex)
buf.EncodeBool(m.SortMasks)
return buf.Bytes(), nil
}
func (m *ClassifyPcapSetTable) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
m.TableIndex = buf.DecodeUint32()
m.SortMasks = buf.DecodeBool()
return nil
}
// ClassifyPcapSetTableReply defines message 'classify_pcap_set_table_reply'.
type ClassifyPcapSetTableReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
TableIndex uint32 `binapi:"u32,name=table_index" json:"table_index,omitempty"`
}
func (m *ClassifyPcapSetTableReply) Reset() { *m = ClassifyPcapSetTableReply{} }
func (*ClassifyPcapSetTableReply) GetMessageName() string { return "classify_pcap_set_table_reply" }
func (*ClassifyPcapSetTableReply) GetCrcString() string { return "9c6c6773" }
func (*ClassifyPcapSetTableReply) GetMessageType() api.MessageType {
return api.ReplyMessage
}
func (m *ClassifyPcapSetTableReply) Size() (size int) {
if m == nil {
return 0
}
size += 4 // m.Retval
size += 4 // m.TableIndex
return size
}
func (m *ClassifyPcapSetTableReply) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeInt32(m.Retval)
buf.EncodeUint32(m.TableIndex)
return buf.Bytes(), nil
}
func (m *ClassifyPcapSetTableReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.Retval = buf.DecodeInt32()
m.TableIndex = buf.DecodeUint32()
return nil
}
// ClassifySessionDetails defines message 'classify_session_details'.
type ClassifySessionDetails struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
HitNextIndex uint32 `binapi:"u32,name=hit_next_index" json:"hit_next_index,omitempty"`
Advance int32 `binapi:"i32,name=advance" json:"advance,omitempty"`
OpaqueIndex uint32 `binapi:"u32,name=opaque_index" json:"opaque_index,omitempty"`
MatchLength uint32 `binapi:"u32,name=match_length" json:"-"`
Match []byte `binapi:"u8[match_length],name=match" json:"match,omitempty"`
}
func (m *ClassifySessionDetails) Reset() { *m = ClassifySessionDetails{} }
func (*ClassifySessionDetails) GetMessageName() string { return "classify_session_details" }
func (*ClassifySessionDetails) GetCrcString() string { return "60e3ef94" }
func (*ClassifySessionDetails) GetMessageType() api.MessageType {
return api.ReplyMessage
}
func (m *ClassifySessionDetails) Size() (size int) {
if m == nil {
return 0
}
size += 4 // m.Retval
size += 4 // m.TableID
size += 4 // m.HitNextIndex
size += 4 // m.Advance
size += 4 // m.OpaqueIndex
size += 4 // m.MatchLength
size += 1 * len(m.Match) // m.Match
return size
}
func (m *ClassifySessionDetails) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeInt32(m.Retval)
buf.EncodeUint32(m.TableID)
buf.EncodeUint32(m.HitNextIndex)
buf.EncodeInt32(m.Advance)
buf.EncodeUint32(m.OpaqueIndex)
buf.EncodeUint32(uint32(len(m.Match)))
buf.EncodeBytes(m.Match, 0)
return buf.Bytes(), nil
}
func (m *ClassifySessionDetails) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.Retval = buf.DecodeInt32()
m.TableID = buf.DecodeUint32()
m.HitNextIndex = buf.DecodeUint32()
m.Advance = buf.DecodeInt32()
m.OpaqueIndex = buf.DecodeUint32()
m.MatchLength = buf.DecodeUint32()
m.Match = make([]byte, m.MatchLength)
copy(m.Match, buf.DecodeBytes(len(m.Match)))
return nil
}
// ClassifySessionDump defines message 'classify_session_dump'.
type ClassifySessionDump struct {
TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
}
func (m *ClassifySessionDump) Reset() { *m = ClassifySessionDump{} }
func (*ClassifySessionDump) GetMessageName() string { return "classify_session_dump" }
func (*ClassifySessionDump) GetCrcString() string { return "0cca2cd9" }
func (*ClassifySessionDump) GetMessageType() api.MessageType {
return api.RequestMessage
}
func (m *ClassifySessionDump) Size() (size int) {
if m == nil {
return 0
}
size += 4 // m.TableID
return size
}
func (m *ClassifySessionDump) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeUint32(m.TableID)
return buf.Bytes(), nil
}
func (m *ClassifySessionDump) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.TableID = buf.DecodeUint32()
return nil
}
// ClassifySetInterfaceIPTable defines message 'classify_set_interface_ip_table'.
type ClassifySetInterfaceIPTable struct {
IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
TableIndex uint32 `binapi:"u32,name=table_index" json:"table_index,omitempty"`
}
func (m *ClassifySetInterfaceIPTable) Reset() { *m = ClassifySetInterfaceIPTable{} }
func (*ClassifySetInterfaceIPTable) GetMessageName() string { return "classify_set_interface_ip_table" }
func (*ClassifySetInterfaceIPTable) GetCrcString() string { return "e0b097c7" }
func (*ClassifySetInterfaceIPTable) GetMessageType() api.MessageType {
return api.RequestMessage
}
func (m *ClassifySetInterfaceIPTable) Size() (size int) {
if m == nil {
return 0
}
size += 1 // m.IsIPv6
size += 4 // m.SwIfIndex
size += 4 // m.TableIndex
return size
}
func (m *ClassifySetInterfaceIPTable) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeBool(m.IsIPv6)
buf.EncodeUint32(uint32(m.SwIfIndex))
buf.EncodeUint32(m.TableIndex)
return buf.Bytes(), nil
}
func (m *ClassifySetInterfaceIPTable) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.IsIPv6 = buf.DecodeBool()
m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
m.TableIndex = buf.DecodeUint32()
return nil
}
// ClassifySetInterfaceIPTableReply defines message 'classify_set_interface_ip_table_reply'.
type ClassifySetInterfaceIPTableReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
func (m *ClassifySetInterfaceIPTableReply) Reset() { *m = ClassifySetInterfaceIPTableReply{} }
func (*ClassifySetInterfaceIPTableReply) GetMessageName() string {
return "classify_set_interface_ip_table_reply"
}
func (*ClassifySetInterfaceIPTableReply) GetCrcString() string { return "e8d4e804" }
func (*ClassifySetInterfaceIPTableReply) GetMessageType() api.MessageType {
return api.ReplyMessage
}
func (m *ClassifySetInterfaceIPTableReply) Size() (size int) {
if m == nil {
return 0
}
size += 4 // m.Retval
return size
}
func (m *ClassifySetInterfaceIPTableReply) 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 *ClassifySetInterfaceIPTableReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.Retval = buf.DecodeInt32()
return nil
}
// ClassifySetInterfaceL2Tables defines message 'classify_set_interface_l2_tables'.
type ClassifySetInterfaceL2Tables struct {
SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
IP4TableIndex uint32 `binapi:"u32,name=ip4_table_index" json:"ip4_table_index,omitempty"`
IP6TableIndex uint32 `binapi:"u32,name=ip6_table_index" json:"ip6_table_index,omitempty"`
OtherTableIndex uint32 `binapi:"u32,name=other_table_index" json:"other_table_index,omitempty"`
IsInput bool `binapi:"bool,name=is_input" json:"is_input,omitempty"`
}
func (m *ClassifySetInterfaceL2Tables) Reset() { *m = ClassifySetInterfaceL2Tables{} }
func (*ClassifySetInterfaceL2Tables) GetMessageName() string {
return "classify_set_interface_l2_tables"
}
func (*ClassifySetInterfaceL2Tables) GetCrcString() string { return "5a6ddf65" }
func (*ClassifySetInterfaceL2Tables) GetMessageType() api.MessageType {
return api.RequestMessage
}
func (m *ClassifySetInterfaceL2Tables) Size() (size int) {
if m == nil {
return 0
}
size += 4 // m.SwIfIndex
size += 4 // m.IP4TableIndex
size += 4 // m.IP6TableIndex
size += 4 // m.OtherTableIndex
size += 1 // m.IsInput
return size
}
func (m *ClassifySetInterfaceL2Tables) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeUint32(uint32(m.SwIfIndex))
buf.EncodeUint32(m.IP4TableIndex)
buf.EncodeUint32(m.IP6TableIndex)
buf.EncodeUint32(m.OtherTableIndex)
buf.EncodeBool(m.IsInput)
return buf.Bytes(), nil
}
func (m *ClassifySetInterfaceL2Tables) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
m.IP4TableIndex = buf.DecodeUint32()
m.IP6TableIndex = buf.DecodeUint32()
m.OtherTableIndex = buf.DecodeUint32()
m.IsInput = buf.DecodeBool()
return nil
}
// ClassifySetInterfaceL2TablesReply defines message 'classify_set_interface_l2_tables_reply'.
type ClassifySetInterfaceL2TablesReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
func (m *ClassifySetInterfaceL2TablesReply) Reset() { *m = ClassifySetInterfaceL2TablesReply{} }
func (*ClassifySetInterfaceL2TablesReply) GetMessageName() string {
return "classify_set_interface_l2_tables_reply"
}
func (*ClassifySetInterfaceL2TablesReply) GetCrcString() string { return "e8d4e804" }
func (*ClassifySetInterfaceL2TablesReply) GetMessageType() api.MessageType {
return api.ReplyMessage
}
func (m *ClassifySetInterfaceL2TablesReply) Size() (size int) {
if m == nil {
return 0
}
size += 4 // m.Retval
return size
}
func (m *ClassifySetInterfaceL2TablesReply) 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 *ClassifySetInterfaceL2TablesReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.Retval = buf.DecodeInt32()
return nil
}
// ClassifyTableByInterface defines message 'classify_table_by_interface'.
type ClassifyTableByInterface struct {
SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
}
func (m *ClassifyTableByInterface) Reset() { *m = ClassifyTableByInterface{} }
func (*ClassifyTableByInterface) GetMessageName() string { return "classify_table_by_interface" }
func (*ClassifyTableByInterface) GetCrcString() string { return "f9e6675e" }
func (*ClassifyTableByInterface) GetMessageType() api.MessageType {
return api.RequestMessage
}
func (m *ClassifyTableByInterface) Size() (size int) {
if m == nil {
return 0
}
size += 4 // m.SwIfIndex
return size
}
func (m *ClassifyTableByInterface) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeUint32(uint32(m.SwIfIndex))
return buf.Bytes(), nil
}
func (m *ClassifyTableByInterface) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
return nil
}
// ClassifyTableByInterfaceReply defines message 'classify_table_by_interface_reply'.
type ClassifyTableByInterfaceReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
L2TableID uint32 `binapi:"u32,name=l2_table_id" json:"l2_table_id,omitempty"`
IP4TableID uint32 `binapi:"u32,name=ip4_table_id" json:"ip4_table_id,omitempty"`
IP6TableID uint32 `binapi:"u32,name=ip6_table_id" json:"ip6_table_id,omitempty"`
}
func (m *ClassifyTableByInterfaceReply) Reset() { *m = ClassifyTableByInterfaceReply{} }
func (*ClassifyTableByInterfaceReply) GetMessageName() string {
return "classify_table_by_interface_reply"
}
func (*ClassifyTableByInterfaceReply) GetCrcString() string { return "ed4197db" }
func (*ClassifyTableByInterfaceReply) GetMessageType() api.MessageType {
return api.ReplyMessage
}
func (m *ClassifyTableByInterfaceReply) Size() (size int) {
if m == nil {
return 0
}
size += 4 // m.Retval
size += 4 // m.SwIfIndex
size += 4 // m.L2TableID
size += 4 // m.IP4TableID
size += 4 // m.IP6TableID
return size
}
func (m *ClassifyTableByInterfaceReply) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeInt32(m.Retval)
buf.EncodeUint32(uint32(m.SwIfIndex))
buf.EncodeUint32(m.L2TableID)
buf.EncodeUint32(m.IP4TableID)
buf.EncodeUint32(m.IP6TableID)
return buf.Bytes(), nil
}
func (m *ClassifyTableByInterfaceReply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
m.Retval = buf.DecodeInt32()
m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
m.L2TableID = buf.DecodeUint32()
m.IP4TableID = buf.DecodeUint32()
m.IP6TableID = buf.DecodeUint32()
return nil
}
// ClassifyTableIds defines message 'classify_table_ids'.
type ClassifyTableIds struct{}
func (m *ClassifyTableIds) Reset() { *m = ClassifyTableIds{} }
func (*ClassifyTableIds) GetMessageName() string { return "classify_table_ids" }
func (*ClassifyTableIds) GetCrcString() string { return "51077d14" }
func (*ClassifyTableIds) GetMessageType() api.MessageType {
return api.RequestMessage
}
func (m *ClassifyTableIds) Size() (size int) {
if m == nil {
return 0
}
return size
}
func (m *ClassifyTableIds) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
return buf.Bytes(), nil
}
func (m *ClassifyTableIds) Unmarshal(b []byte) error {
return nil
}
// ClassifyTableIdsReply defines message 'classify_table_ids_reply'.
type ClassifyTableIdsReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
Count uint32 `binapi:"u32,name=count" json:"-"`
Ids []uint32 `binapi:"u32[count],name=ids" json:"ids,omitempty"`
}
func (m *ClassifyTableIdsReply) Reset() { *m = ClassifyTableIdsReply{} }
func (*ClassifyTableIdsReply) GetMessageName() string { return "classify_table_ids_reply" }
func (*ClassifyTableIdsReply) GetCrcString() string { return "d1d20e1d" }
func (*ClassifyTableIdsReply) GetMessageType() api.MessageType {
return api.ReplyMessage
}
func (m *ClassifyTableIdsReply) Size() (size int) {
if m == nil {
return 0
}
size += 4 // m.Retval
size += 4 // m.Count
size += 4 * len(m.Ids) // m.Ids
return size
}
func (m *ClassifyTableIdsReply) Marshal(b []byte) ([]byte, error) {
if b == nil {
b = make([]byte, m.Size())
}
buf := codec.NewBuffer(b)
buf.EncodeInt32(m.Retval)
buf.EncodeUint32(uint32(len(m.Ids)))
for i := 0; i < len(m.Ids); i++ {
var x uint32
if i < len(m.Ids) {
x = uint32(m.Ids[i])
}
buf.EncodeUint32(x)
}