2 *------------------------------------------------------------------
3 * cgse_defs.h - CGSE specific definiitions
5 * Copyright (c) 2007-2013 Cisco and/or its affiliates.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at:
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *------------------------------------------------------------------
20 #ifndef __CGSE_DEFS_H__
21 #define __CGSE_DEFS_H__
23 #include "spp_platform_common.h"
27 #define CGSE_SVI_TYPE_CNAT 1
28 #define CGSE_SVI_TYPE_XLAT 2
29 #define CGSE_SVI_TYPE_NAT64_STATEFUL 3
30 #define CGSE_SVI_TYPE_V6RD 4
31 #define CGSE_SVI_TYPE_INFRA 5
32 #define CGSE_SVI_TYPE_DS_LITE 7
33 #define CGSE_SVI_TYPE_MAPE 9
35 #define CGSE_SET_TX_PKT_TYPE(type) PLATFORM_SET_CTX_RU_TX_PKT_TYPE(ctx, type)
37 #define CGSE_INVALID_UIDX 0xffff /*invalid svi app uidb index */
38 #define CGSE_INVALID_VRFID 0xffffffff /*invalid vrf id */
40 #define CGSE_VRF_MASK 0x3fff
41 #define CGSE_MAX_VRFMAP_ENTRIES (CGSE_VRF_MASK + 1)
43 #define CGSE_VRFMAP_ENTRY_INVALID 0xffff
46 #define CGSE_INVALID_CGSE_ID (0)
48 #define CGSE_TABLE_ENTRY_DELETED 0
49 #define CGSE_TABLE_ENTRY_ACTIVE 1
50 #define CGSE_TABLE_ENTRY_DORMANT 2
51 #define CGSE_TABLE_ENTRY_INVALID_UIDB 3
54 #define CGSE_CONFIG_HANDLER_DEBUG_PRINTF1(level, a) \
55 if (cgse_config_debug_level > level) printf(a);
57 #define CGSE_CONFIG_HANDLER_DEBUG_PRINTF2(level, a, b) \
58 if (cgse_config_debug_level > level) printf(a, b);
60 #define CGSE_CONFIG_HANDLER_DEBUG_PRINTF3(level, a, b, c) \
61 if (cgse_config_debug_level > level) printf(a, b, c);
63 #define CGSE_CONFIG_HANDLER_DEBUG_PRINTF4(level, a, b, c, d) \
64 if (cgse_config_debug_level > level) printf(a, b, c, d);
66 #define CGSE_CONFIG_HANDLER_DEBUG_PRINTF5(level, a, b, c, d, e) \
67 if (cgse_config_debug_level > level) printf(a, b, c, d, e);
69 #define CGSE_CONFIG_HANDLER_DEBUG_PRINTF6(level, a, b, c, d, e, f) \
70 if (cgse_config_debug_level > level) printf(a, b, c, d, e, f);
72 #define CGSE_CONFIG_HANDLER_DEBUG_PRINTF7(level, a, b, c, d, e, f, g) \
73 if (cgse_config_debug_level > level) printf(a, b, c, d, e, f, g);
75 #define CGSE_CONFIG_HANDLER_DEBUG_PRINTF8(level, a, b, c, d, e, f, g, h) \
76 if (cgse_config_debug_level > level) printf(a, b, c, d, e, f, g, h);
78 #define CGSE_CONFIG_HANDLER_DEBUG_PRINTF9(level, a, b, c, d, e, f, g, h, i) \
79 if (cgse_config_debug_level > level) printf(a, b, c, d, e, f, g, h, i);
81 extern u16 *cgse_uidb_index_cgse_id_mapping_ptr;
83 #define CGSE_ADD_UIDB_INDEX_CGSE_ID_MAPPING(uidb_index, cgse_id) \
84 *(cgse_uidb_index_cgse_id_mapping_ptr + uidb_index) = cgse_id;
86 extern u8 my_instance_number;