|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
16 #ifndef __FIB_TYPES_H__
17 #define __FIB_TYPES_H__
30 #define FIB_NODE_INDEX_INVALID ((fib_node_index_t)(~0))
41 #define FIB_PROTOCOLS { \
42 [FIB_PROTOCOL_IP4] = "ipv4", \
43 [FIB_PROTOCOL_IP6] = "ipv6", \
44 [FIB_PROTOCOL_MPLS] = "MPLS", \
51 #define FIB_PROTOCOL_MAX (FIB_PROTOCOL_MPLS + 1)
57 #define FIB_PROTOCOL_IP_MAX (FIB_PROTOCOL_IP6 + 1)
62 #define FIB_PROTOCOL_NONE (FIB_PROTOCOL_MAX+1)
64 #define FOR_EACH_FIB_PROTOCOL(_item) \
65 for (_item = FIB_PROTOCOL_IP4; \
66 _item <= FIB_PROTOCOL_MPLS; \
69 #define FOR_EACH_FIB_IP_PROTOCOL(_item) \
70 for (_item = FIB_PROTOCOL_IP4; \
71 _item <= FIB_PROTOCOL_IP6; \
149 #define FIB_FORW_CHAINS { \
150 [FIB_FORW_CHAIN_TYPE_ETHERNET] = "ethernet", \
151 [FIB_FORW_CHAIN_TYPE_BIER] = "bier", \
152 [FIB_FORW_CHAIN_TYPE_UNICAST_IP4] = "unicast-ip4", \
153 [FIB_FORW_CHAIN_TYPE_UNICAST_IP6] = "unicast-ip6", \
154 [FIB_FORW_CHAIN_TYPE_MCAST_IP4] = "multicast-ip4", \
155 [FIB_FORW_CHAIN_TYPE_MCAST_IP6] = "multicast-ip6", \
156 [FIB_FORW_CHAIN_TYPE_MPLS_NON_EOS] = "mpls-neos", \
157 [FIB_FORW_CHAIN_TYPE_MPLS_EOS] = "mpls-eos", \
158 [FIB_FORW_CHAIN_TYPE_NSH] = "nsh", \
161 #define FIB_FORW_CHAIN_NUM (FIB_FORW_CHAIN_TYPE_NSH+1)
162 #define FIB_FORW_CHAIN_MPLS_NUM (FIB_FORW_CHAIN_TYPE_MPLS_EOS+1)
164 #define FOR_EACH_FIB_FORW_CHAIN(_item) \
165 for (_item = FIB_FORW_CHAIN_TYPE_UNICAST_IP4; \
166 _item <= FIB_FORW_CHAIN_TYPE_NSH; \
169 #define FOR_EACH_FIB_FORW_MPLS_CHAIN(_item) \
170 for (_item = FIB_FORW_CHAIN_TYPE_UNICAST_IP4; \
171 _item <= FIB_FORW_CHAIN_TYPE_MPLS_EOS; \
241 "FIB Prefix's address is 4 byte aligned.");
318 #define FIB_SPEICAL_TYPE_MAX (FIB_SPEICAL_TYPE_LAST + 1)
320 #define FOR_EACH_FIB_SPEICAL_TYPE(_item) \
321 for (_item = FIB_TYPE_SPEICAL_FIRST; \
322 _item <= FIB_SPEICAL_TYPE_LAST; _item++)
423 #define MFIB_RPF_ID_NONE (0)
442 #define FIB_MPLS_LSP_MODES { \
443 [FIB_MPLS_LSP_MODE_PIPE] = "pipe", \
444 [FIB_MPLS_LSP_MODE_UNIFORM] = "uniform", \
630 #define FIB_ROUTE_PATH_HELP "[next-hop-address] [next-hop-interface] [next-hop-table <value>] [weight <value>] [preference <value>] [udp-encap-id <value>] [ip4-lookup-in-table <value>] [ip6-lookup-in-table <value>] [mpls-lookup-in-table <value>] [resolve-via-host] [resolve-via-connected] [rx-ip4 <interface>] [out-labels <value value value>]"
fib_special_type_t_
Enurmeration of special path/entry types.
u32 frp_fib_index
The FIB index to lookup the nexthop Only valid for recursive paths.
int fib_prefix_cmp(const fib_prefix_t *p1, const fib_prefix_t *p2)
Compare two prefixes for equality.
u32 frp_mitf_flags
MFIB interface flags.
u8 * format_fib_protocol(u8 *s, va_list *ap)
static fib_protocol_t fib_ip_proto(bool is_ip6)
Convert from boolean is_ip6 to FIB protocol.
void fib_prefix_copy(fib_prefix_t *dst, const fib_prefix_t *src)
Copy a prefix.
index_t frp_bier_imp
A path via a BIER imposition object.
struct fib_prefix_t_ fib_prefix_t
Aggregate type for a prefix.
struct fib_route_path_t_ fib_route_path_t
A representation of a path as described by a route producer.
u8 frp_weight
[un]equal cost path weight
enum dpo_proto_t_ dpo_proto_t
Data path protocol.
@ FIB_ROUTE_PATH_ICMP_PROHIBIT
u8 fml_exp
EXP bits; valid only at imposition.
bier_table_id_t frp_bier_tbl
A path that resolves via a BIER Table.
fib_mpls_lsp_mode_t_
MPLS LSP mode - only valid at the head and tail.
@ FIB_FORW_CHAIN_TYPE_MPLS_EOS
Contribute an object that is to be used to forward end-of-stack MPLS packets.
u8 * format_fib_forw_chain_type(u8 *s, va_list *args)
dpo_id_t frp_dpo
The DPO for use with exclusive paths.
enum fib_path_list_walk_rc_t_ fib_path_list_walk_rc_t
return code to control pat-hlist walk
ip46_address_t frp_addr
The next-hop address.
@ FIB_FORW_CHAIN_TYPE_MCAST_IP4
Contribute an object that is to be used to forward IP4 packets.
fib_rpf_id_t frp_rpf_id
The RPF-ID.
enum fib_special_type_t_ fib_special_type_t
Enurmeration of special path/entry types.
@ FIB_FORW_CHAIN_TYPE_ETHERNET
Contribute an object that is to be used to forward Ethernet packets.
u16 fp_len
The mask length.
mpls_eos_bit_t frp_eos
EOS bit for the resolving label.
u32 frp_sw_if_index
The interface.
index_t frp_bier_fmask
Resolving via a BIER Fmask.
dpo_proto_t frp_proto
The protocol of the address below.
vnet_link_t fib_proto_to_link(fib_protocol_t proto)
Convert from a protocol to a link type.
fib_forward_chain_type_t fib_forw_chain_type_from_dpo_proto(dpo_proto_t proto)
Convert from a payload-protocol to a chain type.
u8 * format_vnet_link(u8 *s, va_list *ap)
@ FIB_SPECIAL_TYPE_DROP
drop paths
@ FIB_ROUTE_PATH_DVR
A path that resolves via a DVR DPO.
struct fib_path_ext_t_ * fpel_exts
fib_mpls_label_t * frp_label_stack
The outgoing MPLS label Stack.
@ FIB_FORW_CHAIN_TYPE_NSH
Contribute an object that is to be used to forward NSH packets.
@ FIB_FORW_CHAIN_TYPE_UNICAST_IP4
Contribute an object that is to be used to forward IP4 packets.
#define STRUCT_OFFSET_OF(t, f)
@ FIB_SPECIAL_TYPE_LAST
Marker.
int fib_route_path_is_attached(const fib_route_path_t *rpath)
u32 fib_rpf_id_t
An RPF-ID is numerical value that is used RPF validate.
uword unformat_fib_route_path(unformat_input_t *input, va_list *args)
Unformat a fib_route_path_t from CLI input.
dpo_proto_t fib_forw_chain_type_to_dpo_proto(fib_forward_chain_type_t fct)
Convert from a chain type to the DPO proto it will install.
@ FIB_ROUTE_PATH_INTF_RX
A path that result in received traffic being recieved/recirculated so that it appears to have arrived...
void fib_prefix_from_ip46_addr(const ip46_address_t *addr, fib_prefix_t *pfx)
Host prefix from ip.
enum fib_forward_chain_type_t_ fib_forward_chain_type_t
FIB output chain type.
struct fib_path_ext_list_t_ fib_path_ext_list_t
A list of path-extensions.
fib_protocol_t fib_proto_from_ip46(ip46_type_t iproto)
Convert from ip46_type to fib_protocol.
void fib_prefix_normalize(const fib_prefix_t *p, fib_prefix_t *out)
normalise a prefix (i.e.
@ FIB_ROUTE_PATH_BIER_TABLE
A path that resolves via a BIER [ECMP] Table.
A list of path-extensions.
fib_forward_chain_type_t fib_forw_chain_type_from_link_type(vnet_link_t lt)
Convert from a adjacency's link type to chain type.
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.
u32 fib_node_index_t
A typedef of a node index.
@ 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.
enum fib_mpls_lsp_mode_t_ fib_mpls_lsp_mode_t
MPLS LSP mode - only valid at the head and tail.
@ FIB_ROUTE_PATH_UDP_ENCAP
A path via a UDP encap object.
int fib_prefix_is_host(const fib_prefix_t *p)
Return true is the prefix is a host prefix.
dpo_proto_t fp_payload_proto
This protocol determines the payload protocol of packets that will be forwarded by this entry once th...
@ FIB_ROUTE_PATH_RPF_ID
A local path with a RPF-ID => multicast traffic.
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
@ FIB_PATH_LIST_WALK_STOP
struct fib_mpls_label_t_ fib_mpls_label_t
Configuration for each label value in the output-stack.
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
u8 * format_fib_route_path(u8 *s, va_list *ap)
Format route path flags.
@ FIB_PATH_LIST_WALK_CONTINUE
enum bier_hdr_proto_id_t_ bier_hdr_proto_id_t
BIER header protocol payload types.
mpls_label_t fml_value
The label value.
dpo_proto_t fib_proto_to_dpo(fib_protocol_t fib_proto)
@ FIB_SPECIAL_TYPE_FIRST
Marker.
fib_protocol_t bier_hdr_proto_to_fib(bier_hdr_proto_id_t bproto)
Convert from BIER next-hop proto to FIB proto.
@ FIB_ROUTE_PATH_RESOLVE_VIA_ATTACHED
Recursion constraint of via an attahced prefix.
STATIC_ASSERT(STRUCT_OFFSET_OF(fib_prefix_t, fp_addr)==4, "FIB Prefix's address is 4 byte aligned.")
@ FIB_FORW_CHAIN_TYPE_MPLS_NON_EOS
Contribute an object that is to be used to forward non-end-of-stack MPLS packets.
fib_route_path_flags_t frp_flags
flags on the path
@ FIB_ROUTE_PATH_POP_PW_CW
Pop a Psuedo Wire Control Word.
dpo_id_t dpo
Exclusive DPO.
@ FIB_ROUTE_PATH_FLAG_NONE
@ FIB_MPLS_LSP_MODE_UNIFORM
Uniform mode.
u8 fib_prefix_get_host_length(fib_protocol_t proto)
A representation of a path as described by a route producer.
fib_forward_chain_type_t_
FIB output chain type.
fib_mpls_lsp_mode_t fml_mode
The LSP mode.
@ FIB_ROUTE_PATH_ICMP_UNREACH
fib_route_path_flags_t_
Path flags from the control plane.
@ FIB_ROUTE_PATH_ATTACHED
Attached path.
@ FIB_FORW_CHAIN_TYPE_BIER
Contribute an object that is to be used to forward BIER packets.
fib_protocol_t fp_proto
protocol type
fib_path_list_walk_rc_t_
return code to control pat-hlist walk
@ FIB_FORW_CHAIN_TYPE_MCAST_IP6
Contribute an object that is to be used to forward IP6 packets.
u8 * format_fib_mpls_lsp_mode(u8 *s, va_list *ap)
Format an LSP mode type.
Configuration for each label value in the output-stack.
enum vnet_link_t_ vnet_link_t
Link Type: A description of the protocol of packets on the link.
fib_protocol_t dpo_proto_to_fib(dpo_proto_t dpo_proto)
u8 * format_fib_route_path_flags(u8 *s, va_list *ap)
Format route path flags.
fib_forward_chain_type_t fib_forw_chain_type_from_fib_proto(fib_protocol_t proto)
Convert from a fib-protocol to a chain type.
@ FIB_ROUTE_PATH_GLEAN
A path that resolves via a glean adjacency.
ip46_type_t fib_proto_to_ip46(fib_protocol_t fproto)
Convert from fib_protocol to ip46_type.
fib_protocol_t_
Protocol Type.
A path extension is a per-entry addition to the forwarding information when packets are sent for that...
enum fib_route_path_flags_t_ fib_route_path_flags_t
Path flags from the control plane.
@ FIB_ROUTE_PATH_DROP
A Drop path - resolve the path on the drop DPO.
u8 * format_fib_prefix(u8 *s, va_list *args)
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
@ FIB_SPECIAL_TYPE_LOCAL
Local/for-us paths.
u32 mpls_label_t
A label value only, i.e.
u8 frp_preference
A path preference.
u32 frp_udp_encap_id
UDP encap ID.
int fib_prefix_is_cover(const fib_prefix_t *p1, const fib_prefix_t *p2)
Compare two prefixes for covering relationship.
@ FIB_ROUTE_PATH_EXCLUSIVE
Don't resolve the path, use the DPO the client provides.
@ FIB_ROUTE_PATH_BIER_IMP
A path that resolves via a BIER impostion object.
@ FIB_FORW_CHAIN_TYPE_UNICAST_IP6
Contribute an object that is to be used to forward IP6 packets.
@ FIB_MPLS_LSP_MODE_PIPE
Pipe Mode - the default.
@ FIB_ROUTE_PATH_BIER_FMASK
A path that resolves via a BIER F-Mask.
enum mpls_eos_bit_t_ mpls_eos_bit_t
u8 * format_fib_mpls_label(u8 *s, va_list *ap)
Format an MPLS label.
mpls_label_t frp_local_label
The MPLS local Label to reursively resolve through.
fib_prefix_t frp_connected
Glean prefix on a glean path.
@ FIB_ROUTE_PATH_CLASSIFY
Aggregate type for a prefix.
@ FIB_ROUTE_PATH_LOCAL
A for-us/local path.
vnet_link_t fib_forw_chain_type_to_link_type(fib_forward_chain_type_t fct)
Convert from a chain type to the adjacency's link type.