FD.io VPP  v20.01-48-g3e0dafb74
Vector Packet Processing
dhcp6_ia_na_client_cp_api.c
Go to the documentation of this file.
1 /*
2  *------------------------------------------------------------------
3  * dhcp_api.c - dhcp api
4  *
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:
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
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  *------------------------------------------------------------------
18  */
19 
20 #include <vnet/vnet.h>
21 #include <vlibmemory/api.h>
22 
24 
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>
29 
30 /**
31  * Base message ID fot the plugin
32  */
34 #define REPLY_MSG_ID_BASE dhcp_base_msg_id
35 
37 
38 static void
41 {
42  vl_api_dhcp6_client_enable_disable_reply_t *rmp;
44  int rv = 0;
45 
47 
48  sw_if_index = ntohl (mp->sw_if_index);
49 
50  rv = dhcp6_client_enable_disable (sw_if_index, mp->enable);
51 
53 
54  REPLY_MACRO (VL_API_DHCP6_CLIENT_ENABLE_DISABLE_REPLY);
55 }
56 
57 #define vl_msg_name_crc_list
58 #include <dhcp/dhcp6_ia_na_client_cp.api.c>
59 #undef vl_msg_name_crc_list
60 
61 static clib_error_t *
63 {
64  /*
65  * Set up the (msg_name, crc, message-id) table
66  */
67  dhcp_base_msg_id = setup_message_id_table ();
68 
69  return 0;
70 }
71 
73 
74 /*
75  * fd.io coding-style-patch-verification: ON
76  *
77  * Local Variables:
78  * eval: (c-set-style "gnu")
79  * End:
80  */
int dhcp6_client_enable_disable(u32 sw_if_index, u8 enable)
static u32 dhcp_base_msg_id
Base message ID fot the plugin.
vl_api_interface_index_t sw_if_index
Definition: gre.api:59
#define VLIB_INIT_FUNCTION(x)
Definition: init.h:173
unsigned int u32
Definition: types.h:88
#define REPLY_MACRO(t)
vlib_main_t * vm
Definition: in2out_ed.c:1810
#define BAD_SW_IF_INDEX_LABEL
Enable/disable DHCPv6 client on interface.
static clib_error_t * dhcp_ia_na_client_cp_api_init(vlib_main_t *vm)
static void setup_message_id_table(snat_main_t *sm, api_main_t *am)
Definition: nat_api.c:3410
static void vl_api_dhcp6_client_enable_disable_t_handler(vl_api_dhcp6_client_enable_disable_t *mp)
#define VALIDATE_SW_IF_INDEX(mp)