-
Notifications
You must be signed in to change notification settings - Fork 494
/
Copy pathsaiacl.h
3879 lines (3411 loc) · 108 KB
/
saiacl.h
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
/**
* Copyright (c) 2014 Microsoft Open Technologies, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT
* LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS
* FOR A PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
*
* See the Apache Version 2.0 License for specific language governing
* permissions and limitations under the License.
*
* Microsoft would like to thank the following companies for their review and
* assistance with these files: Intel Corporation, Mellanox Technologies Ltd,
* Dell Products, L.P., Facebook, Inc., Marvell International Ltd.
*
* @file saiacl.h
*
* @brief This module defines SAI ACL interface
*/
#if !defined (__SAIACL_H_)
#define __SAIACL_H_
#include <saitypes.h>
/**
* @defgroup SAIACL SAI - ACL specific API definitions
*
* @{
*/
/**
* @brief ACL IP Type
*/
typedef enum _sai_acl_ip_type_t
{
/** Don't care */
SAI_ACL_IP_TYPE_ANY,
/** IPv4 and IPv6 packets */
SAI_ACL_IP_TYPE_IP,
/** Non-IP packet */
SAI_ACL_IP_TYPE_NON_IP,
/** Any IPv4 packet */
SAI_ACL_IP_TYPE_IPV4ANY,
/** Anything but IPv4 packets */
SAI_ACL_IP_TYPE_NON_IPV4,
/** IPv6 packet */
SAI_ACL_IP_TYPE_IPV6ANY,
/** Anything but IPv6 packets */
SAI_ACL_IP_TYPE_NON_IPV6,
/** ARP/RARP */
SAI_ACL_IP_TYPE_ARP,
/** ARP Request */
SAI_ACL_IP_TYPE_ARP_REQUEST,
/** ARP Reply */
SAI_ACL_IP_TYPE_ARP_REPLY
} sai_acl_ip_type_t;
/**
* @brief ACL IP Fragment
*/
typedef enum _sai_acl_ip_frag_t
{
/** Any Fragment of Fragmented Packet */
SAI_ACL_IP_FRAG_ANY,
/** Non-Fragmented Packet */
SAI_ACL_IP_FRAG_NON_FRAG,
/** Non-Fragmented or First Fragment */
SAI_ACL_IP_FRAG_NON_FRAG_OR_HEAD,
/** First Fragment of Fragmented Packet */
SAI_ACL_IP_FRAG_HEAD,
/** Not the First Fragment */
SAI_ACL_IP_FRAG_NON_HEAD
} sai_acl_ip_frag_t;
/**
* @brief DTEL flow operation
*
* @warning experimental
*/
typedef enum _sai_acl_dtel_flow_op_t
{
/** No operation (experimental) */
SAI_ACL_DTEL_FLOW_OP_NOP,
/** In-band Network Telemetry (experimental) */
SAI_ACL_DTEL_FLOW_OP_INT,
/** In-band OAM (experimental) */
SAI_ACL_DTEL_FLOW_OP_IOAM,
/** Packet Postcard (experimental) */
SAI_ACL_DTEL_FLOW_OP_POSTCARD,
} sai_acl_dtel_flow_op_t;
/**
* @brief ACL Action Type
*/
typedef enum _sai_acl_action_type_t
{
/** Set Redirect */
SAI_ACL_ACTION_TYPE_REDIRECT = 0x00000000,
/** Set tunnel endpoint IP */
SAI_ACL_ACTION_TYPE_ENDPOINT_IP = 0x00000001,
/** Redirect Packet to a list of destination which can be a port list */
SAI_ACL_ACTION_TYPE_REDIRECT_LIST = 0x00000002,
/** Packet Action */
SAI_ACL_ACTION_TYPE_PACKET_ACTION = 0x00000003,
/** Flood Packet on Vlan domain */
SAI_ACL_ACTION_TYPE_FLOOD = 0x00000004,
/** Attach/detach counter id to the entry */
SAI_ACL_ACTION_TYPE_COUNTER = 0x00000005,
/** Ingress Mirror */
SAI_ACL_ACTION_TYPE_MIRROR_INGRESS = 0x00000006,
/** Egress Mirror */
SAI_ACL_ACTION_TYPE_MIRROR_EGRESS = 0x00000007,
/** Associate with policer */
SAI_ACL_ACTION_TYPE_SET_POLICER = 0x00000008,
/** Decrement TTL */
SAI_ACL_ACTION_TYPE_DECREMENT_TTL = 0x00000009,
/** Set Class-of-Service */
SAI_ACL_ACTION_TYPE_SET_TC = 0x0000000a,
/** Set Packet Color */
SAI_ACL_ACTION_TYPE_SET_PACKET_COLOR = 0x0000000b,
/** Set Packet Inner Vlan Id */
SAI_ACL_ACTION_TYPE_SET_INNER_VLAN_ID = 0x0000000c,
/** Set Packet Inner Vlan Priority */
SAI_ACL_ACTION_TYPE_SET_INNER_VLAN_PRI = 0x0000000d,
/** Set Packet Outer Vlan Id */
SAI_ACL_ACTION_TYPE_SET_OUTER_VLAN_ID = 0x0000000e,
/** Set Packet Outer Vlan Priority */
SAI_ACL_ACTION_TYPE_SET_OUTER_VLAN_PRI = 0x0000000f,
/** Add Packet Vlan Id */
SAI_ACL_ACTION_TYPE_ADD_VLAN_ID = 0x00000032,
/** Add Packet Vlan Priority */
SAI_ACL_ACTION_TYPE_ADD_VLAN_PRI = 0x00000033,
/** Set Packet Src MAC Address */
SAI_ACL_ACTION_TYPE_SET_SRC_MAC = 0x00000010,
/** Set Packet Dst MAC Address */
SAI_ACL_ACTION_TYPE_SET_DST_MAC = 0x00000011,
/** Set Packet Src IPv4 Address */
SAI_ACL_ACTION_TYPE_SET_SRC_IP = 0x00000012,
/** Set Packet Src IPv4 Address */
SAI_ACL_ACTION_TYPE_SET_DST_IP = 0x00000013,
/** Set Packet Src IPv6 Address */
SAI_ACL_ACTION_TYPE_SET_SRC_IPV6 = 0x00000014,
/** Set Packet Src IPv6 Address */
SAI_ACL_ACTION_TYPE_SET_DST_IPV6 = 0x00000015,
/** Set Packet DSCP */
SAI_ACL_ACTION_TYPE_SET_DSCP = 0x00000016,
/** Set Packet ECN */
SAI_ACL_ACTION_TYPE_SET_ECN = 0x00000017,
/** Set Packet L4 Src Port */
SAI_ACL_ACTION_TYPE_SET_L4_SRC_PORT = 0x00000018,
/** Set Packet L4 Src Port */
SAI_ACL_ACTION_TYPE_SET_L4_DST_PORT = 0x00000019,
/** Set ingress packet sampling */
SAI_ACL_ACTION_TYPE_INGRESS_SAMPLEPACKET_ENABLE = 0x0000001a,
/** Set egress packet sampling */
SAI_ACL_ACTION_TYPE_EGRESS_SAMPLEPACKET_ENABLE = 0x0000001b,
/** Set metadata to carry forward to next ACL stage */
SAI_ACL_ACTION_TYPE_SET_ACL_META_DATA = 0x0000001c,
/** Egress block port list. To be deprecated */
SAI_ACL_ACTION_TYPE_EGRESS_BLOCK_PORT_LIST = 0x0000001d,
/** Set user defined trap id */
SAI_ACL_ACTION_TYPE_SET_USER_TRAP_ID = 0x0000001e,
/** Set Do Not Learn unknown source MAC */
SAI_ACL_ACTION_TYPE_SET_DO_NOT_LEARN = 0x0000001f,
/** Set DTEL flow operation (experimental) */
SAI_ACL_ACTION_TYPE_ACL_DTEL_FLOW_OP = 0x00000020,
/** Set DTEL INT session (experimental) */
SAI_ACL_ACTION_TYPE_DTEL_INT_SESSION = 0x00000021,
/** Enable DTEL drop report (experimental) */
SAI_ACL_ACTION_TYPE_DTEL_DROP_REPORT_ENABLE = 0x00000022,
/** Enable DTEL tail drop reporting (experimental) */
SAI_ACL_ACTION_TYPE_DTEL_TAIL_DROP_REPORT_ENABLE = 0x00000023,
/** Set DTEL flow sampling (experimental) */
SAI_ACL_ACTION_TYPE_DTEL_FLOW_SAMPLE_PERCENT = 0x00000024,
/** Enable DTEL report for all packets without filtering (experimental) */
SAI_ACL_ACTION_TYPE_DTEL_REPORT_ALL_PACKETS = 0x00000025,
/** Set NAT exception rule */
SAI_ACL_ACTION_TYPE_NO_NAT = 0x00000026,
/** Enable insertion of INT metadata */
SAI_ACL_ACTION_TYPE_INT_INSERT = 0x00000027,
/** Enable deletion of INT metadata */
SAI_ACL_ACTION_TYPE_INT_DELETE = 0x00000028,
/** Enable reports of INT metadata */
SAI_ACL_ACTION_TYPE_INT_REPORT_FLOW = 0x00000029,
/** Enable INT drop reports */
SAI_ACL_ACTION_TYPE_INT_REPORT_DROPS = 0x0000002a,
/** Enable INT tail drop reports */
SAI_ACL_ACTION_TYPE_INT_REPORT_TAIL_DROPS = 0x0000002b,
/** Bind a TAM INT object */
SAI_ACL_ACTION_TYPE_TAM_INT_OBJECT = 0x0000002c,
/** Set isolation group to prevent traffic to members of isolation group */
SAI_ACL_ACTION_TYPE_SET_ISOLATION_GROUP = 0x0000002d,
/** Bind a MACsec flow object */
SAI_ACL_ACTION_TYPE_MACSEC_FLOW = 0x0000002e,
/** Set custom LAG hash object ID */
SAI_ACL_ACTION_TYPE_SET_LAG_HASH_ID = 0x0000002f,
/** Set custom ECMP hash object ID */
SAI_ACL_ACTION_TYPE_SET_ECMP_HASH_ID = 0x00000030,
/** Associate with virtual router */
SAI_ACL_ACTION_TYPE_SET_VRF = 0x00000031,
/** Set Forwarding class */
SAI_ACL_ACTION_TYPE_SET_FORWARDING_CLASS = 0x00000034,
/** Set ARS monitoring */
SAI_ACL_ACTION_TYPE_SET_ARS_MONITORING = 0x00000035,
/** Set ARS object */
SAI_ACL_ACTION_TYPE_SET_ARS_OBJECT = 0x00000036,
/** Disable ARS forwarding */
SAI_ACL_ACTION_TYPE_DISABLE_ARS_FORWARDING = 0x00000037,
/** Next Chain Group */
SAI_ACL_ACTION_TYPE_CHAIN_REDIRECT = 0x00000038,
/** Disable packet trim */
SAI_ACL_ACTION_TYPE_PACKET_TRIM_DISABLE = 0x00000039,
} sai_acl_action_type_t;
/**
* @brief Attribute data for SAI_ACL_TABLE_CHAIN_GROUP_ATTR_TYPE
*/
typedef enum _sai_acl_table_chain_group_type_t
{
/** SEQUENTIAL */
SAI_ACL_TABLE_CHAIN_GROUP_TYPE_SEQUENTIAL,
/** PARALLEL */
SAI_ACL_TABLE_CHAIN_GROUP_TYPE_PARALLEL,
} sai_acl_table_chain_group_type_t;
/**
* @brief Attribute data for SAI_ACL_TABLE_GROUP_ATTR_TYPE
*/
typedef enum _sai_acl_table_group_type_t
{
/** SEQUENTIAL */
SAI_ACL_TABLE_GROUP_TYPE_SEQUENTIAL,
/** PARALLEL */
SAI_ACL_TABLE_GROUP_TYPE_PARALLEL,
} sai_acl_table_group_type_t;
/**
* @brief Attribute Id for acl_table_group
*/
typedef enum _sai_acl_table_group_attr_t
{
/**
* @brief Start of attributes
*/
SAI_ACL_TABLE_GROUP_ATTR_START,
/**
* @brief ACL stage
*
* @type sai_acl_stage_t
* @flags MANDATORY_ON_CREATE | CREATE_ONLY
*/
SAI_ACL_TABLE_GROUP_ATTR_ACL_STAGE = SAI_ACL_TABLE_GROUP_ATTR_START,
/**
* @brief List of ACL bind points where this group will be applied.
*
* ACL group bind point list - create only attribute required for ACL
* groups to let the user specify his intention to allow further error
* checks and optimizations based on a specific ASIC SAI implementation.
* ACL members being added to this group SHOULD be a subset of the bind
* point list that ACL group was created with.
*
* @type sai_s32_list_t sai_acl_bind_point_type_t
* @flags CREATE_ONLY
* @default empty
*/
SAI_ACL_TABLE_GROUP_ATTR_ACL_BIND_POINT_TYPE_LIST,
/**
* @brief ACL table group type
*
* ACL table group type represents the way various ACL tables within this
* ACL table group perform their lookups. There are two optional values:
* Sequential - All the ACL tables are looked up in a sequential order,
* which is based on the ACL table priorities and only one ACL entry is matched
* with its corresponding ACL entry action applied. In case two ACL tables
* have the same priority they are looked up on a first come basis.
* Parallel - All the ACL tables within the ACL table groups are looked up
* in parallel and non-conflicting actions are resolved and applied from
* multiple matched ACL entries (each from different ACL tables of this group).
* Conflicting actions are resolved based on the ACL table priorities.
*
* @type sai_acl_table_group_type_t
* @flags CREATE_ONLY
* @default SAI_ACL_TABLE_GROUP_TYPE_SEQUENTIAL
*/
SAI_ACL_TABLE_GROUP_ATTR_TYPE,
/**
* @brief ACL table group members associated with this group.
*
* @type sai_object_list_t
* @flags READ_ONLY
* @objects SAI_OBJECT_TYPE_ACL_TABLE_GROUP_MEMBER
*/
SAI_ACL_TABLE_GROUP_ATTR_MEMBER_LIST,
/**
* @brief ACL table sub groups associated with this group.
*
* @type sai_object_list_t
* @flags READ_ONLY
* @objects SAI_OBJECT_TYPE_ACL_TABLE_CHAIN_GROUP
*/
SAI_ACL_TABLE_GROUP_ATTR_CHAIN_GROUP_LIST,
/**
* @brief End of attributes
*/
SAI_ACL_TABLE_GROUP_ATTR_END,
/**
* @brief Custom range base value start
*/
SAI_ACL_TABLE_GROUP_ATTR_CUSTOM_RANGE_START = 0x10000000,
/**
* @brief End of Custom range base
*/
SAI_ACL_TABLE_GROUP_ATTR_CUSTOM_RANGE_END
} sai_acl_table_group_attr_t;
/**
* @brief Attribute Id for acl_table_chain_group
*/
typedef enum _sai_acl_table_chain_group_attr_t
{
/**
* @brief Start of attributes
*/
SAI_ACL_TABLE_CHAIN_GROUP_ATTR_START,
/**
* @brief ACL table sub group type
*
* ACL table group type represents the way various ACL tables within this
* ACL table group perform their lookups. There are two optional values:
* Sequential - All the ACL tables are looked up in a sequential order,
* which is based on the ACL table priorities and only one ACL entry is matched
* with its corresponding ACL entry action applied. In case two ACL tables
* have the same priority they are looked up on a first come basis.
* Parallel - All the ACL tables within the ACL table groups are looked up
* in parallel and non-conflicting actions are resolved and applied from
* multiple matched ACL entries (each from different ACL tables of this group).
* Conflicting actions are resolved based on the ACL table priorities.
*
* @type sai_acl_table_chain_group_type_t
* @flags CREATE_ONLY
* @default SAI_ACL_TABLE_CHAIN_GROUP_TYPE_SEQUENTIAL
*/
SAI_ACL_TABLE_CHAIN_GROUP_ATTR_TYPE = SAI_ACL_TABLE_CHAIN_GROUP_ATTR_START,
/**
* @brief ACL table sub group stage
*
* ACL table sub group stage represents the cascading stage in the pipeline.
* Lower numbered stage comes before the higher numbered stage.
*
* @type sai_acl_table_chain_group_stage_t
* @flags CREATE_ONLY
* @default SAI_ACL_TABLE_CHAIN_GROUP_STAGE_0
*/
SAI_ACL_TABLE_CHAIN_GROUP_ATTR_STAGE,
/**
* @brief End of attributes
*/
SAI_ACL_TABLE_CHAIN_GROUP_ATTR_END,
/**
* @brief Custom range base value start
*/
SAI_ACL_TABLE_CHAIN_GROUP_ATTR_CUSTOM_RANGE_START = 0x10000000,
/**
* @brief End of Custom range base
*/
SAI_ACL_TABLE_CHAIN_GROUP_ATTR_CUSTOM_RANGE_END
} sai_acl_table_chain_group_attr_t;
/**
* @brief Attribute Id for acl_table_group_member
*/
typedef enum _sai_acl_table_group_member_attr_t
{
/**
* @brief Start of attributes
*/
SAI_ACL_TABLE_GROUP_MEMBER_ATTR_START,
/**
* @brief ACL table group id
*
* This attribute is required to associate or attach a member object (acl_table_id)
* to a ACL table group id allocated during create ACL group API.
*
* User should always use the group id returned by SAI create_acl_group API,
* to group the tables else Invalid attribute value error code will be returned.
*
* The ACL Table lookup could be done serially or in parallel. In both the
* cases there could be a need to group multiple tables so that only single
* ACL rule entry actions are performed in case of serial, or non-conflicting
* actions are resolved in case of parallel.
*
* @type sai_object_id_t
* @flags MANDATORY_ON_CREATE | CREATE_ONLY
* @objects SAI_OBJECT_TYPE_ACL_TABLE_GROUP
*/
SAI_ACL_TABLE_GROUP_MEMBER_ATTR_ACL_TABLE_GROUP_ID = SAI_ACL_TABLE_GROUP_MEMBER_ATTR_START,
/**
* @brief ACL table id
*
* @type sai_object_id_t
* @flags MANDATORY_ON_CREATE | CREATE_ONLY
* @objects SAI_OBJECT_TYPE_ACL_TABLE
*/
SAI_ACL_TABLE_GROUP_MEMBER_ATTR_ACL_TABLE_ID,
/**
* @brief Priority
*
* Value must be in the range defined in
* [SAI_SWITCH_ATTR_ACL_TABLE_MINIMUM_PRIORITY,
* SAI_SWITCH_ATTR_ACL_TABLE_MAXIMUM_PRIORITY]
*
* This priority attribute is valid for both SEQUENTIAL and PARALLEL type of ACL groups
*
* @type sai_uint32_t
* @flags MANDATORY_ON_CREATE | CREATE_ONLY
*/
SAI_ACL_TABLE_GROUP_MEMBER_ATTR_PRIORITY,
/**
* @brief ACL table chain group id
*
* This attribute is required to associate or attach a member object (acl_table_id)
* to a ACL table chain group id allocated during create ACL table chain group API.
*
* The ACL Table lookup could be done serially or in parallel within the chain group.
*
* @type sai_object_id_t
* @flags CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_ACL_TABLE_CHAIN_GROUP
* @allownull true
* @default SAI_NULL_OBJECT_ID
*/
SAI_ACL_TABLE_GROUP_MEMBER_ATTR_ACL_TABLE_CHAIN_GROUP_ID,
/**
* @brief End of attributes
*/
SAI_ACL_TABLE_GROUP_MEMBER_ATTR_END,
/**
* @brief Custom range base value start
*/
SAI_ACL_TABLE_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START = 0x10000000,
/**
* @brief End of Custom range base
*/
SAI_ACL_TABLE_GROUP_MEMBER_ATTR_CUSTOM_RANGE_END
} sai_acl_table_group_member_attr_t;
/**
* @brief ACL User Defined Field Attribute ID Range
*/
#define SAI_ACL_USER_DEFINED_FIELD_ATTR_ID_RANGE 0xFF
/**
* @brief Attribute Id for sai_acl_table
*
* @flags ranges
*/
typedef enum _sai_acl_table_attr_t
{
/**
* @brief Table attributes start
*/
SAI_ACL_TABLE_ATTR_START,
/**
* @brief ACL stage
*
* @type sai_acl_stage_t
* @flags MANDATORY_ON_CREATE | CREATE_ONLY
*/
SAI_ACL_TABLE_ATTR_ACL_STAGE = SAI_ACL_TABLE_ATTR_START,
/**
* @brief List of ACL bind point where this ACL can be applied
*
* (Default = empty) - if the bind point is empty during create or
* ACL Table that is previously bound is unbound, then it is expected that
* there is no real hardware resource that is being utilized. In this case,
* application is not expected to query for SAI_ACL_TABLE_ATTR_AVAILABLE_ACL_ENTRY
* or SAI_ACL_TABLE_ATTR_AVAILABLE_ACL_COUNTER. If it is queried, the result is
* undefined
*
* @type sai_s32_list_t sai_acl_bind_point_type_t
* @flags CREATE_ONLY
* @default empty
*/
SAI_ACL_TABLE_ATTR_ACL_BIND_POINT_TYPE_LIST,
/**
* @brief Table size
*
* (Default = 0) - Grow dynamically till MAX ACL TCAM Size
* By default, table can grow up to maximum ACL TCAM space.
* Supported only during Table Create for now until NPU
* supports Dynamic adjustment of Table size post Table creation
*
* The table size refers to the number of ACL entries. The number
* of entries that gets allocated when we create a table with a
* specific size would depend on the ACL CAM Arch of the NPU. Some
* NPU supports different blocks, each may have same or different
* size and what gets allocated can depend on the block size or other
* factors. So internally what gets allocated when we do a table
* create would be based on the NPU CAM Arch and size may be more
* than what is requested. As an example the NPU may support blocks of
* 128 entries. When a user creates a table of size 100, the actual
* size that gets allocated is 128. Hence, it's recommended that the user
* does a get_attribute(#SAI_ACL_TABLE_ATTR_SIZE) to query the actual
* table size on table create so the user knows the ACL CAM space
* allocated and able to do ACL CAM Carving accurately.
*
* @type sai_uint32_t
* @flags CREATE_ONLY
* @default 0
* @isresourcetype true
*/
SAI_ACL_TABLE_ATTR_SIZE,
/**
* @brief List of actions in sai_acl_action_type_t
*
* Based on the ACL capability per stage obtained from the switch
* attributes #SAI_SWITCH_ATTR_ACL_STAGE_INGRESS and #SAI_SWITCH_ATTR_ACL_STAGE_EGRESS
* application should pass the action list if its mandatory per stage.
* Pass the action list if its mandatory per stage.
* If its not mandatory application can either pass the action list
* or ignore it.
*
* @type sai_s32_list_t sai_acl_action_type_t
* @flags CREATE_ONLY
* @default empty
*/
SAI_ACL_TABLE_ATTR_ACL_ACTION_TYPE_LIST,
/*
* Match fields [bool]
* Mandatory to pass at least one field during ACL Table creation.
* Match fields cannot be changed after the table is created.
*/
/**
* @brief Start of Table Match Field
*/
SAI_ACL_TABLE_ATTR_FIELD_START = 0x00001000,
/**
* @brief Src IPv6 Address
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_SRC_IPV6 = SAI_ACL_TABLE_ATTR_FIELD_START,
/**
* @brief Src IPv6 Address 127:96 32 bits
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_SRC_IPV6_WORD3 = SAI_ACL_TABLE_ATTR_FIELD_START + 0x153,
/**
* @brief Src IPv6 Address 95:64 32 bits
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_SRC_IPV6_WORD2 = SAI_ACL_TABLE_ATTR_FIELD_START + 0x154,
/**
* @brief Src IPv6 Address 63:32 32 bits
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_SRC_IPV6_WORD1 = SAI_ACL_TABLE_ATTR_FIELD_START + 0x155,
/**
* @brief Src IPv6 Address 31:0 32 bits
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_SRC_IPV6_WORD0 = SAI_ACL_TABLE_ATTR_FIELD_START + 0x156,
/**
* @brief Dst IPv6 Address
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_DST_IPV6 = SAI_ACL_TABLE_ATTR_FIELD_START + 0x1,
/**
* @brief Dst IPv6 Address 127:96 32 bits
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_DST_IPV6_WORD3 = SAI_ACL_TABLE_ATTR_FIELD_START + 0x157,
/**
* @brief Dst IPv6 Address 95:64 32 bits
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_DST_IPV6_WORD2 = SAI_ACL_TABLE_ATTR_FIELD_START + 0x158,
/**
* @brief Dst IPv6 Address 63:32 32 bits
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_DST_IPV6_WORD1 = SAI_ACL_TABLE_ATTR_FIELD_START + 0x159,
/**
* @brief Dst IPv6 Address 31:0 32 bits
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_DST_IPV6_WORD0 = SAI_ACL_TABLE_ATTR_FIELD_START + 0x15a,
/**
* @brief Inner Src IPv6 Address
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_INNER_SRC_IPV6 = SAI_ACL_TABLE_ATTR_FIELD_START + 0x2,
/**
* @brief Inner Dst IPv6 Address
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_INNER_DST_IPV6 = SAI_ACL_TABLE_ATTR_FIELD_START + 0x3,
/**
* @brief Src MAC Address
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_SRC_MAC = SAI_ACL_TABLE_ATTR_FIELD_START + 0x4,
/**
* @brief Dst MAC Address
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_DST_MAC = SAI_ACL_TABLE_ATTR_FIELD_START + 0x5,
/**
* @brief Src IPv4 Address
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_SRC_IP = SAI_ACL_TABLE_ATTR_FIELD_START + 0x6,
/**
* @brief Dst IPv4 Address
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_DST_IP = SAI_ACL_TABLE_ATTR_FIELD_START + 0x7,
/**
* @brief Inner Src IPv4 Address
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_INNER_SRC_IP = SAI_ACL_TABLE_ATTR_FIELD_START + 0x8,
/**
* @brief Inner Dst IPv4 Address
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_INNER_DST_IP = SAI_ACL_TABLE_ATTR_FIELD_START + 0x9,
/**
* @brief In-Ports
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_IN_PORTS = SAI_ACL_TABLE_ATTR_FIELD_START + 0xa,
/**
* @brief Out-Ports
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_OUT_PORTS = SAI_ACL_TABLE_ATTR_FIELD_START + 0xb,
/**
* @brief In-Port
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_IN_PORT = SAI_ACL_TABLE_ATTR_FIELD_START + 0xc,
/**
* @brief Out-Port
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_OUT_PORT = SAI_ACL_TABLE_ATTR_FIELD_START + 0xd,
/**
* @brief Source Port
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_SRC_PORT = SAI_ACL_TABLE_ATTR_FIELD_START + 0xe,
/**
* @brief Outer Vlan Id
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_OUTER_VLAN_ID = SAI_ACL_TABLE_ATTR_FIELD_START + 0xf,
/**
* @brief Outer Vlan Priority
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_OUTER_VLAN_PRI = SAI_ACL_TABLE_ATTR_FIELD_START + 0x10,
/**
* @brief Outer Vlan CFI
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_OUTER_VLAN_CFI = SAI_ACL_TABLE_ATTR_FIELD_START + 0x11,
/**
* @brief Inner Vlan Id
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_INNER_VLAN_ID = SAI_ACL_TABLE_ATTR_FIELD_START + 0x12,
/**
* @brief Inner Vlan Priority
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_INNER_VLAN_PRI = SAI_ACL_TABLE_ATTR_FIELD_START + 0x13,
/**
* @brief Inner Vlan CFI
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_INNER_VLAN_CFI = SAI_ACL_TABLE_ATTR_FIELD_START + 0x14,
/**
* @brief L4 Src Port
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_L4_SRC_PORT = SAI_ACL_TABLE_ATTR_FIELD_START + 0x15,
/**
* @brief L4 Dst Port
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_L4_DST_PORT = SAI_ACL_TABLE_ATTR_FIELD_START + 0x16,
/**
* @brief Inner L4 Src Port
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_INNER_L4_SRC_PORT = SAI_ACL_TABLE_ATTR_FIELD_START + 0x17,
/**
* @brief Inner L4 Dst Port
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_INNER_L4_DST_PORT = SAI_ACL_TABLE_ATTR_FIELD_START + 0x18,
/**
* @brief EtherType
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_ETHER_TYPE = SAI_ACL_TABLE_ATTR_FIELD_START + 0x19,
/**
* @brief Inner EtherType
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_INNER_ETHER_TYPE = SAI_ACL_TABLE_ATTR_FIELD_START + 0x1a,
/**
* @brief IP Protocol
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_IP_PROTOCOL = SAI_ACL_TABLE_ATTR_FIELD_START + 0x1b,
/**
* @brief Inner IP Protocol
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_INNER_IP_PROTOCOL = SAI_ACL_TABLE_ATTR_FIELD_START + 0x1c,
/**
* @brief IP Identification
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_IP_IDENTIFICATION = SAI_ACL_TABLE_ATTR_FIELD_START + 0x1d,
/**
* @brief IP DSCP
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_DSCP = SAI_ACL_TABLE_ATTR_FIELD_START + 0x1e,