2 *------------------------------------------------------------------
5 * Copyright (c) 2009 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 included_vlibmemory_api_h
21 #define included_vlibmemory_api_h
24 #include <vlib/vlib.h>
25 #include <vlibmemory/unix_shared_memory_queue.h>
26 #include <vlib/unix/unix.h>
27 #include <vlibapi/api.h>
28 #include <vlibmemory/api_common.h>
31 vl_msg_api_handle_get_epoch (u32 index)
33 return (index & VL_API_EPOCH_MASK);
37 vl_msg_api_handle_get_index (u32 index)
39 return (index >> VL_API_EPOCH_SHIFT);
43 vl_msg_api_handle_from_index_and_epoch (u32 index, u32 epoch)
46 ASSERT (index < 0x00FFFFFF);
48 handle = (index << VL_API_EPOCH_SHIFT) | (epoch & VL_API_EPOCH_MASK);
52 void vl_enable_disable_memory_api (vlib_main_t * vm, int yesno);
54 #endif /* included_vlibmemory_api_h */
57 * fd.io coding-style-patch-verification: ON
60 * eval: (c-set-style "gnu")