16 #ifndef __FIB_TYPES_H__ 17 #define __FIB_TYPES_H__ 29 #define FIB_NODE_INDEX_INVALID ((fib_node_index_t)(~0)) 42 } __attribute__ ((packed)) fib_protocol_t;
44 #define FIB_PROTOCOLS { \ 45 [FIB_PROTOCOL_IP4] = "ipv4", \ 46 [FIB_PROTOCOL_IP6] = "ipv6", \ 47 [FIB_PROTOCOL_MPLS] = "MPLS", \ 54 #define FIB_PROTOCOL_MAX (FIB_PROTOCOL_MPLS + 1) 59 #define FIB_PROTOCOL_NONE (FIB_PROTOCOL_MAX+1) 61 #define FOR_EACH_FIB_PROTOCOL(_item) \ 62 for (_item = FIB_PROTOCOL_IP4; \ 63 _item <= FIB_PROTOCOL_MPLS; \ 66 #define FOR_EACH_FIB_IP_PROTOCOL(_item) \ 67 for (_item = FIB_PROTOCOL_IP4; \ 68 _item <= FIB_PROTOCOL_IP6; \ 108 } __attribute__ ((packed)) fib_forward_chain_type_t;
110 #define FIB_FORW_CHAINS { \ 111 [FIB_FORW_CHAIN_TYPE_ETHERNET] = "ethernet", \ 112 [FIB_FORW_CHAIN_TYPE_UNICAST_IP4] = "unicast-ip4", \ 113 [FIB_FORW_CHAIN_TYPE_UNICAST_IP6] = "unicast-ip6", \ 114 [FIB_FORW_CHAIN_TYPE_MPLS_NON_EOS] = "mpls-neos", \ 115 [FIB_FORW_CHAIN_TYPE_MPLS_EOS] = "mpls-eos", \ 118 #define FIB_FORW_CHAIN_NUM (FIB_FORW_CHAIN_TYPE_MPLS_ETHERNET+1) 119 #define FIB_FORW_CHAIN_MPLS_NUM (FIB_FORW_CHAIN_TYPE_MPLS_EOS+1) 121 #define FOR_EACH_FIB_FORW_CHAIN(_item) \ 122 for (_item = FIB_FORW_CHAIN_TYPE_UNICAST_IP4; \ 123 _item <= FIB_FORW_CHAIN_TYPE_ETHERNET; \ 126 #define FOR_EACH_FIB_FORW_MPLS_CHAIN(_item) \ 127 for (_item = FIB_FORW_CHAIN_TYPE_UNICAST_IP4; \ 128 _item <= FIB_FORW_CHAIN_TYPE_MPLS_EOS; \ 188 "FIB Prefix's address is 4 byte aligned.");
236 } __attribute__ ((packed)) fib_special_type_t;
241 #define FIB_SPEICAL_TYPE_MAX (FIB_SPEICAL_TYPE_LAST + 1) 243 #define FOR_EACH_FIB_SPEICAL_TYPE(_item) \ 244 for (_item = FIB_TYPE_SPEICAL_FIRST; \ 245 _item <= FIB_SPEICAL_TYPE_LAST; _item++) fib_protocol_t fp_proto
protocol type
fib_protocol_t frp_proto
The protocol of the address below.
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 path as described by a route producer.
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)
Contribute an object that is to be used to forward IP4 packets.
#define STRUCT_OFFSET_OF(t, f)
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.
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.
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.
fib_protocol_t dpo_proto_to_fib(dpo_proto_t dpo_proto)
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.
dpo_proto_t vnet_link_to_dpo_proto(vnet_link_t linkt)
struct fib_prefix_t_ fib_prefix_t
Aggregrate type for a prefix.
u32 frp_weight
[un]equal cost path weight
u32 fib_node_index_t
A typedef of a node index.
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.
mpls_label_t frp_label
The outgoing MPLS label.
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.
u8 * format_fib_forw_chain_type(u8 *s, va_list *args)
dpo_proto_t fib_proto_to_dpo(fib_protocol_t fib_proto)
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.
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