|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
28 #include <vpp/app/version.h>
35 #include <vnet/ip6-nd/ip6_nd.api_enum.h>
36 #include <vnet/ip6-nd/ip6_nd.api_types.h>
42 #define REPLY_MSG_ID_BASE ip6_nd_base_msg_id
55 mp->_vl_msg_id =
ntohs (VL_API_IP6ND_PROXY_DETAILS);
125 vl_api_ip6nd_proxy_enable_disable_reply_t *rmp;
136 REPLY_MACRO (VL_API_IP6ND_PROXY_ENABLE_DISABLE_REPLY);
142 vl_api_ip6nd_proxy_add_del_reply_t *rmp;
162 vl_api_sw_interface_ip6nd_ra_config_reply_t *rmp;
165 u8 is_no, suppress, managed, other, ll_option, send_unicast, cease,
168 is_no = mp->
is_no == 1;
171 other = mp->
other == 1;
174 cease = mp->
cease == 1;
180 suppress, managed, other,
181 ll_option, send_unicast, cease,
182 default_router, ntohl (mp->
lifetime),
190 REPLY_MACRO (VL_API_SW_INTERFACE_IP6ND_RA_CONFIG_REPLY);
198 vl_api_sw_interface_ip6nd_ra_prefix_reply_t *rmp;
201 u8 is_no, use_default, no_advertise, off_link, no_autoconfig, no_onlink;
206 is_no = mp->
is_no == 1;
218 off_link, no_autoconfig, no_onlink, is_no);
221 REPLY_MACRO (VL_API_SW_INTERFACE_IP6ND_RA_PREFIX_REPLY);
228 vl_api_ip6nd_send_router_solicitation_reply_t *rmp;
236 REPLY_MACRO (VL_API_IP6ND_SEND_ROUTER_SOLICITATION_REPLY);
241 params.
irt = ntohl (mp->
irt);
242 params.
mrt = ntohl (mp->
mrt);
243 params.
mrc = ntohl (mp->
mrc);
244 params.
mrd = ntohl (mp->
mrd);
264 vl_api_ip6_ra_prefix_info_t *
prefix;
269 sizeof (vl_api_ip6_ra_prefix_info_t));
275 event->sw_if_index = clib_host_to_net_u32 (rap->
sw_if_index);
281 event->flags = rap->
flags;
282 event->router_lifetime_in_sec =
284 event->neighbor_reachable_time_in_msec =
286 event->time_in_msec_between_retransmitted_neighbor_solicitations =
314 vl_api_want_ip6_ra_events_reply_t *rmp;
315 int rv = 0, had_reg, have_reg;
317 had_reg =
hash_elts (
am->ip6_ra_events_registration_hash);
325 rv = VNET_API_ERROR_INVALID_REGISTRATION;
331 pool_put (
am->ip6_ra_events_registrations, rp);
339 rv = VNET_API_ERROR_INVALID_REGISTRATION;
342 pool_get (
am->ip6_ra_events_registrations, rp);
346 rp -
am->ip6_ra_events_registrations);
349 have_reg =
hash_elts (
am->ip6_ra_events_registration_hash);
351 if (!had_reg && have_reg)
353 else if (had_reg && !have_reg)
366 p =
hash_get (
am->ip6_ra_events_registration_hash, client_index);
371 pool_put (
am->ip6_ra_events_registrations, rp);
372 hash_unset (
am->ip6_ra_events_registration_hash, client_index);
379 #include <vnet/ip6-nd/ip6_nd.api.c>
int ip6_ra_prefix(vlib_main_t *vm, u32 sw_if_index, ip6_address_t *prefix_addr, u8 prefix_len, u8 use_default, u32 val_lifetime, u32 pref_lifetime, u8 no_advertise, u8 off_link, u8 no_autoconfig, u8 no_onlink, u8 is_no)
#define VALIDATE_SW_IF_INDEX(mp)
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
#define hash_set(h, key, value)
u32 time_in_msec_between_retransmitted_neighbor_solicitations
vl_api_interface_index_t sw_if_index
const fib_prefix_t * fib_entry_get_prefix(fib_node_index_t fib_entry_index)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
int fib_entry_cmp_for_sort(void *i1, void *i2)
vl_api_interface_index_t sw_if_index
int ip6_ra_config(vlib_main_t *vm, u32 sw_if_index, u8 suppress, u8 managed, u8 other, u8 ll_option, u8 send_unicast, u8 cease, u8 use_lifetime, u32 lifetime, u32 initial_count, u32 initial_interval, u32 max_interval, u32 min_interval, u8 is_no)
static uword hash_elts(void *v)
u16 fp_len
The mask length.
void ip6_address_decode(const vl_api_ip6_address_t in, ip6_address_t *out)
#define pool_put(P, E)
Free an object E in pool P.
Tell client about a router advertisement event.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
u16 router_lifetime_in_sec
void icmp6_send_router_solicitation(vlib_main_t *vm, u32 sw_if_index, u8 stop, const icmp6_send_router_solicitation_params_t *params)
void fib_table_walk(u32 fib_index, fib_protocol_t proto, fib_table_walk_fn_t fn, void *ctx)
Walk all entries in a FIB table N.B: This is NOT safe to deletes.
void * vl_msg_api_alloc_zero(int nbytes)
static void vl_api_ip6nd_proxy_enable_disable_t_handler(vl_api_ip6nd_proxy_enable_disable_t *mp)
struct api_ip6nd_proxy_fib_table_walk_ctx_t_ api_ip6nd_proxy_fib_table_walk_ctx_t
IPv6 router advertisement config request.
static void vl_api_ip6nd_proxy_dump_t_handler(vl_api_ip6nd_proxy_dump_t *mp)
ip6_address_t router_address
vl_api_interface_index_t sw_if_index
vl_api_interface_index_t sw_if_index
#define hash_unset(h, key)
static clib_error_t * ip6_nd_api_init(vlib_main_t *vm)
void ip_prefix_encode(const fib_prefix_t *in, vl_api_prefix_t *out)
static u32 ip6_nd_base_msg_id
Base message ID fot the plugin.
int ip6_nd_proxy_add(u32 sw_if_index, const ip6_address_t *addr)
#define pool_foreach(VAR, POOL)
Iterate through pool.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
Start / stop sending router solicitation.
IPv6 ND proxy dump request.
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
void ip6_address_encode(const ip6_address_t *in, vl_api_ip6_address_t out)
vl_api_ip6_address_t router_addr
static fib_table_walk_rc_t api_ip6nd_proxy_fib_table_walk(fib_node_index_t fei, void *arg)
An API client registration, only in vpp/vlib.
static void setup_message_id_table(api_main_t *am)
void ip_prefix_decode(const vl_api_prefix_t *in, fib_prefix_t *out)
u32 fib_node_index_t
A typedef of a node index.
#define REPLY_MSG_ID_BASE
int ip6_nd_proxy_enable_disable(u32 sw_if_index, u8 enable)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
ra_report_prefix_info_t * prefixes
struct fib_table_t_ * fibs
u32 fib_entry_get_resolving_interface(fib_node_index_t entry_index)
vl_api_interface_index_t sw_if_index
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
static void ip6_ra_handle_report(const ip6_ra_report_t *rap)
static void vl_api_ip6nd_proxy_add_del_t_handler(vl_api_ip6nd_proxy_add_del_t *mp)
#define BAD_SW_IF_INDEX_LABEL
void ip6_ra_report_unregister(ip6_ra_report_notify_t fn)
#define vec_free(V)
Free vector's memory (no header).
IPv6 ND proxy details returned after request.
#define pool_foreach_index(i, v)
int fib_entry_is_sourced(fib_node_index_t fib_entry_index, fib_source_t source)
static int vl_api_can_send_msg(vl_api_registration_t *rp)
#define VLIB_INIT_FUNCTION(x)
@ FIB_SOURCE_IP6_ND_PROXY
IPv6 Proxy ND.
enum fib_table_walk_rc_t_ fib_table_walk_rc_t
return code controlling how a table walk proceeds
#define vec_foreach(var, vec)
Vector iterator.
Register for ip6 router advertisement events.
#define vec_sort_with_function(vec, f)
Sort a vector using the supplied element comparison function.
@ FIB_TABLE_WALK_CONTINUE
Continue on to the next entry.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static vlib_main_t * vlib_get_main(void)
vl_api_interface_index_t sw_if_index
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
int ip6_nd_proxy_del(u32 sw_if_index, const ip6_address_t *addr)
#define clib_warning(format, args...)
void ip6_ra_report_register(ip6_ra_report_notify_t fn)
u32 neighbor_reachable_time_in_msec
VL_MSG_API_REAPER_FUNCTION(want_ip6_ra_events_reaper)
static void vl_api_ip6nd_send_router_solicitation_t_handler(vl_api_ip6nd_send_router_solicitation_t *mp)
static void vl_api_want_ip6_ra_events_t_handler(vl_api_want_ip6_ra_events_t *mp)
static void send_ip6nd_proxy_details(vl_api_registration_t *reg, u32 context, const ip46_address_t *addr, u32 sw_if_index)
static void vl_api_sw_interface_ip6nd_ra_config_t_handler(vl_api_sw_interface_ip6nd_ra_config_t *mp)
vl_api_interface_index_t sw_if_index
static clib_error_t * want_ip6_ra_events_reaper(u32 client_index)
Aggregate type for a prefix.
IPv6 router advertisement prefix config request.
static void vl_api_sw_interface_ip6nd_ra_prefix_t_handler(vl_api_sw_interface_ip6nd_ra_prefix_t *mp)
vpe_api_main_t vpe_api_main
void * vl_msg_api_alloc(int nbytes)