2 * Copyright (c) 2016 Cisco and/or its affiliates.
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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 #ifndef __LISP_GPE_TENANT_H__
17 #define __LISP_GPE_TENANT_H__
19 #include <vnet/lisp-gpe/lisp_gpe.h>
22 * Refernece counting lock types on the tenant.
23 * When all of these counters drop to zero, we no longer need the tenant.
25 typedef enum lisp_gpe_tenant_lock_t_
27 LISP_GPE_TENANT_LOCK_L2_IFACE,
28 LISP_GPE_TENANT_LOCK_L3_IFACE,
29 LISP_GPE_TENANT_LOCK_NUM,
30 } lisp_gpe_tenant_lock_t;
33 * @brief Representation of the data associated with a LISP overlay tenant
35 * This object exists to manage the shared resources of the L2 and L3 interface
38 typedef struct lisp_gpe_tenant_t_
41 * The VNI is the identifier of the tenant
46 * The tenant can have both L2 and L3 services enabled.
52 * The number of locks on the tenant's L3 interface.
54 u32 lt_locks[LISP_GPE_TENANT_LOCK_NUM];
57 * The L3 SW interface index
59 u32 lt_l3_sw_if_index;
62 * The L2 SW interface index
64 u32 lt_l2_sw_if_index;
68 extern u32 lisp_gpe_tenant_find_or_create (u32 vni);
70 extern u32 lisp_gpe_tenant_l3_iface_add_or_lock (u32 vni, u32 vrf);
71 extern void lisp_gpe_tenant_l3_iface_unlock (u32 vni);
73 extern u32 lisp_gpe_tenant_l2_iface_add_or_lock (u32 vni, u32 vrf);
74 extern void lisp_gpe_tenant_l2_iface_unlock (u32 vni);
76 extern const lisp_gpe_tenant_t *lisp_gpe_tenant_get (u32 index);
78 extern void lisp_gpe_tenant_flush (void);
81 * fd.io coding-style-patch-verification: ON
84 * eval: (c-set-style "gnu")