@@ -46,6 +46,10 @@ acl_rule_attr_lookup_t aclMatchLookup =
46
46
{ MATCH_IP_TYPE, SAI_ACL_ENTRY_ATTR_FIELD_ACL_IP_TYPE },
47
47
{ MATCH_DSCP, SAI_ACL_ENTRY_ATTR_FIELD_DSCP },
48
48
{ MATCH_TC, SAI_ACL_ENTRY_ATTR_FIELD_TC },
49
+ { MATCH_ICMP_TYPE, SAI_ACL_ENTRY_ATTR_FIELD_ICMP_TYPE },
50
+ { MATCH_ICMP_CODE, SAI_ACL_ENTRY_ATTR_FIELD_ICMP_CODE },
51
+ { MATCH_ICMPV6_TYPE, SAI_ACL_ENTRY_ATTR_FIELD_ICMPV6_TYPE },
52
+ { MATCH_ICMPV6_CODE, SAI_ACL_ENTRY_ATTR_FIELD_ICMPV6_CODE },
49
53
{ MATCH_L4_SRC_PORT_RANGE, (sai_acl_entry_attr_t )SAI_ACL_RANGE_TYPE_L4_SRC_PORT_RANGE },
50
54
{ MATCH_L4_DST_PORT_RANGE, (sai_acl_entry_attr_t )SAI_ACL_RANGE_TYPE_L4_DST_PORT_RANGE },
51
55
{ MATCH_TUNNEL_VNI, SAI_ACL_ENTRY_ATTR_FIELD_TUNNEL_VNI },
@@ -334,6 +338,12 @@ bool AclRule::validateAddMatch(string attr_name, string attr_value)
334
338
value.aclfield .data .u8 = to_uint<uint8_t >(attr_value);
335
339
value.aclfield .mask .u8 = 0xFF ;
336
340
}
341
+ else if (attr_name == MATCH_ICMP_TYPE || attr_name == MATCH_ICMP_CODE ||
342
+ attr_name == MATCH_ICMPV6_TYPE || attr_name == MATCH_ICMPV6_CODE)
343
+ {
344
+ value.aclfield .data .u8 = to_uint<uint8_t >(attr_value);
345
+ value.aclfield .mask .u8 = 0xFF ;
346
+ }
337
347
else if (attr_name == MATCH_TUNNEL_VNI)
338
348
{
339
349
value.aclfield .data .u32 = to_uint<uint32_t >(attr_value);
@@ -850,12 +860,19 @@ bool AclRuleL3::validateAddMatch(string attr_name, string attr_value)
850
860
{
851
861
if (attr_name == MATCH_DSCP)
852
862
{
853
- SWSS_LOG_ERROR (" DSCP match is not supported for the tables of type L3" );
863
+ SWSS_LOG_ERROR (" DSCP match is not supported for table type L3" );
854
864
return false ;
855
865
}
866
+
856
867
if (attr_name == MATCH_SRC_IPV6 || attr_name == MATCH_DST_IPV6)
857
868
{
858
- SWSS_LOG_ERROR (" IPv6 address match is not supported for the tables of type L3" );
869
+ SWSS_LOG_ERROR (" IPv6 address match is not supported for table type L3" );
870
+ return false ;
871
+ }
872
+
873
+ if (attr_name == MATCH_ICMPV6_TYPE || attr_name == MATCH_ICMPV6_CODE)
874
+ {
875
+ SWSS_LOG_ERROR (" ICMPv6 match is not supported for table type L3" );
859
876
return false ;
860
877
}
861
878
@@ -906,12 +923,19 @@ bool AclRuleL3V6::validateAddMatch(string attr_name, string attr_value)
906
923
{
907
924
if (attr_name == MATCH_DSCP)
908
925
{
909
- SWSS_LOG_ERROR (" DSCP match is not supported for the tables of type L3V6" );
926
+ SWSS_LOG_ERROR (" DSCP match is not supported for table type L3V6" );
910
927
return false ;
911
928
}
929
+
912
930
if (attr_name == MATCH_SRC_IP || attr_name == MATCH_DST_IP)
913
931
{
914
- SWSS_LOG_ERROR (" IPv4 address match is not supported for the tables of type L3V6" );
932
+ SWSS_LOG_ERROR (" IPv4 address match is not supported for table type L3V6" );
933
+ return false ;
934
+ }
935
+
936
+ if (attr_name == MATCH_ICMP_TYPE || attr_name == MATCH_ICMP_CODE)
937
+ {
938
+ SWSS_LOG_ERROR (" ICMPv4 match is not supported for table type L3V6" );
915
939
return false ;
916
940
}
917
941
@@ -956,31 +980,40 @@ bool AclRuleMirror::validateAddMatch(string attr_name, string attr_value)
956
980
957
981
/*
958
982
* Type of Tables and Supported Match Types (Configuration)
959
- * |--------------------------------------------------|
960
- * | Match Type | TABLE_MIRROR | TABLE_MIRRORV6 |
961
- * |--------------------------------------------------|
962
- * | MATCH_SRC_IP | √ | |
963
- * | MATCH_DST_IP | √ | |
964
- * |--------------------------------------------------|
965
- * | MATCH_SRC_IPV6 | | √ |
966
- * | MATCH_DST_IPV6 | | √ |
967
- * |--------------------------------------------------|
968
- * | MARTCH_ETHERTYPE | √ | |
969
- * |--------------------------------------------------|
983
+ * |---------------------------------------------------|
984
+ * | Match Type | TABLE_MIRROR | TABLE_MIRRORV6 |
985
+ * |---------------------------------------------------|
986
+ * | MATCH_SRC_IP | √ | |
987
+ * | MATCH_DST_IP | √ | |
988
+ * |---------------------------------------------------|
989
+ * | MATCH_ICMP_TYPE | √ | |
990
+ * | MATCH_ICMP_CODE | √ | |
991
+ * |---------------------------------------------------|
992
+ * | MATCH_ICMPV6_TYPE | | √ |
993
+ * | MATCH_ICMPV6_CODE | | √ |
994
+ * |---------------------------------------------------|
995
+ * | MATCH_SRC_IPV6 | | √ |
996
+ * | MATCH_DST_IPV6 | | √ |
997
+ * |---------------------------------------------------|
998
+ * | MARTCH_ETHERTYPE | √ | |
999
+ * |---------------------------------------------------|
970
1000
*/
971
1001
972
1002
if (m_tableType == ACL_TABLE_MIRROR &&
973
- (attr_name == MATCH_SRC_IPV6 || attr_name == MATCH_DST_IPV6))
1003
+ (attr_name == MATCH_SRC_IPV6 || attr_name == MATCH_DST_IPV6 ||
1004
+ attr_name == MATCH_ICMPV6_TYPE || attr_name == MATCH_ICMPV6_CODE))
974
1005
{
975
1006
SWSS_LOG_ERROR (" %s match is not supported for the table of type MIRROR" ,
976
1007
attr_name.c_str ());
977
1008
return false ;
978
1009
}
979
1010
980
1011
if (m_tableType == ACL_TABLE_MIRRORV6 &&
981
- (attr_name == MATCH_SRC_IP || attr_name == MATCH_DST_IP || attr_name == MATCH_ETHER_TYPE))
1012
+ (attr_name == MATCH_SRC_IP || attr_name == MATCH_DST_IP ||
1013
+ attr_name == MATCH_ICMP_TYPE || attr_name == MATCH_ICMP_CODE ||
1014
+ attr_name == MATCH_ETHER_TYPE))
982
1015
{
983
- SWSS_LOG_ERROR (" %s match is not supported for the table of type MIRRORV6 " ,
1016
+ SWSS_LOG_ERROR (" %s match is not supported for the table of type MIRRORv6 " ,
984
1017
attr_name.c_str ());
985
1018
return false ;
986
1019
}
@@ -1172,19 +1205,25 @@ bool AclTable::create()
1172
1205
1173
1206
/*
1174
1207
* Type of Tables and Supported Match Types (ASIC database)
1175
- * |-----------------------------------------------------------------|
1176
- * | | TABLE_MIRROR | TABLE_MIRROR | TABLE_MIRRORV6 |
1177
- * | Match Type |----------------------------------------------|
1178
- * | | combined | separated |
1179
- * |-----------------------------------------------------------------|
1180
- * | MATCH_SRC_IP | √ | √ | |
1181
- * | MATCH_DST_IP | √ | √ | |
1182
- * |-----------------------------------------------------------------|
1183
- * | MATCH_SRC_IPV6 | √ | | √ |
1184
- * | MATCH_DST_IPV6 | √ | | √ |
1185
- * |-----------------------------------------------------------------|
1186
- * | MARTCH_ETHERTYPE | √ | √ | |
1187
- * |-----------------------------------------------------------------|
1208
+ * |------------------------------------------------------------------|
1209
+ * | | TABLE_MIRROR | TABLE_MIRROR | TABLE_MIRRORV6 |
1210
+ * | Match Type |----------------------------------------------|
1211
+ * | | combined | separated |
1212
+ * |------------------------------------------------------------------|
1213
+ * | MATCH_SRC_IP | √ | √ | |
1214
+ * | MATCH_DST_IP | √ | √ | |
1215
+ * |------------------------------------------------------------------|
1216
+ * | MATCH_ICMP_TYPE | √ | √ | |
1217
+ * | MATCH_ICMP_CODE | √ | √ | |
1218
+ * |------------------------------------------------------------------|
1219
+ * | MATCH_SRC_IPV6 | √ | | √ |
1220
+ * | MATCH_DST_IPV6 | √ | | √ |
1221
+ * |------------------------------------------------------------------|
1222
+ * | MATCH_ICMPV6_TYPE | √ | | √ |
1223
+ * | MATCH_ICMPV6_CODE | √ | | √ |
1224
+ * |------------------------------------------------------------------|
1225
+ * | MARTCH_ETHERTYPE | √ | √ | |
1226
+ * |------------------------------------------------------------------|
1188
1227
*/
1189
1228
1190
1229
if (type == ACL_TABLE_MIRROR)
@@ -1197,6 +1236,14 @@ bool AclTable::create()
1197
1236
attr.value .booldata = true ;
1198
1237
table_attrs.push_back (attr);
1199
1238
1239
+ attr.id = SAI_ACL_TABLE_ATTR_FIELD_ICMP_TYPE;
1240
+ attr.value .booldata = true ;
1241
+ table_attrs.push_back (attr);
1242
+
1243
+ attr.id = SAI_ACL_TABLE_ATTR_FIELD_ICMP_CODE;
1244
+ attr.value .booldata = true ;
1245
+ table_attrs.push_back (attr);
1246
+
1200
1247
// If the switch supports v6 and requires one single table
1201
1248
if (m_pAclOrch->m_mirrorTableCapabilities [ACL_TABLE_MIRRORV6] &&
1202
1249
m_pAclOrch->m_isCombinedMirrorV6Table )
@@ -1208,6 +1255,14 @@ bool AclTable::create()
1208
1255
attr.id = SAI_ACL_TABLE_ATTR_FIELD_DST_IPV6;
1209
1256
attr.value .booldata = true ;
1210
1257
table_attrs.push_back (attr);
1258
+
1259
+ attr.id = SAI_ACL_TABLE_ATTR_FIELD_ICMPV6_TYPE;
1260
+ attr.value .booldata = true ;
1261
+ table_attrs.push_back (attr);
1262
+
1263
+ attr.id = SAI_ACL_TABLE_ATTR_FIELD_ICMPV6_CODE;
1264
+ attr.value .booldata = true ;
1265
+ table_attrs.push_back (attr);
1211
1266
}
1212
1267
}
1213
1268
else if (type == ACL_TABLE_L3V6 || type == ACL_TABLE_MIRRORV6) // v6 only
@@ -1219,6 +1274,14 @@ bool AclTable::create()
1219
1274
attr.id = SAI_ACL_TABLE_ATTR_FIELD_DST_IPV6;
1220
1275
attr.value .booldata = true ;
1221
1276
table_attrs.push_back (attr);
1277
+
1278
+ attr.id = SAI_ACL_TABLE_ATTR_FIELD_ICMPV6_TYPE;
1279
+ attr.value .booldata = true ;
1280
+ table_attrs.push_back (attr);
1281
+
1282
+ attr.id = SAI_ACL_TABLE_ATTR_FIELD_ICMPV6_CODE;
1283
+ attr.value .booldata = true ;
1284
+ table_attrs.push_back (attr);
1222
1285
}
1223
1286
else // v4 only
1224
1287
{
@@ -1229,6 +1292,14 @@ bool AclTable::create()
1229
1292
attr.id = SAI_ACL_TABLE_ATTR_FIELD_DST_IP;
1230
1293
attr.value .booldata = true ;
1231
1294
table_attrs.push_back (attr);
1295
+
1296
+ attr.id = SAI_ACL_TABLE_ATTR_FIELD_ICMP_TYPE;
1297
+ attr.value .booldata = true ;
1298
+ table_attrs.push_back (attr);
1299
+
1300
+ attr.id = SAI_ACL_TABLE_ATTR_FIELD_ICMP_CODE;
1301
+ attr.value .booldata = true ;
1302
+ table_attrs.push_back (attr);
1232
1303
}
1233
1304
1234
1305
attr.id = SAI_ACL_TABLE_ATTR_FIELD_L4_SRC_PORT;
0 commit comments