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 #include <vnet/dpo/dpo.h>
17 #include <vnet/lisp-gpe/lisp_gpe.h>
18 #include <vnet/lisp-cp/control.h>
21 lisp_cp_dpo_get (fib_protocol_t proto)
24 * there are only two instances of this DPO type.
25 * we can use the protocol as the index
31 format_lisp_cp_dpo (u8 *s, va_list *args)
33 index_t index = va_arg (*args, index_t);
34 CLIB_UNUSED(u32 indent) = va_arg (*args, u32);
36 return (format(s, "lisp-cp-punt-%U",
37 format_fib_protocol, index));
41 lisp_cp_dpo_lock (dpo_id_t *dpo)
46 lisp_cp_dpo_unlock (dpo_id_t *dpo)
50 const static dpo_vft_t lisp_cp_vft = {
51 .dv_lock = lisp_cp_dpo_lock,
52 .dv_unlock = lisp_cp_dpo_unlock,
53 .dv_format = format_lisp_cp_dpo,
57 * @brief The per-protocol VLIB graph nodes that are assigned to a LISP-CP
60 * this means that these graph nodes are ones from which a LISP-CP is the
61 * parent object in the DPO-graph.
63 const static char* const lisp_cp_ip4_nodes[] =
68 const static char* const lisp_cp_ip6_nodes[] =
74 const static char* const * const lisp_cp_nodes[DPO_PROTO_NUM] =
76 [DPO_PROTO_IP4] = lisp_cp_ip4_nodes,
77 [DPO_PROTO_IP6] = lisp_cp_ip6_nodes,
78 [DPO_PROTO_MPLS] = NULL,
82 lisp_cp_dpo_module_init (vlib_main_t * vm)
85 * there are no exit arcs from the LIS-CP VLIB node, so we
86 * pass NULL as said node array.
88 dpo_register(DPO_LISP_CP, &lisp_cp_vft, lisp_cp_nodes);
93 VLIB_INIT_FUNCTION(lisp_cp_dpo_module_init);