FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
dhcp6_pd_client_cp_api.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 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:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
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.
14  */
15 
16 #include <vnet/vnet.h>
17 #include <vlibmemory/api.h>
18 #include <vnet/ip/ip_types_api.h>
19 
21 
22 /* define message IDs */
23 #include <vnet/format_fns.h>
24 #include <dhcp/dhcp6_pd_client_cp.api_enum.h>
25 #include <dhcp/dhcp6_pd_client_cp.api_types.h>
26 
27 /**
28  * Base message ID fot the plugin
29  */
31 #define REPLY_MSG_ID_BASE dhcp_base_msg_id
32 
34 
35 static void
38 {
39  vl_api_dhcp6_pd_client_enable_disable_reply_t *rmp;
41  int rv = 0;
42 
44 
45  sw_if_index = ntohl (mp->sw_if_index);
46 
48  mp->prefix_group, mp->enable);
49 
51 
52  REPLY_MACRO (VL_API_DHCP6_PD_CLIENT_ENABLE_DISABLE_REPLY);
53 }
54 
55 static void
58 {
59  vl_api_ip6_add_del_address_using_prefix_reply_t *rmp;
61  ip6_address_t address;
62  u8 prefix_length;
63  int rv = 0;
64 
66 
67  sw_if_index = ntohl (mp->sw_if_index);
68 
70  prefix_length = mp->address_with_prefix.len;
71 
73  prefix_length, mp->is_add);
74 
76 
77  REPLY_MACRO (VL_API_IP6_ADD_DEL_ADDRESS_USING_PREFIX_REPLY);
78 }
79 
80 #define vl_msg_name_crc_list
81 #include <dhcp/dhcp6_pd_client_cp.api.c>
82 #undef vl_msg_name_crc_list
83 
84 static clib_error_t *
86 {
87  /*
88  * Set up the (msg_name, crc, message-id) table
89  */
91 
92  return 0;
93 }
94 
96 
97 /*
98  * fd.io coding-style-patch-verification: ON
99  *
100  * Local Variables:
101  * eval: (c-set-style "gnu")
102  * End:
103  */
VALIDATE_SW_IF_INDEX
#define VALIDATE_SW_IF_INDEX(mp)
Definition: api_helper_macros.h:281
api.h
vl_api_ip6_add_del_address_using_prefix_t::is_add
bool is_add
Definition: dhcp6_pd_client_cp.api:56
dhcp6_cp_ip6_address_add_del
int dhcp6_cp_ip6_address_add_del(u32 sw_if_index, const u8 *prefix_group, ip6_address_t address, u8 prefix_length, u8 is_add)
Definition: dhcp6_pd_client_cp.c:955
ip6_address_decode
void ip6_address_decode(const vl_api_ip6_address_t in, ip6_address_t *out)
Definition: ip_types_api.c:129
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
vl_api_dhcp6_pd_client_enable_disable_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: dhcp6_pd_client_cp.api:32
vl_api_dhcp6_pd_client_enable_disable_t::enable
bool enable
Definition: dhcp6_pd_client_cp.api:34
vl_api_ip6_add_del_address_using_prefix_t
Add/delete IPv6 address optionally using available prefix.
Definition: dhcp6_pd_client_cp.api:49
dhcp6_pd_client_enable_disable
int dhcp6_pd_client_enable_disable(u32 sw_if_index, const u8 *prefix_group, u8 enable)
Definition: dhcp6_pd_client_cp.c:1238
REPLY_MACRO
#define REPLY_MACRO(t)
Definition: api_helper_macros.h:30
setup_message_id_table
static void setup_message_id_table(api_main_t *am)
Definition: sr_mpls_api.c:174
address
manual_print typedef address
Definition: ip_types.api:96
dhcp6_pd_client_dp.h
vl_api_dhcp6_pd_client_enable_disable_t_handler
static void vl_api_dhcp6_pd_client_enable_disable_t_handler(vl_api_dhcp6_pd_client_enable_disable_t *mp)
Definition: dhcp6_pd_client_cp_api.c:37
BAD_SW_IF_INDEX_LABEL
#define BAD_SW_IF_INDEX_LABEL
Definition: api_helper_macros.h:289
format_fns.h
u32
unsigned int u32
Definition: types.h:88
VLIB_INIT_FUNCTION
#define VLIB_INIT_FUNCTION(x)
Definition: init.h:172
vl_api_dhcp6_pd_client_enable_disable_t::prefix_group
string prefix_group[64]
Definition: dhcp6_pd_client_cp.api:33
vl_api_ip6_add_del_address_using_prefix_t::prefix_group
string prefix_group[64]
Definition: dhcp6_pd_client_cp.api:54
api_helper_macros.h
dhcp_pd_client_cp_api_init
static clib_error_t * dhcp_pd_client_cp_api_init(vlib_main_t *vm)
Definition: dhcp6_pd_client_cp_api.c:85
vlib_main_t
Definition: main.h:102
vl_api_ip6_add_del_address_using_prefix_t::address_with_prefix
vl_api_ip6_address_with_prefix_t address_with_prefix
Definition: dhcp6_pd_client_cp.api:55
dhcp_base_msg_id
static u32 dhcp_base_msg_id
Base message ID fot the plugin.
Definition: dhcp6_pd_client_cp_api.c:30
u8
unsigned char u8
Definition: types.h:56
clib_error_t
Definition: clib_error.h:21
vlib_init_function_t
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
Definition: init.h:51
rv
int __clib_unused rv
Definition: application.c:491
vl_api_ip6_add_del_address_using_prefix_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: dhcp6_pd_client_cp.api:53
vnet.h
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
ip_types_api.h
vl_api_dhcp6_pd_client_enable_disable_t
Enable/disable DHCPv6 PD client on interface.
Definition: dhcp6_pd_client_cp.api:28
vl_api_ip6_add_del_address_using_prefix_t_handler
static void vl_api_ip6_add_del_address_using_prefix_t_handler(vl_api_ip6_add_del_address_using_prefix_t *mp)
Definition: dhcp6_pd_client_cp_api.c:57