16 #ifndef __FIB_TYPES_H__ 17 #define __FIB_TYPES_H__ 31 #define FIB_NODE_INDEX_INVALID ((fib_node_index_t)(~0)) 42 #define FIB_PROTOCOLS { \ 43 [FIB_PROTOCOL_IP4] = "ipv4", \ 44 [FIB_PROTOCOL_IP6] = "ipv6", \ 45 [FIB_PROTOCOL_MPLS] = "MPLS", \ 52 #define FIB_PROTOCOL_MAX (FIB_PROTOCOL_MPLS + 1) 58 #define FIB_PROTOCOL_IP_MAX (FIB_PROTOCOL_IP6 + 1) 63 #define FIB_PROTOCOL_NONE (FIB_PROTOCOL_MAX+1) 65 #define FOR_EACH_FIB_PROTOCOL(_item) \ 66 for (_item = FIB_PROTOCOL_IP4; \ 67 _item <= FIB_PROTOCOL_MPLS; \ 70 #define FOR_EACH_FIB_IP_PROTOCOL(_item) \ 71 for (_item = FIB_PROTOCOL_IP4; \ 72 _item <= FIB_PROTOCOL_IP6; \ 79 static inline fib_protocol_t
150 #define FIB_FORW_CHAINS { \ 151 [FIB_FORW_CHAIN_TYPE_ETHERNET] = "ethernet", \ 152 [FIB_FORW_CHAIN_TYPE_BIER] = "bier", \ 153 [FIB_FORW_CHAIN_TYPE_UNICAST_IP4] = "unicast-ip4", \ 154 [FIB_FORW_CHAIN_TYPE_UNICAST_IP6] = "unicast-ip6", \ 155 [FIB_FORW_CHAIN_TYPE_MCAST_IP4] = "multicast-ip4", \ 156 [FIB_FORW_CHAIN_TYPE_MCAST_IP6] = "multicast-ip6", \ 157 [FIB_FORW_CHAIN_TYPE_MPLS_NON_EOS] = "mpls-neos", \ 158 [FIB_FORW_CHAIN_TYPE_MPLS_EOS] = "mpls-eos", \ 159 [FIB_FORW_CHAIN_TYPE_NSH] = "nsh", \ 162 #define FIB_FORW_CHAIN_NUM (FIB_FORW_CHAIN_TYPE_NSH+1) 163 #define FIB_FORW_CHAIN_MPLS_NUM (FIB_FORW_CHAIN_TYPE_MPLS_EOS+1) 165 #define FOR_EACH_FIB_FORW_CHAIN(_item) \ 166 for (_item = FIB_FORW_CHAIN_TYPE_UNICAST_IP4; \ 167 _item <= FIB_FORW_CHAIN_TYPE_NSH; \ 170 #define FOR_EACH_FIB_FORW_MPLS_CHAIN(_item) \ 171 for (_item = FIB_FORW_CHAIN_TYPE_UNICAST_IP4; \ 172 _item <= FIB_FORW_CHAIN_TYPE_MPLS_EOS; \ 242 "FIB Prefix's address is 4 byte aligned.");
312 #define FIB_SPEICAL_TYPE_MAX (FIB_SPEICAL_TYPE_LAST + 1) 314 #define FOR_EACH_FIB_SPEICAL_TYPE(_item) \ 315 for (_item = FIB_TYPE_SPEICAL_FIRST; \ 316 _item <= FIB_SPEICAL_TYPE_LAST; _item++) 408 #define MFIB_RPF_ID_NONE (0) 427 #define FIB_MPLS_LSP_MODES { \ 428 [FIB_MPLS_LSP_MODE_PIPE] = "pipe", \ 429 [FIB_MPLS_LSP_MODE_UNIFORM] = "uniform", \ 606 #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_protocol_t fp_proto
protocol type
Contribute an object that is to be used to forward BIER packets.
dpo_id_t frp_dpo
The DPO for use with exclusive paths.
Contribute an object that is to be used to forward IP6 packets.
ip46_address_t frp_addr
The next-hop address.
A path that resolves via a DVR DPO.
Contribute an object that is to be used to forward IP6 packets.
mpls_eos_bit_t frp_eos
EOS bit for the resolving label.
A representation of a path as described by a route producer.
A Drop path - resolve the path on the drop DPO.
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.
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.
u32 frp_mitf_flags
MFIB interface flags.
u8 * format_vnet_link(u8 *s, va_list *ap)
A path that resolves via a BIER impostion object.
index_t frp_bier_imp
A path via a BIER imposition object.
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.
u32 mpls_label_t
A label value only, i.e.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
u8 * format_fib_mpls_lsp_mode(u8 *s, va_list *ap)
Format an LSP mode type.
A path that resolves via a BIER [ECMP] Table.
struct fib_path_ext_t_ * fpel_exts
Contribute an object that is to be used to forward IP4 packets.
#define STRUCT_OFFSET_OF(t, f)
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.
dpo_proto_t frp_proto
The protocol of the address below.
bier_table_id_t frp_bier_tbl
A path that resolves via a BIER Table.
A path that result in received traffic being recieved/recirculated so that it appears to have arrived...
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
fib_rpf_id_t frp_rpf_id
The RPF-ID.
A local path with a RPF-ID => multicast traffic.
dpo_proto_t fp_payload_proto
This protocol determines the payload protocol of packets that will be forwarded by this entry once th...
fib_mpls_lsp_mode_t_
MPLS LSP mode - only valid at the head and tail.
u32 frp_sw_if_index
The interface.
fib_special_type_t_
Enurmeration of special path/entry types.
Recursion constraint of via a host prefix.
Aggregate type for a prefix.
A path via a UDP encap object.
enum fib_route_path_flags_t_ fib_route_path_flags_t
Path flags from the control plane.
Contribute an object that is to be used to forward Ethernet packets.
enum dpo_proto_t_ dpo_proto_t
Data path protocol.
u16 fp_len
The mask length.
STATIC_ASSERT(STRUCT_OFFSET_OF(fib_prefix_t, fp_addr)==4, "FIB Prefix's address is 4 byte aligned.")
enum fib_special_type_t_ fib_special_type_t
Enurmeration of special path/entry types.
index_t frp_bier_fmask
Resolving via a BIER Fmask.
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
Contribute an object that is to be used to forward end-of-stack MPLS packets.
fib_protocol_t_
Protocol Type.
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
u8 fib_prefix_get_host_length(fib_protocol_t proto)
enum fib_mpls_lsp_mode_t_ fib_mpls_lsp_mode_t
MPLS LSP mode - only valid at the head and tail.
u8 * format_fib_prefix(u8 *s, va_list *args)
int fib_prefix_is_cover(const fib_prefix_t *p1, const fib_prefix_t *p2)
Compare two prefixes for covering relationship.
Configuration for each label value in the output-stack.
fib_mpls_label_t * frp_label_stack
The outgoing MPLS label Stack.
Recursion constraint of via an attahced prefix.
struct fib_route_path_t_ fib_route_path_t
A representation of a path as described by a route producer.
A list of path-extensions.
fib_protocol_t dpo_proto_to_fib(dpo_proto_t dpo_proto)
fib_path_list_walk_rc_t_
return code to control pat-hlist walk
dpo_id_t dpo
Exclusive DPO.
fib_mpls_lsp_mode_t fml_mode
The LSP mode.
Pop a Psuedo Wire Control Word.
uword unformat_fib_route_path(unformat_input_t *input, va_list *args)
Unformat a fib_route_path_t from CLI input.
struct fib_path_ext_list_t_ fib_path_ext_list_t
A list of path-extensions.
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.
u32 frp_classify_table_id
Classify table ID.
struct fib_prefix_t_ fib_prefix_t
Aggregate type for a prefix.
Contribute an object that is to be used to forward NSH packets.
u32 fib_node_index_t
A typedef of a node index.
Don't resolve the path, use the DPO the client provides.
mpls_label_t fml_value
The label value.
enum bier_hdr_proto_id_t_ bier_hdr_proto_id_t
BIER header protocol payload types.
u8 * format_fib_mpls_label(u8 *s, va_list *ap)
Format an MPLS label.
u32 fib_rpf_id_t
An RPF-ID is numerical value that is used RPF validate.
u8 * format_fib_protocol(u8 *s, va_list *ap)
struct fib_mpls_label_t_ fib_mpls_label_t
Configuration for each label value in the output-stack.
vnet_link_t fib_proto_to_link(fib_protocol_t proto)
Convert from a protocol to a link type.
void fib_prefix_copy(fib_prefix_t *dst, const fib_prefix_t *src)
Copy a prefix.
enum vnet_link_t_ vnet_link_t
Link Type: A description of the protocol of packets on the link.
u8 frp_preference
A path preference.
A deag path using the packet's source not destination address.
enum fib_forward_chain_type_t_ fib_forward_chain_type_t
FIB output chain type.
fib_route_path_flags_t frp_flags
flags on the path
A path that resolves via a BIER F-Mask.
int fib_prefix_cmp(const fib_prefix_t *p1, const fib_prefix_t *p2)
Compare two prefixes for equality.
A path that resolves via another table.
void fib_prefix_from_ip46_addr(const ip46_address_t *addr, fib_prefix_t *pfx)
Host prefix from ip.
u8 * format_fib_forw_chain_type(u8 *s, va_list *args)
mpls_label_t frp_local_label
The MPLS local Label to reursively resolve through.
dpo_proto_t fib_proto_to_dpo(fib_protocol_t fib_proto)
enum fib_path_list_walk_rc_t_ fib_path_list_walk_rc_t
return code to control pat-hlist walk
fib_protocol_t fib_proto_from_ip46(ip46_type_t iproto)
Convert from ip46_type to fib_protocol.
static fib_protocol_t fib_ip_proto(bool is_ip6)
Convert from boolean is_ip6 to FIB protocol.
u32 frp_bier_fib_index
The BIER table to resolve the fmask in.
fib_protocol_t bier_hdr_proto_to_fib(bier_hdr_proto_id_t bproto)
Convert from BIER next-hop proto to FIB proto.
A path extension is a per-entry addition to the forwarding information when packets are sent for that...
u8 fml_exp
EXP bits; valid only at imposition.
int fib_prefix_is_host(const fib_prefix_t *p)
Return true is the prefix is a host prefix.
Contribute an object that is to be used to forward non-end-of-stack MPLS packets. ...
fib_route_path_flags_t_
Path flags from the control plane.
u8 frp_weight
[un]equal cost path weight
u32 frp_udp_encap_id
UDP encap ID.
Contribute an object that is to be used to forward IP4 packets.
u32 frp_fib_index
The FIB index to lookup the nexthop Only valid for recursive paths.
ip46_type_t fib_proto_to_ip46(fib_protocol_t fproto)
Convert from fib_protocol to ip46_type.
fib_forward_chain_type_t_
FIB output chain type.
enum mpls_eos_bit_t_ mpls_eos_bit_t