bmv2
Designing your own switch target with bmv2
match_error_codes.h
1 /* Copyright 2013-present Barefoot Networks, Inc.
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 /*
17  * Antonin Bas (antonin@barefootnetworks.com)
18  *
19  */
20 
21 #ifndef BM_BM_SIM_MATCH_ERROR_CODES_H_
22 #define BM_BM_SIM_MATCH_ERROR_CODES_H_
23 
24 namespace bm {
25 
26 enum class MatchErrorCode {
27  SUCCESS = 0,
28  TABLE_FULL,
29  INVALID_HANDLE,
30  EXPIRED_HANDLE,
31  COUNTERS_DISABLED,
32  METERS_DISABLED,
33  AGEING_DISABLED,
34  INVALID_TABLE_NAME,
35  INVALID_ACTION_NAME,
36  WRONG_TABLE_TYPE,
37  INVALID_MBR_HANDLE,
38  MBR_STILL_USED,
39  MBR_ALREADY_IN_GRP,
40  MBR_NOT_IN_GRP,
41  INVALID_GRP_HANDLE,
42  GRP_STILL_USED,
43  EMPTY_GRP,
44  DUPLICATE_ENTRY,
45  BAD_MATCH_KEY,
46  INVALID_METER_OPERATION,
47  DEFAULT_ACTION_IS_CONST,
48  DEFAULT_ENTRY_IS_CONST,
49  NO_DEFAULT_ENTRY,
50  INVALID_ACTION_PROFILE_NAME,
51  NO_ACTION_PROFILE_SELECTION,
52  IMMUTABLE_TABLE_ENTRIES,
53  BAD_ACTION_DATA,
54  NO_TABLE_KEY,
55  ERROR,
56 };
57 
58 const char *match_error_code_to_string(MatchErrorCode code);
59 
60 } // namespace bm
61 
62 #endif // BM_BM_SIM_MATCH_ERROR_CODES_H_