|
FD.io VPP
v21.06-3-gbb25fbf28
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);
126 vl_api_ip6nd_proxy_add_del_reply_t *rmp;
146 vl_api_sw_interface_ip6nd_ra_config_reply_t *rmp;
149 u8 is_no, suppress, managed, other, ll_option, send_unicast, cease,
152 is_no = mp->
is_no == 1;
155 other = mp->
other == 1;
158 cease = mp->
cease == 1;
164 suppress, managed, other,
165 ll_option, send_unicast, cease,
166 default_router, ntohl (mp->
lifetime),
174 REPLY_MACRO (VL_API_SW_INTERFACE_IP6ND_RA_CONFIG_REPLY);
182 vl_api_sw_interface_ip6nd_ra_prefix_reply_t *rmp;
185 u8 is_no, use_default, no_advertise, off_link, no_autoconfig, no_onlink;
190 is_no = mp->
is_no == 1;
202 off_link, no_autoconfig, no_onlink, is_no);
205 REPLY_MACRO (VL_API_SW_INTERFACE_IP6ND_RA_PREFIX_REPLY);
212 vl_api_ip6nd_send_router_solicitation_reply_t *rmp;
220 REPLY_MACRO (VL_API_IP6ND_SEND_ROUTER_SOLICITATION_REPLY);
225 params.
irt = ntohl (mp->
irt);
226 params.
mrt = ntohl (mp->
mrt);
227 params.
mrc = ntohl (mp->
mrc);
228 params.
mrd = ntohl (mp->
mrd);
248 vl_api_ip6_ra_prefix_info_t *
prefix;
253 sizeof (vl_api_ip6_ra_prefix_info_t));
259 event->sw_if_index = clib_host_to_net_u32 (rap->
sw_if_index);
265 event->flags = rap->
flags;
266 event->router_lifetime_in_sec =
268 event->neighbor_reachable_time_in_msec =
270 event->time_in_msec_between_retransmitted_neighbor_solicitations =
298 vl_api_want_ip6_ra_events_reply_t *rmp;
299 int rv = 0, had_reg, have_reg;
301 had_reg =
hash_elts (
am->ip6_ra_events_registration_hash);
309 rv = VNET_API_ERROR_INVALID_REGISTRATION;
315 pool_put (
am->ip6_ra_events_registrations, rp);
323 rv = VNET_API_ERROR_INVALID_REGISTRATION;
326 pool_get (
am->ip6_ra_events_registrations, rp);
330 rp -
am->ip6_ra_events_registrations);
333 have_reg =
hash_elts (
am->ip6_ra_events_registration_hash);
335 if (!had_reg && have_reg)
337 else if (had_reg && !have_reg)
350 p =
hash_get (
am->ip6_ra_events_registration_hash, client_index);
355 pool_put (
am->ip6_ra_events_registrations, rp);
356 hash_unset (
am->ip6_ra_events_registration_hash, client_index);
363 #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)
u32 time_in_msec_between_retransmitted_neighbor_solicitations
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)
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)
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
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.
#define hash_set(h, key, value)
int ip6_nd_proxy_add(u32 sw_if_index, const ip6_address_t *addr)
static void setup_message_id_table(api_main_t *am)
A protocol Independent FIB table.
#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).
fib_node_index_t ft_index
Index into FIB vector.
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.
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
#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)
static uword hash_elts(void *v)
#define vec_free(V)
Free vector's memory (no header).
IPv6 ND proxy details returned after request.
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 hash_unset(h, key)
#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)