16 #ifndef __FIB_TYPES_H__ 17 #define __FIB_TYPES_H__ 29 #define FIB_NODE_INDEX_INVALID ((fib_node_index_t)(~0)) 38 } __attribute__ ((packed)) fib_protocol_t;
40 #define FIB_PROTOCOLS { \ 41 [FIB_PROTOCOL_IP4] = "ipv4", \ 42 [FIB_PROTOCOL_IP6] = "ipv6", \ 43 [FIB_PROTOCOL_MPLS] = "MPLS", \ 50 #define FIB_PROTOCOL_MAX (FIB_PROTOCOL_MPLS + 1) 55 #define FIB_PROTOCOL_NONE (FIB_PROTOCOL_MAX+1) 57 #define FOR_EACH_FIB_PROTOCOL(_item) \ 58 for (_item = FIB_PROTOCOL_IP4; \ 59 _item <= FIB_PROTOCOL_MPLS; \ 62 #define FOR_EACH_FIB_IP_PROTOCOL(_item) \ 63 for (_item = FIB_PROTOCOL_IP4; \ 64 _item <= FIB_PROTOCOL_IP6; \ 116 } __attribute__ ((packed)) fib_forward_chain_type_t;
118 #define FIB_FORW_CHAINS { \ 119 [FIB_FORW_CHAIN_TYPE_ETHERNET] = "ethernet", \ 120 [FIB_FORW_CHAIN_TYPE_UNICAST_IP4] = "unicast-ip4", \ 121 [FIB_FORW_CHAIN_TYPE_UNICAST_IP6] = "unicast-ip6", \ 122 [FIB_FORW_CHAIN_TYPE_MCAST_IP4] = "multicast-ip4", \ 123 [FIB_FORW_CHAIN_TYPE_MCAST_IP6] = "multicast-ip6", \ 124 [FIB_FORW_CHAIN_TYPE_MPLS_NON_EOS] = "mpls-neos", \ 125 [FIB_FORW_CHAIN_TYPE_MPLS_EOS] = "mpls-eos", \ 126 [FIB_FORW_CHAIN_TYPE_NSH] = "nsh", \ 129 #define FIB_FORW_CHAIN_NUM (FIB_FORW_CHAIN_TYPE_NSH+1) 130 #define FIB_FORW_CHAIN_MPLS_NUM (FIB_FORW_CHAIN_TYPE_MPLS_EOS+1) 132 #define FOR_EACH_FIB_FORW_CHAIN(_item) \ 133 for (_item = FIB_FORW_CHAIN_TYPE_UNICAST_IP4; \ 134 _item <= FIB_FORW_CHAIN_TYPE_NSH; \ 137 #define FOR_EACH_FIB_FORW_MPLS_CHAIN(_item) \ 138 for (_item = FIB_FORW_CHAIN_TYPE_UNICAST_IP4; \ 139 _item <= FIB_FORW_CHAIN_TYPE_MPLS_EOS; \ 199 "FIB Prefix's address is 4 byte aligned.");
253 } __attribute__ ((packed)) fib_special_type_t;
258 #define FIB_SPEICAL_TYPE_MAX (FIB_SPEICAL_TYPE_LAST + 1) 260 #define FOR_EACH_FIB_SPEICAL_TYPE(_item) \ 261 for (_item = FIB_TYPE_SPEICAL_FIRST; \ 262 _item <= FIB_SPEICAL_TYPE_LAST; _item++) 317 #define MFIB_RPF_ID_NONE (0) fib_protocol_t fp_proto
protocol type
Contribute an object that is to be used to forward IP6 packets.
ip46_address_t frp_addr
The next-hop address.
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.
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.
vnet_link_t fib_forw_chain_type_to_link_type(fib_forward_chain_type_t fct)
Convert from a chain type to the adjacencies link type.
u32 mpls_label_t
A label value only, i.e.
u8 * format_fib_protocol(u8 *s, va_list ap)
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)
dpo_proto_t frp_proto
The protocol of the address below.
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...
u32 frp_sw_if_index
The interface.
fib_special_type_t_
Enurmeration of special path/entry types.
mpls_label_t * frp_label_stack
The outgoing MPLS label Stack.
Recursion constraint of via a host prefix.
Aggregrate type for a prefix.
enum fib_route_path_flags_t_ fib_route_path_flags_t
Path flags from the control plane.
u8 * format_vnet_link(u8 *s, va_list ap)
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.")
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.
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
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.
u32 fib_rpf_id_t
An RPF-ID is numerical value that is used RPF validate.
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.
fib_route_path_flags_t frp_flags
flags on the path
int fib_prefix_cmp(const fib_prefix_t *p1, const fib_prefix_t *p2)
Compare two prefixes for equality.
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
A path extension is a per-entry addition to the forwarding information when packets are sent for that...
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
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