|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
27 #include <vnet/fib/fib.api_enum.h>
28 #include <vnet/fib/fib.api_types.h>
31 #define REPLY_MSG_ID_BASE fib_base_msg_id
43 return VNET_API_ERROR_NO_SUCH_FIB;
58 return VNET_API_ERROR_NO_SUCH_FIB;
69 clib_memcpy (&out->ip4, &in->nh.address.ip4, sizeof (out->ip4));
71 clib_memcpy (&out->ip6, &in->nh.address.ip6, sizeof (out->ip6));
74 static vl_api_fib_path_nh_proto_t
99 vl_api_fib_path_t *fp)
153 in->flags = ntohl (in->flags);
154 in->type = ntohl (in->type);
155 in->proto = ntohl (in->proto);
211 return VNET_API_ERROR_NO_SUCH_TABLE;
274 return VNET_API_ERROR_NO_MATCHING_INTERFACE;
313 return (VNET_API_ERROR_NO_SUCH_FIB);
333 ntohl(in->label_stack[ii].label);
335 in->label_stack[ii].ttl;
337 in->label_stack[ii].exp;
339 (in->label_stack[ii].is_uniform ?
350 vl_api_fib_path_t *out)
352 memset (out, 0,
sizeof (*out));
428 out->flags = htonl (out->flags);
429 out->type = htonl (out->type);
430 out->proto = htonl (out->proto);
438 out->label_stack[ii].label =
440 out->label_stack[ii].ttl =
442 out->label_stack[ii].exp =
461 return (VNET_API_ERROR_NO_PATHS_IN_ROUTE);
481 return (VNET_API_ERROR_NO_PATHS_IN_ROUTE);
503 const vl_api_fib_path_t *
path = va_arg (*args, vl_api_fib_path_t*);
505 s =
format (s,
"sw_if_index %d", ntohl (
path->sw_if_index));
506 switch (clib_net_to_host_u32(
path->proto))
520 s =
format (s,
" preference %d",
path->preference);
521 s =
format (s,
" type %d", ntohl(
path->type));
522 s =
format (s,
" proto %d", ntohl(
path->proto));
523 s =
format (s,
" flags %d", ntohl(
path->flags));
524 s =
format (s,
" n_labels %d", ntohl(
path->n_labels));
525 s =
format (s,
" table-id %d", ntohl(
path->table_id));
526 s =
format (s,
" rpf-id %d", ntohl(
path->rpf_id));
544 return (VNET_API_ERROR_INVALID_ADDRESS_FAMILY);
547 vl_api_address_family_t
611 mp->
src.priority = prio;
639 #include <vnet/fib/fib.api.c>
u32 frp_fib_index
The FIB index to lookup the nexthop Only valid for recursive paths.
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
#define REPLY_MSG_ID_BASE
#define REPLY_MACRO2(t, body)
index_t frp_bier_imp
A path via a BIER imposition object.
#define clib_memcpy(d, s, n)
u32 fib_table_get_table_id(u32 fib_index, fib_protocol_t proto)
Get the Table-ID of the FIB from protocol and index.
void fib_table_entry_delete(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source)
Delete a FIB entry.
u8 frp_weight
[un]equal cost path weight
enum dpo_proto_t_ dpo_proto_t
Data path protocol.
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
@ FIB_ROUTE_PATH_ICMP_PROHIBIT
vl_api_mfib_entry_flags_t entry_flags
u8 fml_exp
EXP bits; valid only at imposition.
static void fib_api_next_hop_decode(const vl_api_fib_path_t *in, ip46_address_t *out)
vnet_classify_main_t vnet_classify_main
dpo_id_t frp_dpo
The DPO for use with exclusive paths.
static void fib_api_next_hop_encode(const fib_route_path_t *rpath, vl_api_fib_path_t *fp)
@ FIB_API_PATH_TYPE_CLASSIFY
ip46_address_t frp_addr
The next-hop address.
fib_rpf_id_t frp_rpf_id
The RPF-ID.
@ FIB_API_PATH_TYPE_ICMP_UNREACH
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
mpls_eos_bit_t frp_eos
EOS bit for the resolving label.
u32 frp_sw_if_index
The interface.
static int fib_api_path_nh_proto_to_dpo(vl_api_fib_path_nh_proto_t pp, dpo_proto_t *dproto)
@ FIB_API_PATH_NH_PROTO_BIER
void vl_api_fib_source_add_t_handler(vl_api_fib_source_add_t *mp)
void * vl_msg_api_alloc_zero(int nbytes)
void vl_api_fib_source_dump_t_handler(vl_api_fib_source_dump_t *mp)
dpo_proto_t frp_proto
The protocol of the address below.
static clib_error_t * fib_api_hookup(vlib_main_t *vm)
u8 * format_vl_api_fib_path(u8 *s, va_list *args)
void fib_api_path_encode(const fib_route_path_t *rpath, vl_api_fib_path_t *out)
Encode and decode functions from the API types to internal types.
@ FIB_ROUTE_PATH_DVR
A path that resolves via a DVR DPO.
fib_mpls_label_t * frp_label_stack
The outgoing MPLS label Stack.
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
static void setup_message_id_table(api_main_t *am)
@ FIB_API_PATH_NH_PROTO_IP4
vl_api_address_family_t fib_proto_to_api_address_family(fib_protocol_t fproto)
enum fib_entry_flag_t_ fib_entry_flag_t
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
@ FIB_ROUTE_PATH_INTF_RX
A path that result in received traffic being recieved/recirculated so that it appears to have arrived...
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
vl_api_registration_t * reg
vnet_main_t * vnet_get_main(void)
int fib_proto_from_api_address_family(vl_api_address_family_t af, fib_protocol_t *out)
An API client registration, only in vpp/vlib.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
@ FIB_ROUTE_PATH_SOURCE_LOOKUP
A deag path using the packet's source not destination address.
@ FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED
int fib_api_route_add_del(u8 is_add, u8 is_multipath, u32 fib_index, const fib_prefix_t *prefix, fib_source_t src, fib_entry_flag_t entry_flags, fib_route_path_t *rpaths)
Adding routes from the API.
@ FIB_ROUTE_PATH_RESOLVE_VIA_HOST
Recursion constraint of via a host prefix.
u32 frp_classify_table_id
Classify table ID.
@ FIB_ROUTE_PATH_DEAG
A path that resolves via another table.
u8 * format_vl_api_address_union(u8 *s, va_list *args)
@ FIB_ROUTE_PATH_UDP_ENCAP
A path via a UDP encap object.
vnet_feature_config_main_t * cm
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
@ FIB_ROUTE_PATH_RPF_ID
A local path with a RPF-ID => multicast traffic.
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
enum fib_source_behaviour_t_ fib_source_behaviour_t
Each source has a defined behaviour that controls how entries behave that have that source.
static vl_api_fib_path_nh_proto_t fib_api_path_dpo_proto_to_nh(dpo_proto_t dproto)
VLIB_API_INIT_FUNCTION(fib_api_hookup)
fib_source_t fib_source_allocate(const char *name, fib_source_priority_t prio, fib_source_behaviour_t bh)
vnet_sw_interface_t * sw_interfaces
int fib_api_table_id_decode(fib_protocol_t fproto, u32 table_id, u32 *fib_index)
static u8 ip46_address_is_zero(const ip46_address_t *ip46)
@ FIB_SOURCE_BH_API
add paths with [mpls] path extensions
void fib_source_walk(fib_source_walk_t fn, void *ctx)
mpls_label_t fml_value
The label value.
u8 fib_source_priority_t
Each source is assigned a priority.
@ FIB_API_PATH_NH_PROTO_ETHERNET
#define vec_free(V)
Free vector's memory (no header).
@ FIB_ROUTE_PATH_RESOLVE_VIA_ATTACHED
Recursion constraint of via an attahced prefix.
fib_route_path_flags_t frp_flags
flags on the path
index_t bier_disp_table_find(u32 table_id)
fib_protocol_t dpo_proto_to_fib(dpo_proto_t dpo_proto)
fib_node_index_t fib_table_entry_path_add2(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, fib_route_path_t *rpaths)
Add n paths to an entry (aka route) in the FIB.
u32 mfib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
@ FIB_ROUTE_PATH_POP_PW_CW
Pop a Psuedo Wire Control Word.
description fragment has unexpected format
u32 mfib_table_get_table_id(u32 fib_index, fib_protocol_t proto)
Get the Table-ID of the FIB from protocol and index.
@ FIB_MPLS_LSP_MODE_UNIFORM
Uniform mode.
@ FIB_API_PATH_FLAG_RESOLVE_VIA_HOST
@ FIB_API_PATH_TYPE_INTERFACE_RX
@ FIB_API_PATH_NH_PROTO_IP6
void fib_table_entry_path_remove2(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_route_path_t *rpaths)
Remove n paths to an entry (aka route) in the FIB.
A representation of a path as described by a route producer.
struct fib_source_dump_ctx_t_ fib_source_dump_ctx_t
@ FIB_API_PATH_TYPE_UDP_ENCAP
@ FIB_API_PATH_TYPE_BIER_IMP
fib_mpls_lsp_mode_t fml_mode
The LSP mode.
@ FIB_ROUTE_PATH_ICMP_UNREACH
struct _vnet_classify_main vnet_classify_main_t
static u16 fib_base_msg_id
@ FIB_API_PATH_FLAG_POP_PW_CW
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static walk_rc_t send_fib_source(fib_source_t id, const char *name, fib_source_priority_t prio, fib_source_behaviour_t bh, void *data)
@ FIB_API_PATH_TYPE_NORMAL
@ FIB_API_PATH_TYPE_ICMP_PROHIBIT
@ FIB_API_PATH_TYPE_LOCAL
int fib_api_mtable_id_decode(fib_protocol_t fproto, u32 table_id, u32 *fib_index)
@ FIB_ROUTE_PATH_DROP
A Drop path - resolve the path on the drop DPO.
enum fib_source_t_ fib_source_t
The different sources that can create a route.
u8 frp_preference
A path preference.
u32 frp_udp_encap_id
UDP encap ID.
@ FIB_ROUTE_PATH_BIER_IMP
A path that resolves via a BIER impostion object.
@ FIB_MPLS_LSP_MODE_PIPE
Pipe Mode - the default.
@ FIB_API_PATH_NH_PROTO_MPLS
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
int fib_api_path_decode(vl_api_fib_path_t *in, fib_route_path_t *out)
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
mpls_label_t frp_local_label
The MPLS local Label to reursively resolve through.
enum walk_rc_t_ walk_rc_t
Walk return code.
@ FIB_ROUTE_PATH_CLASSIFY
Aggregate type for a prefix.
@ FIB_API_PATH_TYPE_SOURCE_LOOKUP
@ FIB_ROUTE_PATH_LOCAL
A for-us/local path.
vnet_interface_main_t interface_main
fib_node_index_t fib_table_entry_update(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, fib_route_path_t *paths)
Update an entry to have a new set of paths.