16 #ifndef __FIB_TYPES_H__ 17 #define __FIB_TYPES_H__ 31 #define FIB_NODE_INDEX_INVALID ((fib_node_index_t)(~0)) 40 } __attribute__ ((packed)) fib_protocol_t;
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
138 } __attribute__ ((packed)) fib_forward_chain_type_t;
140 #define FIB_FORW_CHAINS { \ 141 [FIB_FORW_CHAIN_TYPE_ETHERNET] = "ethernet", \ 142 [FIB_FORW_CHAIN_TYPE_BIER] = "bier", \ 143 [FIB_FORW_CHAIN_TYPE_UNICAST_IP4] = "unicast-ip4", \ 144 [FIB_FORW_CHAIN_TYPE_UNICAST_IP6] = "unicast-ip6", \ 145 [FIB_FORW_CHAIN_TYPE_MCAST_IP4] = "multicast-ip4", \ 146 [FIB_FORW_CHAIN_TYPE_MCAST_IP6] = "multicast-ip6", \ 147 [FIB_FORW_CHAIN_TYPE_MPLS_NON_EOS] = "mpls-neos", \ 148 [FIB_FORW_CHAIN_TYPE_MPLS_EOS] = "mpls-eos", \ 149 [FIB_FORW_CHAIN_TYPE_NSH] = "nsh", \ 152 #define FIB_FORW_CHAIN_NUM (FIB_FORW_CHAIN_TYPE_NSH+1) 153 #define FIB_FORW_CHAIN_MPLS_NUM (FIB_FORW_CHAIN_TYPE_MPLS_EOS+1) 155 #define FOR_EACH_FIB_FORW_CHAIN(_item) \ 156 for (_item = FIB_FORW_CHAIN_TYPE_UNICAST_IP4; \ 157 _item <= FIB_FORW_CHAIN_TYPE_NSH; \ 160 #define FOR_EACH_FIB_FORW_MPLS_CHAIN(_item) \ 161 for (_item = FIB_FORW_CHAIN_TYPE_UNICAST_IP4; \ 162 _item <= FIB_FORW_CHAIN_TYPE_MPLS_EOS; \ 232 "FIB Prefix's address is 4 byte aligned.");
291 } __attribute__ ((packed)) fib_special_type_t;
296 #define FIB_SPEICAL_TYPE_MAX (FIB_SPEICAL_TYPE_LAST + 1) 298 #define FOR_EACH_FIB_SPEICAL_TYPE(_item) \ 299 for (_item = FIB_TYPE_SPEICAL_FIRST; \ 300 _item <= FIB_SPEICAL_TYPE_LAST; _item++) 383 #define MFIB_RPF_ID_NONE (0) 400 } __attribute__((packed)) fib_mpls_lsp_mode_t;
402 #define FIB_MPLS_LSP_MODES { \ 403 [FIB_MPLS_LSP_MODE_PIPE] = "pipe", \ 404 [FIB_MPLS_LSP_MODE_UNIFORM] = "uniform", \ 563 #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.
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.
A representation of a fib path for fib_path_encode to convey the information to the caller...
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.
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...
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.
Aggregrate 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.")
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 * 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
fib_mpls_lsp_mode_t fml_mode
The LSP mode.
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.
struct fib_route_path_encode_t_ fib_route_path_encode_t
A representation of a fib path for fib_path_encode to convey the information to the caller...
struct fib_prefix_t_ fib_prefix_t
Aggregrate 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.
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.
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
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.
fib_forward_chain_type_t_
FIB output chain type.
enum mpls_eos_bit_t_ mpls_eos_bit_t