2 *------------------------------------------------------------------
3 * dhcp_api.c - dhcp api
5 * Copyright (c) 2016 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 #include <vnet/vnet.h>
21 #include <vlibmemory/api.h>
23 #include <dhcp/dhcp6_ia_na_client_dp.h>
25 /* define message IDs */
26 #include <vnet/format_fns.h>
27 #include <dhcp/dhcp6_ia_na_client_cp.api_enum.h>
28 #include <dhcp/dhcp6_ia_na_client_cp.api_types.h>
31 * Base message ID fot the plugin
33 static u32 dhcp_base_msg_id;
34 #define REPLY_MSG_ID_BASE dhcp_base_msg_id
36 #include <vlibapi/api_helper_macros.h>
39 vl_api_dhcp6_client_enable_disable_t_handler
40 (vl_api_dhcp6_client_enable_disable_t * mp)
42 vl_api_dhcp6_client_enable_disable_reply_t *rmp;
46 VALIDATE_SW_IF_INDEX (mp);
48 sw_if_index = ntohl (mp->sw_if_index);
50 rv = dhcp6_client_enable_disable (sw_if_index, mp->enable);
52 BAD_SW_IF_INDEX_LABEL;
54 REPLY_MACRO (VL_API_DHCP6_CLIENT_ENABLE_DISABLE_REPLY);
57 #define vl_msg_name_crc_list
58 #include <dhcp/dhcp6_ia_na_client_cp.api.c>
59 #undef vl_msg_name_crc_list
62 dhcp_ia_na_client_cp_api_init (vlib_main_t * vm)
65 * Set up the (msg_name, crc, message-id) table
67 dhcp_base_msg_id = setup_message_id_table ();
72 VLIB_INIT_FUNCTION (dhcp_ia_na_client_cp_api_init);
75 * fd.io coding-style-patch-verification: ON
78 * eval: (c-set-style "gnu")