108 #define IP4_LOOKUP_NEXT_NODES { \ 109 [IP_LOOKUP_NEXT_DROP] = "ip4-drop", \ 110 [IP_LOOKUP_NEXT_PUNT] = "ip4-punt", \ 111 [IP_LOOKUP_NEXT_LOCAL] = "ip4-local", \ 112 [IP_LOOKUP_NEXT_ARP] = "ip4-arp", \ 113 [IP_LOOKUP_NEXT_GLEAN] = "ip4-glean", \ 114 [IP_LOOKUP_NEXT_REWRITE] = "ip4-rewrite", \ 115 [IP_LOOKUP_NEXT_MCAST] = "ip4-rewrite-mcast", \ 116 [IP_LOOKUP_NEXT_BCAST] = "ip4-rewrite-bcast", \ 117 [IP_LOOKUP_NEXT_MIDCHAIN] = "ip4-midchain", \ 118 [IP_LOOKUP_NEXT_MCAST_MIDCHAIN] = "ip4-mcast-midchain", \ 119 [IP_LOOKUP_NEXT_ICMP_ERROR] = "ip4-icmp-error", \ 122 #define IP6_LOOKUP_NEXT_NODES { \ 123 [IP_LOOKUP_NEXT_DROP] = "ip6-drop", \ 124 [IP_LOOKUP_NEXT_PUNT] = "ip6-punt", \ 125 [IP_LOOKUP_NEXT_LOCAL] = "ip6-local", \ 126 [IP_LOOKUP_NEXT_ARP] = "ip6-discover-neighbor", \ 127 [IP_LOOKUP_NEXT_GLEAN] = "ip6-glean", \ 128 [IP_LOOKUP_NEXT_REWRITE] = "ip6-rewrite", \ 129 [IP_LOOKUP_NEXT_BCAST] = "ip6-rewrite-bcast", \ 130 [IP_LOOKUP_NEXT_MCAST] = "ip6-rewrite-mcast", \ 131 [IP_LOOKUP_NEXT_MIDCHAIN] = "ip6-midchain", \ 132 [IP_LOOKUP_NEXT_MCAST_MIDCHAIN] = "ip6-mcast-midchain", \ 133 [IP_LOOKUP_NEXT_ICMP_ERROR] = "ip6-icmp-error", \ 134 [IP6_LOOKUP_NEXT_HOP_BY_HOP] = "ip6-hop-by-hop", \ 135 [IP6_LOOKUP_NEXT_ADD_HOP_BY_HOP] = "ip6-add-hop-by-hop", \ 136 [IP6_LOOKUP_NEXT_POP_HOP_BY_HOP] = "ip6-pop-hop-by-hop", \ 190 #define ADJ_ATTR_NAMES { \ 191 [ADJ_ATTR_SYNC_WALK_ACTIVE] = "walk-active", \ 192 [ADJ_ATTR_MIDCHAIN_NO_COUNT] = "midchain-no-count", \ 193 [ADJ_ATTR_MIDCHAIN_IP_STACK] = "midchain-ip-stack", \ 194 [ADJ_ATTR_MIDCHAIN_LOOPED] = "midchain-looped", \ 195 [ADJ_ATTR_MIDCHAIN_FIXUP_IP4O4_HDR] = "midchain-ip4o4-hdr-fixup", \ 198 #define FOR_EACH_ADJ_ATTR(_attr) \ 199 for (_attr = ADJ_ATTR_SYNC_WALK_ACTIVE; \ 200 _attr <= ADJ_ATTR_MIDCHAIN_FIXUP_IP4O4_HDR; \ 287 u8 __ia_midchain_pad[4];
357 "IP adjacency cacheline 0 is not offset");
360 "IP adjacency cacheline 1 is more than one cacheline size offset");
361 #if defined __x86_64__ 364 "IP adjacency cacheline 3 is more than one cacheline size offset");
476 return (adj_per_adj_counters);
int adj_is_up(adj_index_t ai)
Return true if the adjacency is 'UP', i.e.
adj_flags_t ia_flags
Flags on the adjacency 1-bytes.
Packets TX through the midchain do not increment the interface counters.
u32 adj_child_add(adj_index_t adj_index, fib_node_type_t type, fib_node_index_t child_index)
Add a child dependent to an adjacency.
enum adj_attr_t_ adj_attr_t
Flags on an IP adjacency.
adj_flags_t_
Flags on an IP adjacency.
This packet is to be rewritten and forwarded to the next processing node.
When stacking midchains on a fib-entry extract the choice from the load-balance returned based on an ...
#define STRUCT_OFFSET_OF(t, f)
const ip46_address_t ADJ_BCAST_ADDR
The special broadcast address (to construct a broadcast adjacency.
union ip_adjacency_t_::@137 sub_type
void(* adj_midchain_fixup_t)(vlib_main_t *vm, const struct ip_adjacency_t_ *adj, vlib_buffer_t *b0, const void *data)
A function type for post-rewrite fixups on midchain adjacency.
adj_midchain_fixup_t fixup_func
A function to perform the post-rewrite fixup.
ip_lookup_next_t
An adjacency is a representation of an attached L3 peer.
void adj_walk(u32 sw_if_index, adj_walk_cb_t cb, void *ctx)
Walk the Adjacencies on a given interface.
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
struct ip_adjacency_t_ ip_adjacency_t
IP unicast adjacency.
vnet_link_t ia_link
link/ether-type 1 bytes
Adjacency to punt this packet.
ip46_address_t receive_addr
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
vl_api_interface_index_t sw_if_index
ip46_address_t next_hop
The recursive next-hop.
int adj_recursive_loop_detect(adj_index_t ai, fib_node_index_t **entry_indicies)
descend the FIB graph looking for loops
struct ip_adjacency_t_::@137::@139 midchain
IP_LOOKUP_NEXT_MIDCHAIN.
STATIC_ASSERT_SIZEOF(ip_adjacency_t, 4 *64)
vl_api_fib_path_type_t type
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
STATIC_ASSERT((STRUCT_OFFSET_OF(ip_adjacency_t, cacheline0)==0), "IP adjacency cacheline 0 is not offset")
dpo_id_t next_dpo
The next DPO to use.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
CLIB_CACHE_LINE_ALIGN_MARK(cacheline0)
ip_adjacency_t * adj_pool
The global adjacency pool.
u32 ia_node_index
The VLIB node in which this adj is used to forward packets.
This packet matches an "interface route" and packets need to be passed to ARP to find rewrite string ...
void adj_lock(adj_index_t adj_index)
Take a reference counting lock on the adjacency.
An node in the FIB graph.
fib_node_t ia_node
Linkage into the FIB node graph.
const u8 * adj_get_rewrite(adj_index_t ai)
Return the link type of the adjacency.
fib_node_index_t fei
the FIB entry this midchain resolves through.
This packet matches an "incomplete adjacency" and packets need to be passed to ARP to find rewrite st...
Adjacency to drop this packet.
Multicast Midchain Adjacency.
u32 fib_node_index_t
A typedef of a node index.
adj_walk_rc_t(* adj_walk_cb_t)(adj_index_t ai, void *ctx)
Call back function when walking adjacencies.
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
u32 adj_index_t
An index for adjacencies.
This packets follow a mid-chain adjacency.
struct ip_adjacency_t_::@137::@138 nbr
IP_LOOKUP_NEXT_ARP/IP_LOOKUP_NEXT_REWRITE.
enum vnet_link_t_ vnet_link_t
Link Type: A description of the protocol of packets on the link.
Currently a sync walk is active.
vnet_link_t adj_get_link_type(adj_index_t ai)
Return the link type of the adjacency.
u32 ia_cfg_index
feature [arc] config index
const void * fixup_data
Fixup data passed back to the client in the fixup function.
vlib_combined_counter_main_t adjacency_counters
Adjacency packet counters.
struct ip_adjacency_t_::@137::@140 glean
IP_LOOKUP_NEXT_GLEAN.
enum adj_flags_t_ adj_flags_t
Flags on an IP adjacency.
This packets needs to go to ICMP error.
This packet is for one of our own IP addresses.
fib_protocol_t ia_nh_proto
The protocol of the neighbor/peer.
ip_lookup_next_t lookup_next_index
Next hop after ip4-lookup.
void adj_child_remove(adj_index_t adj_index, u32 sibling_index)
Remove a child dependent.
VLIB buffer representation.
adj_attr_t_
Flags on an IP adjacency.
u32 adj_get_sw_if_index(adj_index_t ai)
Return the sw interface index of the adjacency.
A collection of combined counters.
static int adj_is_valid(adj_index_t adj_index)
enum fib_node_type_t_ fib_node_type_t
The types of nodes in a FIB graph.
int adj_per_adj_counters
Global Config for enabling per-adjacency counters This is configurable because it comes with a non-ne...
#define CLIB_CACHE_LINE_BYTES
u8 * format_adj_flags(u8 *s, va_list *args)
Format adjacency flags.
void adj_unlock(adj_index_t adj_index)
Release a reference counting lock on the adjacency.
VNET_DECLARE_REWRITE
Rewrite in second and third cache lines.
static int adj_are_counters_enabled(void)
Get the global configuration option for enabling per-adj counters.
If the midchain were to stack on its FIB entry a loop would form.
the fixup function is standard IP4o4 header
struct adj_delegate_t_ * ia_delegates
A sorted vector of delegates.